• screensaver in Windows 10

    From malone@21:1/5 to All on Fri Aug 16 11:19:57 2024
    A bit off-topic but perhaps someone who understands how the screensaver
    works in Windows 10 may be able to shed some light on this.

    I'm running an Excel VBA program continuously all day. Amongst other
    things it creates a UserForm appearing on the desktop every two minutes (containing just weather information as text), after removing the
    previous UserForm. If I go to Windows settings and set the screensaver
    to operate after 15 minutes mouse/keyboard inactivity I find that the screensaver never comes on. If I now disable the generation of the
    UserForm in Excel, but still run the program to generate the
    information, the screensaver does come on after 15 minutes
    mouse/keyboard inactivity. From this I deduce that creating the UserForm
    has the same effect as mouse or keyboard activity - preventing the
    screensaver from starting. I find that a bit strange but, hey, this is Microsoft and there's probably a reason for it.

    But what's even more strange is that when I force the screensaver to
    start by running C:\Windows\System32\ssText3d.scr the screensaver comes
    on immediately but it then stays on whenever a UserForm is created. But keyboard and mouse activity does turn it off.

    Perhaps this is one for Excel experts, but I'd be interested to know the
    reason for this behaviour.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Paul@21:1/5 to malone on Thu Aug 15 21:24:04 2024
    On Thu, 8/15/2024 7:19 PM, malone wrote:

    A bit off-topic but perhaps someone who understands how the screensaver works in Windows 10 may be able to shed some light on this.

    I'm running an Excel VBA program continuously all day. Amongst other things it creates a UserForm appearing on the desktop every two minutes (containing just weather information as text), after removing the previous UserForm. If I go to Windows
    settings and set the screensaver to operate after 15 minutes mouse/keyboard inactivity I find that the screensaver never comes on. If I now disable the generation of the UserForm in Excel, but still run the program to generate the information, the
    screensaver does come on after 15 minutes mouse/keyboard inactivity. From this I deduce that creating the UserForm has the same effect as mouse or keyboard activity - preventing the screensaver from starting. I find that a bit strange but, hey, this is
    Microsoft and there's probably a reason for it.

    But what's even more strange is that when I force the screensaver to start by running C:\Windows\System32\ssText3d.scr the screensaver comes on immediately but it then stays on whenever a UserForm is created. But keyboard and mouse activity does turn
    it off.

    Perhaps this is one for Excel experts, but I'd be interested to know the reason for this behaviour.

    All I can find in Google, is something like this. Changing this
    likely won't help your application, but this does indicate that
    the Userform has an "ability" to signal how it is configured.

    Userform:

    "Application.ScreenUpdating = True" into "False".

    *******

    Windows has the capability, for a video application (hollywood movie player)
    to assert a flag that prevents the screensaver from running (due to mouse inactivity).
    This allows a two hour movie to play, without the user being annoyed
    by the screensaver cutting in.

    https://superuser.com/questions/387627/any-way-to-detect-what-is-disabling-the-screensaver

    "Run powercfg /requests from an Admin Command Prompt. For example, mine printed:
    ^^^^^ ^^^^^^^ ^^^^^^^
    DISPLAY:
    [PROCESS] \Device\HarddiskVolume8\Games\Origin\Origin.exe
    Playing video

    SYSTEM:
    [DRIVER] Realtek High Definition Audio (HDAUDIO\FUNC_01&VEN_10EC&DEV_0900&SUBSYS_10438560&REV_1000\4&9793a48&0&0001)
    An audio stream is currently in use.

    AWAYMODE:
    None.

    Which indicates that Origin was playing a video and this was preventing the screensaver from running.
    "

    Paul

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From malone@21:1/5 to Paul on Sat Aug 17 11:11:24 2024
    On Fri-16-Aug-2024 1:24 pm, Paul wrote:
    On Thu, 8/15/2024 7:19 PM, malone wrote:

    A bit off-topic but perhaps someone who understands how the screensaver works in Windows 10 may be able to shed some light on this.

    I'm running an Excel VBA program continuously all day. Amongst other things it creates a UserForm appearing on the desktop every two minutes (containing just weather information as text), after removing the previous UserForm. If I go to Windows
    settings and set the screensaver to operate after 15 minutes mouse/keyboard inactivity I find that the screensaver never comes on. If I now disable the generation of the UserForm in Excel, but still run the program to generate the information, the
    screensaver does come on after 15 minutes mouse/keyboard inactivity. From this I deduce that creating the UserForm has the same effect as mouse or keyboard activity - preventing the screensaver from starting. I find that a bit strange but, hey, this is
    Microsoft and there's probably a reason for it.

    But what's even more strange is that when I force the screensaver to start by running C:\Windows\System32\ssText3d.scr the screensaver comes on immediately but it then stays on whenever a UserForm is created. But keyboard and mouse activity does turn
    it off.

    Perhaps this is one for Excel experts, but I'd be interested to know the reason for this behaviour.

    All I can find in Google, is something like this. Changing this
    likely won't help your application, but this does indicate that
    the Userform has an "ability" to signal how it is configured.

    Userform:

    "Application.ScreenUpdating = True" into "False".

    *******

    Windows has the capability, for a video application (hollywood movie player) to assert a flag that prevents the screensaver from running (due to mouse inactivity).
    This allows a two hour movie to play, without the user being annoyed
    by the screensaver cutting in.

    https://superuser.com/questions/387627/any-way-to-detect-what-is-disabling-the-screensaver

    "Run powercfg /requests from an Admin Command Prompt. For example, mine printed:
    ^^^^^ ^^^^^^^ ^^^^^^^
    DISPLAY:
    [PROCESS] \Device\HarddiskVolume8\Games\Origin\Origin.exe
    Playing video

    SYSTEM:
    [DRIVER] Realtek High Definition Audio (HDAUDIO\FUNC_01&VEN_10EC&DEV_0900&SUBSYS_10438560&REV_1000\4&9793a48&0&0001)
    An audio stream is currently in use.

    AWAYMODE:
    None.

    Which indicates that Origin was playing a video and this was preventing the screensaver from running.
    "

    Paul

    Thanks for that Paul.

    I've tried your ScreenUpdating suggestion and that doesn't change things.

    I've run powercfg /requests from an Admin Command Prompt. Mine prints
    all "none", and still the screensaver does not activate.

    So, I' still very much in the dark as to how to get screensaver to not
    treat the creation of a UserForm in the same way as mouse/keyboard
    activity. It seems to be some strange "feature" of the UserForm.Show
    vbModeless method. Perhaps I need to hunt through the Windows Event log?

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)