Hello guys,
I have Windows 10 and I am Using Autohotkey. I controll my PC in the upper etage with TeamViewer and my PC is permanently running a CMD window. For some reason, the CMD window goes in some kind of idle mode sometimes so I use AutoHotkey to spamm Enter every 20 seconds so my CMD window always works and it refreshes everytime it registers a key.
I set my PC so it restarts every 3 hours and I thought about putting the script simply in shell:startup so it will automatically load at startup like my CMD window (I'm mining Ethereum - if you're wondering what i mean with CMD window).
Can I set my script so it "locks" on my CMD window (conhost.exe) every time the script runs? So i dont have to put my mouse on the process/window that it spamms in the right place.
My script is very basic, I only want that it spamms in the window from "conhost.exe". Or locks on this window, or however it can be solved:
#Persistent
SetTimer, PressTheKey, 20000
Return
PressTheKey:
Send, {Enter}
Return
Ty in advance.
How to make a Hotkey for a specific window/process? Topic is solved
Re: How to make a Hotkey for a specific window/process?
You can try the ControlSend command, which works with some windows, but not all. If it doesn't work, you can use WinActivate to activate your CMD window before you send to it. You can also determine which window is active right before it does that, so then you can return focus to that window afterwards.
Who is online
Users browsing this forum: ConnorMcLoud, Google [Bot] and 169 guests