Just to follow-up on your suggestions GEV.
I tried both of them with the following same results for each one:
When I hit the key the first time it launches the app.
Second time it minimizes window.
Third time nothing happens.
If I click on another program to change focus, and then hit the key, the app maximizes.
Hit key again it minimizes and the above cycle will continue.
Another key point here that I discovered yesterday when I found my CPU meter unusually high, is that when this app (USB camera) is running, it keeps my CPU load at 50% or higher. This occurs even if it is minimized.
So I am going to stick with my clumsy code that I threw together yesterday.
What my code did basically was replicate with one hotkey, what I had been doing before with two different combinations:
I would hit the hotkey to launch the app, and then hit Alt-F4 to close the app. The app launches super-fast because the process continues to run.
So this way (opening and closing with the same hotkey) my CPU load stays much lower and also I can quickly change between camera and no camera, with a quick toggle. I don't have to change focus first.
Had I known from the beginning that I was actually closing the program each time, before 'maximizing' it, I would have worded my initial question differently. Sorry for the confusion!
One other thing I should add.
I just read that with State = 0 it means that the window is neither min. nor max.
Which is the situation with my app. The window is in the middle of the screen, not max nor min.
So this is why I ended up choosing State = 0 for my code. At the time it was simply trial by error.
WinGet, CurrentState, MinMax
If (CurrentState = 0)