I am using AHK to solve the Win10 issue where every time I hit the calcualtor button on my keyboard, a new calcualtor instance opens up.
The AHK code I have works to limit Win10 to a single instance of calculator.exe, but fails to bring it to the top in front of other windows unless I hit the button 2 times. The "WinActivate" command works if calc is already open, but not when opening it for the first time. Is there an easy way to fix this?
IfWinExist Calculator
WinActivate
else
Run calculator://
WinActivate calculator
return
Bring Calculator window to top Topic is solved
Re: Bring Calculator window to top
cnwinger wrote: ↑05 May 2020, 13:43I am using AHK to solve the Win10 issue where every time I hit the calcualtor button on my keyboard, a new calcualtor instance opens up.
The AHK code I have works to limit Win10 to a single instance of calculator.exe, but fails to bring it to the top in front of other windows unless I hit the button 2 times. The "WinActivate" command works if calc is already open, but not when opening it for the first time. Is there an easy way to fix this?
IfWinExist Calculator
WinActivate
else
Run calculator://
WinActivate calculator
return
Code: Select all
IfWinNotExist
Run calculator://
WinActivate calculator
return
Re: Bring Calculator window to top
Thank you, but this code doesn't fix the original problem in Windows10 as far as I can tell - I end up with multiple instances of the calculator button if I press the calculator button (that is linked to the .ahk) multiple times.hasantr wrote: ↑05 May 2020, 15:10cnwinger wrote: ↑05 May 2020, 13:43I am using AHK to solve the Win10 issue where every time I hit the calcualtor button on my keyboard, a new calcualtor instance opens up.
The AHK code I have works to limit Win10 to a single instance of calculator.exe, but fails to bring it to the top in front of other windows unless I hit the button 2 times. The "WinActivate" command works if calc is already open, but not when opening it for the first time. Is there an easy way to fix this?
IfWinExist Calculator
WinActivate
else
Run calculator://
WinActivate calculator
return
Code: Select all
IfWinNotExist Run calculator:// WinActivate calculator return
Re: Bring Calculator window to top Topic is solved
Ahh sorry.cnwinger wrote: ↑05 May 2020, 15:58Thank you, but this code doesn't fix the original problem in Windows10 as far as I can tell - I end up with multiple instances of the calculator button if I press the calculator button (that is linked to the .ahk) multiple times.hasantr wrote: ↑05 May 2020, 15:10cnwinger wrote: ↑05 May 2020, 13:43I am using AHK to solve the Win10 issue where every time I hit the calcualtor button on my keyboard, a new calcualtor instance opens up.
The AHK code I have works to limit Win10 to a single instance of calculator.exe, but fails to bring it to the top in front of other windows unless I hit the button 2 times. The "WinActivate" command works if calc is already open, but not when opening it for the first time. Is there an easy way to fix this?
IfWinExist Calculator
WinActivate
else
Run calculator://
WinActivate calculator
return
Code: Select all
IfWinNotExist Run calculator:// WinActivate calculator return
Code: Select all
IfWinNotExist Calculator
Run calculator://
WinActivate calculator
return
Re: Bring Calculator window to top
Working great. Thanks!
Re: Bring Calculator window to top
Having the same issue with this new code in Win10. For some reason the calc window isn't brought to the top - it just flashes orange in the taskbar. no matter how many times I press the button tied to the autohotkey script. It always seems to be under my current window - so if I minimize my active window, it's there on top of all my other windows.
Is there some reason this is happening?
Is there some reason this is happening?
Re: Bring Calculator window to top
WinActivate --> Remarks
Window titles and text are case sensitive
Code: Select all
IfWinNotExist Calculator
Run calculator://
; WinWait Calculator, , 3
; If not ErrorLevel
WinActivate Calculator
Re: Bring Calculator window to top
Thanks...Same issue though. I think I have narrowed this down - it seems to only happen with Firefox. Calc on top -> close Calc -> switch to another Firefox tab -> open Calc. Calc is not brought to the front. It always stays under Firefox if I have switched to a different tab before opening Calc. No idea what is causing this. Possibly a Firefox about:config setting?GEV wrote: ↑14 May 2020, 18:22WinActivate --> Remarks
Window titles and text are case sensitiveCode: Select all
IfWinNotExist Calculator Run calculator:// ; WinWait Calculator, , 3 ; If not ErrorLevel WinActivate Calculator
Re: Bring Calculator window to top
It doesn't happen to me with Firefox.
Re: Bring Calculator window to top
Do you have a tab open in Firefox with Calculator in its wintitle (like this topic, along with SetTitleMatchMode 2 probably) when this happens?it seems to only happen with Firefox
That would explain it.
Who is online
Users browsing this forum: doodles333, onurcoban and 376 guests