How to restart Windows 8/10 and go to Advanced Boot settings using WinAPI?

I know that you can reboot a workstation using the InitiateShutdown API. I am wondering how to reboot and go to the "Advanced Download" window, which is available in Windows 8/10? (I ask about WinAPI or registry settings.)

enter image description here

PS. The same can be achieved by calling:

shutdown \r \o
+4
source share
1 answer

Windows 8 dwShutdownFlags 0x400, , . SHUTDOWN_RESTART, SHUTDOWN_RESTARTAPPS, SHUTDOWN_FORCE_OTHERS, SHUTDOWN_FORCE_SELF.

:

DWORD dwResult = InitiateShutdown(NULL, NULL, 
    30,                                            //Use 30-second timeout 
    SHUTDOWN_RESTART | 0x400,                      //Reboot with advanced menu options
    SHTDN_REASON_FLAG_PLANNED | 
    SHTDN_REASON_MAJOR_APPLICATION |
    SHTDN_REASON_MINOR_OTHER);

, , !

+1

Source: https://habr.com/ru/post/1624377/


All Articles