16 Commits

Author SHA1 Message Date
ge0rdi
12f1742f71 Show shutdown warning if there are multiple users logged in (#1303) 2023-07-24 18:09:49 +02:00
ge0rdi
1c95f17460 Fixed typo [skip ci] 2022-12-29 10:24:53 +01:00
ge0rdi
ba24c72347 Simplify "advanced_boot" command handling
`SHUTDOWN_RESTART_BOOTOPTIONS` should be supported at least since Win8.1
2022-12-28 19:26:22 +01:00
ge0rdi
11dd302689 Properly handle Windows updates during shutdown
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
2022-12-28 19:26:22 +01:00
ge0rdi
58bc654304 Allow shutdown even if limited admin doesn't have shutdown privilege
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
2022-12-28 19:26:22 +01:00
ge0rdi
c5410326fe Use InitiateShutdown instead of ExitWindowsEx for shutdown/restart
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).
2022-12-28 19:26:22 +01:00
ge0rdi
db0e768f81 Proper sleep operation on systems with connected standby enabled
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
2022-12-28 19:26:22 +01:00
ge0rdi
b0c1d9a229 Fix for potential crash introduced in 1b013c3
Fixes #1245
2022-12-14 16:10:10 +01:00
ge0rdi
1b013c3590 Don't track usage of Open-Shell modern settings folder
This way `Open-Shell Modern Settings` folder won't appear in File
Explorer's frequent list.

Fixes #744.
2022-12-06 19:17:18 +01:00
thisismy-github
27e5c2bc74 Added option to open folders to their true path
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.
2022-08-13 16:00:26 -04:00
ge0rdi
62b949679b Respect Use multiple columns setting for all folder items
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.
2020-09-01 19:28:04 +02:00
ge0rdi
0da20180ac Search modern settings using our new shell folder
Use our modern settings shell folder (`shell:::{82E749ED-B971-4550-BAF7-06AA2BF7E836}`)
to search (enumerate) modern settings.

Fixes #57
2020-08-29 14:03:59 +02:00
ge0rdi
9ebe53fdbf Fix issue with confirmation dialog being blocked
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
2020-02-08 11:23:05 +01:00
ge0rdi
fe47f841e7 Don't close menu(s) on certain operations
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`
2019-10-26 20:29:23 +02:00
ge0rdi
16de25a8b0 Use C++17 by default
Plus C++ standard conformance fixes.
2018-08-18 20:04:21 +02:00
Xenhat
f4dd56155b Rebrand to Open-Shell (#36) (#58)
* Rebrand to Open-Shell

* Slight installer branding improvement
2018-08-05 15:22:10 -04:00