ControlSend not sending to the non-topmost windowAutoHotkey ControlSend problem on one machineControlSend to send key input to Notepad windowWhat to do when ControlSend or Send doesn't work?AutoHotKey ControlSend() Not working with Ctrl functionsControlSend sends incorrect text to background appAlt+F4 with ControlSend in AutoHotKeyWhat's the difference between Send and ControlSend?ControlSend to inactive window - doesn't workControlSend Suppress Newlines When Sending Text to NotepadControlSend sends extra newline

I hit a pipe with a mower and now it won't turn

"Plugged in" or "Plugged in in"

Golf the smallest circle!

How can I convince my reader that I will not use a certain trope?

How to expand abbrevs without hitting another extra key?

Averting Real Women Don’t Wear Dresses

What is a macro? Difference between macro and function?

Do space suits measure "methane" levels or other biological gases?

How to fix a dry solder pin in BGA package?

Symbol for "not absolutely continuous" in Latex

In native German words, is Q always followed by U, as in English?

Plotting the gradient descent

Can you sign using a digital signature itself?

What exactly is a fey/fiend/celestial spirit?

Most elegant way to write a one shot IF

Did Wakanda officially get the stuff out of Bucky's head?

Different budgets within roommate group

How do I change the old-style numerals in the Georgia font?

Is there a category where products don't exist because uniqueness fails?

Does “comme on était à New York” mean “since” or “as though”?

Mean Value Theorem: Continuous or Defined?

Java Optional working of orElse is not as if else

The difference between Rad1 and Rfd1

Index consecutive duplicates in vector



ControlSend not sending to the non-topmost window


AutoHotkey ControlSend problem on one machineControlSend to send key input to Notepad windowWhat to do when ControlSend or Send doesn't work?AutoHotKey ControlSend() Not working with Ctrl functionsControlSend sends incorrect text to background appAlt+F4 with ControlSend in AutoHotKeyWhat's the difference between Send and ControlSend?ControlSend to inactive window - doesn't workControlSend Suppress Newlines When Sending Text to NotepadControlSend sends extra newline






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;








1















Is it possible to make ControlSend send / click to a background window?
This code finds a window by id / handler, but sends a click / keystroke only if the window is the topmost. ControlSend skips its action if the window is not topmost. ControlClick force brings window to top and then clicks.



#Singleinstance
DetectHiddenWindows, On
#SingleInstance Force
#MaxThreadsPerHotkey, 2
SendMode Input ; Recommended for new scripts


SetControlDelay -1


PostClick(x,y,win="A") (y & 0xFFFF) << 16
PostMessage, 0x201, , %lParam%, , %win% ;WM_LBUTTONDOWN
PostMessage, 0x202, , %lParam%, , %win% ;WM_LBUTTONUP



RunAsAdmin()
Loop, %0%
param := %A_Index% ; Fetch the contents of the variable whose name is contained in A_Index.
params .= A_Space . param

ShellExecute := A_IsUnicode ? "shell32ShellExecute":"shell32ShellExecuteA"
if not A_IsAdmin

