Results 1 to 2 of 2

Thread: Sending keystrokes to other Applications (Windows XP)

  1. #1
    Join Date
    Apr 2007
    Posts
    4
    Thanks
    1
    Qt products
    Qt4

    Question Sending keystrokes to other Applications (Windows XP)

    Hello !

    I'm thinking about a way to send keystrokes/text strings to other, non-QT applications.
    I'm wondering if it is possible to use the win32 api to send keypress-events to specific windows. My problem is how to get, the WindowID of, say Word or Notepad. I tried to use EnumDesktops and EnumDesktopWindows, but i really have no clue how to do it. I wanted to use mingwm's libuser32 and mingw's winduser.h but to no success (lots of problems with typedefs, maybe i can unwind this sometime...)

    Anyway, is this the way to go ? Or are there simpler methods ? I was also thinking about using the clipboard to transfer text...

    TIA, Simon

  2. #2
    Join Date
    Feb 2006
    Location
    Romania
    Posts
    2,744
    Thanks
    8
    Thanked 541 Times in 521 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Sending keystrokes to other Applications (Windows XP)

    Try the FindWindow family functions to get the window handle for a specific window.
    Also you can all the existing windows, but it would be a little difficult to select the actual windows.

    Do a little search on www.codeproject.com, because there are a few Spy++-like projects.

Similar Threads

  1. converting unix exe to windows binary
    By deekayt in forum General Programming
    Replies: 2
    Last Post: 17th September 2006, 01:00
  2. qt network performance
    By criss in forum Qt Programming
    Replies: 16
    Last Post: 24th July 2006, 09:23
  3. Qt and windows vista
    By munna in forum General Discussion
    Replies: 8
    Last Post: 11th January 2006, 22:33

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.