Results 1 to 2 of 2

Thread: WM_CHAR, WM_SYSCHAR, Subclassing, smelly purple monkeys.

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Sep 1999
    Location
    Cleveland, Ohio
    Posts
    263

    WM_CHAR, WM_SYSCHAR, Subclassing, smelly purple monkeys.

    Alright, I'm messing with some subclassing, and I notice that WM_CHAR and WM_SYSCHAR (along with WM_SYSDEADCHAR) do not capture all the keypresses for a handle. In fact, WM_SYSDEADCHAR captured nothing. WM_CHAR captures regular ascii characters, including when Shift and Control are held, WM_SYSCHAR does the same but it is only triggered when Alt is held. How to get on to capturing function keys? The numeric key pad?

    Note: according to microsoft, WM_CHAR is the message given when TranslateMessage API translates WM_KEYUP and WM_KEYDOWN, as well as WM_SYSCHAR for WM_SYSKEYUP and WM_SYSKEYDOWN. I have no idea what the hell WM_SYSDEADCHAR is. However, from my own testing WM_KEYUP captures the numeric keypad and function keys when Alt is held down. Anyways, main question: how to capture function keys, numeric keypad, etc.

    Oh yeah, as far as the smelly purple monkeys go, I have no idea; but I knew they'd catch your eyes... admit it. That's why you looked in the first place.

  2. #2
    Megatron
    Guest
    You don't even need to subclass (check the KeyDown event) but if the control doesn't have a keydown event, then catch the WM_KEYDOWN message.
    VB Code:
    1. 'In your Winproc function
    2. If uMsg = WM_KEYDOWN And wParam = vbKeyF1 Then MsgBox "F1 pressed"

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width