LB Booster
« Mouse event on redraw »

Welcome Guest. Please Login or Register.
Apr 1st, 2018, 04:10am



ATTENTION MEMBERS: Conforums will be closing it doors and discontinuing its service on April 15, 2018.
We apologize Conforums does not have any export functions to migrate data.
Ad-Free has been deactivated. Outstanding Ad-Free credits will be reimbursed to respective payment methods.

Thank you Conforums members.
Speed up Liberty BASIC programs by up to ten times!
Compile Liberty BASIC programs to compact, standalone executables!
Overcome many of Liberty BASIC's bugs and limitations!
LB Booster Resources
LB Booster documentation
LB Booster Home Page
LB Booster technical Wiki
Just BASIC forum
BBC BASIC Home Page
Liberty BASIC forum (the original)

« Previous Topic | Next Topic »
Pages: 1  Notify Send Topic Print
 thread  Author  Topic: Mouse event on redraw  (Read 118 times)
tsh73
Full Member
ImageImageImage


member is offline

Avatar




PM

Gender: Male
Posts: 210
xx Re: Mouse event on redraw
« Reply #1 on: Feb 9th, 2018, 5:13pm »

GetCursorPos function ?
User IP Logged

Rod
Full Member
ImageImageImage


member is offline

Avatar




PM

Gender: Male
Posts: 110
xx Re: Mouse event on redraw
« Reply #2 on: Feb 9th, 2018, 5:58pm »

The mouse may not even be inside the window when it opens? Surely the user has to take some action first?
User IP Logged

Richard Russell
Administrator
ImageImageImageImageImage


member is offline

Avatar




Homepage PM


Posts: 1348
xx Re: Mouse event on redraw
« Reply #3 on: Feb 9th, 2018, 7:44pm »

on Feb 9th, 2018, 5:13pm, tsh73 wrote:
GetCursorPos function ?

Yes, GetCursorPos followed by ScreenToClient typically.

Richard.
User IP Logged

Rod
Full Member
ImageImageImage


member is offline

Avatar




PM

Gender: Male
Posts: 110
xx Re: Mouse event on redraw
« Reply #4 on: Feb 10th, 2018, 08:50am »

Code:


    'open a window and graphicbox
    WindowHeight = 300
    WindowWidth = 400
    graphicbox #w.g, 0, 0, 400, 300
    open "test" for window_nf as #w
    print #w, "trapclose [quit]"
    #w.g "setfocus"

    hw = hWnd(#w.g)
    struct MouseRect ,mx as long,my as long
    calldll #user32, "GetCursorPos",MouseRect As struct,re As Long
    calldll #user32, "ScreenToClient",hw As ulong,MouseRect As struct,re as long
    print MouseRect.mx.struct
    print MouseRect.my.struct
    wait


[quit]

    close #w
    end
 
User IP Logged

Pages: 1  Notify Send Topic Print
« Previous Topic | Next Topic »

| |

This forum powered for FREE by Conforums ©
Terms of Service | Privacy Policy | Conforums Support | Parental Controls