Okay, thank you. Your script works wonderful.
But i have sadly another problem.
Whenever the program get´s suspended, it of course creates the "Ghost" Image over it (White Overlay over the Window) and the window title get´s the "(Not Responding)" text added to the Program´s Title (examle is Picture 01)
And this is where the script won´t work anymore, because it can´t see the Program´s Progress or something.
I thought of maybe using this ("Example: Source" is the title of the program)
if (!BFS.Application.GetMainFileByWindow(windowHandle).Contains("Example.exe"))
but instead using
if (BFS.Window.GetText(windowHandle).Contains("Example: Source (Not Responding)"));
or
if (BFS.Window.IsHung(windowHandle).Contains("Example: Source"));
But nothing i tried since 5 hours works here. I don´t get it.
As usual, i always use this Function with the Trigger from Picture 02.
So in Summary i want to do the following:
1.- Start the Program (Example.exe)
2.- When Mouse is not over Example.exe´s Window, then launch "nircmd.exe suspendprocess Example.exe".
3.- Program (Example.exe) get´s frozen and don´t use any unescesarry CPU Resources while it´s not focused.
4.- When Mouse is over Example.exe´s Window, then launch "nircmd.exe resumeprocess Example.exe"
5.- Program (Example.exe) get´s out of the Frozen State and you can work on the Program again. Until it´s not focused, then the whole Function starts from the beginnning.
At Point 4, this is where it seems not to work, because the program get´s not unfrozed anymore. So maybe using the Window Title or the Function Windows Hung as i described above instead of only using the Programs Exe could be working.
Sorry for all that questions, but as i said before, i already tried that since 5 hours myself searching through Example Scrips and whatnot.
Thank you very much.