Is it possible to add an extra dialogue pop up to sleep?


  1. Posts : 104
    Windows 10 64
       #1

    Is it possible to add an extra dialogue pop up to sleep?


    Ok, this is an odd one.

    In simple terms, I want to add an extra dialogue pop up reminder when I select the sleep option in windows 10.

    Aka, go to sleep option, click, and instead of immediately sleeping it gives me a dialogue pop up first asking me if I'm sure I want to or similar customisable dialogue?

    Is there such a thing that could do something like that?

    Thanks.

    - - - Updated - - -

    Bump!
      My Computer

  2. dalchina's Avatar
    Posts : 29,839
    Win 10 Pro (1903)
       #2

    Please be patient and wait in turn. Forum rules- please read- prohibit thread bumping. Thank you.
      My Computers


  3. Posts : 104
    Windows 10 64
    Thread Starter
       #3

    Apologise for the rule break, didn't realise, but not absolutely sure forums operate on a queuing basis!

    Anyway, I still hope someone can help me.
      My Computer


  4. Posts : 264
    Windows 10
       #4

    DannyG13 said:
    Ok, this is an odd one.

    In simple terms, I want to add an extra dialogue pop up reminder when I select the sleep option in windows 10.

    Aka, go to sleep option, click, and instead of immediately sleeping it gives me a dialogue pop up first asking me if I'm sure I want to or similar customisable dialogue?

    Is there such a thing that could do something like that?

    Thanks.

    - - - Updated - - -

    Bump!
    maybe if you attach a task with a script to an event that is triggered when you click that option....

    I think it would be much easier if you create a whole new script an launch it from a desktop shortcut instead of the button in the menu. I think you would have a lot more control over it.
      My Computer


  5. Posts : 104
    Windows 10 64
    Thread Starter
       #5

    xaccell said:
    maybe if you attach a task with a script to an event that is triggered when you click that option....
    Could you guide me through that suggestion slowly... haha that's me saying 'how do I do that' :)
    I think it would be much easier if you create a whole new script an launch it from a desktop shortcut instead of the button in the menu. I think you would have a lot more control over it.
    Force of habit. I will never remember to do anything other than go to the start menu. 25+ years of the same thing is hard to break.
      My Computer


  6. Posts : 264
    Windows 10
       #6

    First we should find the event ID that is triggered when you clic on Sleep! Some googling is required!
      My Computer

  7. Berton's Avatar
    Posts : 10,483
    Win10 Pro Versions 2004 and 2009/20H2, Win10 Pro IP_Dev, Win10 Home 1909
       #7

    DannyG13 said:
    Apologise for the rule break, didn't realise, but not absolutely sure forums operate on a queuing basis!

    Anyway, I still hope someone can help me.
    It's not really about waiting in line but more that folks who post suggested solutions are volunteers and have to wait until someone with experience in a particular area sees the posted question/problem and can respond.
      My Computers

  8. RickC's Avatar
    Posts : 670
    Windows 7 + 10
       #8

    There's no way I know to detect/redirect the 'click' event when you choose Start > Power > Sleep. Instead, you would have to create a shortcut or hotkey to trigger an event that fired a custom dialog (created with something like AutoHotkey or AutoIt) or Yes/No batch file which, in turn, fired the sleep command.

    Unfortunately, the 'sleep' command in Windows 10 appears to be broken. In earlier versions of Windows the command rundll32.exe powrprof.dll,SetSuspendState Sleep worked to put a device into the low-power 'sleep' state (except for Surface 3's which don't support this state apparently).

    In Windows 10 this puts the device into hibernation instead of the low-power 'sleep' state. (Try entering the command in the Run dialog to see what I mean.)

    Various coders have worked around this limitation and I know of 4 ways to invoke a proper 'sleep' state programmatically:

    1. NirCmd - Use the standby command (nircmd standby).
    2. Sysinternals' PsTools - Use the psshutdown command (psshutdown -d).
    3. Steve Gibson's Wizmo - Use the standby command (wizmo standby).
    4. Sleep Shortcut - No commandline, just run it from shortcut, script or batch file.

    All 4 of these can be trigged by a 'dialog' script (AutoHotkey/AutoIt) or 'Yes/No' batch file.

    DannyG13 said:
    I will never remember to do anything other than go to the start menu. 25+ years of the same thing is hard to break.
    The Start menu is managed by ShellExperienceHost.exe and I don't think it's possible to detect the 'click' event on Sleep. (Using a Windows Info utility I found that all four Start > Power options have a Class NN text of Start, no matter which of the 4 Power options the mouse pointer was hovering over. As a result you would have to base an OnClick event based on co-ordinates... urgh!)

    I believe the actual 'entering sleep' event is Event ID 42 but from what I've read, others have not been successful in setting up a scheduled task based on that event.

    Hope this helps...
    Last edited by RickC; 03 Mar 2020 at 10:02.
      My Computer


  9. Posts : 104
    Windows 10 64
    Thread Starter
       #9

    Thank you all. Especially Rick.

    So, basically there are patchy workarounds but no one can actually work the solution I was hoping for!

    Bah, that's a shame. I am literally going to have to rely on my failing memory.

    Thank you again, I'll just have to wing it, as they say here in the UK!
      My Computer

  10. Try3's Avatar
    Posts : 7,384
    Windows 10 Home x64 Version 20H2 Build 19042.868
       #10

    DannyG13 said:
    Is there such a thing that could do something like that?
    No. You will waste any time you devote to pursuing this matter because you will not get a solution.

    Any solution would have to involve not just detecting but inhibiting Windows internal commands.

    Denis
      My Computer


 

  Related Discussions
Our Sites
Site Links
About Us
Windows 10 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 10" and related materials are trademarks of Microsoft Corp.

© Designer Media Ltd
All times are GMT -5. The time now is 11:47.
Find Us




Windows 10 Forums