 |
AutoHotkey Community Let's help each other out
|
| View previous topic :: View next topic |
| Author |
Message |
GreatKent
Joined: 05 Oct 2004 Posts: 20
|
Posted: Thu Apr 21, 2005 9:55 pm Post subject: send keys to a particular window |
|
|
Hi everyone,
it seems using Send command to send Keys to a particular window fails pretty easily coz that window may go NotActive occassionally. Is there way to make sure the keys can be successfully sent to a particular window?
Thx!  |
|
| Back to top |
|
 |
BoBo Guest
|
Posted: Thu Apr 21, 2005 10:21 pm Post subject: |
|
|
| Code: | WinActivate, Untitled - Notepad
Send, This is a test`n |
or
| Code: | | ControlSend, Edit1, This is a another test`n, Untitled - Notepad |
|
|
| Back to top |
|
 |
GreatKent
Joined: 05 Oct 2004 Posts: 20
|
Posted: Fri Apr 22, 2005 12:55 am Post subject: |
|
|
from the WindowSpy, the ahk_class for a Notepad editor is : "Notepad"
but if I replace "Edit1" with "Notepad", the script doesn't work. Do you know why? and what does "Edit1" actually mean?
Thanks a lot
| BoBo wrote: | | Code: | WinActivate, Untitled - Notepad
Send, This is a test`n |
or
| Code: | | ControlSend, Edit1, This is a another test`n, Untitled - Notepad |
|
|
|
| Back to top |
|
 |
BoBo Guest
|
Posted: Fri Apr 22, 2005 6:29 am Post subject: |
|
|
| Quote: | ControlSend / ControlSendRaw
--------------------------------------------------------------------------------
Sends simulated keystrokes to a window or control.
ControlSend [, Control, Keys, WinTitle, WinText, ExcludeTitle, ExcludeText]
Note: ControlSendRaw uses the same parameters. |
Ergo ...
| Quote: | | ControlSend, Edit1, This is a another test`n, Untitled - Notepad |
In this case the Edit field/area of Notepad is labled/named Edit1.
Window spy shows:
Now Under Mouse Cursor: Edit1
Window Title & Class: Untitled - Notepad
The text you send to the Edit area of Notepad: This is a another test |
|
| Back to top |
|
 |
GreatKent
Joined: 05 Oct 2004 Posts: 20
|
Posted: Sat Apr 23, 2005 12:09 am Post subject: |
|
|
oh ic, thanks a lot for your crystal clear explanation  |
|
| Back to top |
|
 |
|
|
You can post new topics in this forum You can reply to topics in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|