Page 1 of 1

Firing WinMinimize untill window is minimized

Posted: 12 Aug 2018, 00:54
by Heihachi88

Code: Select all

Process, wait, Boostnote.exe, 1
NewPID = %ErrorLevel%
if NewPID = 0
{
	Run, "C:\Users\Alexander\AppData\Local\boost\Boostnote.exe",, Min, PID
	WinWait, Boostnote
	Sleep, 10000
	WinMinimize
}

return
I use Sleep now to successfully minimize the window on startup (this script launches on startup via task scheduler). WinWait is somehow not working. Is it possible to loop WinMinimze untill my window is actually minimized?

Re: Firing WinMinimize untill window is minimized

Posted: 12 Aug 2018, 03:03
by iseahound
It looks like an electron app, so just use the --minimized flag.

Code: Select all

Run, % "C:\Users\Alexander\AppData\Local\boost\Boostnote.exe  --minimized"
or without quotes and a percent sign (these two are equal)

Code: Select all

Run, C:\Users\Alexander\AppData\Local\boost\Boostnote.exe  --minimized
Source: https://peter.sh/experiments/chromium-c ... -switches/

Tip: Try to avoid the electron framework, which is the unholy synthesis of Node.js + Chromium.

Re: Firing WinMinimize untill window is minimized

Posted: 12 Aug 2018, 04:05
by Heihachi88
Sadly, but --minimized has no effect on it.

Re: Firing WinMinimize untill window is minimized

Posted: 12 Aug 2018, 11:02
by YMP2
Have you tried WinWaitActive? It seems to work.