PocketMatrix forums

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

opening dialogs

while I have easyce running I need to open a fileopen dialog.
This works fine the first time, press cancel and returns to the game correctly, select it a second time press cancel, the game displays but the pocket pc destop is running in the background ie it has focus.

1. do I need to call certain functions before and after the dialog.

2. Have I just done something else dumb.

any help on the above would be marvelous.
cheers
jim.
Make sure you're specifying the handle to the main Easy CE window in the OPENFILENAME struct (hwndOwner member).

Dan East
the hwnd for the main easyce window is being passed in. I have it stored as a global, and is initialized in InitInstance() in easyce.cpp.

The dialog works fine on my windows version.

I'm calling GetOpenFileName(), do I need to call another function to regain control after the dialog has closed?

Any help will be much appreciated.

cheers
Jim.
I don't have the source to EasyCE 2.0 around, but I remember discussing the handling of WM_ACTIVATE messages to detect when the App loses focus, so it can gracefully let another app take control. Your app will get a WM_ACTIVATE indicating your main window lost activation if you create a dialog (even if your main window is the parent of the dialog).
Try adding lines 3 & 4 below to your WM_ACTIVATE handler to prevent your app from releasing the display if a child window gains activation:

Code:

case WM_ACTIVATE:
if (LOWORD(wParam)==WA_INACTIVE) {
if (lParam&&(GetParent((HWND)lParam)==hWnd))
break;
//Release display with SHFullScreen, etc
} else {
//We gained activation
}


hWnd would be the handle to the main EasyCE window.

Dan East
sorted!
Many Thanks

Jim
Was the activation code the problem, or did it lie elsewhere?

Dan East
The problem was in the activation code, running a heavily modified version of easyce so I don't use the latest versions.

cheers
Jim.
having problems with the low power dialog but only on certain devices. Compaq iPaq H3630,HP Jornarda 568.

any ideas.
I changed my code to that in easyce 2.0, so I imagine this is likely to be causing probs for others
I keep having problems with this low power stuff. I can make it so that the low power warning doesn't stand a chance, but that way, you take the risk of loosing all your data when playing your favorite game for too long. :) I also tried to let the window pop to the foreground, but that way, I can't return to the game app, wich is also annoying. I still don't have a good solution for this. The best solution would probably be to add some sort of battery warning in EasyCE itself, but I don't know if there is a device-independent way of measuring the remaining battery power...