Commit Graph

109 Commits

Author SHA1 Message Date
ge0rdi
4705b35694 Fix Aero button alignment on multiple monitors (#1310)
Shift Aero button slightly when it is positioned in corner of any
monitor (not just primary one).

Moreover this shift should be done only for top/bottom taskbar.
2023-02-03 08:55:26 +01:00
ge0rdi
21eea53dfd Properly scale default skin font according to DPI (#1110)
Original fix introduced in 528d15 was not correct.
The problem is that `SystemParametersInfo` uses DPI that current session
started with.

We should use `SystemParametersInfoForDpi` (available since Win10 1607)
that returns properly scaled font size.

Fixes #1110
2023-01-19 08:27:02 +01:00
ge0rdi
528d15e6c9 Properly scale default skin font according to DPI (#1110)
If skin doesn't specify font to be used (such as `Classic Skin`) we will
use default system font (used for menus).

But we didn't scale the font size according to DPI.
This commit will fix that.

Fixes #1110
2023-01-13 16:42:16 +01:00
ge0rdi
615fe66544 Start menu keyboard hotkey fix for Win11 Insider (#1165)
Windows 11 Insider builds started to register global shell hotkey for
Win key (and Ctrl+Esc) that are used to trigger start menu.

The problem is that it is not (easily) possible to intercept messages
about these hotkeys.

Thus we will unregister them during init and install hook that will
prevent their further registration.

Fixes #1165
2023-01-13 16:42:16 +01:00
Eli Farmer
ecd17cb628 New default Immersive skin for Win10/11 (#538)
Fixes #538
2023-01-06 18:05:01 +01:00
ge0rdi
134b414f0b Use proper modern settings icon (#495)
Fixes #495
2023-01-06 18:05:01 +01:00
ge0rdi
421f55192e Properly scale modern task icons (#518)
Fixes #518
2023-01-06 18:05:01 +01:00
Mr-Update
c6924a8b92 Update StartMenuL10N.ini (German) 2023-01-02 20:42:26 +01:00
ge0rdi
344aa60893 Select Apps icon based on Windows version
We now have nicer Apps icons for Win10/11 so we will select proper icon
based on Windows version.
2022-12-30 18:14:22 +01:00
Eli Farmer
7f492f3a9f Modern looking icons for Apps folder on Win10/11. 2022-12-30 18:14:22 +01:00
ge0rdi
1c95f17460 Fixed typo [skip ci] 2022-12-29 10:24:53 +01:00
ge0rdi
674a486c7f Make sure tray buttons are properly positioned when custom start button was created
Fixes #1232
2022-12-28 19:26:22 +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
23a1dc7e07 Added new option "Require Alt key for accelerators"
With the option enabled keyboard accelerators will be triggered only if Alt key
is pressed as well.

This is how typical Windows keyboard accelerators work, to avoid
confusion with regular key presses.

Fixes #117
2022-12-28 19:26:22 +01:00
ge0rdi
a7b6a80799 Added new option "Enable accelerators"
It will control whether keyboard accelerators are used in start menu.

Disabling it can be helpful for people that tend to hit some accelerator by mistake.

Fixes #447
2022-12-28 19:26:22 +01:00
ge0rdi
fad20ba4c7 Activate start menu window only after search focus was set
Start menu window was activated early in the process of its creation.
This means it was receiving input before focus was set to search bar.
And that may have lead to unwanted use of keyboard accelerators.

We need to make sure that window is activated (receives input) only once
focus was set to search box.

Fixes #1068
2022-12-28 19:26:22 +01:00
ge0rdi
2a7fc0034c ModernSettings: Remove duplicates
Windows started to add newer version of settings to settings description
file. These have the same description as older settings, but use
different parameters.

Unfortunately old settings are still present.
This causes our modern settings folder to contain duplicates.
And also we tend to use older setting definitions that no longer work
properly.

Thus we will de-duplicate parsed settings and try to keep newer ones
(that should work better).
New settings tend to have numeric suffix, so we will keep those with
biggest suffix.

Fixes #1031
2022-12-28 19:26:22 +01:00
ge0rdi
658981adf7 ModernSettings: Improve indirect string loading
Defender settings on Win11 use indirect strings in form:
`@{Microsoft.SecHealthUI_8wekyb3d8bbwe?ms-resource://Microsoft.SecHealthUI/Resources/DisplayName}`

`SHLoadIndirectString` is unable to load such indirect string, because it expects full
package name (instead of package family name).

In such case we will convert package family name to full name and try again.
2022-12-28 19:26:22 +01:00
ge0rdi
b6f5402220 Fix taskbar texture on Windows 11
- Taskbar is now handled by taskbar.dll, so we need to hook APIs there
  - TaskList window (MSTaskListWClass) is not visible so we need to
    hook messages of its parent TaskBand window (MSTaskSwWClass)

Fixes #1230
2022-12-28 19:26:22 +01:00
ge0rdi
de0d6cff40 Show start menu next to taskbar by default
This changes default value of `Show next to taskbar (when the taskbar is vertical)` setting to `enabled`.

It makes more sense to have menu next to vertical taskbar than to
overlap it (and hide taskbar buttons).

Windows start menu does it like that too.
2022-12-28 19:26:22 +01:00
ge0rdi
881787bed6 Proper start menu alignment in case of vertical taskbar Windows 11
Fixes #1231
2022-12-28 19:26:22 +01:00
ge0rdi
e25b656275 Use VS2022
Note that `_ATL_MODULES` define is now needed for compatibility with C++
conformance mode (`/permissive-`).
More details here:
https://developercommunity.visualstudio.com/t/Crash-in-ATL-CEnumerator::MoveNext-after/10116823
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
bonzibudd
d28c8e512a New icons and installer artwork
This adds the new artwork for the main icon and installer screens.
Addresses #31.

Update classic button thumbnail

Improve setup banner icon

Fix web.ico size

New installer art

Fix dialog2
2022-12-07 11:58:37 +01:00
ge0rdi
0465ac9c1b Use Segoe Fluent Icons font for modern settings icons on Win11
It seems that Windows 11 prefers `Segoe Fluent Icons` over `Segoe MDL2 Assets` font.
https://learn.microsoft.com/en-us/windows/apps/design/style/segoe-fluent-icons-font

Most of settings defined in `AllSystemSettings_{253E530E-387D-4BC2-959D-E6F86122E5F2}.xml` now refer to the new font.
2022-12-06 19:17:18 +01:00
ge0rdi
77d2d3a01d Don't show Windows Shell Experience Host in list of frequent programs
It is not a program that user will use explicitly.
No need to show it in the list even if Windows tracks it as frequent
program for some reason.

Fixes #1164
2022-12-06 19:17:18 +01:00
ge0rdi
704459225b Properly handle automatically hiding taskbar on multi-monitor setup
When taskbar is hidden its window is moved off the screen (except for
few pixels at border). It may happen that the taskbar window actually
spans to another monitor (though still not visible).

MonitorFromWindow API may thus return different monitor handle than the
one visible taskbar is on.

We will use GetTaskbarPosition function that correctly identifies taskbar's
monitor by checking rectangle of visible taskbar.

Fixes #908
2022-12-06 19:17:18 +01:00
ge0rdi
04770c403d Windows 11 start menu button support
- handling of `Taskbar alignment` setting (left/center)
  - start menu position is based on position of start button
  - mouse clicks to original button now work properly (without triggering original menu)
  - custom button is properly positioned
  - Win+X works properly
2022-12-06 19:17:18 +01:00
ge0rdi
f42980e090 Make debugging more skin friendly
Debug StartMenuDLL used to not find skins when put to Open-Shell
installation folder.

Now it will try to look for skins in default location (Skins folder in
the same folder as DLL) and use alternative (Skins folder one level up)
if not present.
2022-12-06 19:17:18 +01:00
ge0rdi
7ad33f509e Fix skin options default values
Multi-string settings have to be terminated by new line.
Otherwise there may be some garbage (following the string)
stored in registry.
2022-12-06 19:17:18 +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
ge0rdi
cef27bdfa0 Use more convenient format for color settings
We are storing color settings in BBGGRR format (for historical reasons).
This may be confusing for people that are used to (more widely used) RRGGBB format.

Thus we will present color settings in RRGGBB format when editing.

We will still use BBGGRR format for those settings internally. To
maintain backward compatibility with existing settings stored in
registry/xml.

Also setting descriptions now contain hint about expected color format.
This way it should be more clear what values `Open-Shell` expects.

Fixes #82, #1141.
2022-12-06 19:17:18 +01:00
ge0rdi
f7334882c3 Fix image rendering on Win7
Fixes #1023 #90.
2022-12-06 19:17:18 +01:00
ge0rdi
9397d58986 Show Open-Shell version in start context menu
Fixes #888.
2022-12-06 19:17:18 +01:00
ge0rdi
7f6b7229f6 Get proper branding string on Windows 11
Based on info from https://dennisbabkin.com/blog/?t=how-to-tell-the-real-version-of-windows-your-app-is-running-on#ver_string .

Fixes #878, #960, #1063.
2022-12-06 19:17:18 +01:00
among-us-official
9606e11e0e Restore Main_no_icons2 behavior for inline subitems (#1172) 2022-10-15 10:53:16 +02:00
ge0rdi
e6b33a70e4 Add -reloadsettings command line switch
It will force Open-Shell to reload settings from registry.

Fixes #1157.
2022-10-08 07:48:50 +02:00
ge0rdi
179a59ac1b Revert "Auto-detect when setting is back to default value"
This reverts commit 998d83c15c.

This change was wrong and it shouldn't get merged in first place.
See https://github.com/Open-Shell/Open-Shell-Menu/pull/829#issuecomment-907667829 for further explanation.

Fixes #1135.
2022-09-12 16:17:06 +02:00
ge0rdi
2a5ed14599 Fix 'Highlight modified settings' option tooltip 2022-09-12 16:17:06 +02:00
ge0rdi
1cc5d2eb53 Fix broken menu sorting
It was broken in bb26cec commit.

Fixes #1111
2022-09-09 17:07:29 +02:00
thisismy-github
64259f73e8 Various single-click option fixes
Fixed single-click option ignoring split arrows
Fixed Apps folder being clickable
2022-08-13 16:00:26 -04:00
thisismy-github
8031739110 Added option to customize Pinned folder location
Items can be pinned to directories that require administative privileges
(such as Open-Shell's default installation directory), so long as users
take ownership of the pinned folder. Also adds a command to Open-Shell's
context menu that opens the current pinned folder.

Adds general support for directory-based settings by creating a new
setting type called TYPE_DIRECTORY which uses a new bool added to
BrowseLinkHelper, called bFoldersOnly. START_MENU_PINNED_ROOT
has been removed, and all instances of both it and BrowseLinkHelper
have been adjusted accordingly. To create your own directory-based
settings, use CSetting::TYPE_DIRECTORY. Empty directory paths are
reset to their default value as they can cause unexpected behavior.
2022-08-13 16:00:26 -04: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
thisismy-github
bb26cec0ec Added option to single-expand any Win7 style item
Expands the "display as a list of drives" option from This PC to work on
almost any item in the Windows 7 style. Incompatible items have a new
setting called ITEM_NODRIVES which blocks the option from appearing.
This PC still uses the original "list of drives" text, while other items
use "list of links" instead. Sorting has been updated to account for
this option by adding a property called bFolderLink which marks any
folder, even if it is not explicitly expandable.
2022-08-13 16:00:26 -04:00
thisismy-github
ef663d2051 Added option to set custom commands for controls
Includes a unique option for each control and supports environment
variables.
2022-08-13 16:00:26 -04:00
thisismy-github
be8568ce00 Added option to hide "see more results" in search
Hides the item in both start menu styles and adjusts search height to
ensure the empty space is used. Partially fixes #660, but currently
does not honor group policy settings.
2022-08-13 16:00:26 -04:00