Thread: Sending Keyboard Int

  1. #1
    Registered User cfrost's Avatar
    Join Date
    Apr 2004
    Posts
    119

    Sending Keyboard Int

    How can send interrupt to windows of a particular key press
    Software is like sex it is good when it is free

  2. #2
    30 Helens Agree neandrake's Avatar
    Join Date
    Jan 2002
    Posts
    640
    I believe you meant to post this in the windows board. If I'm understanding your one-sentence description right, it sounds like you want to know when a key is pressed. This depends on if you are trying to capture the key from any program (use System Wide Hooks) or for just one particular program. If you are looking to check for keypresses inside your own program, it's alot easier and you should be able to search for examples.
    Environment: OS X, GCC / G++
    Codes: Java, C#, C/C++
    AOL IM: neandrake, Email: neandrake (at) gmail (dot) com

  3. #3
    Registered User cfrost's Avatar
    Join Date
    Apr 2004
    Posts
    119
    no actually like on screen keyboard I want to make programm to send keyboard interrupts
    Last edited by cfrost; 12-08-2004 at 03:25 PM.
    Software is like sex it is good when it is free

  4. #4
    30 Helens Agree neandrake's Avatar
    Join Date
    Jan 2002
    Posts
    640
    Try looking up SendMessage() windows API function.
    SendMessage(HWND, MESSAGE, WPARAM, LPARAM)
    is the syntax I believe.
    HWND should be the handle to the window
    MESSAGE should be a predefined constant pertaining to what message you are sending (this would have to do with key press. Look up what message is given for pressing a button and put it here).
    WPARAM and LPARAM depend on the message you send. One of these will be the code to which key you want to send.
    Environment: OS X, GCC / G++
    Codes: Java, C#, C/C++
    AOL IM: neandrake, Email: neandrake (at) gmail (dot) com

  5. #5
    Yes, my avatar is stolen anonytmouse's Avatar
    Join Date
    Dec 2002
    Posts
    2,544
    keybd_event()
    SendInput

  6. #6
    Registered User cfrost's Avatar
    Join Date
    Apr 2004
    Posts
    119
    well I also searched and got keybd_event()
    But it has limitation If user presses any key it will over ride it
    Software is like sex it is good when it is free

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. NEED HELP READING FILE and PRINTING
    By geoffr0 in forum C Programming
    Replies: 4
    Last Post: 04-16-2009, 05:26 PM
  2. can some one please tell me the cause of the error ?
    By broli86 in forum C Programming
    Replies: 8
    Last Post: 06-26-2008, 08:36 PM
  3. Replies: 8
    Last Post: 03-10-2008, 11:57 AM
  4. Binary Search Trees Part III
    By Prelude in forum A Brief History of Cprogramming.com
    Replies: 16
    Last Post: 10-02-2004, 03:00 PM
  5. Quack! It doesn't work! >.<
    By *Michelle* in forum C++ Programming
    Replies: 8
    Last Post: 03-02-2003, 12:26 AM