Windows updates are applied on shutdown/reboot no matter of flags used
in ExitWindowsEx (or InitiateShutdown).
Windows start menu shutdown code handles updates in special way.
If there are updates prepared and shutdown/reboot is selected it will
use `UpdateSessionOrchestrator` object to dismiss updates and carry out
the command.
We will now do similar thing.
Fixes#1250
Shutdown privilege can be removed from users (in Local Security Policy settings).
This will remove it also from limited admin.
Thus admin will be unable to shutdown machine (because Explorer runs as
limited admin by default).
In such case we will attempt to do silent elevation and proceed with
shutdown using `SystemSettingsAdminFlows.exe` helper.
Fixes#1015
Windows start menu uses it that way too.
ExitWindowsEx is also annotated as legacy API in SDK.
We will also put shutdown handling into separate function, so that we
have it handled at one place (will make further changes easier).
Standard API for sleep (`SetSuspendState`) seems to do nothing on
systems with connected standby.
Windows start menu calls `NtPowerInformation(ScreenOff)` on such systems instead.
This is implemented in `shutdownux!ShutdownViewModel::_InitiatePowerTransition` function.
Fixes#719
Adds a new function called GetFakeFolder which attempts to find and get
the target.lnk file from a fake folder (what Open-Shell uses to pin
folders). If detected, InvokeCommand is swapped for a ShellExecute call
to the target shortcut. Fixes#555, #653, and by extension, #691.
Currently it was used only in some cases (like Programs/Apps folder).
It will be more consistent to respect the setting for all folder
items.
Fixes#436.
Delete confirmation dialog may be (partially) hidden behing start menu.
As a result the dialog may be not accessible because start menu(s) are
displayed as top-most windows.
Thus when executing menu command we will make menu(s) non-topmost. So that
other windows can be drawn on top of menu(s).
Fixes#257
In several cases we don't want menu(s) to close when an action on menu was
done. For example on drag-n-drop or menu item deletion (where confirmation
dialog is shown).
In such situations `s_bPreventClosing` was set to true (and then back to
false when closing was allowed again).
Though original code honored this variable only in certain situations and
typically (at least on Win10) menus were hidden/closed despite of it.
This patch changes the behavior and menus(s) are not closed when
`s_bPreventClosing` is set to true.
Basically now menu(s) stay visible until there is an action that changes
active window.
Following functionality was also removed because it is not needed now:
* CMenuContainer::HideTemp
* COwnerWindow::OnClear
WM_CLEAR was sent to the window only by already removed `HideTemp`