Posts: 4
Threads: 1
Joined: Dec 2013
Hi, I've ben trying many maccro... but i just can't get this one working lol.
I want to sendkey to a windows in the background, as I navigate or do something else.
So in general, the basi c is , I need to send the END key to the windows of everquest, wait 5.2second and repeat.
I can somehow get it to work if the windows is active , but not in the background.
rep 2
int w1=act(win("EverQuest" "_EverQuestwndclass"))
'E ;; End
wait 5.2
is the code, when I press it, it does cast but wont repeat either.
Posts: 12,081
Threads: 142
Joined: Dec 2002
Create function SendKeysToWindow. Its code is here:
pasting to notepad (when notepad is in background)
Then try this macro with Notepad:
Macro
Macro2207
int w1=act(win("Untitled - Notepad" "Notepad")) ;;to test
int c1=child ;;the focused control
rep
,SendKeysToWindow c1 key(a)
,1
;You can activate some other window, this macro will still work.
Macro for your window would be like this:
Macro
Macro2206
int w1=act(win("EverQuest" "_EverQuestwndclass"))
int c1=child ;;the focused control
rep
,SendKeysToWindow c1 key(E)
,wait 5.2
Posts: 4
Threads: 1
Joined: Dec 2013
For some weird reason i'm getting Unknown identifier for SendKeysToWindows.
Posts: 12,081
Threads: 142
Joined: Dec 2002
Need to create function SendKeysToWindow. It must be function, not macro.
Posts: 4
Threads: 1
Joined: Dec 2013
Created a new functiion, copy pasted it, get the same error : "Error in Function: unknown identifier" which target SendKeysToWindow.
Posts: 12,081
Threads: 142
Joined: Dec 2002
Create new function named SendKeysToWindow, and paste SendKeysToWindow code from the link.
pasting to notepad (when notepad is in background)
Posts: 4
Threads: 1
Joined: Dec 2013
Hmm, the notepad one work... the EQ one doesn't... so I guess the program is preventing macro?
Posts: 12,081
Threads: 142
Joined: Dec 2002
Not all programs/windows support the send-keys method used by SendKeysToWindow.
Other way would be to run the program on other computer, real or virtual.
I don't know other ways to send keys to background windows.