fast_rx wrote:Some points of interest...
*Even though the remote process viewer has that bogus name, the FindWindow(...) code does work correctly. There was another program that had the same bogus window name at one point.
I couldn't find what this bogus name is, but read on:
fast_rx wrote:*Calling ShowWindow(SW_HIDE) does not cause the GameSuspended function to fire off...at least the user overridden one. And GameResume() is not called autmatically durind what I have in my 'bAlreadyRunning' section (I need to make sure I try the exact code - I'm not doing the IsIconic )
I am unable to reproduce your button problem with PHAL 0.8.4. I do get a call to OnGameSuspend(). Did you implement the "focus fix" for PF0.7.0 by removing the WM_SETFOCUS and WM_KILLFOCUS handlers?
Calling ShowWindow(SW_HIDE) or SetWindowPos( ... SWP_HIDEWINDOW ) indeed hides the window. This is why it is not showing up in the task list. I am still investigating the proper way of "minimizing" an app, but consider that the following code brings you to the today screen and works perfectly (ie your app will show in the task list):
- Code:
HWND hwnd = GetDesktopWindow();
SetForegroundWindow( hwnd );
It seems that in your case, hiding the window doesn't activate the app. This is somewhat expected and would explain your button problem. Stylus input on the other hand will go to the topmost visible window. Can you try "minimizing" the app using this snippet of code and see what happen? If it still doesn't work, can you send me some code that exhibits the problem?
fast_rx wrote:*And lastly, the main message loop of PF doesn't include any sleep time when the game is suspended (look for m_bSuspended I believe). It needs to be an if/else with something like Sleep(250) when it's not active. Originally, minimizing my app would slow the system down. I thought this had been added a while back - but it didn't make it into the last release.
This will be fixed. Minimized apps shouldn't use any CPU.
fast_rx wrote:edit: one more thing...
When using a SendMessage(... WA_INACTIVE), the program DOES show up in the running programs tab of the system/memory. So, SW_HIDE really hides well.
Indeed. It is not the proper way of minimizing an app. Aside from setting the desktop on top, I am not sure what can be done.