If A_IsCompiled
DllCall(ShellExecute, uint, 0, str, "RunAs", str, A_ScriptFullPath, str, params , str, A_WorkingDir, int, 1)
Else
DllCall(ShellExecute, uint, 0, str, "RunAs", str, A_AhkPath, str, """" . A_ScriptFullPath . """" . A_Space . params, str, A_WorkingDir, int, 1)
ExitApp



RunAsAdmin()

F1::
Loop

; http://particle-clicker.web.cern.ch/particle-clicker/
WinGet, WinID, ID, Particle Clicker - Google Chrome

; Send keystrokes only if tab active and topmost, suspend if focus lost, continue when gain focue
; ControlSend, ahk_parent, Space, ahk_id %WinID%

; send clicks only if tab not mininised, if tab on background - force bring it to front
; ControlClick, x799 y449, ahk_id %WinID%

; same as above
; ControlClick, x799 y449, ahk_id %WinID%,,,,NA

; same as above
; Controlclick x799 y449,ahk_id %WinID%,,Left,1,NA

; same as above
PostClick(799,449,"Particle Clicker - Google Chrome")


sleep 1000

return

F12::ExitApp









share|improve this question
























  • If nothing helps try to combine WinHide before ControlClick and afterwards WinSet, Bottom and WinShow.

    – user3419297
    Mar 25 at 15:15

















1















Is it possible to make ControlSend send / click to a background window?
This code finds a window by id / handler, but sends a click / keystroke only if the window is the topmost. ControlSend skips its action if the window is not topmost. ControlClick force brings window to top and then clicks.



#Singleinstance
DetectHiddenWindows, On
#SingleInstance Force
#MaxThreadsPerHotkey, 2
SendMode Input ; Recommended for new scripts


SetControlDelay -1


PostClick(x,y,win="A") (y & 0xFFFF) << 16
PostMessage, 0x201, , %lParam%, , %win% ;WM_LBUTTONDOWN
PostMessage, 0x202, , %lParam%, , %win% ;WM_LBUTTONUP



RunAsAdmin()
Loop, %0%
param := %A_Index% ; Fetch the contents of the variable whose name is contained in A_Index.
params .= A_Space . param

ShellExecute := A_IsUnicode ? "shell32ShellExecute":"shell32ShellExecuteA"
if not A_IsAdmin

If A_IsCompiled
DllCall(ShellExecute, uint, 0, str, "RunAs", str, A_ScriptFullPath, str, params , str, A_WorkingDir, int, 1)
Else
DllCall(ShellExecute, uint, 0, str, "RunAs", str, A_AhkPath, str, """" . A_ScriptFullPath . """" . A_Space . params, str, A_WorkingDir, int, 1)
ExitApp



RunAsAdmin()

F1::
Loop

; http://particle-clicker.web.cern.ch/particle-clicker/
WinGet, WinID, ID, Particle Clicker - Google Chrome

; Send keystrokes only if tab active and topmost, suspend if focus lost, continue when gain focue
; ControlSend, ahk_parent, Space, ahk_id %WinID%

; send clicks only if tab not mininised, if tab on background - force bring it to front
; ControlClick, x799 y449, ahk_id %WinID%

; same as above
; ControlClick, x799 y449, ahk_id %WinID%,,,,NA

; same as above
; Controlclick x799 y449,ahk_id %WinID%,,Left,1,NA

; same as above
PostClick(799,449,"Particle Clicker - Google Chrome")


sleep 1000

return

F12::ExitApp









share|improve this question
























  • If nothing helps try to combine WinHide before ControlClick and afterwards WinSet, Bottom and WinShow.

    – user3419297
    Mar 25 at 15:15













1












1








1








Is it possible to make ControlSend send / click to a background window?
This code finds a window by id / handler, but sends a click / keystroke only if the window is the topmost. ControlSend skips its action if the window is not topmost. ControlClick force brings window to top and then clicks.



#Singleinstance
DetectHiddenWindows, On
#SingleInstance Force
#MaxThreadsPerHotkey, 2
SendMode Input ; Recommended for new scripts


SetControlDelay -1


PostClick(x,y,win="A") (y & 0xFFFF) << 16
PostMessage, 0x201, , %lParam%, , %win% ;WM_LBUTTONDOWN
PostMessage, 0x202, , %lParam%, , %win% ;WM_LBUTTONUP



RunAsAdmin()
Loop, %0%
param := %A_Index% ; Fetch the contents of the variable whose name is contained in A_Index.
params .= A_Space . param

ShellExecute := A_IsUnicode ? "shell32ShellExecute":"shell32ShellExecuteA"
if not A_IsAdmin

If A_IsCompiled
DllCall(ShellExecute, uint, 0, str, "RunAs", str, A_ScriptFullPath, str, params , str, A_WorkingDir, int, 1)
Else
DllCall(ShellExecute, uint, 0, str, "RunAs", str, A_AhkPath, str, """" . A_ScriptFullPath . """" . A_Space . params, str, A_WorkingDir, int, 1)
ExitApp



RunAsAdmin()

F1::
Loop

; http://particle-clicker.web.cern.ch/particle-clicker/
WinGet, WinID, ID, Particle Clicker - Google Chrome

; Send keystrokes only if tab active and topmost, suspend if focus lost, continue when gain focue
; ControlSend, ahk_parent, Space, ahk_id %WinID%

; send clicks only if tab not mininised, if tab on background - force bring it to front
; ControlClick, x799 y449, ahk_id %WinID%

; same as above
; ControlClick, x799 y449, ahk_id %WinID%,,,,NA

; same as above
; Controlclick x799 y449,ahk_id %WinID%,,Left,1,NA

; same as above
PostClick(799,449,"Particle Clicker - Google Chrome")


sleep 1000

return

F12::ExitApp









share|improve this question
















Is it possible to make ControlSend send / click to a background window?
This code finds a window by id / handler, but sends a click / keystroke only if the window is the topmost. ControlSend skips its action if the window is not topmost. ControlClick force brings window to top and then clicks.



#Singleinstance
DetectHiddenWindows, On
#SingleInstance Force
#MaxThreadsPerHotkey, 2
SendMode Input ; Recommended for new scripts


SetControlDelay -1


PostClick(x,y,win="A") (y & 0xFFFF) << 16
PostMessage, 0x201, , %lParam%, , %win% ;WM_LBUTTONDOWN
PostMessage, 0x202, , %lParam%, , %win% ;WM_LBUTTONUP



RunAsAdmin()
Loop, %0%
param := %A_Index% ; Fetch the contents of the variable whose name is contained in A_Index.
params .= A_Space . param

ShellExecute := A_IsUnicode ? "shell32ShellExecute":"shell32ShellExecuteA"
if not A_IsAdmin

If A_IsCompiled
DllCall(ShellExecute, uint, 0, str, "RunAs", str, A_ScriptFullPath, str, params , str, A_WorkingDir, int, 1)
Else
DllCall(ShellExecute, uint, 0, str, "RunAs", str, A_AhkPath, str, """" . A_ScriptFullPath . """" . A_Space . params, str, A_WorkingDir, int, 1)
ExitApp



RunAsAdmin()

F1::
Loop

; http://particle-clicker.web.cern.ch/particle-clicker/
WinGet, WinID, ID, Particle Clicker - Google Chrome

; Send keystrokes only if tab active and topmost, suspend if focus lost, continue when gain focue
; ControlSend, ahk_parent, Space, ahk_id %WinID%

; send clicks only if tab not mininised, if tab on background - force bring it to front
; ControlClick, x799 y449, ahk_id %WinID%

; same as above
; ControlClick, x799 y449, ahk_id %WinID%,,,,NA

; same as above
; Controlclick x799 y449,ahk_id %WinID%,,Left,1,NA

; same as above
PostClick(799,449,"Particle Clicker - Google Chrome")


sleep 1000

return

F12::ExitApp






autohotkey






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Mar 25 at 12:40







Eliont til Ameth

















asked Mar 25 at 12:29









Eliont til AmethEliont til Ameth

62 bronze badges




62 bronze badges












  • If nothing helps try to combine WinHide before ControlClick and afterwards WinSet, Bottom and WinShow.

    – user3419297
    Mar 25 at 15:15

















  • If nothing helps try to combine WinHide before ControlClick and afterwards WinSet, Bottom and WinShow.

    – user3419297
    Mar 25 at 15:15
















If nothing helps try to combine WinHide before ControlClick and afterwards WinSet, Bottom and WinShow.

– user3419297
Mar 25 at 15:15





If nothing helps try to combine WinHide before ControlClick and afterwards WinSet, Bottom and WinShow.

– user3419297
Mar 25 at 15:15












0






active

oldest

votes










Your Answer






StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");

StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);

else
createEditor();

);

function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);



);













