PostMessage with #WM_MOUSEMOVE

Windows specific forum
BarryG
Addict
Addict
Posts: 3324
Joined: Thu Apr 18, 2019 8:17 am

PostMessage with #WM_MOUSEMOVE

Post by BarryG »

Hi all, been trying to work out how to do this:

Code: Select all

PostMessage_(hWnd,#WM_MOUSEMOVE,#MK_LBUTTON,new_mousex_and_mousey_go_here)
And according to http://winapi.freetechsecrets.com/win32 ... SEMOVE.htm I need to put the new X and Y mouse values for the "lParam" paremeter at the end. How do I do that? Do I make those into a point structure or something? It seems like I do, but I'm not 100% sure? I feel like I'm so close but can't work it out. Thanks.
Rinzwind
Enthusiast
Enthusiast
Posts: 638
Joined: Wed Mar 11, 2009 4:06 pm
Location: NL

Re: PostMessage with #WM_MOUSEMOVE

Post by Rinzwind »

Code: Select all

Macro HiWord(a)
  ((a) >> 16 & $ffff)
EndMacro

Macro LoWord(a)
  ((a) & $ffff)
EndMacro

Macro MakeParam(LoWord, HiWord)
  ((HiWord) << 16 | (LoWord))
EndMacro
BarryG
Addict
Addict
Posts: 3324
Joined: Thu Apr 18, 2019 8:17 am

Re: PostMessage with #WM_MOUSEMOVE

Post by BarryG »

Thanks, Rinzwind. It doesn't move the mouse like I hoped, though. Will have to settle for SetCursorPos_() instead.
User avatar
mk-soft
Always Here
Always Here
Posts: 5406
Joined: Fri May 12, 2006 6:51 pm
Location: Germany

Re: PostMessage with #WM_MOUSEMOVE

Post by mk-soft »

Little bugfix. So works with signed lowords

Code: Select all

Macro HiWord(a)
  ((a) >> 16 & $ffff)
EndMacro

Macro LoWord(a)
  ((a) & $ffff)
EndMacro

Macro MakeParam(LoWord, HiWord)
  (HiWord << 16 | (LoWord & $FFFF))
EndMacro

Debug MakeParam($8000, 0)

My Projects ThreadToGUI / OOP-BaseClass / EventDesigner V3
PB v3.30 / v5.75 - OS Mac Mini OSX 10.xx - VM Window Pro / Linux Ubuntu
Downloads on my Webspace / OneDrive
Post Reply