PocketMatrix forums

A read-only archive of the PocketMatrix forums (2001–2014). Posting and accounts are closed.

suspend/resume display problem

I've found that when I use the SuspendDisplay() function on my pocket pc (ipaq) that calling ResumeDisplay() afterwards does not cause my application to regain its focus. It does work in the emulator that I'm using however.

I saw a post that suggested this

m_pDisplay->SuspendDisplay(); ToggleFullscreen(m_hWnd, FALSE); // Force repaint

//code here

m_pDisplay->ResumeDisplay(); ToggleFullscreen(m_hWnd, TRUE);

but, that has not effect either. Whats up?
In addition:

Does anyone know what setting it is that causes the window created by the gapiApplication class to not allow windows created from such things as shellexecute to be seen unless the gapiApplication window is minimized?
Are you using the latest version of GapiDraw, or an old 2.x release?

Suspend/Resume display only prevents direct access while the application is minimized. You can minimize your application by calling Minimize(). In the latest branches of 3.01 and 3.50 GapiDraw WILL automatically minimize when other Shell windows are shown. But you can force it to always be on top by using a configuration flag to GapiApplication.

You should not call SuspendDisplay and ResumeDisplay directly, trust the GapiApplication framework to do this work for you.
Oh sorry, it did minimize by default on a shell window - I'm pulling my hair out trying to figure this out and confusing myself. I'm using GAPIDRAW VERSION 3.5 and my problem remains however, which is once the shell window is closed my application never regains focus unless I manually go find the executable and open it.

One specific example is that I call GetOpenFileName to get an image, but once an image is selected and the window closes, I don't get my application back. Another thing about it is that when the GetOpenFileName window is open - the task bar area shows the area of my application that was there rather than the taskbar. I just did some more experimenting and found that in gapiapplication.cpp, the WM_USER_MINIMIZE message isn't processed until after I press ok or cancel on the GetOpenFileName dialog box. So I guess that explains the task bar region being weird since gapiapplication's ToggleFullscreen hasn't been called yet. It seems that the message loop is one step behind my dialog calls - because why?