vsub wrote: ↑17 May 2019, 16:31
How about this then
This minimizes all visible windows of this process
Code: Select all
SetWinDelay,0
SetBatchLines,0
WinGet,ID,List,ahk_exe sm18.exe
Loop, %ID%
{
ID := ID%A_Index%
WinMinimize,ahk_id %ID%
}
thanks for input, minimizing works great but have two issues when implementing the fix.
Code: Select all
if(!WinExist("ahk_class TElWind ahk_class TApplication ahk_exe sm18.exe")) ; you can stack different identifiers, such as title, class, and exe
ShellRun("C:\SuperMemo\sm18.exe")
else
{
if(!WinActive("ahk_exe sm18.exe"))
{
SetWinDelay,0
SetBatchLines,0
WinGet,ID,List,ahk_exe sm18.exe
Loop, %ID%
{
ID := ID%A_Index%
WinActivate, ahk_id %ID%
Sleep, 19999
}
}
else
SetWinDelay,0
SetBatchLines,0
WinGet,ID,List,ahk_exe sm18.exe
Loop, %ID%
{
ID := ID%A_Index%
WinMinimize, ahk_id %ID%
}
}
return
1. after WinActivate I have implemented sleep because it would instantly run second part of the script with else and winminimize
2. problem you can see in the picture this is what happens when trying to winactivate, there are other windows of the program "laying" close to the taskbar and not activating. It is like he can't or doesn't know which window to activate
- 2019-05-18_11-55-19.png (85.07 KiB) Viewed 876 times