In a standalone player, is it possible to force minimizing the screen by scripting?
What I am trying to do is minimizing the screen when some event happens, and then maximising the screen whe I read a value from a text file.
Maybe i have to write a plugin, in that case how does it work?
You can do anything with window by using WinAPI. But you have to get window handle to do it. In usual .NET application you can get them by this way:
But it doesn't work in unity. So, i use another way to get the handle. I enumerate all windows by function `EnumWindowsProc` and i get process id of each window by `GetWindowThreadProcessId`. When i find window with pid, that equals to pid of unity i can manipulate by unity window. Resize, move, minimize, etc.
To minimize window you can use `ShowWindow` function.
To use WinAPI functions you have to import them:
answered Dec 08, 2011 at 08:05 PM
Switch that boolean argument to True for fullscreen and False for windowed.
answered Dec 08, 2011 at 07:46 PM