- Autohotkey controlsend to inactive window My first major stumbeling block so far seems to be that I cannot figure out how to send commands to an inactive window using ControlSend without the ClassNN information for the Home Board index AutoHotkey (v1. Post by F1r3blaze » Sun Sep 08, 2019 2:01 am Hi! I'm very new to AutoHotKey shenanigans, but I've botched some code together and I just can't make it work. cfg, and it is awesome but i cant do it while Controlsend only works on a few programs that are native to windows like calculator or notepad, among others. com Port 443 Home Board index AutoHotkey (v1. Which of these (if any) is of interest to you? I press F1 on the window I want to grab, then when I press F2 it will press and release the Esc button, which works fine. That is a problem even if you fix the variable scope issue (global vs. I'd love to be proven wrong, but people keep asking this Any way to use gamepad in an inactive windows ? - posted in Ask for Help: i am playing call of duty world at war , i managed to get it splitscreen and play with my friend, but there was alittle problem that when i assign the look keys to the gamepad , it has alocked sensitivity, while when i play alone i use the default_controller. The script is a variant of one posted on this thread: http://www. I'm sure its a mess settitlematchmode,2 capslock:: loop {sleep,2000 controlsend,,z, ahk_exe MapleStory. So far i have - #ifWinActive Trove { Loop { Send {Space} Sleep 10000 } } return which works but it also spamms spacebar when the Trove window isnt even active. Ask gaming related questions. 1 and older) Home Board index AutoHotkey (v1. You could try adding delays to ControlSend via SetKeyDelay. It's basically a hit or miss. Up::ControlSend, , Up, ahk_class notepad. On your hotkey get the current active window, store it, activate the game, send your stuff, than reactivate what you was doing. Sending buttons to an inactive window. Ask gaming related questions (AHK v1. ; The third parameter is omitted so the last found window is used. Im having a lot of fun creating simple scripts so far. You should not have to send a separate 'up' command although you can put that in there if you want. ControlSend to inactive window not working - posted in Ask for Help: Here is my entire script, using a notepad file named test. I want the script to presses a key every x seconds in an inactive window. my problem is i want to send key strokes to the game when the games window is NOT active. I would like to be able to target the inactive RDP session. Send the down event on toggle true and the up event on toggle false. Can someone please help me? I am trying to write a script to do the following: Open a program Called Prophet 21 on the second of 2 monitors Wait 30 sec Send the Enter Key Wait 15 sec Send the F5 Key every 5 seconds Because you can send a button press with ControlSend when it's not active, then wait 5 min and as soon as you click the Window, activating it, the button press gets executed. i have hey guys im rly bad at this stuff :/ i somehow managed to pick up parts and setup my ahk script it runs like i want to , runs only when my mouse is inside the game i love it, but how do i make this script to work with no mouse, meaning how can i browse youtube while the script runs inside the game client? i dont need mouse movement inside the game , i just want ahk ControlSending might work. 1 and older) Send keys to inactive window. First, see if a regular Send command works when your target window is already active. 1 and older) Ask for Help (v1) Gaming Help (v1) ControlSend to specific inactive window (two inactive windows have same name) Ask gaming related questions (AHK v1. ; Send the text to the inactive Notepad edit control. app. exe' ctl := 'RichEditD2DPT1' ; Win 11 keys := '123' #HotIf WinExist(winTitle) z:: { ; Some windows do not respond to ControlSend; an elevated window may require an elevated script Static on If the inactive window stuff doesnt work maybe you can try activate the window first? There are commands for it. 99 send {enter} } Since I discover the power of ControlSend even when the window is inactive while I am working on other task, I created the Home Board index AutoHotkey (v1. I don't have access to change the server inactivity timeout. It send the key while the window is active, but not when inactive. STAND_by_MODUS Posts: 9 FiveM Inactive Window ControlSend. This script is for testing purposes, I Send Key To Multiple Inactive Game Windows - posted in Gaming Questions: I want to run multiple games of Trove and have them jump every once and a while to avoid going AFK. I recently came across a few other posts which were attempting to use ControlSend to interact with inactive or minimized windows and they used, in some instances, DetectHiddenWindows (my thought was that because ControlSend is working while the window is active it may be that the window is hidden when not active) but this also didn't solve the FiveM Inactive Window ControlSend. You are checking WinTitle above before it even gets defined inside MouseIsOver. I ran them as administrator. I'd love to be proven wrong, but people keep asking this and there's no real answer besides activating the window, doing the key stroke, and then going back to the other window. Ive got the pattern down but i cant get it to work while tabbed out of the window (also toggle wont work sadly it seems that way :/ yeah that isn't really an option, because i needed to execute some task in a timely manner, i think the only real option would be to send a keystroke to the controlled system and start a script there based on that, unfortunately i can't install autohotkey on that. SendMode Input ; Recommended for new scripts due to its superior speed and reliability. exe' ctl := 'RichEditD2DPT1' ; Win 11 keys := '123' #HotIf WinExist(winTitle) z:: { ; Some windows do not respond to ControlSend; an elevated window may require an elevated script Static on ControlSend to inactive Browsers - posted in Ask for Help: I have searched for hours to find a way to send commands to a Internet Explorer Window only to find countless postings on how to send commands to gaming windows, but cant find any topic to help me. Please excuse code errors, commas and the sort. If that I'm trying to make a simple script, that press the 1 key and then clicks on specific X,Y coordinates on an inactive window. sending key strokes to inactive windows - posted in Ask for Help: i need help with this i too am trying to use this for a game like many other posts i have read but my problem seems to be different than what other people have. 5 posts WinGet, hwnds, ID, A return WheelDown:: ControlSend,, {Down}, ahk_id %hwnds% ; return WheelUp:: ControlSend,, {Up}, ahk_id %hwnds% ; return. Sweetins Posts: 112 Joined: Sun Jul 02, 2017 6:22 pm. In particular I want to use autohotkey to multibox (dualbox) guild wars, where I want to send certain keys directly to the topmost window, but other keys to the other window currently not in focus. This is an amazing piece of software. g: via WinTitle. Window. xWojtal Posts: 8 Joined: Mon May 27, 2019 12:45 pm. 1 and older) and its commands and hotkeys. exe will not work unless the window title is "ProcessName. a game two times and use the first window in focus with the first controller and send keyboard input to the second inactive window. 1 and older) and its commands and hotkeys Hi, Im trying to create a script to send keys to an inactive window in the background. It only works when the window is in focus in my example. tried ControlSend,, 4, ahk_class l2UnrealWWindowsViewportWindow but it works only when window is active. Any suggestionwhat comand I can try to use for that. 131a902_r6_ad1 return None of these work to send the "z" key to the virtual machine window. Most of my scripts look like this:NumPad0:: { IfWinExist, CatiAtHome WinActivate Send 5+{enter 2} Send 1+{enter 2} } returnMy workflow: I do R&D in a web browser on one I am completely new to AutoHotkey, but haven't found this: Is it possible (and if yes, how) to send a key to an inactive window ONLY. Autohothey2. ControlSend F# to an inactive window. ControlSend,Edit1,aaaa, Untitled - Notepad AutoHotkey (v2, current version Inactive Window (ControlSend?) Script Help - posted in Ask for Help: Hello All, Im new to the forum so please pardon my etiquette if it is improper. I hope that helps. Meaning notepad is in the foreground while I can see Page 1 of 2 - Sending a key stroke to an inactive window ***UnSolved*** - posted in Ask for Help: ok im brand new to ahk and im trying to get my macro to send a keystroke to an inactive window via controlsend this is my script so far:#space::controlsend,,{0 down}{0 up}, window namecan anyone help me figure out why it only works when the window is active? Please excuse code errors, commas and the sort. 1 and older) Ask for Help (v1) Gaming Help (v1) It is currently Tue Dec 24, 2024 1:46 pm; All times are UTC; ControlSend F# to an inactive window. Try to get the correct handle a different way. If blank or omitted, the target window's topmost control will be used. All my tests have either been on active windows or background windows. Furthermore I would like you to give an example how to convert a SendEvent (Click, X, Y) command into a ControlClick and a SendPlay, abc into a ControlSend properly. The only time you would spam the keys is if in-game you hit up and A repeatedly. Im trying to send keystrokes to an inactive window, either minimized or just in the background. AutoHotkey Community; AutoHotkey; Ask for Help; View New Content Sending input to inactive window Started by Kaldrick , ControlSend Apache Server at autohotkey. exe} return Please excuse code errors, commas and the sort. 1 and older) Ask for Help (v1) How to controlsend to inactive window without ClassNN Topic is solved Get help with using AutoHotkey (v1. Are you giving enough time for the game to react with ControlSend, like in your example above, or just doing ControlSend, ,{1}? Myself I'm using ControlSend to control youtube in the background. To operate upon a control's HWND (window handle), leave the Control parameter blank and specify ahk_id %ControlHwnd% for the WinTitle parameter (this also works on hidden controls even when DetectHiddenWindows is Off). It'll be worth a try for you though. Before you start a longer script, test if Autohotkey can distinguish your two tabs. The HWND of a control is typically retrieved Before you start a longer script, test if Autohotkey can distinguish your two tabs. e. Scrolling inactive window Topic is solved. Your problem seems to be ahk_id 0xa0610. ControlSend, , z, ahk_class WindowsForms10. The keys will be sent even if the window is Just send the down event. autohotketopic30568. I googled and i just find things telling me controlsend should work in inactive windows, but it definitely isn't. Forum rules. 1 and older) Ask for Help (v1) Gaming Help (v1) It is currently Sun Jan 05, 2025 1:26 am; All times are UTC; ControlSend F# to an inactive window. TL;DR: function that, when a specific key is pressed, detects the ahk_id of the window on focus, to be able to send ControlSend not able to send text after {Tab} - posted in Ask for Help: I have been using AHK to change the data (i. 1 and older) Probably the GTA5 or FiveM processes are somewhat blocking the inputs to inactive windows, is there a way to bypass it? Post by mikeyww » Tue Mar 19, 2024 2:29 am Welcome to this AutoHotkey forum! Instead of testing 29 lines, test a one-line script Hi I got a small problem with a little script I would like to use at work. It is possible to use 'inputbox' to collect characters and then send to the inactive window. {Enter} ControlSendRaw, Edit1, Notice that {Enter} is not sent as an Enter keystroke with ControlSendRaw. i used the auto hotkey help file and ControlSend to inactive Notepad++ window (without activating it) - posted in Ask for Help: I have written the following script, which works fine:#NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases. r/AutoHotkey Trying to send commands to an inactive window D: Hey all, For the past hour or 2 ive been trying to throw together an AFK script for roblox that just walks around in a square like pattern. The keys will be sent even if the window is minimized or inactive. Get help with using AutoHotkey (v1. Here's the code, please help me. MsgBox,% "GotaPID" A_Index ": " GotaPID% A_Index % Return. Inactive Window - ControlSend - posted in Gaming Questions: Hello, So i am quite new to AHK, but ive searched around but couldnt find anything that solved my problem I wanna send a text to a nonfocused window (inactive) but i cannot figur out how to script this, and the program i wanna send a text to doesnt have a ClassNN. Is this command correct? (game has anticheat/bot system, ControlSend without ClassNN - posted in Ask for Help: Hey everyone, Im new to AHK, and wow. Msgbox, Press OK to activate the window to see the result. exe Down::ControlSend, , Down Welcome to this AutoHotkey forum! I approach ControlSend in a very simple manner, in two steps. 10000 Return PressTheKey Don't know unless you want to activate those windows briefly. exe" - to target the window with the process name of "MyProcess. How to send keystrokes and keys to a window not in focus - posted in Ask for Help: Hello. for example a notpadfile as inactive window. 5 SoundBeep 1500 WinWaitClose SetTimer go, 0 SoundBeep 1000 } go() { ControlSend 123, 'Edit1', winTitle } Top. 2. myWinTitle:="ahk_exe iexplore. I just don't know what to do anymore. ive done research and googled for about a day now, and nothing has come up. . 1 and older) Ask for Help (v1) Gaming Help (v1) It is currently Tue Jan 14, 2025 5:46 pm; All times are UTC; ControlSend F# to an inactive window. To automate repetive, boring tasks is a small task for AHK. I know how to get the window name from the Window Spy. Here's my code $1:: Loop { ; ControlClick, X682 Y515, To send keystrokes to a particular control, use Window Spy to get the target control by hovering your mouse over it and looking for 'ClassNN' under 'Control Under Mouse Position' (the 2nd I have a script that is supposed to control foobar2000 while it is inactive using controlsend. html Maybe I should try to use ControlSend with ahk_class, ahk_exe or ahk_group, as I have not done that yet. ControlSend,,{w down}, Untitled - Notepad This will only produce a single W in the notepad. txt to try sending a w down and w up keystroke to it while its not active, doesnt work Its two separate hotkeys because the real window the script will be used for needs to know how long the key is pressed. Also, you're going to want to use a timer as opposed to looping in a hotkey thread. exe Return *~t:: SetKeyDelay, 1 IF WinActive("ahk_pid " GotaPID1) ControlSend, , t, ahk_pid %GotaPID2% Else ControlSend, , t, ahk_pid %GotaPID1% sleep 10 return opens 2 Notepad windows side by side Send keys to inactive window. Dunno if this is a good enough solution or the key even stays down after going inactive, im just guessing. That is, use Window Spy to see if there is a value beside the ClassNN: label in the Window Spy when you mouse over Desa. My need: To continue working on other internet explorer windows while a script is typing SendEvent, SendInput, SendPlay and ControlSend all use different methods, which are suited for different situations. exe' ctl := 'RichEditD2DPT1' ; Win 11 keys := '123' #HotIf WinExist(winTitle) z:: { ; Some windows do not respond to ControlSend; an elevated window may require an elevated script Static on Sending input to inactive window - posted in Ask for Help: Hi there! Im sorry if theres any thread like this, because Ive searched for it and didnt find anything particulary good for me. i have gotten controlsettext to work, so i have all of my controls and windows Controlsend only works on a few programs that are native to windows like calculator or notepad, among others. I'm learning, and I'm a bit rusty. exe", you would use ControlSend, , $ , ahk_exe MyProcess. I found some info on how to send commands to an inactive window, but I need help utilizing the above code to work. 1 and older) 08, 2019 1:50 am. It is possible to use 'input' to do the same. Best practice would be using PID, as it is "more precise", in that it would work for situations with multiple unfocused/hidden windows of the same type, for example if you have multiple Google Chrome windows open, all with their unique PIDs, then you could ControlSend to specific inactive window (two inactive windows have same name) Post by clopot12 » Sun Mar 22, 2020 7:54 am Hi friends, I have been scripting in a specific game for a while now, however I've used standard "send" Get help with using AutoHotkey (v1. 0 winTitle := 'ahk_exe notepad. exe Sending buttons to an inactive window. 1 and older) Probably the GTA5 or FiveM processes are somewhat blocking the inputs to inactive windows, is there a way to bypass it? Quote; Post by mikeyww » 18 Mar 2024, 21:29 Welcome to this AutoHotkey forum! Instead of testing 29 lines, test a one-line script AutoHotkey Can I ControlSend to an inactive window without a ClassNN? - posted in Ask for Help: I need to send key strokes to a window without activating it, but the AutoIt3 Window Spy does not specify a ClassNN for this (type of) window Home Board index AutoHotkey (v1. Hope it 1. The stipulation of 2 statements makes sending control characters easier. Re: Sending key to inactive ControlSend,, {enter}, MinecraftA ControlSend,, {enter}, MinecraftB so first controlsend will work for MinecraftA & the second Controlsend will work for MinecraftB. But when the window is out of focus, F2 does not work anymore. Thanks in advance. The handle of a window is valid until it gets destroyed. it Doesnt work with notepad if i change the command Code: Select all. TL;DR: function that, when a specific key is pressed, detects the ahk_id of the window on focus, to be able to send keystrokes to it even when it becomes inactive or unfocused, while having another copy of that game open that DOESN'T receive the keystrokes. ; Tab Wheel Scroll for Notepad++ AutoHotkey v1 Help; AutoHotkey v2 Help; Tutorial (v1) Tutorial (v2) Download Just joined and made a script to send to multiple inactive windows but doesn't seem to work. Is there a way to have it act as though the key is held down without the notepad window being active? controlsend does work on inactive windows. For scripts, hardcoding like ahk_id 0xa0610 does not work. 1 and older) Forum rules i'm trying to send a keystroke to an inactive window, but it doesnt work even with notepad. Otherwise, specify either ClassNN (the classname and instance number of the control) or the control's text, both of which can be determined via Window Spy. Doesn't work when minimized though. Window spy doesnt show ClassNN for this window. Post by xWojtal » Thu Jan 02, 2020 5:10 pm Hi, can someone help me with send some keystrokes to this inactive window . SendLabel: ; Get your ahk_class from Window Spy. Inactive game window - posted in Ask for Help: I want to send commands\\hotkeys to inactive game window (Lineage2). 1 and older) Ask for Help (v1) It is currently Fri Jan 03, 2025 9:26 am; All times are UTC; ControlSend arrows to inactive window. 1 and older) ControlSend F# to an inactive window. #Requires AutoHotkey v2. price) on a window program successfully using Send command Loop 1 { send {enter} Send {Tab 8} 29. 1 and older) Ask for Help (v1) Gaming Help (v1) It is currently Fri Jan 03, 2025 4:52 pm; All times are UTC; ControlSend to an inactive window is not working Ask gaming related questions (AHK v1. So I tried WM_ACTIVATE and it seems to make the button press go through the queue instantly regardless of whether the window is active or not. 1 and older) ; Send the text to the inactive Notepad edit control. I was under the impression ControlSend would work even when the window is out of focus. Normal key send works (with focused window). MsgBox, Press OK to activate the window to see the result. SetTitleMatchMode 1 WinGet, swgid, List, World of Warcraft loop { ControlSend,, 1, ahk_id %swgid1% sleep, 500 ControlSend,, 1, ahk_id %swgid2% sleep The two that I would've hoped would work are ControlSend, ahk_parent, {Enter}, Desa and ControlSend,, {Enter}, Desa. If #1 works, see if the following kind of The easiest method to send keystrokes to an inactive window with AutoHotkey is to: (1) remember the current active window, (2) activate the target window, (3) send keystrokes, and (4) ControlSend ahk_parent, ^p, MyWindowTitle name - Rapsody return It's probably obvious that second one not only is less complex but is also much faster. 1 and older) Get help with using AutoHotkey (v1. 1 and older) Ask for Help (v1) Gaming Help (v1) It is currently Tue Jan 14, 2025 9:37 pm; All times are UTC; Inactive Window Issues. inactive window - posted in Ask for Help: Hi, I am trying to send {Alt} with the SendControl command to an inactive window. ControlSend, Edit1, This is a line of text in the notepad window. 1 and older) Forum rules. 5 posts • Page 1 of 1. ControlSend uses the only method which can be applied to a specific, inactive control or window. E. Someone please help. I want to scroll with my scroll inactive window, without However, I do not know what parts of the following script can be used with the Control command and therefore be send to an inactive window. It is possible to 'bind' any desired hotkeys to a 1 or 2 controlsend statements. if someone could point me in the right direction thatd be great I have a script that is supposed to control foobar2000 while it is inactive using controlsend. Send key combination (modifier and a key) to an inactive window (ControlSend) Post by Sweetins » Sun Feb 10, 2019 7:44 pm I can send single keys to the target window. Using. PNG. Timer is intended just for something like this and what you were doing is kind of bad practice for various reasons. I save countless hours a week on using AHK. Note that this is not a check on whether that happens to be the case or not, it just tries to send either way. Home Board index AutoHotkey (v1. Any help would be greatly appreciated. sending key strokes to inactive game windows - posted in Ask for Help: Bear with me, I been at this for about 4 hours now and cant get this to work. ControlSend, , $ , WindowTitle are you literally using the word "WindowTitle" or, are you putting the actual title of the window in there? ControlSend, , $ , ProcessName. 1 post • Page 1 of 1. I tried: ControlSend, , {Alt down}x{Alt up}, ahk_id %MyInactiveWindow% ; 0x104==WM_SYSKEYDOWN, 0x12==ALT PostMessage, 0x104, 0x12, 0, , ahk_id %MyInactiveWindow% ControlSend, , x, ahk_id ControlSend Virtual Keys to Inactive Window - posted in Ask for Help: Made an account on this forum just to make this topic. Send keys to inactive window. exe' Loop { WinWait winTitle SetTimer go, 1000 * SECS := 0. 1. If neither worked, double check that there is not a Control to target for the Desa window. 0. 5 posts • Page 1 #Requires AutoHotkey v2. 8. Two questions though. I've searched over the web and tried a bit, but nothing seems to work. Try: *~t, Toggle WinGet, GotaPID, List, ahk_exe javaw. Edit: Try using this. exe" ; pick a window title or program Loop { ControlSend,,^{vk43sc02E}, %myWinTitle% ; send Ctrl+C Sleep 100 } pause::pause ControlSend {Alt} vs. ControlSend,Edit1,aaaa, Untitled - Notepad AutoHotkey (v2, current version 4. local) with WinTitle. Code: Select all. This is my current script F4:: ; Send the text to the inactive Notepad edit control. ControlSend to inactive window. When using text, the matching behavior is determined by S You can use ControlSend. Poedre7 Posts: 1 2019 12:04 pm Hello i need help to work this scritp to inactive window using to Controlsend to Go to AutoHotkey r/AutoHotkey. It'll work for some applications, and for some it wont. Imageserch an inactive window - posted in Ask for Help: i have spent about 5 hours searching and have not found a way to ControlSend a Imagserch if any one could help that would be great here is my code;Determine Main and Clone Windows WinActivate, ahk_id %wowid1% MsgBox, 4,, Is this your Warrior? (press Yes or No) IfMsgBox no idMain = %wowid1% else Home Board index AutoHotkey (v1. ControlSend to hold a button down on an inactive window? - posted in Ask for Help: So something relatively simple. vpzhs wrzgkds czfcw krtv znn aegc bmyb mfglev ifre uhx svdl izj uqhxj qjtzes qenhvf