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. Visual Basic
  4. ScreenSaver's child process dies a-borning

ScreenSaver's child process dies a-borning

Scheduled Pinned Locked Moved Visual Basic
6 Posts 2 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.
  • J Offline
    J Offline
    jim_taylor
    wrote on last edited by
    #1

    I wrote a screen saver using the starter kit that came with VB 2005 Express. Worked great! Then I wanted it to kick off an application when it ended, thus: . . 'Code here validates a password . . Process.Start("AppPath", "Params") Thread.Sleep(2000) Close() With the screensaver active, I move the mouse. It asks for the secret word. I type the word. The application pops up. Two seconds later the screen saver and the application die together. When I run the screen saver from the command line it works the way I want it to. What do I have to do to make it work that way in screen saver mode? JimT

    M J 2 Replies Last reply
    0
    • J jim_taylor

      I wrote a screen saver using the starter kit that came with VB 2005 Express. Worked great! Then I wanted it to kick off an application when it ended, thus: . . 'Code here validates a password . . Process.Start("AppPath", "Params") Thread.Sleep(2000) Close() With the screensaver active, I move the mouse. It asks for the secret word. I type the word. The application pops up. Two seconds later the screen saver and the application die together. When I run the screen saver from the command line it works the way I want it to. What do I have to do to make it work that way in screen saver mode? JimT

      M Offline
      M Offline
      Marcus J Smith
      wrote on last edited by
      #2

      Doesnt Windows control the activation/de-activation of screensavers? You probably have to dive deeper into the Windows APIs in order to control that behavior.


      CleaKO

      "I think you'll be okay here, they have a thin candy shell. 'Surprised you didn't know that." - Tommy Boy
      "Fill it up again! Fill it up again! Once it hits your lips, it's so good!" - Frank the Tank (Old School)

      1 Reply Last reply
      0
      • J jim_taylor

        I wrote a screen saver using the starter kit that came with VB 2005 Express. Worked great! Then I wanted it to kick off an application when it ended, thus: . . 'Code here validates a password . . Process.Start("AppPath", "Params") Thread.Sleep(2000) Close() With the screensaver active, I move the mouse. It asks for the secret word. I type the word. The application pops up. Two seconds later the screen saver and the application die together. When I run the screen saver from the command line it works the way I want it to. What do I have to do to make it work that way in screen saver mode? JimT

        J Offline
        J Offline
        jim_taylor
        wrote on last edited by
        #3

        The screen saver problem turns out to be one of ownership. If the operating system starts the screen saver because of inactivity, it is owned by the system, and it, along with everything it owns, goes in the dumper when some activity causes it to close. If you start it from the command line, or by clicking on it in Windows Explorer, or by clicking the preview button, you own it and it acts just like any other program; if it starts a child process, the child continues after the parent dies. The problem, then, is to convince the OS that the child process does not belong to its parent. This is done by setting the UserName and Password parameters in the StartInfo structure before starting the child process. The only difficulty is that StartInfo.Password is not a System.String but a Security.SecureString, that is, it’s encrypted, so it takes a little doing to create it.

        M 1 Reply Last reply
        0
        • J jim_taylor

          The screen saver problem turns out to be one of ownership. If the operating system starts the screen saver because of inactivity, it is owned by the system, and it, along with everything it owns, goes in the dumper when some activity causes it to close. If you start it from the command line, or by clicking on it in Windows Explorer, or by clicking the preview button, you own it and it acts just like any other program; if it starts a child process, the child continues after the parent dies. The problem, then, is to convince the OS that the child process does not belong to its parent. This is done by setting the UserName and Password parameters in the StartInfo structure before starting the child process. The only difficulty is that StartInfo.Password is not a System.String but a Security.SecureString, that is, it’s encrypted, so it takes a little doing to create it.

          M Offline
          M Offline
          Marcus J Smith
          wrote on last edited by
          #4

          Did you just reply to yourself with the answer? :laugh:


          CleaKO

          "I think you'll be okay here, they have a thin candy shell. 'Surprised you didn't know that." - Tommy Boy
          "Fill it up again! Fill it up again! Once it hits your lips, it's so good!" - Frank the Tank (Old School)

          J 1 Reply Last reply
          0
          • M Marcus J Smith

            Did you just reply to yourself with the answer? :laugh:


            CleaKO

            "I think you'll be okay here, they have a thin candy shell. 'Surprised you didn't know that." - Tommy Boy
            "Fill it up again! Fill it up again! Once it hits your lips, it's so good!" - Frank the Tank (Old School)

            J Offline
            J Offline
            jim_taylor
            wrote on last edited by
            #5

            I was so desperate I was forced to think about it.

            M 1 Reply Last reply
            0
            • J jim_taylor

              I was so desperate I was forced to think about it.

              M Offline
              M Offline
              Marcus J Smith
              wrote on last edited by
              #6

              Well good job, now if I ever have the issue, Ill just refer to your reply to yourself. ;P


              CleaKO

              "I think you'll be okay here, they have a thin candy shell. 'Surprised you didn't know that." - Tommy Boy
              "Fill it up again! Fill it up again! Once it hits your lips, it's so good!" - Frank the Tank (Old School)

              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