CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 4 of 4

Thread: Key trapping

  1. #1
    Join Date
    Dec 1999
    Location
    Netherlands
    Posts
    4

    Key trapping

    How can i trap a key? Not like the "shortkey" function were only the form is displayed, but I want to execute more code than just showwindow...

    Example:
    So when ALT-Z is pressed ANYWHERE, I want the caption of button A changed into: Click here.

    Please help? Thanks in advance


    ---
    Dennis Lassing
    [email protected]
    icq: 17355083

  2. #2
    Join Date
    Dec 1999
    Location
    Israel
    Posts
    101

    Re: Key trapping

    Try API Function GetAsyncKeyState().

    Good Luck!


  3. #3
    Join Date
    Dec 1999
    Location
    Netherlands
    Posts
    4

    Re: Key trapping

    THX!!!! ===))))
    It working!

    ---
    Dennis Lassing
    [email protected]
    icq: 17355083

  4. #4
    Join Date
    May 1999
    Location
    Omika, Japan
    Posts
    729

    Re: Key trapping

    Set Form's KeyPreview = True ,and write the key checking code in FOrms's keyPress Event.

    RK

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