Jump to content

Sendkey to Process/Windows


Guest Lafiell
 Share

Recommended Posts

Guest Lafiell

Hi,

is there a way to send key via Sendkey Function to a specific Window, which isn't on the top/focused?

As far as i see it, it's only possible to send Key(-strokes) to a focused Window, since i haven't found a parameter which stores the handle of a window, to be able to send it to this Window instead of focued/global keypress/-strokes.

It's kind of important, because i want to send keystrokes to a programm which runs in background and do this sendkey/keystrokes while the user is still working with windows i.e. browsing

If it's currently not possible, would it be much work to implement it?

P.S. haven't read the whole documentation yet, but can you send Windows Events/Msgs to Windows too? (Like WM_CLOSE and the other stuff you usally use in C++ in Windows Applications)

Link to comment
Share on other sites

i think your looking for ControlSend()

help has very good demo's at the bottom of each page

on your computer press the following

Start > All Programs > Autoit v3 > Autoit Help File

when that loads then press the "search" tab

then type in "?your search?" and press "List Topics"

**** you can do this with any word you want

thats what i do all the time

8)

NEWHeader1.png

Link to comment
Share on other sites

Welcome to the forums!

P.S. haven't read the whole documentation yet, but can you send Windows Events/Msgs to Windows too? (Like WM_CLOSE and the other stuff you usally use in C++ in Windows Applications)

If you grab the beta you can use DLLCall() to send Windows messages:

; WM_COMMAND => 273
DLLCall("user32.dll", "None", "SendMessage", "HWnd", WinGetHandle("My Window"), "Int", 273, "Int", 12345)
Link to comment
Share on other sites

  • 12 years later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...