News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

Mouse Location

Started by Don57, June 08, 2008, 11:34:25 PM

Previous topic - Next topic

Don57

How do I get the mouse position in the current window. I am using GetMessage to read the event and WM_LBUTTONDOWN to filter for the mouse click, but I need to know where the mouse is in the window.



I tried the lParam, it worked like a charm. Thanks

Jimg

Most all the mouse events get the position in lParam.
you can do something like this-
        mov eax,lParam
        push eax
        and eax,0FFFFh
        cwde
        mov MouseX,eax

        pop eax     ;mov eax,lParam
        sar eax,16  ; signed shift
        mov MouseY,eax

jj2007

Study the ScreenToClient and GetCursorPos calls. You will need them...