"WinActive" issue and "Run"
Posted: 06 May 2017, 05:07
Hi, I'm quite new in autohotkey and i need an assistance with two issues.
First one is that my WinActive command seem to be not regonized. I'm using it as condition in if function. Regardles of the state of the WinActive value it awayis send me the same result.
The second issue is that on my win 10 machine the function Run cannot be used without a file path.
Here's my simple code, i reduce it to the most simpler level for easy debuging.
My desire is to have a program that i can minimze if it's active, and activate if minimized. The command work one by one. "WinMinimize" and "WinActivate" are wokring perfectly. The problem seem to be in the "if WinActivate". I've made the example with winword.exe, but in general i'm using variables. The results are the same, it aways run the operator for which the window is active. Can someone point me to why could that be?
In regards to my seond issue normally i can run a program just by calling its .exe, however on my win10 machine some programs do not recognize those and require me to use file path to be runned.
Here's a list of the offenders:
Win7/Win10
W/W - explorer.exe
W/W - dopus.exe
W/W - chrome.exe
W/W - firefox.exe
W/D - winword.exe
W/D - excel.exe
W/D - spotify.exe
W - working, D - Doesn't work.
Does anyone know a reason why that could be?
First one is that my WinActive command seem to be not regonized. I'm using it as condition in if function. Regardles of the state of the WinActive value it awayis send me the same result.
The second issue is that on my win 10 machine the function Run cannot be used without a file path.
Here's my simple code, i reduce it to the most simpler level for easy debuging.
Code: Select all
{
IfWinExist, ahk_exe winword.exe
{
if WinActive "winword.exe"
{
WinMinimize
}
else
{
WinActivate ahk_exe winword.exe
}
}
else
{
Run, "C:\ProgramData\Microsoft\Windows\Start Menu\Programs\Word 2016.lnk"
}
Return
}
In regards to my seond issue normally i can run a program just by calling its .exe, however on my win10 machine some programs do not recognize those and require me to use file path to be runned.
Here's a list of the offenders:
Win7/Win10
W/W - explorer.exe
W/W - dopus.exe
W/W - chrome.exe
W/W - firefox.exe
W/D - winword.exe
W/D - excel.exe
W/D - spotify.exe
W - working, D - Doesn't work.
Does anyone know a reason why that could be?