Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Mobile Development
  3. Mobile
  4. Shutting an App Down *Completely*

Shutting an App Down *Completely*

Scheduled Pinned Locked Moved Mobile
performancequestion
8 Posts 4 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • realJSOPR Offline
    realJSOPR Offline
    realJSOP
    wrote on last edited by
    #1

    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

    M A J 3 Replies Last reply
    0
    • realJSOPR realJSOP

      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

      M Offline
      M Offline
      Mariz
      wrote on last edited by
      #2

      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!

      realJSOPR 1 Reply Last reply
      0
      • M Mariz

        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!

        realJSOPR Offline
        realJSOPR Offline
        realJSOP
        wrote on last edited by
        #3

        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

        1 Reply Last reply
        0
        • realJSOPR realJSOP

          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

          A Offline
          A Offline
          Atlantys
          wrote on last edited by
          #4

          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]

          realJSOPR 1 Reply Last reply
          0
          • A Atlantys

            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]

            realJSOPR Offline
            realJSOPR Offline
            realJSOP
            wrote on last edited by
            #5

            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

            A 1 Reply Last reply
            0
            • realJSOPR realJSOP

              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

              A Offline
              A Offline
              Atlantys
              wrote on last edited by
              #6

              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]

              realJSOPR 1 Reply Last reply
              0
              • A Atlantys

                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]

                realJSOPR Offline
                realJSOPR Offline
                realJSOP
                wrote on last edited by
                #7

                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

                1 Reply Last reply
                0
                • realJSOPR realJSOP

                  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

                  J Offline
                  J Offline
                  Joao Paulo Figueira
                  wrote on last edited by
                  #8

                  Try this: QA: How can I close my application by clicking the smart minimize (X) button?[^] Regards, João Paulo

                  1 Reply Last reply
                  0
                  Reply
                  • Reply as topic
                  Log in to reply
                  • Oldest to Newest
                  • Newest to Oldest
                  • Most Votes


                  • Login

                  • Don't have an account? Register

                  • Login or register to search.
                  • First post
                    Last post
                  0
                  • Categories
                  • Recent
                  • Tags
                  • Popular
                  • World
                  • Users
                  • Groups