Please,
Anyone can help me to how to send a keypress of F7 to another window?
The tittle of the inactive window is " Profitchart Pro".
I know it is a simple code, but I having dificulties to do this with Controlsend.
Thnaks!
Send F7 key to inactive window
Re: Send F7 key to inactive window
You may not be doing anything wrong. Some windows/programs just won't react to being sent virtual keys like that. Some won't if they're not the active window. Sometimes it works if you send it to the window itself, sometimes you have to send it to a certain control directly within that window. Sometimes nothing works.
If you want to post your code, we can at least see if everything looks correct from a syntax standpoint.
If you want to post your code, we can at least see if everything looks correct from a syntax standpoint.
Re: Send F7 key to inactive window
Thanks for your answer
I am trying the basics as
Regards
I am trying the basics as
Code: Select all
ControlSend , , {F7}, Profit
Re: Send F7 key to inactive window
No.
Please do the following:
Compile this script, go to your application and press Ctrl+Shift+Alt+F1 (or change the key combination in the script).
Then you'll have the class name.
After this, go to your script editor (whatever you use), and paste the class name (it is in the clipboard).
Then change your current script to:
Change ANYKEY to any key, and write the ahk_class (normally you already have it.
If it doesn't work, remove the ahk_parent
So only:
Let us know if it worked.
Please do the following:
Compile this script, go to your application and press Ctrl+Shift+Alt+F1 (or change the key combination in the script).
Then you'll have the class name.
Code: Select all
^+!F1::
WinGetClass, class, A
Clipboard = ahk_class %class%
MsgBox, Class of current window is "%class%".
return
Then change your current script to:
Code: Select all
ANYKEY::
ControlSend, ahk_parent, {F7}, ahk_class XYZ
If it doesn't work, remove the ahk_parent
So only:
Code: Select all
ANYKEY::
ControlSend, {F7}, ahk_class XYZ
Please use [code][/code] when posting code!
Keyboard: Logitech G PRO - Mouse: Logitech G502 LS - OS: Windows 10 Pro 64 Bit - AHK version: 1.1.33.09
Keyboard: Logitech G PRO - Mouse: Logitech G502 LS - OS: Windows 10 Pro 64 Bit - AHK version: 1.1.33.09
Re: Send F7 key to inactive window
Hi, Scr1pter!
Thanks,but it did not worked.
My code was this:
ControlSend, ahk_parent, {F7}, ahk_class CabinetWClass
I already tried
ControlSend, , {F7}, ahk_class CabinetWClass
I did not put ANYKEY::, because this code must be executed directly without input from any key.
I am a begginer and thanks for your help.
Any addtional suggestion
Regards!
Thanks,but it did not worked.
My code was this:
ControlSend, ahk_parent, {F7}, ahk_class CabinetWClass
I already tried
ControlSend, , {F7}, ahk_class CabinetWClass
I did not put ANYKEY::, because this code must be executed directly without input from any key.
I am a begginer and thanks for your help.
Any addtional suggestion
Regards!
Re: Send F7 key to inactive window
If you happen to have more than one window with the class CabinetWClass, it can get sent to the wrong window. Also, changing the WinTitle from Profit to the class of that window does nothing to help make the ControlSend work or be more reliable. As long as the window gets identified, how it's referenced doesn't matter. Using the class alone can be ambiguous and risky.
-
- Posts: 862
- Joined: 21 Dec 2015, 02:34
Re: Send F7 key to inactive window
what about this (if it hasn't already been suggested):
Code: Select all
ControlSend, ahk_parent,{F7},Profitchart Pro
Re: Send F7 key to inactive window
That's the same as using Profit as the title as long as no other windows start with the word Profit since the default title match mode is to match the start of the title.
Re: Send F7 key to inactive window
That is missing a comma to skip the Control parameter. Otherwise, the parameters you did include are in the wrong place. EDIT: But I see fdoped realized that and put it in himself.Scr1pter wrote:Code: Select all
ANYKEY:: ControlSend, {F7}, ahk_class XYZ
Who is online
Users browsing this forum: Google [Bot], haomingchen1998, jdfnnl and 367 guests