CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 4 of 4
  1. #1
    Join Date
    May 1999
    Posts
    2

    Windows Special Keys

    Is there any way to disable Windows Left & Right keys from within a process?


  2. #2
    Guest

    Re: Windows Special Keys

    How do you mean disable? For the whole machine or only for your process?? If for your process, use PreTranslateMessage in CWinApp and take care of WM_KEYDOWN + WM_KEYUP for VK_LEFT and VK_RIGHT.

    /Rob



  3. #3
    Join Date
    May 1999
    Posts
    2

    Re: Windows Special Keys

    When I am running my application, I don't want Windows Special Left/Right keys to function. i.e. if the user presses Left/Right Windows key, Windows 95/NT should not display Start menu.
    (note: not all the keyboards have these keys )

    Also, my application is not done using MFC. I would appreciate any feed back.

    Sugan




  4. #4
    Guest

    Re: Windows Special Keys

    The virtual keycode for these keys are VK_LWIN and VK_RWIN (def'd in winuser.h). I'm not sure, but you could try setting a hook on the keyboard input when using your application with SetWindowsHookEx (trapping the codes above) then UnhookWindowsHookEx when you're finished.

    /Rob


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

Featured