News:

Masm32 SDK description, downloads and other helpful links
Message to All Guests

Main Menu

WM_CHAR WM_KEYDOWN WM_LBUTTONDOWN

Started by shankle, April 24, 2019, 12:32:05 PM

Previous topic - Next topic

shankle

          4-23-2019

   Subject: WM_CHAR, WM_KEYDOWN, WM_LBUTTONDOWN

   At best IMHO Windows is a very cumbersome Operating System.
   In C. Petzols book on Windows the explanations of the 3 items
   above are vague.
   I need an explanation written for Dummies and it's not in that
   book.
   I have been struggling with which one of the above 3 items to
   put VK_SPACE and VK_ESCAPE for EX. and why it should go there.
   If someone would be kind enough to come down to my level to
   explain this it would appreciated.

       

Yuri

WM_LBUTTONDOWN is for left mouse clicks and WM_CHAR is for characters, not keypresses. So you need WM_KEYDOWN. But you don't put anything in it; it's a constant that indentifies the message. Something like this:

invoke PostMessage, [hWnd], WM_KEYDOWN, VK_SPACE, 0
invoke Sleep, 50
invoke PostMessage, [hWnd], WM_KEYUP, VK_SPACE, 0xC0000001

shankle