For my Job I am trying to create a Heartbeat program that monitors the status of interactives. In order to do this safely, I don't want clients closing out of the program, so I want to hide the window.
This is the single line of code that causes 35% of my processing power to be used when I run it. **There is nothing in the scene and no other scripts.**:
void OnApplicationFocus(bool hasFocus)
{
User32.ShowWindow(User32.GetActiveWindow(), 0);
}
Once you build your application, this code should immediately hide it. Now if you open Task Manager, you can see that when the application is hidden, it takes a lot of processing power. Anyone know why?
↧