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. General Programming
  3. C / C++ / MFC
  4. Show message the first time my app is started after windows has rebooted

Show message the first time my app is started after windows has rebooted

Scheduled Pinned Locked Moved C / C++ / MFC
questionannouncement
9 Posts 5 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.
  • M Offline
    M Offline
    manchukuo
    wrote on last edited by
    #1

    Hi guys how can i accomplish this i need to show a do you want to update message every time the app is started the first time windows has rebooted. Thanks!! ;P

    D K B 3 Replies Last reply
    0
    • M manchukuo

      Hi guys how can i accomplish this i need to show a do you want to update message every time the app is started the first time windows has rebooted. Thanks!! ;P

      D Offline
      D Offline
      David Crow
      wrote on last edited by
      #2

      You could check for a 'flag' in some configuration file or the registry. After your app runs, set the flag to some other value (or remove it).

      "One man's wage rise is another man's price increase." - Harold Wilson

      "Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons

      "Man who follows car will be exhausted." - Confucius

      M 1 Reply Last reply
      0
      • D David Crow

        You could check for a 'flag' in some configuration file or the registry. After your app runs, set the flag to some other value (or remove it).

        "One man's wage rise is another man's price increase." - Harold Wilson

        "Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons

        "Man who follows car will be exhausted." - Confucius

        M Offline
        M Offline
        manchukuo
        wrote on last edited by
        #3

        ok, but how do you detect that windows has reboot??, i mean i put a registry key called "doUpdate" value=false then i start my app i change that registry to true, so the next i launch my app it will not show the message that is ok, but how to reset that value when windows is restarted?

        D 1 Reply Last reply
        0
        • M manchukuo

          ok, but how do you detect that windows has reboot??, i mean i put a registry key called "doUpdate" value=false then i start my app i change that registry to true, so the next i launch my app it will not show the message that is ok, but how to reset that value when windows is restarted?

          D Offline
          D Offline
          David Crow
          wrote on last edited by
          #4

          You might could take advantage of the HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Run key by putting a small app there that runs the next time Windows is started.

          "One man's wage rise is another man's price increase." - Harold Wilson

          "Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons

          "Man who follows car will be exhausted." - Confucius

          M 1 Reply Last reply
          0
          • M manchukuo

            Hi guys how can i accomplish this i need to show a do you want to update message every time the app is started the first time windows has rebooted. Thanks!! ;P

            K Offline
            K Offline
            krmed
            wrote on last edited by
            #5

            Perhaps you could create a registry key using RegCreateKeyEx[^] and use REG_OPTION_VOLATILE as the option. Hope that helps.

            Karl - WK5M PP-ASEL-IA (N43CS) PGP Key: 0xDB02E193 PGP Key Fingerprint: 8F06 5A2E 2735 892B 821C 871A 0411 94EA DB02 E193

            1 Reply Last reply
            0
            • D David Crow

              You might could take advantage of the HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Run key by putting a small app there that runs the next time Windows is started.

              "One man's wage rise is another man's price increase." - Harold Wilson

              "Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons

              "Man who follows car will be exhausted." - Confucius

              M Offline
              M Offline
              manchukuo
              wrote on last edited by
              #6

              ok i did that but every time windows starts up i shows the black window and then closes is kind of anoying is there a parameter to put there so it runs silently?

              I 1 Reply Last reply
              0
              • M manchukuo

                ok i did that but every time windows starts up i shows the black window and then closes is kind of anoying is there a parameter to put there so it runs silently?

                I Offline
                I Offline
                Iain Clarke Warrior Programmer
                wrote on last edited by
                #7

                It shows a black window because you made a console application. Make a normal win32 one, just don't create any windows. Have it set a registry value (eg) HKCU\Software\ManchukuoSoft\MyAmazingApp\Rebooted = 1 Then, when your real MyAmazingApp is run, check the value, and maybe show a message. Then clear that value. Job done! Iain.

                I have now moved to Sweden for love (awwww).

                M 1 Reply Last reply
                0
                • I Iain Clarke Warrior Programmer

                  It shows a black window because you made a console application. Make a normal win32 one, just don't create any windows. Have it set a registry value (eg) HKCU\Software\ManchukuoSoft\MyAmazingApp\Rebooted = 1 Then, when your real MyAmazingApp is run, check the value, and maybe show a message. Then clear that value. Job done! Iain.

                  I have now moved to Sweden for love (awwww).

                  M Offline
                  M Offline
                  manchukuo
                  wrote on last edited by
                  #8

                  Thanks guys that did the work!!! :laugh: . This is Fixed

                  1 Reply Last reply
                  0
                  • M manchukuo

                    Hi guys how can i accomplish this i need to show a do you want to update message every time the app is started the first time windows has rebooted. Thanks!! ;P

                    B Offline
                    B Offline
                    Bhaskar Sandbhor
                    wrote on last edited by
                    #9

                    you will need 2 programs for this. One will run as autorun (startup) and set a value in registry (say reboot = true). Another program whent started by user, will check this value in registry and if it is true then display your messagebox and set the value to false.

                    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