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. The Lounge
  3. Switching users in Vista / screensaver

Switching users in Vista / screensaver

Scheduled Pinned Locked Moved The Lounge
helpcareer
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.
  • P Offline
    P Offline
    Pawel Krakowiak
    wrote on last edited by
    #1

    I wonder if anyone else is having this issue. I lock my account and then another user comes in and switches to his account, then logs out. I login back to my account, but Windows immediately starts the screensaver (I have been away from my account for like 15mins) and I need to log in again, so I log in twice in a row because of this... :| It's Vista Ultimate and I have the screensaver set to display the logon screen on resume.

    B R D 3 Replies Last reply
    0
    • P Pawel Krakowiak

      I wonder if anyone else is having this issue. I lock my account and then another user comes in and switches to his account, then logs out. I login back to my account, but Windows immediately starts the screensaver (I have been away from my account for like 15mins) and I need to log in again, so I log in twice in a row because of this... :| It's Vista Ultimate and I have the screensaver set to display the logon screen on resume.

      B Offline
      B Offline
      benjymous
      wrote on last edited by
      #2

      It's not new to Vista - this used to happen for me on XP

      Help me! I'm turning into a grapefruit! Buzzwords!

      1 Reply Last reply
      0
      • P Pawel Krakowiak

        I wonder if anyone else is having this issue. I lock my account and then another user comes in and switches to his account, then logs out. I login back to my account, but Windows immediately starts the screensaver (I have been away from my account for like 15mins) and I need to log in again, so I log in twice in a row because of this... :| It's Vista Ultimate and I have the screensaver set to display the logon screen on resume.

        R Offline
        R Offline
        Rajesh R Subramanian
        wrote on last edited by
        #3

        Actually, I don't see an issue. Windows is behaving the way you've asked it to behave. The fast user switching works something like this: 1. The logon screen appears, you enter your login credentials. If Winlogon authenticates you, it then consults with Gina and gets back your logon profile information and proceeds to step 2. 2. If this particular user is already logged on (this check happens if fast user switching is enabled), then the user is taken to his desktop, "as he left it (the screen saver was running)". 3. If not, Winlogon creates a new desktop for you (loading all your user preferences). In your case, after step 2, you are taken back to your existing desktop. But the screen saver is running there, and you want to break off the screen saver. You've told Windows to authenticate the user when there is an attempt to exit out of the screen saver and it is just doing that! You may probably have to disable the option which would show the logon screen on resuming from screen saver. Or just logoff completely every time (which is not a very good idea). Vista is innocent here. Invalid rant. ;P

        Many are stubborn in pursuit of the path they have chosen, few in pursuit of the goal - Friedrich Nietzsche .·´¯`·->Rajesh<-·´¯`·. [Microsoft MVP - Visual C++]

        D P 2 Replies Last reply
        0
        • R Rajesh R Subramanian

          Actually, I don't see an issue. Windows is behaving the way you've asked it to behave. The fast user switching works something like this: 1. The logon screen appears, you enter your login credentials. If Winlogon authenticates you, it then consults with Gina and gets back your logon profile information and proceeds to step 2. 2. If this particular user is already logged on (this check happens if fast user switching is enabled), then the user is taken to his desktop, "as he left it (the screen saver was running)". 3. If not, Winlogon creates a new desktop for you (loading all your user preferences). In your case, after step 2, you are taken back to your existing desktop. But the screen saver is running there, and you want to break off the screen saver. You've told Windows to authenticate the user when there is an attempt to exit out of the screen saver and it is just doing that! You may probably have to disable the option which would show the logon screen on resuming from screen saver. Or just logoff completely every time (which is not a very good idea). Vista is innocent here. Invalid rant. ;P

          Many are stubborn in pursuit of the path they have chosen, few in pursuit of the goal - Friedrich Nietzsche .·´¯`·->Rajesh<-·´¯`·. [Microsoft MVP - Visual C++]

          D Offline
          D Offline
          Dalek Dave
          wrote on last edited by
          #4

          Or keep others from using your machine. Nicht Fingergerpoken!

          ------------------------------------ Credit is a system whereby a person who can not pay gets another person who can not pay to guarantee that he can pay. - Charles Dickens

          1 Reply Last reply
          0
          • P Pawel Krakowiak

            I wonder if anyone else is having this issue. I lock my account and then another user comes in and switches to his account, then logs out. I login back to my account, but Windows immediately starts the screensaver (I have been away from my account for like 15mins) and I need to log in again, so I log in twice in a row because of this... :| It's Vista Ultimate and I have the screensaver set to display the logon screen on resume.

            D Offline
            D Offline
            DaveyM69
            wrote on last edited by
            #5

            Hmmm, just an idea - could you write something that sends Win+L, then sends out a safe keypress to the system every 30 secs or so to stop the screensaver. It could maybe disable itself when mousemove is detected on your desktop so the screensaver is automatically enabled again when you unlock? There's probably a better way or a registry tweak but if not it may be worth doing.

            Dave
            BTW, in software, hope and pray is not a viable strategy. (Luc Pattyn)
            Visual Basic is not used by normal people so we're not covering it here. (Uncyclopedia)

            P 1 Reply Last reply
            0
            • R Rajesh R Subramanian

              Actually, I don't see an issue. Windows is behaving the way you've asked it to behave. The fast user switching works something like this: 1. The logon screen appears, you enter your login credentials. If Winlogon authenticates you, it then consults with Gina and gets back your logon profile information and proceeds to step 2. 2. If this particular user is already logged on (this check happens if fast user switching is enabled), then the user is taken to his desktop, "as he left it (the screen saver was running)". 3. If not, Winlogon creates a new desktop for you (loading all your user preferences). In your case, after step 2, you are taken back to your existing desktop. But the screen saver is running there, and you want to break off the screen saver. You've told Windows to authenticate the user when there is an attempt to exit out of the screen saver and it is just doing that! You may probably have to disable the option which would show the logon screen on resuming from screen saver. Or just logoff completely every time (which is not a very good idea). Vista is innocent here. Invalid rant. ;P

              Many are stubborn in pursuit of the path they have chosen, few in pursuit of the goal - Friedrich Nietzsche .·´¯`·->Rajesh<-·´¯`·. [Microsoft MVP - Visual C++]

              P Offline
              P Offline
              Pawel Krakowiak
              wrote on last edited by
              #6

              Thanks for the thorough explanation, Rajesh! Good to know. :) ...But I still don't like how it behaves! I was thinking that the screensaver is run per computer, not per user account (so I'm thinking of the screen in screensaver as the physical screen I have here, not a virtual thing).

              R 1 Reply Last reply
              0
              • D DaveyM69

                Hmmm, just an idea - could you write something that sends Win+L, then sends out a safe keypress to the system every 30 secs or so to stop the screensaver. It could maybe disable itself when mousemove is detected on your desktop so the screensaver is automatically enabled again when you unlock? There's probably a better way or a registry tweak but if not it may be worth doing.

                Dave
                BTW, in software, hope and pray is not a viable strategy. (Luc Pattyn)
                Visual Basic is not used by normal people so we're not covering it here. (Uncyclopedia)

                P Offline
                P Offline
                Pawel Krakowiak
                wrote on last edited by
                #7

                DaveyM69 wrote:

                Hmmm, just an idea - could you write something that sends Win+L, then sends out a safe keypress to the system every 30 secs or so to stop the screensaver. It could maybe disable itself when mousemove is detected on your desktop so the screensaver is automatically enabled again when you unlock?

                Too much work. :) I'd rather login twice.

                DaveyM69 wrote:

                There's probably a better way or a registry tweak but if not it may be worth doing.

                Then writing a custom application is worth more? :P

                D 1 Reply Last reply
                0
                • P Pawel Krakowiak

                  Thanks for the thorough explanation, Rajesh! Good to know. :) ...But I still don't like how it behaves! I was thinking that the screensaver is run per computer, not per user account (so I'm thinking of the screen in screensaver as the physical screen I have here, not a virtual thing).

                  R Offline
                  R Offline
                  Rajesh R Subramanian
                  wrote on last edited by
                  #8

                  Pawel Krakowiak wrote:

                  Thanks for the thorough explanation, Rajesh! Good to know. Smile

                  My pleasure. :)

                  Many are stubborn in pursuit of the path they have chosen, few in pursuit of the goal - Friedrich Nietzsche .·´¯`·->Rajesh<-·´¯`·. [Microsoft MVP - Visual C++]

                  1 Reply Last reply
                  0
                  • P Pawel Krakowiak

                    DaveyM69 wrote:

                    Hmmm, just an idea - could you write something that sends Win+L, then sends out a safe keypress to the system every 30 secs or so to stop the screensaver. It could maybe disable itself when mousemove is detected on your desktop so the screensaver is automatically enabled again when you unlock?

                    Too much work. :) I'd rather login twice.

                    DaveyM69 wrote:

                    There's probably a better way or a registry tweak but if not it may be worth doing.

                    Then writing a custom application is worth more? :P

                    D Offline
                    D Offline
                    DaveyM69
                    wrote on last edited by
                    #9

                    Don't know if this will work under vista - it does on XP pro 32 bit. C# WinForms app, removed Form1 (not used) and put this in Program.cs

                    //Program.cs
                    using System;
                    using System.Runtime.InteropServices;
                    using Microsoft.Win32;
                    namespace NoSaverLock
                    {
                    static class Program
                    {
                    private const uint SPI_GETSCREENSAVEACTIVE = 0x0010;
                    private const uint SPI_SETSCREENSAVEACTIVE = 0x0011;
                    private static bool keepRunning = true;
                    private static bool screenSaverOn;
                    [STAThread]
                    static void Main()
                    {
                    SystemEvents.SessionEnding += new SessionEndingEventHandler(SystemEvents_SessionEnding);
                    SystemEvents.SessionSwitch += new SessionSwitchEventHandler(SystemEvents_SessionSwitch);
                    bool tmpBool = false;
                    SystemParametersInfo(SPI_GETSCREENSAVEACTIVE, 0, ref screenSaverOn, 0);
                    SystemParametersInfo(SPI_SETSCREENSAVEACTIVE, 0, ref tmpBool, 0);
                    LockWorkStation();
                    while (keepRunning)
                    {
                    System.Threading.Thread.Sleep(1000);
                    }
                    SystemParametersInfo(SPI_SETSCREENSAVEACTIVE, Convert.ToUInt32(screenSaverOn), ref tmpBool, 0);
                    SystemEvents.SessionEnding -= SystemEvents_SessionEnding;
                    SystemEvents.SessionSwitch -= SystemEvents_SessionSwitch;
                    }
                    static void SystemEvents_SessionSwitch(object sender, SessionSwitchEventArgs e)
                    {
                    if (e.Reason == SessionSwitchReason.SessionUnlock)
                    keepRunning = false;
                    }
                    static void SystemEvents_SessionEnding(object sender, SessionEndingEventArgs e)
                    {
                    keepRunning = false;
                    }
                    [DllImport("user32.dll")]
                    static extern void LockWorkStation();
                    [DllImport("user32.dll")]
                    private static extern bool SystemParametersInfo(
                    uint uAction, uint uParam, ref bool lpvParam, uint fuWinIni);
                    }
                    }

                    Is there a 'no programming answers in the lounge' rule? If so - sorry!

                    Dave
                    BTW, in software, hope and pray is not a viable strategy. (Luc Pattyn)
                    Visual Basic is not used by normal people so we're not covering it here. (Uncyclopedia)

                    modif

                    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