Results 1 to 12 of 12

Thread: [RESOLVED] sendkeys to a application

  1. #1

    Thread Starter
    Frenzied Member
    Join Date
    Sep 2005
    Posts
    1,364

    Resolved [RESOLVED] sendkeys to a application

    how can i sendkeys to an application on my desktop?

    any ideas guys?

  2. #2
    Frenzied Member the182guy's Avatar
    Join Date
    Nov 2005
    Location
    Cheshire, UK
    Posts
    1,473

    Re: sendkeys to a application

    how about

    VB Code:
    1. SendKeys "lol."
    Chris

  3. #3

    Thread Starter
    Frenzied Member
    Join Date
    Sep 2005
    Posts
    1,364

    Re: sendkeys to a application

    but i want to pick the application to send to

  4. #4
    Hyperactive Member Datacide's Avatar
    Join Date
    Jun 2005
    Posts
    309

    Re: sendkeys to a application

    Then I think you need to use APIs.
    PHP in your FACE!

  5. #5
    Frenzied Member Spajeoly's Avatar
    Join Date
    Mar 2003
    Location
    Utah
    Posts
    1,068

    Re: sendkeys to a application

    If you want a simple way use AppActivate...
    VB Code:
    1. AppActivate "Program's Title Here"
    2. SendKeys "Spit in my mouth, baby!"
    It's a shotty but quick way to pull the program up front before sending the keys.

  6. #6

    Thread Starter
    Frenzied Member
    Join Date
    Sep 2005
    Posts
    1,364

    Re: sendkeys to a application

    Quote Originally Posted by Spajeoly
    If you want a simple way use AppActivate...
    VB Code:
    1. AppActivate "Program's Title Here"
    2. SendKeys "Spit in my mouth, baby!"
    It's a shotty but quick way to pull the program up front before sending the keys.
    thanks, by that do you mean the programs window title at the top? like for e.g, this window for me would be

    VBForums - Reply to Topic - Microsoft Internet Explorer

  7. #7
    Lively Member
    Join Date
    Sep 2005
    Posts
    105

    Re: sendkeys to a application

    thanks, by that do you mean the programs window title at the top? like for e.g, this window for me would be

    VBForums - Reply to Topic - Microsoft Internet Explorer
    Yeah, thats what Spajeoly meant. The other option you could use other than window title is the window handle. You could check it using Spy++, Ive used this option to move windows and sendkeys too. But I find sometimes for a window/program the handle changes which makes using the Program title or window name easier.

  8. #8
    Hyperactive Member Datacide's Avatar
    Join Date
    Jun 2005
    Posts
    309

    Re: sendkeys to a application

    Is there a way without using APIs' to list the currently open window names?

    For example, if I wanted to send it to this browser window I'd want to us left$() because I'd have these options:

    VBForums - Reply to Topic - Microsoft Internet Explorer
    VBForums - Reply to Topic - Mozilla Firefox
    PHP in your FACE!

  9. #9
    Conquistador
    Join Date
    Dec 1999
    Location
    Australia
    Posts
    4,527

    Re: sendkeys to a application

    No, you'd need to use an API to list the currently open windows.

    If you're looking for a specific window all the time, you can use the FindWindow API, with the class name (you can get that in Spy++ iirc).

    Other than that, you have to enumerate all the open windows!

  10. #10

    Thread Starter
    Frenzied Member
    Join Date
    Sep 2005
    Posts
    1,364

    Re: sendkeys to a application

    thanks guys, but how can i then hit the enter button on the keyboard?

    currently i tested it on a messenger conversation i had open with myself

    i sent the message 'hello'

    it put 'hello' in the messenger send box, this is fine, but i also wana make it hit enter!

  11. #11
    PowerPoster
    Join Date
    Mar 2002
    Location
    UK
    Posts
    4,780

    Re: sendkeys to a application

    Im sure about 50 other people have asked this, have you had a good search of the forums?

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

    Re: [RESOLVED] sendkeys to a application

    If your using SendKeys then it's {ENTER} or ~ .

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