Shutting an App Down *Completely*
-
When we shut our app down, it stays in memory. This is a pain because while we're using the emulator, we have to either reset the emulator or go into settings/system/memory/running apps to shut the program down completely. Is there a way to do this programatically from within our own app? [edit] Forgot to mention that this is for PocketPC 2002. [/edit] ------- signature starts "...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001 Please review the Legal Disclaimer in my bio. ------- signature ends
-
When we shut our app down, it stays in memory. This is a pain because while we're using the emulator, we have to either reset the emulator or go into settings/system/memory/running apps to shut the program down completely. Is there a way to do this programatically from within our own app? [edit] Forgot to mention that this is for PocketPC 2002. [/edit] ------- signature starts "...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001 Please review the Legal Disclaimer in my bio. ------- signature ends
Try this: LRESULT CMainFrame::WindowProc(UINT message, WPARAM wParam, LPARAM lParam) { if (message==WM_WINDOWPOSCHANGED) { WINDOWPOS *pWp = (LPWINDOWPOS) lParam; if (pWp->hwndInsertAfter != NULL) { TCHAR str[101]; ::GetWindowText(pWp->hwndInsertAfter, str, 100); if (wcscmp(str, _T("Desktop"))==0) SendMessage(WM_CLOSE,0,0); } } return CFrameWnd::WindowProc(message, wParam, lParam); } I found it on the Net... but i should say João Paulo Figueira was a great help. Thanks!
-
Try this: LRESULT CMainFrame::WindowProc(UINT message, WPARAM wParam, LPARAM lParam) { if (message==WM_WINDOWPOSCHANGED) { WINDOWPOS *pWp = (LPWINDOWPOS) lParam; if (pWp->hwndInsertAfter != NULL) { TCHAR str[101]; ::GetWindowText(pWp->hwndInsertAfter, str, 100); if (wcscmp(str, _T("Desktop"))==0) SendMessage(WM_CLOSE,0,0); } } return CFrameWnd::WindowProc(message, wParam, lParam); } I found it on the Net... but i should say João Paulo Figueira was a great help. Thanks!
Perfect! Thanks! BTW, is this supposed to work in the emulator too? Once I shut down my app, I can't restart it without reseting the emulator. [EDIT] Hmmm, it also does this when I use the Settings|System|Running Programs method for shutting down. [/EDIT] [EDIT2] After shutting the app down (with this code in place), and then trying to restart the app, the title bar reads "Default IME" (and the app doesn't start). [/EDIT2] ------- signature starts "...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001 Please review the Legal Disclaimer in my bio. ------- signature ends
-
When we shut our app down, it stays in memory. This is a pain because while we're using the emulator, we have to either reset the emulator or go into settings/system/memory/running apps to shut the program down completely. Is there a way to do this programatically from within our own app? [edit] Forgot to mention that this is for PocketPC 2002. [/edit] ------- signature starts "...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001 Please review the Legal Disclaimer in my bio. ------- signature ends
John Simmons / outlaw programmer wrote: When we shut our app down, it stays in memory If I understand this correctly, you are "closing" the app by using the "Smart Minimize" button (the X) instead of the OK button, eh? Smart Minimize won't close the app, but the OK button will. To remove the Smart Minimize (and add OK), use this:
ModifyStyle(0, WS_NONAVDONEBUTTON, SWP_NOSIZE);
SHDoneButton(m_hWnd, SHDB_SHOW);Hopefully, this is what you're wanting. I prefer to wear gloves when using it, but that's merely a matter of personal hygiene [Roger Wright on VB] Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning. [Rich Cook]
-
John Simmons / outlaw programmer wrote: When we shut our app down, it stays in memory If I understand this correctly, you are "closing" the app by using the "Smart Minimize" button (the X) instead of the OK button, eh? Smart Minimize won't close the app, but the OK button will. To remove the Smart Minimize (and add OK), use this:
ModifyStyle(0, WS_NONAVDONEBUTTON, SWP_NOSIZE);
SHDoneButton(m_hWnd, SHDB_SHOW);Hopefully, this is what you're wanting. I prefer to wear gloves when using it, but that's merely a matter of personal hygiene [Roger Wright on VB] Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning. [Rich Cook]
That didn't change the current behavior. The app shuts down, and doesn't show as an entry in the "Running Programs" list, but when I try to restart it, all I get is "Default IME" showing up in the PocketPC title bar. ------- signature starts "...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001 Please review the Legal Disclaimer in my bio. ------- signature ends
-
That didn't change the current behavior. The app shuts down, and doesn't show as an entry in the "Running Programs" list, but when I try to restart it, all I get is "Default IME" showing up in the PocketPC title bar. ------- signature starts "...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001 Please review the Legal Disclaimer in my bio. ------- signature ends
That's really weird; I haven't seen anything like before. I did a quick Google search (as I'm sure you have done too), and found some other programs out there have a similar problem. Seems like the error is caused by the Storage Card (CF or SD). HTH. http://www.gpspassion.com/forumsen/topic.asp?TOPIC_ID=597[^] http://www.gpspassion.com/forumsen/topic.asp?TOPIC_ID=529[^] I prefer to wear gloves when using it, but that's merely a matter of personal hygiene [Roger Wright on VB] Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning. [Rich Cook]
-
That's really weird; I haven't seen anything like before. I did a quick Google search (as I'm sure you have done too), and found some other programs out there have a similar problem. Seems like the error is caused by the Storage Card (CF or SD). HTH. http://www.gpspassion.com/forumsen/topic.asp?TOPIC_ID=597[^] http://www.gpspassion.com/forumsen/topic.asp?TOPIC_ID=529[^] I prefer to wear gloves when using it, but that's merely a matter of personal hygiene [Roger Wright on VB] Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning. [Rich Cook]
These people are all end users. I'm trying to figure out how to keep it from happening. Also, I haven't moved the app to the actual iPaq yet - I'm still working in the emulator, but from past experience, what you see in the emulator will also be seen on the actual device. ------- signature starts "...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001 Please review the Legal Disclaimer in my bio. ------- signature ends
-
When we shut our app down, it stays in memory. This is a pain because while we're using the emulator, we have to either reset the emulator or go into settings/system/memory/running apps to shut the program down completely. Is there a way to do this programatically from within our own app? [edit] Forgot to mention that this is for PocketPC 2002. [/edit] ------- signature starts "...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001 Please review the Legal Disclaimer in my bio. ------- signature ends
Try this: QA: How can I close my application by clicking the smart minimize (X) button?[^] Regards, João Paulo