I am struggling with one problem in Windows Mobile programming (dialog based app).
I have dialog based MFC application. App is created like this:
BOOL MyApp::InitInstance()
{
MainDlg dlg;
dlg.DoModal();
m_pMainWnd = &dlg;
return FALSE;
}
This works just fine. But it has a big problem. If user minimizes application (for example by hitting "home button"), he cant retrieve application window again, which is unthinkable (because app some connections to external devices, and if this happenes, phone and device has to be reset).
I had a solution, but wasnt able to implement it: create CFrameWnd
which will be the main window, and this window will "load" dialogs. This would mean, that application will have window and user will be able to use task manager and bring it to top (this was impossible, because dialog based app isnt listed in applications in task manager).
I would really appreciate a help from some experienced developer, who has better skills with MFC than me.
For more information: I am using eVC++ 4.0 with SP 3
Well, I finally figured it out. I had turned off
Title bar
, therefore task manager didnt show my app, because it didnt have any window.But after launching app, it has title at taskbar and titlebar. To remove title bar & border, I left these options:
In code I did this:
Now my application has window - it is visible in task manager, and also I am using as much space as possible.