Results 1 to 3 of 3

Thread: [RESOLVED] Sending keypresses to an application

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Feb 2006
    Location
    Melbourne, Australia
    Posts
    415

    Resolved [RESOLVED] Sending keypresses to an application

    Hey all,

    Is there anyway to simulate a keystroke on the keyboard to an application? Previously, I've been using SendKeys(), but this only sends a keystroke to the window which is in focus. Is there any other command or API which allows you to send to a certain handle? Also if there is, Is there a way to return the hWnd of an app if I have the name of it?

    Thanks in advance

  2. #2
    Oi, fat-rag! bushmobile's Avatar
    Join Date
    Mar 2004
    Location
    on the poop deck
    Posts
    5,592

    Re: Sending keypresses to an application

    For finding out an apps hWnd and the child controls hWnds you'll need FindWindow and FindWindowEx APIs

    Sending keystrokes to a particular hWnd involves the use of SendMessage or PostMessage APIs with WM_KEYDOWN and WM_KEYUP messages.

    For more info on the APIs go to AllAPI.net
    For more info on the messages, go to MSDN

    Edit: & search the forums for examples of all of those

  3. #3

    Thread Starter
    Hyperactive Member
    Join Date
    Feb 2006
    Location
    Melbourne, Australia
    Posts
    415

    Re: Sending keypresses to an application

    Thanks alot for the fast response

    Ill try out those sites, ty

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