draft saved

draft discarded


















StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55337810%2fcontrolsend-not-sending-to-the-non-topmost-window%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown

























0






active

oldest

votes








0






active

oldest

votes









active

oldest

votes






active

oldest

votes




Is this question similar to what you get asked at work? Learn more about asking and sharing private information with your coworkers using Stack Overflow for Teams.








Is this question similar to what you get asked at work? Learn more about asking and sharing private information with your coworkers using Stack Overflow for Teams.




















draft saved

draft discarded
















































Thanks for contributing an answer to Stack Overflow!


  • Please be sure to answer the question. Provide details and share your research!

But avoid


  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.

To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55337810%2fcontrolsend-not-sending-to-the-non-topmost-window%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

Kamusi Yaliyomo Aina za kamusi | Muundo wa kamusi | Faida za kamusi | Dhima ya picha katika kamusi | Marejeo | Tazama pia | Viungo vya nje | UrambazajiKuhusu kamusiGo-SwahiliWiki-KamusiKamusi ya Kiswahili na Kiingerezakuihariri na kuongeza habari

Swift 4 - func physicsWorld not invoked on collision? The Next CEO of Stack OverflowHow to call Objective-C code from Swift#ifdef replacement in the Swift language@selector() in Swift?#pragma mark in Swift?Swift for loop: for index, element in array?dispatch_after - GCD in Swift?Swift Beta performance: sorting arraysSplit a String into an array in Swift?The use of Swift 3 @objc inference in Swift 4 mode is deprecated?How to optimize UITableViewCell, because my UITableView lags

Access current req object everywhere in Node.js ExpressWhy are global variables considered bad practice? (node.js)Using req & res across functionsHow do I get the path to the current script with Node.js?What is Node.js' Connect, Express and “middleware”?Node.js w/ express error handling in callbackHow to access the GET parameters after “?” in Express?Modify Node.js req object parametersAccess “app” variable inside of ExpressJS/ConnectJS middleware?Node.js Express app - request objectAngular Http Module considered middleware?Session variables in ExpressJSAdd properties to the req object in expressjs with Typescript