News:

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

Need some clarification on Keystroke msg

Started by Rainstorm, May 22, 2008, 10:39:53 AM

Previous topic - Next topic

Rainstorm

just need some clarification on the WM_KEYDOWN msg

1.) can my processing of a WM_KEYDOWN msg affect it being translated into a character msg ?

2.) does a TranslateMessage function place a correponding WM_CHAR msg into the msg que only after that particular WM_KEYDOWN msg has returned from processing from the WndProc, or does it translate it inpependently & place the corresponding WM_CHAR msg in the que anyways

3.)
in the SDK it says
QuoteWindows 2000/XP: Applications must pass wParam to TranslateMessage without altering it at all.
Thats referring to the Message Loop,  where we use...       invoke TranslateMessage, addr msg
      invoke DispatchMessage,  addr msg
...not to the WndProc processing of the WM_KEYDOWN msg;..is this right ?

[edit]I guess if i process the WM_KEYDOWN messages in the WindowProc I don't have to
send them to TranslateMessage after, that since they will already have been passed to TranslateMessage in the message loop in the WinMain

===========================
Another Question ; i have a point structure defined like this        caretp       POINT         <0>


this doesn't seem to work...(the caret remains in its original position instead of the new position after the letter just typed) so if the caret xpos was at zero before displaying the character the caret position gets reset to zero, instead of advancing ahead          mov edx, avg_charwidth
          add caretp.x, edx
          invoke SetCaretPos, caretp.x, caretp.y


if i do this my code works proper, & I don't have the problem i described above.           mov edx, caretp.x
           add edx, avg_charwidth
          invoke SetCaretPos, edx, caretp.y

why's that ?
i can add some value to a structure component right ?


thanks!
-

Rainstorm

I figured out the latter problem described in my above post regarding the caret, Whew! ;P
I had this line in my WM_KILLFOCUS msg processing invoke GetCaretPos, addr caretp
It seemed to be resetting the Caret xposition to zero.
i commented it out & all works as desired : )