45 Commits

Author SHA1 Message Date
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
bonzibudd
be57a43589 Format ReadMe icon 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
ge0rdi
a0a03760cd Build: Fix source indexing
x64 version of pdbstr doesn't work (because of missing __CxxFrameHandler4 on Windows Server 2019).
Fortunately it seems that x86 version works well, so we can use that one.
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
7f04293361 Update README.md
Download link should point to latest official release.
2022-10-14 20:02:19 +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
coddec
687e50914f Update appveyor.yml
Change secure,hashed auth token as suggested by @ge0rdi
2022-09-08 13:31:28 +10:00
floppyD
a165ba38a6 Update StartMenuL10N.ini (#1125)
That's how it's called on Windows. "Configurações do computador" also makes the start menu way larger than it should be.
2022-09-01 19:27:25 -04:00
ge0rdi
6b7cfc5ab2 Update: Remove unused code for checking nightly build on AppVeyor
We have nightly builds on Github already.
2022-08-21 22:51:18 +02:00
ge0rdi
1f2c3d43a6 Update: Get nightly (prerelease) builds from Github
We are now deploying official builds from master to Github releases page
(as Prerelease).
So we should get these build from there.

This is also related to AppVeyor's rather tight download limits that
make it quite challenge to obtain nightly builds.
2022-08-21 22:51:18 +02:00
ge0rdi
5bee5ae143 Update JSON library to latest version (3.11.2) 2022-08-21 22:51:18 +02:00
ge0rdi
f01c126b36 AppVeyor: Deploy only if build was done under official account 2022-08-21 22:47:52 +02:00
ge0rdi
3d1fa11973 Update README.md
- Updated "release" badge to point to latest release version directly
- Removed "Latest nightly build" link as nightly builds are now part of standard Releases page
2022-08-21 22:20:32 +02:00
ge0rdi
93245dc4d6 AppVeyor: deploy build to GitHub releases page 2022-08-21 14:01:21 +02:00
ge0rdi
86447299b1 AppVeyor: build only from master
We want to do official builds from master only.
PR builds should be not affected by this.
2022-08-21 14:00:12 +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
thisismy-github
5399e3ad8c Added option to use a custom search hint
If set, intercepts the search hint's DrawText function and swaps out the
default text for user-defined text. Leaving the text blank results in an
empty search box.
2022-08-13 16:00:26 -04:00
thisismy-github
68379f4098 Fixed bug between XML files and active edit boxes
When loading XML files, settings with active edit boxes open will not be
adjusted. This adds an additional tab-reload before the load begins to
forcibly close any active edit boxes.
2022-08-13 16:00:26 -04:00
thisismy-github
daa1d96f12 Added option to never highlight modified settings
Prevents settings from appearing in bold. Does not change the helper
text at the bottom of the window.
2022-08-13 16:00:26 -04:00
thisismy-github
998d83c15c Auto-detect when setting is back to default value
Intercepts *most* instances of FLAG_DEFAULT getting set, including
when XML files are loaded and when Open-Shell starts, adding
if-statements to those spots to check if a new value is actually
different from the setting's default value. Ensures more consistency
behind the scenes and gets rid of inaccurate bold highlights.
2022-08-13 16:00:26 -04:00
thisismy-github
0cb43dd17c Added option to always single-click folders
Opens pinned items on both sides of the start menu in just one click,
while preserving hover functionality. Ignores the All Programs button
for now as the All Programs folder is rarely accessed and this option
can obstruct its use, especially for the inline menu style. Fixes #692.
2022-08-13 16:00:26 -04:00
among-us-official
b89aaed785 Fix corrupted icons in second column (#1088)
When using skin with a different second column icon size, all of the
icons in it would become blank.

Because m_bTwoColumns is set after AddStandardItems, it is still false
in the column break check. As a workaround, use the value it's assigned
later in InitWindowInternal instead.

Fix Open-Shell/Open-Shell-Menu#980
2022-08-11 16:46:12 -04:00
Let's All Love Lain
47cc2b2304 Replacing 'scopeList' contiguous placement of elements in memory more efficient and std::make_unique c++17
Signed-off-by: germanaizek <GermanAizek@yandex.ru>
2022-05-12 20:54:42 +02:00
germanaizek
a20215d9da Replace 'push*' -> 'emplace*' if possible and use std::move() 2022-05-12 20:54:42 +02:00
germanaizek
4f362760b6 Remove unused vars, usage '= default;' and fixed lower scope 2022-05-12 20:54:42 +02:00
Ibuprophen
2e43d4c7a1 Update README.md 2022-05-10 11:05:42 -04:00
55 changed files with 7353 additions and 7838 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.6 KiB

After

Width:  |  Height:  |  Size: 4.0 KiB

View File

@@ -3722,7 +3722,7 @@ Menu.RestartUpdate = Atualizar e reiniciar
Menu.Sleep = &Dormir
Menu.Hibernate = &Hibernar
Menu.ControlPanel = &Painel de controle
Menu.PCSettings = Configurações do computador
Menu.PCSettings = Configurações
Menu.Security = Segurança do Windows
Menu.Network = Co&nexões de Rede
Menu.Printers = &Impressoras

View File

@@ -1,12 +1,11 @@
## Open-Shell ![Open-Shell](/Src/Setup/OpenShell.ico)
## Open-Shell <img src=/Src/Setup/OpenShell.ico width="64" />
*Originally* **[Classic Shell](http://www.classicshell.net)** *by [Ivo Beltchev](https://sourceforge.net/u/ibeltchev/profile/)*
[![GitHub Release](https://img.shields.io/github/release/Open-Shell/Open-Shell-Menu.svg)](https://github.com/Open-Shell/Open-Shell-Menu/releases) [![GitHub Pre-Release](https://img.shields.io/github/release/Open-Shell/Open-Shell-Menu/all.svg)](https://github.com/Open-Shell/Open-Shell-Menu/releases) [![Build status](https://ci.appveyor.com/api/projects/status/2wj5x5qoypfjj0tr/branch/master?svg=true)](https://ci.appveyor.com/project/passionate-coder/open-shell-menu/branch/master) [![GitQ](https://gitq.com/badge.svg)](https://gitq.com/passionate-coder/Classic-Start) [![Gitter chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/open-shell/Lobby) [![Discord](https://img.shields.io/discord/757701054782636082?color=%4E5D94&label=Discord&logo=discord&logoColor=white)](https://discord.gg/7H6arr5)
[![GitHub Release](https://img.shields.io/github/release/Open-Shell/Open-Shell-Menu.svg)](https://github.com/Open-Shell/Open-Shell-Menu/releases/latest) [![GitHub Pre-Release](https://img.shields.io/github/release/Open-Shell/Open-Shell-Menu/all.svg)](https://github.com/Open-Shell/Open-Shell-Menu/releases) [![Build status](https://ci.appveyor.com/api/projects/status/2wj5x5qoypfjj0tr/branch/master?svg=true)](https://ci.appveyor.com/project/passionate-coder/open-shell-menu/branch/master) [![GitQ](https://gitq.com/badge.svg)](https://gitq.com/passionate-coder/Classic-Start) [![Gitter chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/open-shell/Lobby) [![Discord](https://img.shields.io/discord/757701054782636082?color=%4E5D94&label=Discord&logo=discord&logoColor=white)](https://discord.gg/7H6arr5)
[Home Page](https://open-shell.github.io/Open-Shell-Menu)
[Gitter Discussion room](https://gitter.im/Open-Shell)
[Latest nightly build](https://ci.appveyor.com/project/passionate-coder/open-shell-menu/branch/master/artifacts)
### Features
- Classic style Start Menu for Windows 7, 8, 8.1, 10
@@ -18,13 +17,13 @@
### Download
If you just want to use it or looking for setup file, click here to download:
[![GitHub All Releases](https://img.shields.io/github/downloads/Open-Shell/Open-Shell-Menu/total?style=for-the-badge)](https://github.com/Open-Shell/Open-Shell-Menu/releases)
[![GitHub All Releases](https://img.shields.io/github/downloads/Open-Shell/Open-Shell-Menu/total?style=for-the-badge)](https://github.com/Open-Shell/Open-Shell-Menu/releases/latest)
### Temporary Translation/Language Solution
1. Download [language DLL](https://coddec.github.io/Classic-Shell/www.classicshell.net/translations/index.html)
2. Place it either in the Open-Shell's __install folder__ or in the `%ALLUSERSPROFILE%\OpenShell\Languages` folder
---
----
*For archival reasons, we have a mirror of `www.classicshell.net` [here](https://coddec.github.io/Classic-Shell/www.classicshell.net/).*

View File

@@ -380,7 +380,7 @@ LRESULT CEditToolbarDlg::OnBrowseLink( WORD wNotifyCode, WORD wID, HWND hWndCtl,
{
wchar_t text[_MAX_PATH];
GetDlgItemText(IDC_COMBOLINK,text,_countof(text));
if (BrowseLinkHelper(m_hWnd,text))
if (BrowseLinkHelper(m_hWnd,text,false))
{
SetDlgItemText(IDC_COMBOLINK,text);
SendMessage(WM_COMMAND,MAKEWPARAM(IDC_COMBOLINK,CBN_KILLFOCUS));

View File

@@ -135,17 +135,17 @@ BEGIN
IDS_LANGUAGE_SETTINGS "Language"
IDS_CAPTION_FONT "Caption font"
IDS_CAPTION_FONT_TIP "Select the font and text size to use for the caption"
IDS_TEXT_COLOR "Text color"
IDS_TEXT_COLOR "Text color (RRGGBB)"
IDS_TEXT_COLOR_TIP "Select the color for the caption text"
IDS_MAXTEXT_COLOR "Text color (maximized)"
IDS_MAXTEXT_COLOR "Text color (maximized) (RRGGBB)"
IDS_MAXTEXT_COLOR_TIP "Select the color for the caption text when the window is maximized"
IDS_INTEXT_COLOR "Text color (inactive)"
IDS_INTEXT_COLOR "Text color (inactive) (RRGGBB)"
IDS_INTEXT_COLOR_TIP "Select the color for the caption text when the window is inactive"
IDS_MAXINTEXT_COLOR "Text color (maximized, inactive)"
IDS_MAXINTEXT_COLOR "Text color (maximized, inactive) (RRGGBB)"
IDS_MAXINTEXT_COLOR_TIP "Select the color for the caption text when the window is maximized and inactive"
IDS_GLOW "Text glow"
IDS_GLOW_TIP "When this is checked, the text will have a glow around it"
IDS_GLOW_COLOR "Glow color"
IDS_GLOW_COLOR "Glow color (RRGGBB)"
IDS_GLOW_COLOR_TIP "Select the color for the caption glow"
END
@@ -153,7 +153,7 @@ STRINGTABLE
BEGIN
IDS_MAXGLOW "Text glow (maximized)"
IDS_MAXGLOW_TIP "When this is checked, the text in the maximized window will have a glow around it"
IDS_MAXGLOW_COLOR "Glow color (maximized)"
IDS_MAXGLOW_COLOR "Glow color (maximized) (RRGGBB)"
IDS_MAXGLOW_COLOR_TIP "Select the color for the caption glow when the window is maximized"
IDS_STATUS_SETTINGS "Status Bar"
IDS_SHOW_PROGRESS "Show progress"

View File

@@ -195,9 +195,10 @@ static TDownloadResult DownloadFile( const wchar_t *url, std::vector<char> &buf,
{
if (pProgress && pProgress->IsCanceled())
res=DOWNLOAD_CANCEL;
const wchar_t *accept[]={L"*/*",NULL};
if (res==DOWNLOAD_OK)
{
const wchar_t* accept[] = { L"*/*",NULL };
HINTERNET hRequest=HttpOpenRequest(hConnect,L"GET",file,NULL,NULL,accept,((components.nScheme==INTERNET_SCHEME_HTTPS)?INTERNET_FLAG_SECURE:0)|(bAcceptCached?0:INTERNET_FLAG_RELOAD),0);
if (hRequest)
{
@@ -343,7 +344,7 @@ static DWORD WINAPI ThreadVersionCheck( void *param )
VersionData data;
{
auto load = params.nightly ? data.LoadNightly() : data.Load();
auto load = data.Load(!params.nightly);
#ifdef UPDATE_LOG
LogToFile(UPDATE_LOG, L"Load result: %d", load);
@@ -764,20 +765,38 @@ std::vector<char> DownloadUrl(const wchar_t* url)
using namespace nlohmann;
VersionData::TLoadResult VersionData::Load()
VersionData::TLoadResult VersionData::Load(bool official)
{
Clear();
auto buf = DownloadUrl(L"https://api.github.com/repos/Open-Shell/Open-Shell-Menu/releases/latest");
std::wstring baseUrl = L"https://api.github.com/repos/Open-Shell/Open-Shell-Menu/releases";
if (official)
baseUrl += L"/latest";
auto buf = DownloadUrl(baseUrl.c_str());
if (buf.empty())
return LOAD_ERROR;
try
{
auto data = json::parse(buf.begin(), buf.end());
auto jsonData = json::parse(buf.begin(), buf.end());
auto& data = jsonData;
// skip prerelease versions
if (data["prerelease"].get<bool>())
if (official)
{
// skip prerelease versions (just in case)
if (data["prerelease"].get<bool>())
return LOAD_BAD_VERSION;
}
else
{
// we've got list of versions (release and pre-release)
// lets pick first one (that should be the latest one)
data = jsonData[0];
}
// make sure we didn't get draft release (for whatever reason)
if (data["draft"].get<bool>())
return LOAD_BAD_VERSION;
// get version from tag name
@@ -831,116 +850,6 @@ VersionData::TLoadResult VersionData::Load()
}
}
VersionData::TLoadResult VersionData::LoadNightly()
{
Clear();
auto buf = DownloadUrl(L"https://ci.appveyor.com/api/projects/passionate-coder/open-shell-menu/branch/master");
if (buf.empty())
return LOAD_ERROR;
try
{
auto data = json::parse(buf.begin(), buf.end());
auto build = data["build"];
// get version
auto version = build["version"].get<std::string>();
if (version.empty())
return LOAD_BAD_FILE;
{
int v1, v2, v3;
if (sscanf_s(version.c_str(), "%d.%d.%d", &v1, &v2, &v3) != 3)
return LOAD_BAD_FILE;
newVersion = (v1 << 24) | (v2 << 16) | v3;
if (newVersion <= GetVersionEx(g_Instance))
return LOAD_OK;
}
// artifact url
{
auto jobId = build["jobs"][0]["jobId"].get<std::string>();
if (jobId.empty())
return LOAD_BAD_FILE;
std::wstring jobUrl(L"https://ci.appveyor.com/api/buildjobs/");
jobUrl += std::wstring(jobId.begin(), jobId.end());
jobUrl += L"/artifacts";
buf = DownloadUrl(jobUrl.c_str());
if (buf.empty())
return LOAD_ERROR;
auto artifacts = json::parse(buf.begin(), buf.end());
std::string fileName;
for (const auto& artifact : artifacts)
{
auto name = artifact["fileName"].get<std::string>();
if (name.find("OpenShellSetup") == 0)
{
fileName = name;
break;
}
}
if (fileName.empty())
return LOAD_BAD_FILE;
auto artifactUrl(jobUrl);
artifactUrl += L'/';
artifactUrl += std::wstring(fileName.begin(), fileName.end());
downloadUrl = artifactUrl.c_str();
}
// changelog
news.Append(CA2T(version.c_str()));
news.Append(L"\r\n\r\n");
try
{
// use Github API to compare commit that actual version was built from (APPVEYOR_REPO_COMMIT)
// and commit that AppVeyor version was built from (commitId)
auto commitId = build["commitId"].get<std::string>();
std::wstring compareUrl(L"https://api.github.com/repos/Open-Shell/Open-Shell-Menu/compare/");
compareUrl += _T(APPVEYOR_REPO_COMMIT);
compareUrl += L"...";
compareUrl += std::wstring(commitId.begin(), commitId.end());
buf = DownloadUrl(compareUrl.c_str());
auto compare = json::parse(buf.begin(), buf.end());
// then use first lines (subjects) of commit messages as changelog
auto commits = compare["commits"];
for (const auto& commit : commits)
{
auto message = commit["commit"]["message"].get<std::string>();
auto pos = message.find('\n');
if (pos != message.npos)
message.resize(pos);
news.Append(L"- ");
news.Append(CA2T(message.c_str()));
news.Append(L"\r\n");
}
}
catch (...)
{
}
}
catch (...)
{
return LOAD_BAD_FILE;
}
return LOAD_OK;
}
VersionData::TLoadResult VersionData::Load( const wchar_t *fname, bool bLoadFlags )
{
Clear();

View File

@@ -59,8 +59,7 @@ struct VersionData
LOAD_BAD_FILE, // the file is corrupted
};
TLoadResult Load();
TLoadResult LoadNightly();
TLoadResult Load(bool official);
TLoadResult Load( const wchar_t *fname, bool bLoadFlags );
private:
void operator=( const VersionData& );

View File

@@ -60,3 +60,17 @@ bool IsFakeFolder( const wchar_t *fname )
}
return false;
}
bool GetFakeFolder( wchar_t *dst, int len, const wchar_t *src )
{
Sprintf(dst,len,L"%s\\target.lnk",src);
if (GetFileAttributes(dst)!=INVALID_FILE_ATTRIBUTES)
{
wchar_t path[_MAX_PATH];
Sprintf(path,_countof(path),L"%s\\desktop.ini",src);
DWORD attrib=GetFileAttributes(path);
if (attrib!=INVALID_FILE_ATTRIBUTES && (attrib&FILE_ATTRIBUTE_SYSTEM))
return true;
}
return false;
}

View File

@@ -7,3 +7,4 @@
bool CreateFakeFolder( const wchar_t *source, const wchar_t *fname );
void DeleteFakeFolder( const wchar_t *fname );
bool IsFakeFolder( const wchar_t *fname );
bool GetFakeFolder( wchar_t *dst, int len, const wchar_t *src );

View File

@@ -127,7 +127,6 @@ VersionData CLanguageSettingsDlg::s_VersionData;
void CLanguageSettingsDlg::AddFlag( const wchar_t *langName, int langId, HBITMAP bmp )
{
std::vector<LangInfo>::iterator it=m_LanguageIDs.begin()+1;
int idx=1;
for (;idx<(int)m_LanguageIDs.size();idx++)
{
@@ -205,8 +204,6 @@ void CLanguageSettingsDlg::UpdateFlags( void )
DoEnvironmentSubst(path,_countof(path));
}
CWindow list=GetDlgItem(IDC_LISTLANGUAGE);
wchar_t find[_MAX_PATH];
Sprintf(find,_countof(find),L"%s\\*.dll",path);
WIN32_FIND_DATA data;
@@ -408,7 +405,7 @@ LRESULT CLanguageSettingsDlg::OnSelChange( int idCtrl, LPNMHDR pnmh, BOOL& bHand
CComVariant val(name);
if (m_pSetting->value!=val)
SetSettingsDirty();
m_pSetting->value=val;
m_pSetting->value=std::move(val);
if (_wcsicmp(m_pSetting->value.bstrVal,m_pSetting->defValue.bstrVal)==0)
m_pSetting->flags|=CSetting::FLAG_DEFAULT;

View File

@@ -396,8 +396,11 @@ HBITMAP LoadImageFile( const wchar_t *path, const SIZE *pSize, bool bUseAlpha, b
CComPtr<IWICImagingFactory> pFactory;
if (FAILED(pFactory.CoCreateInstance(CLSID_WICImagingFactory)))
{
if (srcBmp) DeleteObject(srcBmp);
return NULL;
if (FAILED(pFactory.CoCreateInstance(CLSID_WICImagingFactory1)))
{
if (srcBmp) DeleteObject(srcBmp);
return NULL;
}
}
CComPtr<IWICBitmapSource> pBitmap;
@@ -534,7 +537,10 @@ HBITMAP LoadImageResource( HMODULE hModule, const wchar_t *name, bool bTopDown,
{
CComPtr<IWICImagingFactory> pFactory;
if (FAILED(pFactory.CoCreateInstance(CLSID_WICImagingFactory)))
return NULL;
{
if (FAILED(pFactory.CoCreateInstance(CLSID_WICImagingFactory1)))
return NULL;
}
CComPtr<IWICBitmapSource> pBitmap;
if (hModule)
@@ -727,6 +733,19 @@ bool IsWin10RS4( void )
return bIsRS4;
}
static bool IsWin11Helper()
{
auto version = GetOSVersion();
return version.dwMajorVersion >= 10 && version.dwBuildNumber >= 22000;
}
// Returns true if the version is Windows11 or later
bool IsWin11(void)
{
static bool bIsWin11 = IsWin11Helper();
return bIsWin11;
}
// Wrapper for IShellFolder::ParseDisplayName
HRESULT ShParseDisplayName( const wchar_t *pszName, PIDLIST_ABSOLUTE *ppidl, SFGAOF sfgaoIn, SFGAOF *psfgaoOut )
{
@@ -903,3 +922,31 @@ HFONT CreateFontSetting( const wchar_t *fontStr, int dpi )
int size=-_wtol(token);
return CreateFont(size*dpi/72,0,0,0,weight,bItalic?1:0,0,0,DEFAULT_CHARSET,OUT_DEFAULT_PRECIS,CLIP_DEFAULT_PRECIS,DEFAULT_QUALITY,DEFAULT_PITCH,name);
}
static UINT WINAPI GetDpiForWindow(HWND hwnd)
{
static auto p = static_cast<decltype(&GetDpiForWindow)>((void*)GetProcAddress(GetModuleHandle(L"user32.dll"), "GetDpiForWindow"));
if (p)
return p(hwnd);
return 0;
}
UINT GetDpi(HWND hwnd)
{
UINT dpi = GetDpiForWindow(hwnd);
if (!dpi)
{
// fall-back for older systems
HDC hdc = GetDC(nullptr);
dpi = GetDeviceCaps(hdc, LOGPIXELSY);
ReleaseDC(nullptr, hdc);
}
return dpi;
}
int ScaleForDpi(HWND hwnd, int value)
{
return MulDiv(value, GetDpi(hwnd), USER_DEFAULT_SCREEN_DPI);
}

View File

@@ -67,6 +67,9 @@ bool IsWin10RS1( void );
// Returns true if the version is Windows10 RS4 (Spring Creator Update) or later
bool IsWin10RS4( void );
// Returns true if the version is Windows11 or later
bool IsWin11();
// Wrapper for IShellFolder::ParseDisplayName
HRESULT ShParseDisplayName( const wchar_t *pszName, PIDLIST_ABSOLUTE *ppidl, SFGAOF sfgaoIn, SFGAOF *psfgaoOut );
@@ -82,6 +85,12 @@ void StringUpper( CString &str );
// Create a font from the user settings
HFONT CreateFontSetting( const wchar_t *fontStr, int dpi );
// Return DPI of given window (or system DPI on older systems)
UINT GetDpi(HWND hwnd = nullptr);
// Scale given value according to DPI of window
int ScaleForDpi(HWND hwnd, int value);
extern HINSTANCE g_Instance;
const int ANIM_BUTTON_TAG1='ANM';

View File

@@ -125,7 +125,7 @@ bool CSetting::IsEnabled( void ) const
if (operation=='>' && pSetting->GetValue().intVal<=val)
return false;
}
if ((pSetting->type==CSetting::TYPE_STRING || pSetting->type==CSetting::TYPE_BITMAP || pSetting->type==CSetting::TYPE_BITMAP_JPG) && pSetting->GetValue().vt==VT_BSTR)
if ((pSetting->type==CSetting::TYPE_STRING || pSetting->type==CSetting::TYPE_BITMAP || pSetting->type==CSetting::TYPE_BITMAP_JPG || pSetting->type==CSetting::TYPE_DIRECTORY) && pSetting->GetValue().vt==VT_BSTR)
{
if (operation=='~' && *pSetting->GetValue().bstrVal==0)
return false;
@@ -202,7 +202,7 @@ bool CSetting::ReadValue( CRegKey &regKey, const wchar_t *valName )
}
// string
if (type>=CSetting::TYPE_STRING && type<CSetting::TYPE_MULTISTRING)
if (type>=CSetting::TYPE_STRING && type!=CSetting::TYPE_MULTISTRING)
{
ULONG len;
if (regKey.QueryStringValue(valName,NULL,&len)==ERROR_SUCCESS)
@@ -789,7 +789,7 @@ CString CSettingsManager::LoadSettingsXml( const wchar_t *fname )
}
CComPtr<IXMLDOMNode> next;
child2->get_nextSibling(&next);
child2=next;
child2=std::move(next);
}
string.push_back(0);
pSetting->value=CComVariant(&string[0]);
@@ -839,7 +839,7 @@ CString CSettingsManager::LoadSettingsXml( const wchar_t *fname )
CComPtr<IXMLDOMNode> next;
if (child->get_nextSibling(&next)!=S_OK)
break;
child=next;
child=std::move(next);
}
if (ver<0x03090000)
UpgradeSettings(false);
@@ -1701,6 +1701,7 @@ LRESULT CSettingsDlg::OnBackup( WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL&
ofn.Flags=OFN_DONTADDTORECENT|OFN_ENABLESIZING|OFN_EXPLORER|OFN_FILEMUSTEXIST|OFN_HIDEREADONLY|OFN_NOCHANGEDIR;
if (GetOpenFileName(&ofn))
{
SetCurTab(m_Index,true); // reload tab once to force-close any active edit boxes
CString error=g_SettingsManager.LoadSettingsXml(path);
if (!error.IsEmpty())
{
@@ -1710,7 +1711,7 @@ LRESULT CSettingsDlg::OnBackup( WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL&
::MessageBox(m_hWnd,text,LoadStringEx(IDS_ERROR_TITLE),MB_OK|MB_ICONERROR);
}
SetSettingsDirty();
SetCurTab(m_Index,true);
SetCurTab(m_Index,true); // reload tab again to show the new settings
}
}
if (res==3)
@@ -2208,7 +2209,7 @@ bool GetSettingBool( const CSetting &setting )
CString GetSettingString( const CSetting &setting )
{
Assert(setting.type==CSetting::TYPE_STRING);
Assert(setting.type==CSetting::TYPE_STRING || setting.type==CSetting::TYPE_DIRECTORY);
if (setting.value.vt!=VT_BSTR)
return CString();
return setting.value.bstrVal;
@@ -2709,7 +2710,7 @@ bool SaveAdmx( TSettingsComponent component, const char *admxFile, const char *a
{
fprintf_s(fAdmx,"\t\t\t\t<decimal id=\"Value\" valueName=\"%S\"/>\r\n",pSetting->name);
}
else if (pSetting->type==CSetting::TYPE_STRING || pSetting->type==CSetting::TYPE_ICON || pSetting->type==CSetting::TYPE_BITMAP || pSetting->type==CSetting::TYPE_BITMAP_JPG || pSetting->type==CSetting::TYPE_SOUND || pSetting->type==CSetting::TYPE_FONT)
else if (pSetting->type==CSetting::TYPE_STRING || pSetting->type==CSetting::TYPE_ICON || pSetting->type==CSetting::TYPE_BITMAP || pSetting->type==CSetting::TYPE_BITMAP_JPG || pSetting->type==CSetting::TYPE_SOUND || pSetting->type==CSetting::TYPE_FONT || pSetting->type==CSetting::TYPE_DIRECTORY)
{
fprintf_s(fAdmx,"\t\t\t\t<text id=\"Value\" valueName=\"%S\"/>\r\n",pSetting->name);
}
@@ -2769,7 +2770,7 @@ bool SaveAdmx( TSettingsComponent component, const char *admxFile, const char *a
{
fprintf_s(fAdml,"\t\t\t\t<decimalTextBox refId=\"Value\" spin=\"false\">%s</decimalTextBox>\r\n",(const char*)name);
}
else if (pSetting->type==CSetting::TYPE_STRING || pSetting->type==CSetting::TYPE_ICON || pSetting->type==CSetting::TYPE_BITMAP || pSetting->type==CSetting::TYPE_BITMAP_JPG || pSetting->type==CSetting::TYPE_SOUND || pSetting->type==CSetting::TYPE_FONT)
else if (pSetting->type==CSetting::TYPE_STRING || pSetting->type==CSetting::TYPE_ICON || pSetting->type==CSetting::TYPE_BITMAP || pSetting->type==CSetting::TYPE_BITMAP_JPG || pSetting->type==CSetting::TYPE_SOUND || pSetting->type==CSetting::TYPE_FONT || pSetting->type==CSetting::TYPE_DIRECTORY)
{
fprintf_s(fAdml,"\t\t\t\t<textBox refId=\"Value\"><label>%s</label></textBox>\r\n",(const char*)name);
}

View File

@@ -32,6 +32,7 @@ struct CSetting
TYPE_SOUND,
TYPE_FONT,
TYPE_MULTISTRING,
TYPE_DIRECTORY,
};
enum

View File

@@ -1156,7 +1156,7 @@ HRESULT STDMETHODCALLTYPE CBrowseLinkEvents::OnButtonClicked( IFileDialogCustomi
{
pfd->GetFolder(&pItem);
}
m_pResult=pItem;
m_pResult=std::move(pItem);
pfd->Close(S_FALSE);
return S_OK;
}
@@ -1216,7 +1216,7 @@ bool BrowseCommandHelper( HWND parent, wchar_t *text )
return false;
}
bool BrowseLinkHelper( HWND parent, wchar_t *text )
bool BrowseLinkHelper( HWND parent, wchar_t *text, bool bFoldersOnly )
{
DoEnvironmentSubst(text,_MAX_PATH);
@@ -1227,16 +1227,22 @@ bool BrowseLinkHelper( HWND parent, wchar_t *text )
if (!pCustomize)
return false;
pDialog->SetTitle(LoadStringEx(IDS_PICK_LINK_TITLE));
pDialog->SetOkButtonLabel(LoadStringEx(IDS_PICK_LINK_FILE));
wchar_t button[256];
Sprintf(button,_countof(button),L" %s ",LoadStringEx(IDS_PICK_LINK_FOLDER));
pCustomize->AddPushButton(101,button);
pDialog->SetTitle(LoadStringEx(bFoldersOnly?IDS_PICK_LINK_FOLDER:IDS_PICK_LINK_TITLE));
if (!bFoldersOnly) // add separate buttons for selecting files/folders to the dialog
{
pDialog->SetOkButtonLabel(LoadStringEx(IDS_PICK_LINK_FILE));
wchar_t button[256];
Sprintf(button,_countof(button),L" %s ",LoadStringEx(IDS_PICK_LINK_FOLDER));
pCustomize->AddPushButton(101,button);
}
CBrowseLinkEvents events;
DWORD cookie;
pDialog->Advise(&events,&cookie);
pDialog->SetOptions(FOS_ALLNONSTORAGEITEMS|FOS_FILEMUSTEXIST|FOS_DONTADDTORECENT|FOS_DEFAULTNOMINIMODE|FOS_NODEREFERENCELINKS);
if (bFoldersOnly) // set FOS_PICKFOLDERS option to use dialog in folder-only mode
pDialog->SetOptions(FOS_PICKFOLDERS|FOS_ALLNONSTORAGEITEMS|FOS_DONTADDTORECENT|FOS_DEFAULTNOMINIMODE);
else
pDialog->SetOptions(FOS_ALLNONSTORAGEITEMS|FOS_FILEMUSTEXIST|FOS_DONTADDTORECENT|FOS_DEFAULTNOMINIMODE|FOS_NODEREFERENCELINKS);
{
const wchar_t *c=wcschr(text,'|');
if (c)
@@ -2271,6 +2277,7 @@ public:
EDIT_HOTKEY_ANY,
EDIT_COLOR,
EDIT_FONT,
EDIT_DIRECTORY,
};
BEGIN_MSG_MAP( CTreeSettingsDlg )
@@ -2644,15 +2651,14 @@ LRESULT CTreeSettingsDlg::OnBrowse( WORD wNotifyCode, WORD wID, HWND hWndCtl, BO
CString str;
m_EditBox.GetWindowText(str);
str.TrimLeft(); str.TrimRight();
wchar_t *end;
COLORREF val=wcstol(str,&end,16)&0xFFFFFF;
COLORREF val=RgbToBgr(ParseColor(str));
static COLORREF customColors[16];
CHOOSECOLOR choose={sizeof(choose),m_hWnd,NULL,val,customColors};
choose.Flags=CC_ANYCOLOR|CC_FULLOPEN|CC_RGBINIT;
if (ChooseColor(&choose))
{
wchar_t text[100];
Sprintf(text,_countof(text),L"%06X",choose.rgbResult);
Sprintf(text,_countof(text),L"%06X",BgrToRgb(choose.rgbResult));
m_EditBox.SetWindowText(text);
ApplyEditBox();
UpdateGroup(m_pEditSetting);
@@ -2714,6 +2720,29 @@ LRESULT CTreeSettingsDlg::OnBrowse( WORD wNotifyCode, WORD wID, HWND hWndCtl, BO
m_EditBox.SetFocus();
m_bIgnoreFocus=false;
}
else if (m_EditMode==EDIT_DIRECTORY)
{
m_bIgnoreFocus=true;
CString str;
m_EditBox.GetWindowText(str);
str.TrimLeft(); str.TrimRight();
wchar_t text[1024];
DWORD dwAttrs=GetFileAttributes(str); // ensure directory exists before passing it to dialog
if (dwAttrs!=INVALID_FILE_ATTRIBUTES && dwAttrs&FILE_ATTRIBUTE_DIRECTORY)
{
Strcpy(text,_countof(text),str);
DoEnvironmentSubst(text,_countof(text));
}
else
text[0]=0;
Strcpy(text,_countof(text),str);
DoEnvironmentSubst(text,_countof(text));
if (BrowseLinkHelper(m_hWnd,text,true))
m_EditBox.SetWindowText(text);
SendMessage(WM_NEXTDLGCTL,(LPARAM)m_EditBox.m_hWnd,TRUE);
m_EditBox.SetFocus();
m_bIgnoreFocus=false;
}
return 0;
}
@@ -3018,8 +3047,7 @@ void CTreeSettingsDlg::ApplyEditBox( void )
}
else if (pSetting->type==CSetting::TYPE_COLOR)
{
wchar_t *end;
int val=wcstol(str,&end,16)&0xFFFFFF;
int val=RgbToBgr(ParseColor(str));
if (pSetting->value.vt!=VT_I4 || pSetting->value.intVal!=val)
{
pSetting->value=CComVariant(val);
@@ -3034,6 +3062,20 @@ void CTreeSettingsDlg::ApplyEditBox( void )
pSetting->flags&=~CSetting::FLAG_DEFAULT;
}
}
else if (pSetting->type==CSetting::TYPE_DIRECTORY)
{
if (pSetting->value.vt!=VT_BSTR || str!=pSetting->value.bstrVal)
{
if (str.IsEmpty()) // empty directory strings cause unexpected behavior, so we reset to avoid this
pSetting->value=pSetting->defValue;
else // otherwise we are very lenient about what users can input as a path
pSetting->value=CComVariant(str);
if (pSetting->value==pSetting->defValue)
pSetting->flags|=CSetting::FLAG_DEFAULT;
else
pSetting->flags&=~CSetting::FLAG_DEFAULT;
}
}
else
{
if (pSetting->value.vt!=VT_BSTR || str!=pSetting->value.bstrVal)
@@ -3074,7 +3116,7 @@ void CTreeSettingsDlg::ItemSelected( HTREEITEM hItem, CSetting *pSetting, bool b
val=valVar.intVal;
Sprintf(text,_countof(text),L"%d",val);
}
else if (pSetting->type==CSetting::TYPE_STRING || pSetting->type==CSetting::TYPE_ICON || pSetting->type==CSetting::TYPE_BITMAP || pSetting->type==CSetting::TYPE_BITMAP_JPG || pSetting->type==CSetting::TYPE_SOUND || pSetting->type==CSetting::TYPE_FONT)
else if (pSetting->type==CSetting::TYPE_STRING || pSetting->type==CSetting::TYPE_ICON || pSetting->type==CSetting::TYPE_BITMAP || pSetting->type==CSetting::TYPE_BITMAP_JPG || pSetting->type==CSetting::TYPE_SOUND || pSetting->type==CSetting::TYPE_FONT || pSetting->type==CSetting::TYPE_DIRECTORY)
{
if (valVar.vt==VT_BSTR)
Strcpy(text,_countof(text),valVar.bstrVal);
@@ -3090,8 +3132,10 @@ void CTreeSettingsDlg::ItemSelected( HTREEITEM hItem, CSetting *pSetting, bool b
mode=EDIT_BITMAP_JPG;
else if (pSetting->type==CSetting::TYPE_SOUND)
mode=EDIT_SOUND;
else
else if (pSetting->type==CSetting::TYPE_FONT)
mode=EDIT_FONT;
else
mode=EDIT_DIRECTORY;
}
else if (pSetting->type==CSetting::TYPE_HOTKEY || pSetting->type==CSetting::TYPE_HOTKEY_ANY)
{
@@ -3110,7 +3154,7 @@ void CTreeSettingsDlg::ItemSelected( HTREEITEM hItem, CSetting *pSetting, bool b
mode=EDIT_COLOR;
int val=0;
if (valVar.vt==VT_I4)
val=valVar.intVal;
val=BgrToRgb(valVar.intVal);
Sprintf(text,_countof(text),L"%06X",val);
}
}
@@ -3131,7 +3175,7 @@ void CTreeSettingsDlg::ItemSelected( HTREEITEM hItem, CSetting *pSetting, bool b
m_pEditSetting=pSetting;
}
if (mode==EDIT_ICON || mode==EDIT_BITMAP || mode==EDIT_BITMAP_JPG || mode==EDIT_SOUND || mode==EDIT_FONT || mode==EDIT_COLOR)
if (mode==EDIT_ICON || mode==EDIT_BITMAP || mode==EDIT_BITMAP_JPG || mode==EDIT_SOUND || mode==EDIT_FONT || mode==EDIT_COLOR || mode==EDIT_DIRECTORY)
{
RECT rc2=rc;
int width=(rc2.bottom-rc2.top)*3/2;
@@ -3189,14 +3233,15 @@ void CTreeSettingsDlg::UpdateEditPosition( void )
DeleteDC(hdc);
DWORD margins=(DWORD)m_EditBox.SendMessage(EM_GETMARGINS);
size.cx+=HIWORD(margins)+LOWORD(margins)+12;
if (m_EditMode==EDIT_ICON || m_EditMode==EDIT_BITMAP || m_EditMode==EDIT_BITMAP_JPG || m_EditMode==EDIT_FONT || m_EditMode==EDIT_COLOR)
// adjust size and position of edit boxes for settings that use browse/play buttons
if (m_EditMode==EDIT_ICON || m_EditMode==EDIT_BITMAP || m_EditMode==EDIT_BITMAP_JPG || m_EditMode==EDIT_FONT || m_EditMode==EDIT_COLOR || m_EditMode==EDIT_DIRECTORY)
size.cx+=width;
if (m_EditMode==EDIT_SOUND)
size.cx+=width*2;
if (size.cx<w)
rc.right=rc.left+size.cx;
if (m_EditMode==EDIT_ICON || m_EditMode==EDIT_BITMAP || m_EditMode==EDIT_BITMAP_JPG || m_EditMode==EDIT_SOUND || m_EditMode==EDIT_FONT || m_EditMode==EDIT_COLOR)
if (m_EditMode==EDIT_ICON || m_EditMode==EDIT_BITMAP || m_EditMode==EDIT_BITMAP_JPG || m_EditMode==EDIT_SOUND || m_EditMode==EDIT_FONT || m_EditMode==EDIT_COLOR || m_EditMode==EDIT_DIRECTORY)
{
RECT rc2=rc;
rc2.left=rc2.right-width;
@@ -3376,6 +3421,9 @@ void CTreeSettingsDlg::UpdateGroup( const CSetting *pModified )
bool bDefault=pSetting->IsDefault();
const CComVariant &valVar=pSetting->GetValue();
// check if modified items should be bold
bool bBoldSettings=GetSettingBool(L"BoldSettings");
// calculate text
if (pSetting!=m_pEditSetting)
{
@@ -3412,7 +3460,7 @@ void CTreeSettingsDlg::UpdateGroup( const CSetting *pModified )
CString str=LoadStringEx(pSetting->nameID);
int val=0;
if (valVar.vt==VT_I4)
val=valVar.intVal;
val=BgrToRgb(valVar.intVal);
Sprintf(text,_countof(text),L"%s: %06X",str,val);
item.mask|=TVIF_TEXT;
}
@@ -3458,7 +3506,7 @@ void CTreeSettingsDlg::UpdateGroup( const CSetting *pModified )
DeleteDC(hdc);
DeleteDC(hdcMask);
}
int state=bDefault?0:TVIS_BOLD;
int state=bDefault||!bBoldSettings?0:TVIS_BOLD; // check if item should be highlighted in bold
if (!bEnabled)
{
if (pSetting->type!=CSetting::TYPE_COLOR) image|=SETTING_STATE_DISABLED;
@@ -3566,3 +3614,19 @@ bool CDefaultSettingsPanel::Validate( HWND parent )
s_Dialog.Validate();
return true;
}
DWORD RgbToBgr(DWORD val)
{
return ((val & 0xFF) << 16) | (val & 0xFF00) | ((val >> 16) & 0xFF);
}
DWORD BgrToRgb(DWORD val)
{
return RgbToBgr(val);
}
DWORD ParseColor(const wchar_t* str)
{
wchar_t* end;
return wcstoul(str, &end, 16) & 0xFFFFFF;
}

View File

@@ -385,5 +385,13 @@ const wchar_t *GetSettingsRegPath( void );
extern const GUID FOLDERID_DesktopRoot;
bool BrowseCommandHelper( HWND parent, wchar_t *text );
bool BrowseLinkHelper( HWND parent, wchar_t *text );
bool BrowseLinkHelper( HWND parent, wchar_t *text, bool bFoldersOnly );
bool BrowseIconHelper( HWND parent, wchar_t *text );
// convert color in RRGGBB format to BBGGRR
DWORD RgbToBgr(DWORD val);
// convert color in BBGGRR format to RRGGBB
DWORD BgrToRgb(DWORD val);
// parse color from hexadecimal string
DWORD ParseColor(const wchar_t* str);

File diff suppressed because it is too large Load Diff

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.6 KiB

After

Width:  |  Height:  |  Size: 4.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.6 KiB

After

Width:  |  Height:  |  Size: 4.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.6 KiB

After

Width:  |  Height:  |  Size: 4.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.6 KiB

After

Width:  |  Height:  |  Size: 4.0 KiB

View File

@@ -114,7 +114,7 @@ copy /B Output\x64\StartMenuHelper64.dll Output\PDB64 > nul
REM ********* Source Index PDBs
set PDBSTR_PATH="C:\Program Files (x86)\Windows Kits\10\Debuggers\x64\srcsrv\pdbstr.exe"
set PDBSTR_PATH="C:\Program Files (x86)\Windows Kits\10\Debuggers\x86\srcsrv\pdbstr.exe"
if exist %PDBSTR_PATH% (
echo --- Adding source index to PDBs
@@ -122,10 +122,18 @@ if exist %PDBSTR_PATH% (
for %%f in (Output\PDB32\*.pdb) do (
%PDBSTR_PATH% -w -p:%%f -s:srcsrv -i:Output\pdbstr.txt
if not ERRORLEVEL 0 (
echo Error adding source index to PDB
exit /b 1
)
)
for %%f in (Output\PDB64\*.pdb) do (
%PDBSTR_PATH% -w -p:%%f -s:srcsrv -i:Output\pdbstr.txt
if not ERRORLEVEL 0 (
echo Error adding source index to PDB
exit /b 1
)
)
)

Binary file not shown.

Before

Width:  |  Height:  |  Size: 34 KiB

After

Width:  |  Height:  |  Size: 401 KiB

View File

@@ -943,7 +943,7 @@ static BOOL CALLBACK EnumResLangProc( HMODULE hModule, LPCTSTR lpszType, LPCTSTR
if (IS_INTRESOURCE(lpszName))
{
std::vector<std::pair<int,WORD>> &oldStrings=*(std::vector<std::pair<int,WORD>>*)lParam;
oldStrings.push_back(std::pair<int,WORD>(PtrToInt(lpszName),wIDLanguage));
oldStrings.emplace_back(PtrToInt(lpszName),wIDLanguage);
}
return TRUE;
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 26 KiB

After

Width:  |  Height:  |  Size: 19 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 77 KiB

After

Width:  |  Height:  |  Size: 48 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 73 KiB

After

Width:  |  Height:  |  Size: 45 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

After

Width:  |  Height:  |  Size: 1.1 KiB

View File

@@ -561,6 +561,7 @@ int WINAPI wWinMain( HINSTANCE hInstance, HINSTANCE hPrevInstance, LPTSTR lpstrC
else if (wcsstr(lpstrCmdLine,L"-toggle")!=NULL) open=MSG_TOGGLE;
else if (wcsstr(lpstrCmdLine,L"-open")!=NULL) open=MSG_OPEN;
else if (wcsstr(lpstrCmdLine,L"-settings")!=NULL) open=MSG_SETTINGS;
else if (wcsstr(lpstrCmdLine,L"-reloadsettings")!=NULL) open=MSG_RELOADSETTINGS;
else if (wcsstr(lpstrCmdLine,L"-exit")!=NULL) open=MSG_EXIT;
{

View File

@@ -16,9 +16,7 @@ CMenuAccessible::CMenuAccessible( CMenuContainer *pOwner )
CreateStdAccessibleObject(pOwner->m_hWnd,OBJID_CLIENT,IID_IAccessible,(void**)&m_pStdAccessible);
}
CMenuAccessible::~CMenuAccessible( void )
{
}
CMenuAccessible::~CMenuAccessible( void ) = default;
void CMenuAccessible::Reset( void )
{

View File

@@ -95,13 +95,13 @@ CStdCommand7 g_StdCommands7[]={
{L"user_videos",0,NULL,L"$Menu.UserVideosTip",NULL,&FOLDERID_Videos},
{L"control_panel",0,L"$Menu.ControlPanel",L"$Menu.ControlPanelTip",NULL,&FOLDERID_ControlPanelFolder,NULL,StdMenuItem::MENU_TRACK},
{L"pc_settings",IDS_PCSETTINGS,L"$Menu.PCSettings",L"",L"%windir%\\ImmersiveControlPanel\\SystemSettings.exe,10",NULL,NULL,StdMenuItem::MENU_TRACK,CStdCommand7::ITEM_SINGLE},
{L"network_connections",0,NULL,L"$Menu.NetworkTip",NULL,&FOLDERID_ConnectionsFolder},
{L"network_connections",0,NULL,L"$Menu.NetworkTip",NULL,&FOLDERID_ConnectionsFolder,NULL,0,CStdCommand7::ITEM_NODRIVES},
{L"network",0,NULL,NULL,NULL,&FOLDERID_NetworkFolder,NULL,0,CStdCommand7::ITEM_SINGLE},
{L"printers",0,NULL,L"$Menu.PrintersTip",NULL,&FOLDERID_PrintersFolder},
{L"printers",0,NULL,L"$Menu.PrintersTip",NULL,&FOLDERID_PrintersFolder,NULL,0,CStdCommand7::ITEM_NODRIVES},
{L"fonts",0,NULL,NULL,NULL,&FOLDERID_Fonts},
{L"desktop",0,NULL,NULL,NULL,&FOLDERID_Desktop},
{L"admin",0,NULL,L"$Menu.AdminToolsTip",L"imageres.dll,114",&FOLDERID_CommonAdminTools,NULL,StdMenuItem::MENU_TRACK},
{L"startup",0,NULL,NULL,NULL,&FOLDERID_Startup,NULL,StdMenuItem::MENU_TRACK},
{L"admin",0,NULL,L"$Menu.AdminToolsTip",L"imageres.dll,114",&FOLDERID_CommonAdminTools,NULL,StdMenuItem::MENU_TRACK,CStdCommand7::ITEM_NODRIVES},
{L"startup",0,NULL,NULL,NULL,&FOLDERID_Startup,NULL,StdMenuItem::MENU_TRACK,CStdCommand7::ITEM_NODRIVES},
{L"downloads",0,NULL,L"$Menu.DownloadTip",NULL,&FOLDERID_Downloads},
{L"games",0,NULL,L"$Menu.GamesTip",NULL,&FOLDERID_Games,NULL,StdMenuItem::MENU_TRACK},
{L"links",0,NULL,NULL,NULL,&FOLDERID_Links},
@@ -112,7 +112,7 @@ CStdCommand7 g_StdCommands7[]={
{L"lib_videos",IDS_LIB_VIDEOS_ITEM,NULL,L"$Menu.VideosLibTip",NULL,&FOLDERID_VideosLibrary},
{L"lib_tv",IDS_LIB_TV_ITEM,NULL,L"$Menu.RecordingsLibTip",NULL,&FOLDERID_RecordedTVLibrary},
{L"homegroup",0,NULL,L"$Menu.HomegroupTip",NULL,&FOLDERID_HomeGroup,NULL,0,CStdCommand7::ITEM_SINGLE},
{L"devices",0,NULL,NULL,NULL,NULL,L"::{26EE0668-A00A-44D7-9371-BEB064C98683}\\0\\::{A8A91A66-3A7D-4424-8D24-04E180695C7A}"},
{L"devices",0,NULL,NULL,NULL,NULL,L"::{26EE0668-A00A-44D7-9371-BEB064C98683}\\0\\::{A8A91A66-3A7D-4424-8D24-04E180695C7A}",0,CStdCommand7::ITEM_NODRIVES},
{L"defaults",0,NULL,NULL,NULL,NULL,L"::{26EE0668-A00A-44D7-9371-BEB064C98683}\\0\\::{17CD9488-1228-4B2F-88CE-4298E93E0966}",0,CStdCommand7::ITEM_SINGLE},
{L"apps",IDS_METRO_APPS,L"$Menu.Apps",NULL,L",2",NULL,NULL,StdMenuItem::MENU_TRACK,CStdCommand7::ITEM_FOLDER},

View File

@@ -15,6 +15,7 @@ struct CStdCommand7
ITEM_SINGLE=1, // this item never has sub-menu
ITEM_FOLDER=2, // this item always has sub-menu
ITEM_COMPUTER=4, // this item can be expanded only one level
ITEM_NODRIVES=8, // this item can never be expanded only one level
};
const wchar_t *command;
int nameID;

View File

@@ -15,9 +15,7 @@ public:
m_RefCount=0;
}
~CDropTargetProxy( void )
{
}
~CDropTargetProxy( void ) = default;
void Reset( void )
{

View File

@@ -489,7 +489,8 @@ void CItemManager::LoadIconData::Init( void )
HIMAGELIST_QueryInterface(m_TempLists[i],IID_IImageList2,(void**)&m_pTempLists[i]);
}
}
m_pFactory.CoCreateInstance(CLSID_WICImagingFactory);
if (FAILED(m_pFactory.CoCreateInstance(CLSID_WICImagingFactory)))
m_pFactory.CoCreateInstance(CLSID_WICImagingFactory1);
}
void CItemManager::LoadIconData::Close( void )
@@ -589,7 +590,7 @@ void CItemManager::Init( void )
m_RootGames=L"::{ED228FDF-9EA8-4870-83B1-96B02CFE0D52}\\";
wchar_t text[_MAX_PATH];
Strcpy(text,_countof(text),START_MENU_PINNED_ROOT L"\\");
Sprintf(text,_countof(text),L"%s\\",GetSettingString(L"PinnedItemsPath"));
DoEnvironmentSubst(text,_countof(text));
m_RootStartMenu3=text;
StringUpper(m_RootStartMenu3);
@@ -609,7 +610,7 @@ void CItemManager::Init( void )
{
int width, height;
pList->GetIconSize(&width,&height);
m_ListSizes.push_back(std::pair<int,int>(width,i));
m_ListSizes.emplace_back(width,i);
}
}
std::sort(m_ListSizes.begin(),m_ListSizes.end());
@@ -617,7 +618,7 @@ void CItemManager::Init( void )
CreateDefaultIcons();
LoadCacheFile();
ItemInfo &item=m_ItemInfos.insert(std::pair<unsigned int,ItemInfo>(0,ItemInfo()))->second;
ItemInfo &item=m_ItemInfos.emplace(0,ItemInfo())->second;
item.bIconOnly=true;
item.smallIcon=m_DefaultSmallIcon;
item.largeIcon=m_DefaultLargeIcon;
@@ -704,21 +705,21 @@ void CItemManager::CreateDefaultIcons( void )
icon.bitmap=BitmapFromIcon(LoadShellIcon(index,SMALL_ICON_SIZE),SMALL_ICON_SIZE);
else
icon.bitmap=NULL;
m_DefaultSmallIcon=&m_IconInfos.insert(std::pair<unsigned int,IconInfo>(0,icon))->second;
m_DefaultSmallIcon=&m_IconInfos.emplace(0,icon)->second;
icon.sizeType=ICON_SIZE_TYPE_LARGE;
if (index>=0)
icon.bitmap=BitmapFromIcon(LoadShellIcon(index,LARGE_ICON_SIZE),LARGE_ICON_SIZE);
else
icon.bitmap=NULL;
m_DefaultLargeIcon=&m_IconInfos.insert(std::pair<unsigned int,IconInfo>(0,icon))->second;
m_DefaultLargeIcon=&m_IconInfos.emplace(0,icon)->second;
icon.sizeType=ICON_SIZE_TYPE_EXTRA_LARGE;
if (index>=0)
icon.bitmap=BitmapFromIcon(LoadShellIcon(index,EXTRA_LARGE_ICON_SIZE),EXTRA_LARGE_ICON_SIZE);
else
icon.bitmap=NULL;
m_DefaultExtraLargeIcon=&m_IconInfos.insert(std::pair<unsigned int,IconInfo>(0,icon))->second;
m_DefaultExtraLargeIcon=&m_IconInfos.emplace(0,icon)->second;
}
CItemManager::LoadIconData &CItemManager::GetLoadIconData( void )
@@ -896,7 +897,7 @@ const CItemManager::ItemInfo *CItemManager::GetItemInfo( IShellItem *pItem, PIDL
}
if (!pInfo)
{
pInfo=&m_ItemInfos.insert(std::pair<unsigned int,ItemInfo>(hash,ItemInfo()))->second;
pInfo=&m_ItemInfos.emplace(hash,ItemInfo())->second;
pInfo->pidl.Clone(pidl);
pInfo->path=path;
pInfo->PATH=PATH;
@@ -978,7 +979,7 @@ const CItemManager::ItemInfo *CItemManager::GetItemInfo( CString path, int refre
}
if (!pInfo)
{
pInfo=&m_ItemInfos.insert(std::pair<unsigned int,ItemInfo>(hash,ItemInfo()))->second;
pInfo=&m_ItemInfos.emplace(hash,ItemInfo())->second;
if (!PATH.IsEmpty())
MenuParseDisplayName(path,&pInfo->pidl,NULL,NULL);
if (pInfo->pidl)
@@ -1076,7 +1077,7 @@ const CItemManager::ItemInfo *CItemManager::GetCustomIcon( const wchar_t *locati
}
if (!pInfo)
{
pInfo=&m_ItemInfos.insert(std::pair<unsigned int,ItemInfo>(hash,ItemInfo()))->second;
pInfo=&m_ItemInfos.emplace(hash,ItemInfo())->second;
pInfo->bIconOnly=true;
pInfo->bTemp=bTemp;
pInfo->iconPath=location;
@@ -1907,7 +1908,7 @@ void CItemManager::RefreshItemInfo( ItemInfo *pInfo, int refreshFlags, IShellIte
if (SUCCEEDED(store->GetValue(PKEY_MetroAppLauncher, &val)) && (val.vt == VT_I4 || val.vt == VT_UI4) && val.intVal)
{
newInfo.bLink = false;
pItem = target;
pItem = std::move(target);
pStore = store;
}
PropVariantClear(&val);
@@ -2597,7 +2598,7 @@ void CItemManager::StoreInCache( unsigned int hash, const wchar_t *path, HBITMAP
if ((refreshFlags&INFO_SMALL_ICON) && hSmallBitmap)
{
IconInfo *pInfo=&m_IconInfos.insert(std::pair<unsigned int,IconInfo>(hash,IconInfo()))->second;
IconInfo *pInfo=&m_IconInfos.emplace(hash,IconInfo())->second;
pInfo->sizeType=ICON_SIZE_TYPE_SMALL;
pInfo->bTemp=bTemp;
pInfo->bMetro=bMetro;
@@ -2607,7 +2608,7 @@ void CItemManager::StoreInCache( unsigned int hash, const wchar_t *path, HBITMAP
}
if ((refreshFlags&INFO_LARGE_ICON) && hLargeBitmap)
{
IconInfo *pInfo=&m_IconInfos.insert(std::pair<unsigned int,IconInfo>(hash,IconInfo()))->second;
IconInfo *pInfo=&m_IconInfos.emplace(hash,IconInfo())->second;
pInfo->sizeType=ICON_SIZE_TYPE_LARGE;
pInfo->bTemp=bTemp;
pInfo->bMetro=bMetro;
@@ -2617,7 +2618,7 @@ void CItemManager::StoreInCache( unsigned int hash, const wchar_t *path, HBITMAP
}
if ((refreshFlags&INFO_EXTRA_LARGE_ICON) && hExtraLargeBitmap)
{
IconInfo *pInfo=&m_IconInfos.insert(std::pair<unsigned int,IconInfo>(hash,IconInfo()))->second;
IconInfo *pInfo=&m_IconInfos.emplace(hash,IconInfo())->second;
pInfo->sizeType=ICON_SIZE_TYPE_EXTRA_LARGE;
pInfo->bTemp=bTemp;
pInfo->bMetro=bMetro;
@@ -2867,7 +2868,8 @@ void CItemManager::PreloadItemsThread( void )
else if (g_CacheFolders[i].folder==FOLDERID_ClassicPinned)
{
if (GetSettingInt(L"PinnedPrograms")!=PINNED_PROGRAMS_PINNED) continue;
wchar_t path[_MAX_PATH]=START_MENU_PINNED_ROOT;
wchar_t path[_MAX_PATH];
Strcpy(path,_countof(path),GetSettingString(L"PinnedItemsPath"));
DoEnvironmentSubst(path,_countof(path));
if (FAILED(SHParseDisplayName(path,NULL,&pidl,0,NULL)) || !pidl) continue;
if (FAILED(SHCreateItemFromIDList(pidl,IID_IShellItem,(void**)&pFolder)) || !pFolder) continue;
@@ -3273,7 +3275,7 @@ void CItemManager::LoadCacheFile( void )
bError=true;
break;
}
remapIcons.push_back(&m_IconInfos.insert(std::pair<unsigned int,IconInfo>(data.key,info))->second);
remapIcons.push_back(&m_IconInfos.emplace(data.key,info)->second);
}
else
{
@@ -3304,7 +3306,7 @@ void CItemManager::LoadCacheFile( void )
bError=true;
break;
}
ItemInfo &info=m_ItemInfos.insert(std::pair<unsigned int,ItemInfo>(data.key,ItemInfo()))->second;
ItemInfo &info=m_ItemInfos.emplace(data.key,ItemInfo())->second;
info.writestamp=data.writestamp;
info.createstamp=data.createstamp;
@@ -3568,7 +3570,7 @@ void CItemManager::ClearCache( void )
m_IconInfos.clear();
m_MetroItemInfos10.clear();
CreateDefaultIcons();
ItemInfo &item=m_ItemInfos.insert(std::pair<unsigned int,ItemInfo>(0,ItemInfo()))->second;
ItemInfo &item=m_ItemInfos.emplace(0,ItemInfo())->second;
item.bIconOnly=true;
item.smallIcon=m_DefaultSmallIcon;
item.largeIcon=m_DefaultLargeIcon;

View File

@@ -470,7 +470,6 @@ STDAPI ShGetKnownFolderItem(REFKNOWNFOLDERID rfid, IShellItem **ppItem );
HBITMAP ColorizeMonochromeImage(HBITMAP bitmap, DWORD color);
#define TASKBAR_PINNED_ROOT L"%APPDATA%\\Microsoft\\Internet Explorer\\Quick Launch\\User Pinned\\TaskBar"
#define START_MENU_PINNED_ROOT L"%APPDATA%\\OpenShell\\Pinned"
#define STARTSCREEN_COMMAND L"startscreen.lnk"
#define USERASSIST_LINKS_KEY L"Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\UserAssist\\{F4E57C4B-2036-45F0-A9AB-443BCFE33D9F}\\Count"
#define USERASSIST_APPIDS_KEY L"Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\UserAssist\\{CEBFF5CD-ACE2-4F4F-9178-9926F41749EA}\\Count"

View File

@@ -11,6 +11,7 @@
#include "Settings.h"
#include "SettingsUI.h"
#include "SettingsUIHelper.h"
#include "FileHelper.h"
#include "Translations.h"
#include "LogManager.h"
#include "FNVHash.h"
@@ -2782,12 +2783,19 @@ void CMenuContainer::ActivateItem( int index, TActivateType type, const POINT *p
info.lpVerb=MAKEINTRESOURCEA(res-verbOffset);
info.lpVerbW=MAKEINTRESOURCEW(res-verbOffset);
info.nShow=SW_SHOWNORMAL;
bool bOpenTruePath=false;
wchar_t targetlnkPath[_MAX_PATH]; // path to target.lnk in a fake folder
wchar_t dir[_MAX_PATH];
if (SHGetPathFromIDList(pItemPidl1,dir))
{
PathRemoveFileSpec(dir);
if (GetFileAttributes(dir)!=INVALID_FILE_ATTRIBUTES)
info.lpDirectoryW=dir;
if (_stricmp(command,"open")==0 && GetSettingBool(L"OpenTruePath") && GetFakeFolder(targetlnkPath,_countof(targetlnkPath),dir))
bOpenTruePath=true;
else
{
PathRemoveFileSpec(dir);
if (GetFileAttributes(dir)!=INVALID_FILE_ATTRIBUTES)
info.lpDirectoryW=dir;
}
}
if (pPt)
{
@@ -2803,6 +2811,10 @@ void CMenuContainer::ActivateItem( int index, TActivateType type, const POINT *p
if (bRefresh || bRefreshMain)
info.fMask|=CMIC_MASK_NOASYNC; // wait for delete/link commands to finish so we can refresh the menu
// we don't want our virtual folder to appear in Explorer's frequent list
if (wcsncmp(item.pItemInfo->PATH, L"::{82E749ED-B971-4550-BAF7-06AA2BF7E836}", 40) == 0)
info.fMask &= ~CMIC_MASK_FLAG_LOG_USAGE;
s_bPreventClosing=true;
for (auto& it : s_Menus)
{
@@ -2818,9 +2830,20 @@ void CMenuContainer::ActivateItem( int index, TActivateType type, const POINT *p
::SetForegroundWindow(g_OwnerWindow);
::SetWindowPos(g_OwnerWindow,HWND_TOPMOST,rc.left,rc.top,rc.right-rc.left,rc.bottom-rc.top,0);
LOG_MENU(LOG_EXECUTE,L"Invoke command, ptr=%p, command='%S'",this,command);
HRESULT hr=pInvokeMenu->InvokeCommand((LPCMINVOKECOMMANDINFO)&info);
LOG_MENU(LOG_EXECUTE,L"Invoke command, ptr=%p, res=%d",this,hr);
if (type==ACTIVATE_EXECUTE && SUCCEEDED(hr))
bool executeSuccess;
if (bOpenTruePath) // we are trying to open a fake folder, directly open target.lnk instead
{
HINSTANCE hinst=ShellExecute(NULL,NULL,targetlnkPath,NULL,NULL,SW_SHOWNORMAL);
LOG_MENU(LOG_EXECUTE,L"Invoke command, ptr=%p, res=%d",this,hinst);
executeSuccess=static_cast<int>(reinterpret_cast<uintptr_t>(hinst))>=32;
}
else
{
HRESULT hr=pInvokeMenu->InvokeCommand((LPCMINVOKECOMMANDINFO)&info);
LOG_MENU(LOG_EXECUTE,L"Invoke command, ptr=%p, res=%d",this,hr);
executeSuccess=SUCCEEDED(hr);
}
if (type==ACTIVATE_EXECUTE && executeSuccess)
{
if (bTrackRecent)
{

View File

@@ -315,6 +315,7 @@ bool CMenuContainer::s_bShowTopEmpty=false;
bool CMenuContainer::s_bNoDragDrop=false;
bool CMenuContainer::s_bNoContextMenu=false;
bool CMenuContainer::s_bExpandLinks=false;
bool CMenuContainer::s_bSingleClickFolders=false;
bool CMenuContainer::s_bLogicalSort=false;
bool CMenuContainer::s_bExtensionSort=false;
bool CMenuContainer::s_bAllPrograms=false;
@@ -334,6 +335,7 @@ bool CMenuContainer::s_bDragMovable;
bool CMenuContainer::s_bRightDrag;
bool CMenuContainer::s_bLockWorkArea;
bool CMenuContainer::s_bPendingSearchEnter;
bool CMenuContainer::s_bMoreResults;
std::vector<CMenuContainer*> CMenuContainer::s_Menus;
volatile HWND CMenuContainer::s_FirstMenu, CMenuContainer::s_SearchMenu;
CSearchManager::SearchResults CMenuContainer::s_SearchResults;
@@ -343,7 +345,8 @@ bool CMenuContainer::s_bMRULoaded=false;
const CItemManager::ItemInfo *CMenuContainer::s_JumpAppInfo;
CJumpList CMenuContainer::s_JumpList;
int CMenuContainer::s_TaskBarId;
HWND CMenuContainer::s_TaskBar, CMenuContainer::s_StartButton;
HWND CMenuContainer::s_TaskBar;
HWND CMenuContainer::s_StartButton; // custom start button (if any)
UINT CMenuContainer::s_TaskBarEdge;
RECT CMenuContainer::s_StartRect;
HWND CMenuContainer::s_LastFGWindow;
@@ -443,7 +446,10 @@ LRESULT CALLBACK CMenuContainer::SubclassSearchBox( HWND hWnd, UINT uMsg, WPARAM
SetBkColor(hdc,GetSysColor(COLOR_WINDOW));
SetBkMode(hdc,TRANSPARENT);
SetTextColor(hdc,s_Skin.Search_text_colors[1]);
DrawText(hdc,pParent->m_Items[pParent->m_SearchIndex].name,-1,&rc,DT_SINGLELINE|DT_EDITCONTROL|(s_bRTL?DT_RIGHT:DT_LEFT));
if (GetSettingBool(L"SearchHint"))
DrawText(hdc,GetSettingString(L"SearchHintText"),-1,&rc,DT_SINGLELINE|DT_EDITCONTROL|(s_bRTL?DT_RIGHT:DT_LEFT));
else
DrawText(hdc,pParent->m_Items[pParent->m_SearchIndex].name,-1,&rc,DT_SINGLELINE|DT_EDITCONTROL|(s_bRTL?DT_RIGHT:DT_LEFT));
SelectObject(hdc,font0);
}
return res;
@@ -1066,7 +1072,7 @@ void CMenuContainer::AddStandardItems( void )
const StdMenuItem *pInlineParent=NULL;
int searchProviderIndex=-1;
m_SearchProvidersCount=0;
MenuSkin::TIconSize mainIconSize=s_Skin.Main_icon_size;
bool bSecondColumn=false;
for (const StdMenuItem *pStdItem=m_pStdItem;;pStdItem++)
{
if (pStdItem->id==MENU_LAST)
@@ -1084,8 +1090,8 @@ void CMenuContainer::AddStandardItems( void )
if (m_bSubMenu && pStdItem->id==s_ShutdownCommand)
continue;
if (pStdItem->id==MENU_COLUMN_BREAK && m_bTwoColumns)
mainIconSize=s_Skin.Main2_icon_size;
if (pStdItem->id==MENU_COLUMN_BREAK && !m_bSubMenu && s_Skin.TwoColumns)
bSecondColumn=true;
int stdOptions=GetStdOptions(pStdItem->id);
if (!(stdOptions&MENU_ENABLED)) continue;
@@ -1266,6 +1272,10 @@ void CMenuContainer::AddStandardItems( void )
item.bSplit=item.bFolder && (item.pStdItem->settings&StdMenuItem::MENU_SPLIT_BUTTON)!=0;
// get icon
MenuSkin::TIconSize mainIconSize=!bSecondColumn ? s_Skin.Main_icon_size : s_Skin.Main2_icon_size;
if (item.bInline && mainIconSize==MenuSkin::ICON_SIZE_NONE)
mainIconSize=s_Skin.Main_icon_size;
CItemManager::TIconSizeType iconSizeType;
int refreshFlags;
if (bSearchProvider7 || m_bSubMenu)
@@ -1579,6 +1589,23 @@ static const wchar_t *g_MfuIgnoreExes[]={
L"WUAPP.EXE",
};
static bool IgnoreUserAssistItem(const UserAssistItem& uaItem)
{
static constexpr const wchar_t* ignoredNames[] =
{
DESKTOP_APP_ID,
L"Microsoft.Windows.ShellExperienceHost_cw5n1h2txyewy!App",
};
for (const auto& name : ignoredNames)
{
if (_wcsicmp(uaItem.name, name) == 0)
return true;
}
return false;
}
void CMenuContainer::GetRecentPrograms( std::vector<MenuItem> &items, int maxCount )
{
bool bShowMetro=GetSettingBool(L"RecentMetroApps");
@@ -1931,9 +1958,9 @@ void CMenuContainer::GetRecentPrograms( std::vector<MenuItem> &items, int maxCou
continue;
}
if (_wcsicmp(uaItem.name,DESKTOP_APP_ID)==0)
if (IgnoreUserAssistItem(uaItem))
{
LOG_MENU(LOG_MFU,L"UserAssist: Dropping: Ignore desktop");
LOG_MENU(LOG_MFU,L"UserAssist: Dropping: Ignore '%s'",uaItem.name);
continue;
}
@@ -2237,7 +2264,7 @@ void CMenuContainer::AddJumpListItems( std::vector<MenuItem> &items )
{
ILFree(item.pItem1);
item.pItem1=pidl2.Detach();
pItem=pItem2;
pItem=std::move(pItem2);
}
}
}
@@ -2499,9 +2526,9 @@ void CMenuContainer::InitItems( void )
m_Items.resize(MAX_MENU_ITEMS);
}
if (m_Options&CONTAINER_CONTROLPANEL)
if (m_Options&CONTAINER_CONTROLPANEL && !(m_Options&CONTAINER_NOSUBFOLDERS))
{
// expand Administrative Tools. must be done after the sorting because we don't want the folder to jump to the top
// expand Administrative Tools when displaying as a menu. must be done after the sorting because we don't want the folder to jump to the top
unsigned int AdminToolsHash=CalcFNVHash(L"::{D20EA4E1-3957-11D2-A40B-0C5020524153}");
for (std::vector<MenuItem>::iterator it=m_Items.begin();it!=m_Items.end();++it)
if (it->nameHash==AdminToolsHash)
@@ -2740,9 +2767,9 @@ bool CMenuContainer::InitSearchItems( void )
{
sepHeight=s_Skin.ItemSettings[s_Skin.More_bitmap_Size.cx?MenuSkin::LIST_SEPARATOR_SPLIT:MenuSkin::LIST_SEPARATOR].itemHeight;
itemHeight=s_Skin.ItemSettings[MenuSkin::LIST_ITEM].itemHeight;
// total height minus the search box and the "more results"/"search internet"
// total height minus the search box and the "more results"/"search internet", if present
maxHeight=m_Items[m_SearchIndex].itemRect.top-s_Skin.Main_search_padding.top-s_Skin.Search_padding.top;
maxHeight-=itemHeight*(m_SearchItemCount-1);
maxHeight-=itemHeight*(m_SearchItemCount-(s_bMoreResults?1:2));
if (!s_SearchResults.bSearching && !HasMoreResults())
maxHeight+=itemHeight;
}
@@ -2936,25 +2963,28 @@ bool CMenuContainer::InitSearchItems( void )
if (s_bWin7Style)
{
UpdateAccelerators(m_OriginalCount,(int)m_Items.size());
MenuItem &item=m_Items[m_SearchIndex-m_SearchItemCount+1];
if (s_SearchResults.bSearching)
if (s_bMoreResults)
{
item.id=MENU_SEARCH_EMPTY;
item.name=FindTranslation(L"Menu.Searching",L"Searching...");
item.pItemInfo=g_ItemManager.GetCustomIcon(L"imageres.dll,8",CItemManager::ICON_SIZE_TYPE_SMALL);
}
else
{
item.id=MENU_MORE_RESULTS;
item.name=FindTranslation(L"Menu.MoreResults",L"See more results");
item.pItemInfo=g_ItemManager.GetCustomIcon(L"imageres.dll,177",CItemManager::ICON_SIZE_TYPE_SMALL);
MenuItem &item=m_Items[m_SearchIndex-m_SearchItemCount+1];
if (s_SearchResults.bSearching)
{
item.id=MENU_SEARCH_EMPTY;
item.name=FindTranslation(L"Menu.Searching",L"Searching...");
item.pItemInfo=g_ItemManager.GetCustomIcon(L"imageres.dll,8",CItemManager::ICON_SIZE_TYPE_SMALL);
}
else
{
item.id=MENU_MORE_RESULTS;
item.name=FindTranslation(L"Menu.MoreResults",L"See more results");
item.pItemInfo=g_ItemManager.GetCustomIcon(L"imageres.dll,177",CItemManager::ICON_SIZE_TYPE_SMALL);
}
}
}
else
{
m_ScrollCount=(int)m_Items.size();
bool bInternet=GetSettingBool(L"SearchInternet");
if (s_SearchResults.bSearching)
bool bInternet=GetSettingBool(L"SearchInternet");
if (s_bMoreResults && s_SearchResults.bSearching)
{
MenuItem item(MENU_SEARCH_EMPTY);
item.name=FindTranslation(L"Menu.Searching",L"Searching...");
@@ -2969,7 +2999,7 @@ bool CMenuContainer::InitSearchItems( void )
item.name=FindTranslation(L"Menu.NoMatch",L"No items match your search.");
m_Items.push_back(item);
}
if (HasMoreResults())
if (s_bMoreResults && HasMoreResults())
{
{
MenuItem item(MENU_SEPARATOR);
@@ -5057,7 +5087,7 @@ void CMenuContainer::UpdateSearchResults( bool bForceShowAll )
g_SearchManager.BeginSearch(s_SearchResults.currentString);
s_SearchResults.bSearching=true;
s_bPendingSearchEnter=false;
if (s_bWin7Style)
if (s_bWin7Style && s_bMoreResults)
{
MenuItem &item=m_Items[m_SearchIndex-m_SearchItemCount+1];
item.id=MENU_SEARCH_EMPTY;
@@ -6798,7 +6828,7 @@ LRESULT CMenuContainer::OnLButtonDblClick( UINT uMsg, WPARAM wParam, LPARAM lPar
ClientToScreen(&pt);
if (s_bWin7Style && item.id==MENU_PROGRAMS) // only single clicks for All Programs
OnLButtonDown(WM_LBUTTONDOWN,wParam,lParam,bHandled);
else if (!bArrow) // ignore double-click on the split arrow
else if (!bArrow && item.id!=MENU_APPS) // ignore double-click on the split arrow and Apps folder
ActivateItem(index,ACTIVATE_EXECUTE,&pt);
return 0;
}
@@ -6822,7 +6852,7 @@ LRESULT CMenuContainer::OnLButtonUp( UINT uMsg, WPARAM wParam, LPARAM lParam, BO
const MenuItem &item=m_Items[index];
POINT pt2=pt;
ClientToScreen(&pt2);
if (!item.bFolder)
if (!item.bFolder || (s_bSingleClickFolders && item.id!=MENU_PROGRAMS && item.id!=MENU_APPS && !bArrow)) // never open All Programs, Apps folder, or jumplists with single click
{
if (item.jumpIndex>=0 && m_bHotArrow)
{
@@ -7495,6 +7525,7 @@ RECT CMenuContainer::CalculateWorkArea( const RECT &taskbarRect )
return rc;
}
// Calculates start menu position
POINT CMenuContainer::CalculateCorner( void )
{
RECT margin={0,0,0,0};
@@ -7502,10 +7533,24 @@ POINT CMenuContainer::CalculateCorner( void )
AdjustWindowRect(&margin,GetWindowLong(GWL_STYLE),FALSE);
POINT corner;
if (m_Options&CONTAINER_LEFT)
corner.x=s_MainMenuLimits.left+margin.left;
if (IsWin11())
{
// start button can be in the center on Win11
// we want to show menu at the position of start button
if (m_Options&CONTAINER_LEFT)
corner.x=s_StartRect.left+margin.left;
else
corner.x=s_StartRect.right+margin.right;
}
else
corner.x=s_MainMenuLimits.right+margin.right;
{
// start button can be only in corner on older systems
// we can use screen limits to determine menu position
if (m_Options&CONTAINER_LEFT)
corner.x=s_MainMenuLimits.left+margin.left;
else
corner.x=s_MainMenuLimits.right+margin.right;
}
if (m_Options&CONTAINER_TOP)
{
@@ -7624,6 +7669,9 @@ HWND CMenuContainer::ToggleStartMenu( int taskbarId, bool bKeyboard, bool bAllPr
// initialize all settings
bool bErr=false;
HMONITOR initialMonitor=MonitorFromWindow(s_TaskBar,MONITOR_DEFAULTTONEAREST);
// note: GetTaskbarPosition properly identifies monitor in case of multi-monitor setup and automatic taskbar hiding
GetTaskbarPosition(s_TaskBar,NULL,&initialMonitor,NULL);
int dpi=CItemManager::GetDPI(true);
if (!CItemManager::GetDPIOverride() && GetWinVersion()>=WIN_VER_WIN81)
{
@@ -7671,6 +7719,7 @@ HWND CMenuContainer::ToggleStartMenu( int taskbarId, bool bKeyboard, bool bAllPr
g_ItemManager.ResetTempIcons();
s_ScrollMenus=GetSettingInt(L"ScrollType");
s_bExpandLinks=GetSettingBool(L"ExpandFolderLinks");
s_bSingleClickFolders=GetSettingBool(L"SingleClickFolders");
s_bLogicalSort=GetSettingBool(L"NumericSort");
s_MaxRecentDocuments=GetSettingInt(L"MaxRecentDocuments");
s_ShellFormat=RegisterClipboardFormat(CFSTR_SHELLIDLIST);
@@ -7688,6 +7737,7 @@ HWND CMenuContainer::ToggleStartMenu( int taskbarId, bool bKeyboard, bool bAllPr
s_bDisableHover=false;
s_bDragClosed=false;
s_bPendingSearchEnter=false;
s_bMoreResults=GetSettingBool(L"MoreResults");
InitTouchHelper();
bool bRemote=GetSystemMetrics(SM_REMOTESESSION)!=0;
@@ -8056,7 +8106,8 @@ HWND CMenuContainer::ToggleStartMenu( int taskbarId, bool bKeyboard, bool bAllPr
}
else
{
wchar_t path[_MAX_PATH]=START_MENU_PINNED_ROOT;
wchar_t path[_MAX_PATH];
Strcpy(path,_countof(path),GetSettingString(L"PinnedItemsPath"));
DoEnvironmentSubst(path,_countof(path));
SHCreateDirectory(NULL,path);
s_PinFolder=path;
@@ -8068,7 +8119,8 @@ HWND CMenuContainer::ToggleStartMenu( int taskbarId, bool bKeyboard, bool bAllPr
{
bool bPinned=GetSettingInt(L"PinnedPrograms")==PINNED_PROGRAMS_PINNED;
bool bShortcut=GetSettingBool(L"StartScreenShortcut");
wchar_t path[_MAX_PATH]=START_MENU_PINNED_ROOT L"\\" STARTSCREEN_COMMAND;
wchar_t path[_MAX_PATH];
Sprintf(path,_countof(path),L"%s\\%s",GetSettingString(L"PinnedItemsPath"),STARTSCREEN_COMMAND);
DoEnvironmentSubst(path,_countof(path));
if (bPinned)
{

View File

@@ -876,6 +876,7 @@ private:
static bool s_bNoDragDrop; // disables drag/drop
static bool s_bNoContextMenu; // disables the context menu
static bool s_bExpandLinks; // expand links to folders
static bool s_bSingleClickFolders; // open links to folders with one click instead of two
static bool s_bLogicalSort; // use StrCmpLogical instead of CompareString
static bool s_bExtensionSort; // sort file names by extension
static bool s_bAllPrograms; // this is the All Programs menu of the Windows start menu
@@ -895,6 +896,7 @@ private:
static bool s_bRightDrag; // dragging with the right mouse button
static bool s_bLockWorkArea; // changes to the work area are ignored
static bool s_bPendingSearchEnter; // Enter was pressed before the search results were ready
static bool s_bMoreResults; // shows the "Show More Results" item at the bottom of searches
static RECT s_MenuLimits; // area of the main monitor accessible to all menus
static RECT s_MainMenuLimits; // area of the main monitor accessible by the main menu
static DWORD s_TaskbarState; // the state of the taskbar (ABS_AUTOHIDE and ABS_ALWAYSONTOP)

View File

@@ -526,7 +526,7 @@ bool CSearchManager::SearchScope::ParseSearchConnector( const wchar_t *fname )
CComPtr<IXMLDOMNode> pNext;
if (pScopeItem->get_nextSibling(&pNext)!=S_OK)
break;
pScopeItem=pNext;
pScopeItem=std::move(pNext);
}
return true;
}
@@ -639,7 +639,8 @@ void CSearchManager::SearchThread( void )
// pinned folder
if (searchRequest.bPinnedFolder)
{
wchar_t path[_MAX_PATH]=START_MENU_PINNED_ROOT;
wchar_t path[_MAX_PATH];
Strcpy(path,_countof(path),GetSettingString(L"PinnedItemsPath"));
DoEnvironmentSubst(path,_MAX_PATH);
CComPtr<IShellItem> pFolder;
if (SUCCEEDED(SHCreateItemFromParsingName(path,NULL,IID_IShellItem,(void**)&pFolder)))
@@ -798,7 +799,7 @@ void CSearchManager::SearchThread( void )
CSession session;
if (SUCCEEDED(dataSource.OpenFromInitializationString(L"provider=Search.CollatorDSO.1;EXTENDED PROPERTIES=\"Application=Windows\"")) && SUCCEEDED(session.Open(dataSource)))
{
std::list<SearchScope> scopeList;
std::vector<SearchScope> scopeList;
if (searchRequest.bSearchMetroSettings && !m_bMetroSettingsFound)
{
@@ -1104,7 +1105,7 @@ void CSearchManager::SearchThread( void )
command0.Close();
continue;
}
for (std::list<SearchScope>::iterator it=scopeList.begin();it!=scopeList.end();++it)
for (auto it=scopeList.begin();it!=scopeList.end();++it)
{
if (it->roots.empty())
continue;
@@ -1122,7 +1123,7 @@ void CSearchManager::SearchThread( void )
else
{
len+=Strcpy(query+len,_countof(query)-len,L" AND System.Search.Store='FILE' AND System.ItemType!='.settingcontent-ms'");
for (std::list<SearchScope>::iterator it2=scopeList.begin();it2!=it;++it2)
for (auto it2=scopeList.begin();it2!=it;++it2)
{
if (it2->categoryHash==CATEGORY_METROSETTING)
continue;

View File

@@ -36,7 +36,7 @@ public:
struct SearchCategory
{
SearchCategory( void ) {}
SearchCategory( void ) = default;
SearchCategory( const SearchCategory &cat )
{
search.Clone(cat.search);

View File

@@ -30,6 +30,19 @@ const int DEFAULT_TASK_OPACITY10=85; // 85%
///////////////////////////////////////////////////////////////////////////////
CString RgbToBgr(const wchar_t* str)
{
CString retval;
retval.Format(L"%06X", RgbToBgr(ParseColor(str)));
return retval;
}
CString BgrToRgb(const wchar_t* str)
{
return RgbToBgr(str);
}
class CSkinSettingsDlg: public CResizeableDlg<CSkinSettingsDlg>
{
public:
@@ -422,7 +435,7 @@ void CSkinSettingsDlg::UpdateSkinSettings( void )
if (!option.bEnabled || bLocked)
image|=SETTING_STATE_DISABLED;
if (option.bValue && option.type>SKIN_OPTION_BOOL)
Sprintf(text,_countof(text),L"%s: %s",option.label,option.sValue);
Sprintf(text,_countof(text),L"%s: %s",option.label,(option.type==SKIN_OPTION_COLOR)?BgrToRgb(option.sValue):option.sValue);
else
Sprintf(text,_countof(text),L"%s",option.label);
@@ -482,9 +495,7 @@ LRESULT CSkinSettingsDlg::OnCustomDraw( int idCtrl, LPNMHDR pnmh, BOOL& bHandled
if (TreeView_GetItemRect(m_Tree,(HTREEITEM)pDraw->nmcd.dwItemSpec,&rc,TRUE))
{
const wchar_t *str=m_CurrentSkin.Options[pDraw->nmcd.lItemlParam].sValue;
wchar_t *end;
COLORREF color=wcstoul(str,&end,16);
SetDCBrushColor(pDraw->nmcd.hdc,color&0xFFFFFF);
SetDCBrushColor(pDraw->nmcd.hdc,ParseColor(str));
SelectObject(pDraw->nmcd.hdc,GetStockObject(DC_BRUSH));
SelectObject(pDraw->nmcd.hdc,GetStockObject(BLACK_PEN));
Rectangle(pDraw->nmcd.hdc,rc.right,rc.top,rc.right+rc.bottom-rc.top,rc.bottom-1);
@@ -690,15 +701,14 @@ LRESULT CSkinSettingsDlg::OnBrowse( WORD wNotifyCode, WORD wID, HWND hWndCtl, BO
CString str;
m_EditBox.GetWindowText(str);
str.TrimLeft(); str.TrimRight();
wchar_t *end;
COLORREF val=wcstol(str,&end,16)&0xFFFFFF;
COLORREF val=RgbToBgr(ParseColor(str));
static COLORREF customColors[16];
CHOOSECOLOR choose={sizeof(choose),m_hWnd,NULL,val,customColors};
choose.Flags=CC_ANYCOLOR|CC_FULLOPEN|CC_RGBINIT;
if (ChooseColor(&choose))
{
wchar_t text[100];
Sprintf(text,_countof(text),L"%06X",choose.rgbResult);
Sprintf(text,_countof(text),L"%06X",BgrToRgb(choose.rgbResult));
m_EditBox.SetWindowText(text);
ApplyEditBox();
m_Tree.Invalidate();
@@ -717,7 +727,11 @@ void CSkinSettingsDlg::ApplyEditBox( void )
CString str;
m_EditBox.GetWindowText(str);
str.TrimLeft(); str.TrimRight();
m_CurrentSkin.Options[m_EditItemIndex].sValue=str;
auto& option=m_CurrentSkin.Options[m_EditItemIndex];
if (option.type==SKIN_OPTION_COLOR)
option.sValue=RgbToBgr(str);
else
option.sValue=str;
StoreSkinOptions();
}
}
@@ -730,7 +744,7 @@ void CSkinSettingsDlg::ItemSelected( HTREEITEM hItem, int index, bool bEnabled )
const MenuSkin::Option &option=m_CurrentSkin.Options[m_EditItemIndex];
wchar_t text[256];
if (option.bValue && option.type>SKIN_OPTION_BOOL)
Sprintf(text,_countof(text),L"%s: %s",option.label,option.sValue);
Sprintf(text,_countof(text),L"%s: %s",option.label,(option.type==SKIN_OPTION_COLOR)?BgrToRgb(option.sValue):option.sValue);
else
Sprintf(text,_countof(text),L"%s",option.label);
TVITEM item={TVIF_TEXT,m_EditItem,0,0,text};
@@ -745,7 +759,10 @@ void CSkinSettingsDlg::ItemSelected( HTREEITEM hItem, int index, bool bEnabled )
const MenuSkin::Option &option=m_CurrentSkin.Options[index];
if (option.type>SKIN_OPTION_BOOL)
mode=option.type;
text=option.sValue;
if (option.type==SKIN_OPTION_COLOR)
text=BgrToRgb(option.sValue);
else
text=option.sValue;
}
RECT rc;
@@ -1742,7 +1759,7 @@ LRESULT CEditMenuDlg::OnBrowseLink( WORD wNotifyCode, WORD wID, HWND hWndCtl, BO
{
wchar_t text[_MAX_PATH];
GetDlgItemText(IDC_COMBOLINK,text,_countof(text));
if (BrowseLinkHelper(m_hWnd,text))
if (BrowseLinkHelper(m_hWnd,text,false))
{
SetDlgItemText(IDC_COMBOLINK,text);
SendMessage(WM_COMMAND,MAKEWPARAM(IDC_COMBOLINK,CBN_KILLFOCUS));
@@ -2437,7 +2454,7 @@ LRESULT CEditMenuDlg7::OnBrowseLink( WORD wNotifyCode, WORD wID, HWND hWndCtl, B
{
wchar_t text[_MAX_PATH];
GetDlgItemText(IDC_EDITLINK2,text,_countof(text));
if (BrowseLinkHelper(m_hWnd,text))
if (BrowseLinkHelper(m_hWnd,text,false))
{
SetDlgItemText(IDC_EDITLINK2,text);
SendMessage(WM_COMMAND,MAKEWPARAM(IDC_EDITLINK2,EN_KILLFOCUS));
@@ -2725,8 +2742,11 @@ void CCustomMenuDlg7::CItemList::UpdateItem( int index )
str=LoadStringEx(IDS_ITEM_SHOW2);
else if ((menuItem.settings&StdMenuItem::MENU_NOEXPAND) && !(g_StdCommands7[menuItem.stdItemIndex].flags&CStdCommand7::ITEM_FOLDER))
str=LoadStringEx(IDS_ITEM_SHOW);
else if ((menuItem.settings&StdMenuItem::MENU_SINGLE_EXPAND) && (g_StdCommands7[menuItem.stdItemIndex].flags&CStdCommand7::ITEM_COMPUTER))
str=LoadStringEx(IDS_ITEM_DRIVES);
else if ((menuItem.settings&StdMenuItem::MENU_SINGLE_EXPAND) && !(g_StdCommands7[menuItem.stdItemIndex].flags&CStdCommand7::ITEM_NODRIVES))
if (g_StdCommands7[menuItem.stdItemIndex].flags&CStdCommand7::ITEM_COMPUTER)
str=LoadStringEx(IDS_ITEM_DRIVES);
else
str=LoadStringEx(IDS_ITEM_LINKS);
else
str=LoadStringEx(IDS_ITEM_MENU);
ListView_SetItemText(m_hWnd,index,2,(wchar_t*)(const wchar_t*)str);
@@ -3155,13 +3175,12 @@ LRESULT CCustomMenuDlg7::CItemList::OnSelEndOk( WORD wNotifyCode, WORD wID, HWND
if (m_Column==2)
{
// state
CString str;
menuItem.settings&=~CEditMenuDlg7::SETTINGS_MASK;
if (sel==0)
menuItem.settings|=StdMenuItem::MENU_ITEM_DISABLED;
else if (sel==1 && !(g_StdCommands7[menuItem.stdItemIndex].flags&(CStdCommand7::ITEM_SINGLE|CStdCommand7::ITEM_FOLDER)))
menuItem.settings|=StdMenuItem::MENU_NOEXPAND;
else if (sel==3 && (g_StdCommands7[menuItem.stdItemIndex].flags&CStdCommand7::ITEM_COMPUTER))
else if (sel==3 && !(g_StdCommands7[menuItem.stdItemIndex].flags&CStdCommand7::ITEM_NODRIVES))
menuItem.settings|=StdMenuItem::MENU_SINGLE_EXPAND;
}
UpdateItem(m_Line);
@@ -3308,12 +3327,17 @@ void CCustomMenuDlg7::CItemList::CreateCombo( int line, int column )
str=LoadStringEx(IDS_ITEM_DRIVES);
m_Combo.SendMessage(CB_ADDSTRING,0,(LPARAM)(const wchar_t*)str);
}
else if (!(g_StdCommands7[menuItem.stdItemIndex].flags&CStdCommand7::ITEM_NODRIVES))
{
str=LoadStringEx(IDS_ITEM_LINKS);
m_Combo.SendMessage(CB_ADDSTRING,0,(LPARAM)(const wchar_t*)str);
}
}
if (menuItem.settings&StdMenuItem::MENU_ITEM_DISABLED)
m_Combo.SendMessage(CB_SETCURSEL,0);
else if ((g_StdCommands7[menuItem.stdItemIndex].flags&(CStdCommand7::ITEM_SINGLE|CStdCommand7::ITEM_FOLDER)) || (menuItem.settings&StdMenuItem::MENU_NOEXPAND))
m_Combo.SendMessage(CB_SETCURSEL,1);
else if ((g_StdCommands7[menuItem.stdItemIndex].flags&CStdCommand7::ITEM_COMPUTER) && (menuItem.settings&StdMenuItem::MENU_SINGLE_EXPAND))
else if (!(g_StdCommands7[menuItem.stdItemIndex].flags&CStdCommand7::ITEM_NODRIVES) && (menuItem.settings&StdMenuItem::MENU_SINGLE_EXPAND))
m_Combo.SendMessage(CB_SETCURSEL,3);
else
m_Combo.SendMessage(CB_SETCURSEL,2);
@@ -4140,38 +4164,50 @@ CSetting g_Settings[]={
{L"Nothing",CSetting::TYPE_RADIO,IDS_OPEN_NOTHING,IDS_OPEN_NOTHING_TIP},
{L"ClassicMenu",CSetting::TYPE_RADIO,IDS_OPEN_CSM,IDS_OPEN_CSM_TIP},
{L"WindowsMenu",CSetting::TYPE_RADIO,IDS_OPEN_WSM,IDS_OPEN_WSM_TIP},
{L"Command",CSetting::TYPE_RADIO,IDS_OPEN_CMD,IDS_OPEN_CMD_TIP},
{L"Both",CSetting::TYPE_RADIO,IDS_OPEN_BOTH,IDS_OPEN_BOTH_TIP,0,CSetting::FLAG_HIDDEN},
{L"MouseClickCommand",CSetting::TYPE_STRING,IDS_OPEN_CMD_TEXT,IDS_OPEN_CMD_TEXT_TIP,"%userprofile%",0,L"MouseClick=3",L"Command"},
{L"ShiftClick",CSetting::TYPE_INT,IDS_SHIFT_LCLICK,IDS_SHIFT_LCLICK_TIP,2,CSetting::FLAG_BASIC},
{L"Nothing",CSetting::TYPE_RADIO,IDS_OPEN_NOTHING,IDS_OPEN_NOTHING_TIP},
{L"ClassicMenu",CSetting::TYPE_RADIO,IDS_OPEN_CSM,IDS_OPEN_CSM_TIP},
{L"WindowsMenu",CSetting::TYPE_RADIO,IDS_OPEN_WSM,IDS_OPEN_WSM_TIP},
{L"Command",CSetting::TYPE_RADIO,IDS_OPEN_CMD,IDS_OPEN_CMD_TIP},
{L"Both",CSetting::TYPE_RADIO,IDS_OPEN_BOTH,IDS_OPEN_BOTH_TIP,0,CSetting::FLAG_HIDDEN},
/* {L"Desktop",CSetting::TYPE_RADIO,IDS_OPEN_DESKTOP,IDS_OPEN_DESKTOP_TIP,0,CSetting::FLAG_HIDDEN},
{L"Cortana",CSetting::TYPE_RADIO,IDS_OPEN_CORTANA,IDS_OPEN_CORTANA_TIP},*/
{L"ShiftClickCommand",CSetting::TYPE_STRING,IDS_OPEN_CMD_TEXT,IDS_OPEN_CMD_TEXT_TIP,"%systemdrive%",0,L"ShiftClick=3",L"Command"},
{L"WinKey",CSetting::TYPE_INT,IDS_WIN_KEY,IDS_WIN_KEY_TIP,1,CSetting::FLAG_BASIC},
{L"Nothing",CSetting::TYPE_RADIO,IDS_OPEN_NOTHING,IDS_OPEN_NOTHING_TIP},
{L"ClassicMenu",CSetting::TYPE_RADIO,IDS_OPEN_CSM,IDS_OPEN_CSM_TIP},
{L"WindowsMenu",CSetting::TYPE_RADIO,IDS_OPEN_WSM,IDS_OPEN_WSM_TIP},
{L"Command",CSetting::TYPE_RADIO,IDS_OPEN_CMD,IDS_OPEN_CMD_TIP},
{L"Both",CSetting::TYPE_RADIO,IDS_OPEN_BOTH,IDS_OPEN_BOTH_TIP},
{L"Desktop",CSetting::TYPE_RADIO,IDS_OPEN_DESKTOP,IDS_OPEN_DESKTOP_TIP},
{L"WinKeyCommand",CSetting::TYPE_STRING,IDS_OPEN_CMD_TEXT,IDS_OPEN_CMD_TEXT_TIP,"cmd",0,L"WinKey=3",L"Command"},
{L"ShiftWin",CSetting::TYPE_INT,IDS_SHIFT_WIN,IDS_SHIFT_WIN_TIP,2,CSetting::FLAG_BASIC},
{L"Nothing",CSetting::TYPE_RADIO,IDS_OPEN_NOTHING,IDS_OPEN_NOTHING_TIP},
{L"ClassicMenu",CSetting::TYPE_RADIO,IDS_OPEN_CSM,IDS_OPEN_CSM_TIP},
{L"WindowsMenu",CSetting::TYPE_RADIO,IDS_OPEN_WSM,IDS_OPEN_WSM_TIP},
{L"Command",CSetting::TYPE_RADIO,IDS_OPEN_CMD,IDS_OPEN_CMD_TIP},
{L"Both",CSetting::TYPE_RADIO,IDS_OPEN_BOTH,IDS_OPEN_BOTH_TIP},
/* {L"Desktop",CSetting::TYPE_RADIO,IDS_OPEN_DESKTOP,IDS_OPEN_DESKTOP_TIP,0,CSetting::FLAG_HIDDEN},
{L"Cortana",CSetting::TYPE_RADIO,IDS_OPEN_CORTANA,IDS_OPEN_CORTANA_TIP},*/
{L"ShiftWinCommand",CSetting::TYPE_STRING,IDS_OPEN_CMD_TEXT,IDS_OPEN_CMD_TEXT_TIP,"powershell",0,L"ShiftWin=3",L"Command"},
{L"MiddleClick",CSetting::TYPE_INT,IDS_MCLICK,IDS_MCLICK_TIP,0},
{L"Nothing",CSetting::TYPE_RADIO,IDS_OPEN_NOTHING,IDS_OPEN_NOTHING_TIP},
{L"ClassicMenu",CSetting::TYPE_RADIO,IDS_OPEN_CSM,IDS_OPEN_CSM_TIP},
{L"WindowsMenu",CSetting::TYPE_RADIO,IDS_OPEN_WSM,IDS_OPEN_WSM_TIP},
{L"Command",CSetting::TYPE_RADIO,IDS_OPEN_CMD,IDS_OPEN_CMD_TIP},
/* {L"Both",CSetting::TYPE_RADIO,IDS_OPEN_BOTH,IDS_OPEN_BOTH_TIP,0,CSetting::FLAG_HIDDEN},
{L"Desktop",CSetting::TYPE_RADIO,IDS_OPEN_DESKTOP,IDS_OPEN_DESKTOP_TIP,0,CSetting::FLAG_HIDDEN},
{L"Cortana",CSetting::TYPE_RADIO,IDS_OPEN_CORTANA,IDS_OPEN_CORTANA_TIP},*/
{L"MiddleClickCommand",CSetting::TYPE_STRING,IDS_OPEN_CMD_TEXT,IDS_OPEN_CMD_TEXT_TIP,"taskmgr",0,L"MiddleClick=3",L"Command"},
{L"Hover",CSetting::TYPE_INT,IDS_HOVER,IDS_HOVER_TIP,0},
{L"Nothing",CSetting::TYPE_RADIO,IDS_OPEN_NOTHING,IDS_OPEN_NOTHING_TIP},
{L"ClassicMenu",CSetting::TYPE_RADIO,IDS_OPEN_CSM,IDS_OPEN_CSM_TIP},
{L"WindowsMenu",CSetting::TYPE_RADIO,IDS_OPEN_WSM,IDS_OPEN_WSM_TIP},
{L"Command",CSetting::TYPE_RADIO,IDS_OPEN_CMD,IDS_OPEN_CMD_TIP},
{L"HoverCommand",CSetting::TYPE_STRING,IDS_OPEN_CMD_TEXT,IDS_OPEN_CMD_TEXT_TIP,"",0,L"Hover=3",L"Command"},
{L"StartHoverDelay",CSetting::TYPE_INT,IDS_HOVER_DELAY,IDS_HOVER_DELAY_TIP,1000,0,L"Hover",L"Hover"},
{L"ShiftRight",CSetting::TYPE_BOOL,IDS_RIGHT_SHIFT,IDS_RIGHT_SHIFT_TIP,0},
{L"CSMHotkey",CSetting::TYPE_HOTKEY,IDS_CSM_HOTKEY,IDS_CSM_HOTKEY_TIP,0},
@@ -4246,6 +4282,7 @@ CSetting g_Settings[]={
{L"PinnedPrograms",CSetting::TYPE_INT,IDS_PINNED_PROGRAMS,IDS_PINNED_PROGRAMS_TIP,PINNED_PROGRAMS_PINNED},
{L"FastItems",CSetting::TYPE_RADIO,IDS_FAST_ITEMS,IDS_FAST_ITEMS_TIP},
{L"PinnedItems",CSetting::TYPE_RADIO,IDS_PINNED_ITEMS,IDS_PINNED_ITEMS_TIP},
{L"PinnedItemsPath",CSetting::TYPE_DIRECTORY,IDS_PINNED_PATH,IDS_PINNED_PATH_TIP,L"%APPDATA%\\OpenShell\\Pinned",0,L"PinnedPrograms=1",L"PinnedItems"},
{L"RecentPrograms",CSetting::TYPE_INT,IDS_RECENT_PROGRAMS,IDS_RECENT_PROGRAMS_TIP,RECENT_PROGRAMS_RECENT,CSetting::FLAG_BASIC},
{L"None",CSetting::TYPE_RADIO,IDS_NO_RECENT,IDS_NO_RECENT_TIP},
{L"Recent",CSetting::TYPE_RADIO,IDS_SHOW_RECENT,IDS_SHOW_RECENT_TIP},
@@ -4314,11 +4351,14 @@ CSetting g_Settings[]={
{L"UserNameCommand",CSetting::TYPE_STRING,IDS_NAME_COMMAND,IDS_NAME_COMMAND_TIP,L"control nusrmgr.cpl"},
{L"SearchFilesCommand",CSetting::TYPE_STRING,IDS_SEARCH_COMMAND,IDS_SEARCH_COMMAND_TIP,L"search-ms:",CSetting::FLAG_MENU_CLASSIC_BOTH},
{L"ExpandFolderLinks",CSetting::TYPE_BOOL,IDS_EXPAND_LINKS,IDS_EXPAND_LINKS_TIP,1},
{L"SingleClickFolders",CSetting::TYPE_BOOL,IDS_NO_DBLCLICK,IDS_NO_DBLCLICK_TIP,0},
{L"OpenTruePath",CSetting::TYPE_BOOL,IDS_OPEN_TRUE_PATH,IDS_OPEN_TRUE_PATH_TIP,1},
{L"EnableTouch",CSetting::TYPE_BOOL,IDS_ENABLE_TOUCH,IDS_ENABLE_TOUCH_TIP,1},
{L"EnableAccessibility",CSetting::TYPE_BOOL,IDS_ACCESSIBILITY,IDS_ACCESSIBILITY_TIP,1},
{L"ShowNextToTaskbar",CSetting::TYPE_BOOL,IDS_NEXTTASKBAR,IDS_NEXTTASKBAR_TIP,0},
{L"PreCacheIcons",CSetting::TYPE_BOOL,IDS_CACHE_ICONS,IDS_CACHE_ICONS_TIP,1,CSetting::FLAG_COLD},
{L"DelayIcons",CSetting::TYPE_BOOL,IDS_DELAY_ICONS,IDS_DELAY_ICONS_TIP,1,CSetting::FLAG_COLD},
{L"BoldSettings",CSetting::TYPE_BOOL,IDS_BOLD_SETTINGS,IDS_BOLD_SETTINGS_TIP,1},
{L"ReportSkinErrors",CSetting::TYPE_BOOL,IDS_SKIN_ERRORS,IDS_SKIN_ERRORS_TIP,0},
{L"SearchBoxSettings",CSetting::TYPE_GROUP,IDS_SEARCH_BOX},
@@ -4327,6 +4367,8 @@ CSetting g_Settings[]={
{L"Normal",CSetting::TYPE_RADIO,IDS_SEARCH_BOX_SHOW,IDS_SEARCH_BOX_SHOW_TIP},
{L"Tab",CSetting::TYPE_RADIO,IDS_SEARCH_BOX_TAB,IDS_SEARCH_BOX_TAB_TIP},
{L"SearchSelect",CSetting::TYPE_BOOL,IDS_SEARCH_BOX_SEL,IDS_SEARCH_BOX_SEL_TIP,1,0,L"SearchBox=1",L"Normal"},
{L"SearchHint",CSetting::TYPE_BOOL,IDS_SEARCH_HINT,IDS_SEARCH_HINT_TIP,0,0,L"SearchBox"},
{L"SearchHintText",CSetting::TYPE_STRING,IDS_NEW_SEARCH_HINT,IDS_NEW_SEARCH_HINT_TIP,L"",0,L"#SearchHint",L"SearchHint"},
{L"SearchTrack",CSetting::TYPE_BOOL,IDS_SEARCH_TRACK,IDS_SEARCH_TRACK_TIP,1,0,L"SearchBox"},
{L"SearchResults",CSetting::TYPE_INT,IDS_SEARCH_MAX2,IDS_SEARCH_MAX_TIP2,5,CSetting::FLAG_MENU_CLASSIC_BOTH,L"SearchBox"},
{L"SearchResultsMax",CSetting::TYPE_INT,IDS_SEARCH_MAX3,IDS_SEARCH_MAX_TIP3,20,CSetting::FLAG_MENU_CLASSIC_BOTH,L"SearchBox"},
@@ -4341,6 +4383,7 @@ CSetting g_Settings[]={
{L"SearchContents",CSetting::TYPE_BOOL,IDS_SEARCH_CONTENTS,IDS_SEARCH_CONTENTS_TIP,1,0,L"#SearchFiles",L"SearchFiles"},
{L"SearchCategories",CSetting::TYPE_BOOL,IDS_SEARCH_CATEGORIES,IDS_SEARCH_CATEGORIES_TIP,1,0,L"#SearchFiles",L"SearchFiles"},
{L"SearchInternet",CSetting::TYPE_BOOL,IDS_SEARCH_INTERNET,IDS_SEARCH_INTERNET_TIP,1,0,L"SearchBox"},
{L"MoreResults",CSetting::TYPE_BOOL,IDS_MORE_RESULTS,IDS_MORE_RESULTS_TIP,1,0,L"SearchBox"},
{L"Look",CSetting::TYPE_GROUP,IDS_LOOK_SETTINGS},
{L"SmallIconSize",CSetting::TYPE_INT,IDS_SMALL_SIZE_SM,IDS_SMALL_SIZE_SM_TIP,-1,CSetting::FLAG_COLD}, // 16 for DPI<=96, 20 for DPI<=120, 24 otherwise
@@ -4622,6 +4665,48 @@ void UpgradeSettings( bool bShared )
}
}
static CString GetWindowsBrandingString()
{
CString retval;
if (GetWinVersion() >= WIN_VER_WIN10)
{
auto winbrand = LoadLibraryEx(L"winbrand.dll", nullptr, LOAD_LIBRARY_SEARCH_SYSTEM32);
if (winbrand)
{
PWSTR (WINAPI * BrandingFormatString)(PCWSTR pstrFormat);
BrandingFormatString = (decltype(BrandingFormatString))GetProcAddress(winbrand, "BrandingFormatString");
if (BrandingFormatString)
{
auto osName = BrandingFormatString(L"%WINDOWS_LONG%");
if (osName)
{
retval = osName;
GlobalFree(osName);
}
}
FreeLibrary(winbrand);
}
}
if (retval.IsEmpty())
{
// fallback for older Windows
wchar_t title[256] = L"Windows";
if (CRegKey reg; reg.Open(HKEY_LOCAL_MACHINE, L"Software\\Microsoft\\Windows NT\\CurrentVersion", KEY_READ) == ERROR_SUCCESS)
{
ULONG size = _countof(title);
reg.QueryStringValue(L"ProductName", title, &size);
}
retval = title;
}
return retval;
}
void UpdateSettings( void )
{
{
@@ -4744,16 +4829,10 @@ void UpdateSettings( void )
UpdateSetting(L"NumericSort",CComVariant(SHRestricted(REST_NOSTRCMPLOGICAL)?0:1),false);
wchar_t title[256]=L"Windows";
ULONG size=_countof(title);
{
CRegKey regTitle;
if (regTitle.Open(HKEY_LOCAL_MACHINE,L"Software\\Microsoft\\Windows NT\\CurrentVersion",KEY_READ)==ERROR_SUCCESS)
regTitle.QueryStringValue(L"ProductName",title,&size);
}
UpdateSetting(L"MenuCaption",CComVariant(title),false);
UpdateSetting(L"MenuCaption",CComVariant(GetWindowsBrandingString()),false);
size=_countof(title);
wchar_t title[256]{};
ULONG size=_countof(title);
if (!GetUserNameEx(NameDisplay,title,&size))
{
// GetUserNameEx may fail (for example on Home editions). use the login name
@@ -4884,7 +4963,7 @@ void UpdateSettings( void )
if (GetWinVersion()>WIN_VER_WIN7)
{
int color=GetSystemGlassColor8();
UpdateSetting(L"TaskbarColor",CComVariant(((color&0xFF)<<16)|(color&0xFF00)|((color>>16)&0xFF)),false);
UpdateSetting(L"TaskbarColor",CComVariant(RgbToBgr(color)),false);
}
if (GetWinVersion()<=WIN_VER_WIN7)
@@ -4984,15 +5063,15 @@ void UpdateSettings( void )
HIGHCONTRAST contrast={sizeof(contrast)};
if (SystemParametersInfo(SPI_GETHIGHCONTRAST,sizeof(contrast),&contrast,0) && (contrast.dwFlags&HCF_HIGHCONTRASTON))
{
options1=L"CAPTION=1\nUSER_IMAGE=0\nUSER_NAME=0\nCENTER_NAME=0\nSMALL_ICONS=0\nTHICK_BORDER=0\nSOLID_SELECTION=1";
options2=L"NO_ICONS=1\nUSER_IMAGE=1\nUSER_NAME=0\nCENTER_NAME=0\nSMALL_ICONS=0\nTHICK_BORDER=0\nSOLID_SELECTION=1";
options3=L"USER_IMAGE=1\nSMALL_ICONS=0\nTHICK_BORDER=0\nSOLID_SELECTION=1";
options1=L"CAPTION=1\nUSER_IMAGE=0\nUSER_NAME=0\nCENTER_NAME=0\nSMALL_ICONS=0\nTHICK_BORDER=0\nSOLID_SELECTION=1\n";
options2=L"NO_ICONS=1\nUSER_IMAGE=1\nUSER_NAME=0\nCENTER_NAME=0\nSMALL_ICONS=0\nTHICK_BORDER=0\nSOLID_SELECTION=1\n";
options3=L"USER_IMAGE=1\nSMALL_ICONS=0\nTHICK_BORDER=0\nSOLID_SELECTION=1\n";
}
else
{
options1=L"CAPTION=1\nUSER_IMAGE=0\nUSER_NAME=0\nCENTER_NAME=0\nSMALL_ICONS=0\nTHICK_BORDER=0\nSOLID_SELECTION=0";
options2=L"NO_ICONS=1\nUSER_IMAGE=1\nUSER_NAME=0\nCENTER_NAME=0\nSMALL_ICONS=0\nTHICK_BORDER=0\nSOLID_SELECTION=0";
options3=L"USER_IMAGE=1\nSMALL_ICONS=0\nTHICK_BORDER=0\nSOLID_SELECTION=0";
options1=L"CAPTION=1\nUSER_IMAGE=0\nUSER_NAME=0\nCENTER_NAME=0\nSMALL_ICONS=0\nTHICK_BORDER=0\nSOLID_SELECTION=0\n";
options2=L"NO_ICONS=1\nUSER_IMAGE=1\nUSER_NAME=0\nCENTER_NAME=0\nSMALL_ICONS=0\nTHICK_BORDER=0\nSOLID_SELECTION=0\n";
options3=L"USER_IMAGE=1\nSMALL_ICONS=0\nTHICK_BORDER=0\nSOLID_SELECTION=0\n";
}
}
else if (GetWinVersion()<WIN_VER_WIN8)
@@ -5000,25 +5079,25 @@ void UpdateSettings( void )
BOOL comp=FALSE;
skin12=(SUCCEEDED(DwmIsCompositionEnabled(&comp)) && comp)?L"Windows Aero":L"Windows Basic";
skin3=L"Windows Aero";
options1=L"CAPTION=1\nUSER_IMAGE=0\nUSER_NAME=0\nCENTER_NAME=0\nSMALL_ICONS=0\nLARGE_FONT=0\nDISABLE_MASK=0\nWHITE_SUBMENUS=1";
options2=L"NO_ICONS=1\nUSER_IMAGE=1\nUSER_NAME=0\nCENTER_NAME=0\nSMALL_ICONS=0\nLARGE_FONT=0\nDISABLE_MASK=0\nWHITE_SUBMENUS=1";
options3=L"USER_IMAGE=1\nSMALL_ICONS=0\nLARGE_FONT=0\nDISABLE_MASK=0\nWHITE_SUBMENUS=1";
options1=L"CAPTION=1\nUSER_IMAGE=0\nUSER_NAME=0\nCENTER_NAME=0\nSMALL_ICONS=0\nLARGE_FONT=0\nDISABLE_MASK=0\nWHITE_SUBMENUS=1\n";
options2=L"NO_ICONS=1\nUSER_IMAGE=1\nUSER_NAME=0\nCENTER_NAME=0\nSMALL_ICONS=0\nLARGE_FONT=0\nDISABLE_MASK=0\nWHITE_SUBMENUS=1\n";
options3=L"USER_IMAGE=1\nSMALL_ICONS=0\nLARGE_FONT=0\nDISABLE_MASK=0\nWHITE_SUBMENUS=1\n";
}
else if (GetWinVersion()<WIN_VER_WIN10)
{
skin12=L"Windows 8";
skin3=L"Windows 8";
options1=L"CAPTION=1\nUSER_IMAGE=0\nUSER_NAME=0\nCENTER_NAME=0\nSMALL_ICONS=0\nLARGE_FONT=0\nDISABLE_MASK=0\nOPAQUE=0\nWHITE_SUBMENUS=1";
options2=L"NO_ICONS=1\nUSER_IMAGE=1\nUSER_NAME=0\nCENTER_NAME=0\nSMALL_ICONS=0\nLARGE_FONT=0\nDISABLE_MASK=0\nOPAQUE=0\nGLASS_SHADOW=0\nBLACK_TEXT=0\nBLACK_FRAMES=0\nWHITE_SUBMENUS=1";
options3=L"USER_IMAGE=1\nSMALL_ICONS=0\nLARGE_FONT=0\nDISABLE_MASK=0\nOPAQUE=0\nGLASS_SHADOW=0\nBLACK_TEXT=0\nBLACK_FRAMES=0\nWHITE_SUBMENUS=1";
options1=L"CAPTION=1\nUSER_IMAGE=0\nUSER_NAME=0\nCENTER_NAME=0\nSMALL_ICONS=0\nLARGE_FONT=0\nDISABLE_MASK=0\nOPAQUE=0\nWHITE_SUBMENUS=1\n";
options2=L"NO_ICONS=1\nUSER_IMAGE=1\nUSER_NAME=0\nCENTER_NAME=0\nSMALL_ICONS=0\nLARGE_FONT=0\nDISABLE_MASK=0\nOPAQUE=0\nGLASS_SHADOW=0\nBLACK_TEXT=0\nBLACK_FRAMES=0\nWHITE_SUBMENUS=1\n";
options3=L"USER_IMAGE=1\nSMALL_ICONS=0\nLARGE_FONT=0\nDISABLE_MASK=0\nOPAQUE=0\nGLASS_SHADOW=0\nBLACK_TEXT=0\nBLACK_FRAMES=0\nWHITE_SUBMENUS=1\n";
}
else
{
skin12=L"Metro";
skin3=L"Metro";
options1=L"CAPTION=1\nUSER_IMAGE=0\nUSER_NAME=0\nCENTER_NAME=0\nSMALL_ICONS=0\nLARGE_FONT=0\nICON_FRAMES=1\nOPAQUE=0";
options2=L"NO_ICONS=1\nUSER_IMAGE=1\nUSER_NAME=0\nCENTER_NAME=0\nSMALL_ICONS=0\nLARGE_FONT=0\nICON_FRAMES=1\nOPAQUE=0";
options3=L"USER_IMAGE=1\nSMALL_ICONS=0\nLARGE_FONT=0\nICON_FRAMES=1\nOPAQUE=0";
options1=L"CAPTION=1\nUSER_IMAGE=0\nUSER_NAME=0\nCENTER_NAME=0\nSMALL_ICONS=0\nLARGE_FONT=0\nICON_FRAMES=1\nOPAQUE=0\n";
options2=L"NO_ICONS=1\nUSER_IMAGE=1\nUSER_NAME=0\nCENTER_NAME=0\nSMALL_ICONS=0\nLARGE_FONT=0\nICON_FRAMES=1\nOPAQUE=0\n";
options3=L"USER_IMAGE=1\nSMALL_ICONS=0\nLARGE_FONT=0\nICON_FRAMES=1\nOPAQUE=0\n";
}
UpdateSetting(L"SkinC1",CComVariant(skin12),false);
UpdateSetting(L"SkinOptionsC1",CComVariant(options1),false);

View File

@@ -1778,7 +1778,7 @@ bool MenuSkin::LoadSkin( HMODULE hMod, const wchar_t *variation, const wchar_t *
var.label=token;
if (var.labelEn.IsEmpty())
var.labelEn=var.label;
Variations.push_back(std::pair<int,Variation>(res,var));
Variations.emplace_back(res,var);
LOG_MENU(LOG_OPEN,L"Variation found: name=%s, id=%d",token,res);
}
else
@@ -3235,10 +3235,14 @@ void GetSkinsPath( wchar_t *path )
{
GetModuleFileName(g_Instance,path,_MAX_PATH);
*PathFindFileName(path)=0;
#ifdef BUILD_SETUP
Strcat(path,_MAX_PATH,L"Skins\\");
#else
Strcat(path,_MAX_PATH,L"..\\Skins\\");
#ifndef BUILD_SETUP
if (!PathIsDirectory(path))
{
*PathFindFileName(path) = 0;
Strcat(path,_MAX_PATH,L"..\\Skins\\");
}
#endif
}

View File

@@ -154,6 +154,7 @@ LRESULT CStartButton::OnCreate( UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& b
OnThemeChanged(WM_THEMECHANGED,0,0,bHandled);
m_bPressed=true;
SetPressed(false);
ResizeClient(m_Size.cx,m_Size.cy);
bHandled=FALSE;
return 0;
}
@@ -534,12 +535,12 @@ void CStartButton::LoadBitmap( void )
if (!m_Bitmap)
{
int id;
int dpi=CItemManager::GetDPI(false);
int dpi=GetDpi(GetParent());
if (dpi<120)
id=IDB_BUTTON96;
else if (dpi<144)
id=IDB_BUTTON120;
else if (dpi<180)
else if (dpi<168)
id=IDB_BUTTON144;
else
id=IDB_BUTTON180;
@@ -604,55 +605,12 @@ void CStartButton::LoadBitmap( void )
static std::map<int,CStartButton> g_StartButtons;
HWND CreateStartButton( int taskbarId, HWND taskBar, HWND rebar, const RECT &rcTask )
HWND CreateStartButton( int taskbarId, HWND taskBar, HWND rebar )
{
bool bRTL=(GetWindowLongPtr(rebar,GWL_EXSTYLE)&WS_EX_LAYOUTRTL)!=0;
DWORD styleTopmost=GetWindowLongPtr(taskBar,GWL_EXSTYLE)&WS_EX_TOPMOST;
CStartButton &button=g_StartButtons[taskbarId];
button.Create(taskBar,NULL,NULL,WS_POPUP,styleTopmost|WS_EX_TOOLWINDOW|WS_EX_LAYERED,0U,(void*)(intptr_t)(taskbarId*2+(bRTL?1:0)));
SIZE size=button.GetSize();
RECT rcButton;
MONITORINFO info;
UINT uEdge=GetTaskbarPosition(taskBar,&info,NULL,NULL);
if (uEdge==ABE_LEFT || uEdge==ABE_RIGHT)
{
if (GetSettingInt(L"StartButtonType")!=START_BUTTON_CUSTOM || !GetSettingBool(L"StartButtonAlign"))
rcButton.left=(rcTask.left+rcTask.right-size.cx)/2;
else if (uEdge==ABE_LEFT)
rcButton.left=rcTask.left;
else
rcButton.left=rcTask.right-size.cx;
rcButton.top=rcTask.top;
}
else
{
if (bRTL)
rcButton.left=rcTask.right-size.cx;
else
rcButton.left=rcTask.left;
if (GetSettingInt(L"StartButtonType")!=START_BUTTON_CUSTOM || !GetSettingBool(L"StartButtonAlign"))
rcButton.top=(rcTask.top+rcTask.bottom-size.cy)/2;
else if (uEdge==ABE_TOP)
rcButton.top=rcTask.top;
else
rcButton.top=rcTask.bottom-size.cy;
}
rcButton.right=rcButton.left+size.cx;
rcButton.bottom=rcButton.top+size.cy;
g_bAllowMoveButton=true;
button.SetWindowPos(HWND_TOP,&rcButton,SWP_SHOWWINDOW|SWP_NOOWNERZORDER|SWP_NOACTIVATE);
g_bAllowMoveButton=false;
RECT rc;
IntersectRect(&rc,&rcButton,&info.rcMonitor);
HRGN rgn=CreateRectRgn(rc.left-rcButton.left,rc.top-rcButton.top,rc.right-rcButton.left,rc.bottom-rcButton.top);
if (!SetWindowRgn(button,rgn,FALSE))
{
AddTrackedObject(rgn);
DeleteObject(rgn);
}
button.UpdateButton();
return button.m_hWnd;
}

View File

@@ -12,7 +12,7 @@ enum TStartButtonType
// START_BUTTON_METRO,
};
HWND CreateStartButton( int taskbarId, HWND taskBar, HWND rebar, const RECT &rcTask );
HWND CreateStartButton( int taskbarId, HWND taskBar, HWND rebar );
void DestroyStartButton( int taskbarId );
void UpdateStartButton( int taskbarId );
void PressStartButton( int taskbarId, bool bPressed );

View File

@@ -47,7 +47,7 @@ static HWND g_Tooltip;
static TOOLINFO g_StartButtonTool;
static bool g_bHotkeyShift;
static int g_HotkeyCSM, g_HotkeyWSM, g_HotkeyShiftID, g_HotkeyCSMID, g_HotkeyWSMID;
static HHOOK g_ProgHook, g_StartHook, g_AppManagerHook, g_NewWindowHook, g_StartMenuHook;
static HHOOK g_ProgHook, g_StartHook, g_StartMouseHook, g_AppManagerHook, g_NewWindowHook, g_StartMenuHook;
static bool g_bAllProgramsTimer;
static bool g_bInMenu;
static DWORD g_LastClickTime;
@@ -79,6 +79,7 @@ enum
OPEN_NOTHING,
OPEN_CLASSIC,
OPEN_WINDOWS,
OPEN_CUSTOM,
OPEN_BOTH,
OPEN_DESKTOP,
OPEN_CORTANA,
@@ -401,6 +402,7 @@ static TaskbarInfo *FindTaskBarInfoBar( HWND bar )
static LRESULT CALLBACK HookProgManThread( int code, WPARAM wParam, LPARAM lParam );
static LRESULT CALLBACK HookDesktopThread( int code, WPARAM wParam, LPARAM lParam );
static LRESULT CALLBACK HookDesktopThreadMouse(int code, WPARAM wParam, LPARAM lParam);
static BOOL CALLBACK FindTooltipEnum( HWND hwnd, LPARAM lParam )
{
@@ -615,12 +617,12 @@ UINT GetTaskbarPosition( HWND taskBar, MONITORINFO *pInfo, HMONITOR *pMonitor, R
if (pRc->right>rc.right) pRc->right=rc.right;
}
}
HMONITOR monitor=MonitorFromRect(&appbar.rc,MONITOR_DEFAULTTONEAREST);
if (pMonitor) *pMonitor=monitor;
if (pInfo)
{
pInfo->cbSize=sizeof(MONITORINFO);
HMONITOR monitor=MonitorFromRect(&appbar.rc,MONITOR_DEFAULTTONEAREST);
GetMonitorInfo(monitor,pInfo);
if (pMonitor) *pMonitor=monitor;
}
return appbar.uEdge;
}
@@ -670,21 +672,45 @@ UINT GetTaskbarPosition( HWND taskBar, MONITORINFO *pInfo, HMONITOR *pMonitor, R
bool PointAroundStartButton( size_t taskbarId, const CPoint &pt )
{
const TaskbarInfo *taskBar=GetTaskbarInfo(taskbarId);
if (!taskBar || !taskBar->startButton) return false;
RECT rc;
if (!taskBar || !(taskBar->startButton || taskBar->oldButton)) return false;
CRect rc;
GetWindowRect(taskBar->taskBar,&rc);
if (!PtInRect(&rc,pt))
return false;
UINT uEdge=GetTaskbarPosition(taskBar->taskBar,NULL,NULL,NULL);
bool rtl=GetWindowLongPtr(taskBar->taskBar,GWL_EXSTYLE)&WS_EX_LAYOUTRTL;
CRect rcStart;
if (taskBar->startButton)
GetWindowRect(taskBar->startButton,&rcStart);
CRect rcOld;
if (taskBar->oldButton)
{
GetWindowRect(taskBar->oldButton,&rcOld);
if (IsWin11())
{
// on Win11 the Start button rectangle is a bit smaller that actual XAML active area
// lets make it a bit wider to avoid accidental original Start menu triggers
const int adjust=ScaleForDpi(taskBar->taskBar,1);
if (rtl)
rcOld.left-=adjust;
else
rcOld.right+=adjust;
}
}
rc.UnionRect(&rcStart,&rcOld);
// check if the point is inside the start button rect
GetWindowRect(taskBar->startButton,&rc);
UINT uEdge=GetTaskbarPosition(taskBar->taskBar,NULL,NULL,NULL);
if (uEdge==ABE_LEFT || uEdge==ABE_RIGHT)
return pt.y<rc.bottom;
else if (GetWindowLongPtr(taskBar->taskBar,GWL_EXSTYLE)&WS_EX_LAYOUTRTL)
return pt.x>rc.left;
return pt.y>=rc.top && pt.y<rc.bottom;
else if (rtl)
return pt.x>rc.left && pt.x<=rc.right;
else
return pt.x<rc.right;
return pt.x>=rc.left && pt.x<rc.right;
}
// declare few interfaces so we don't need the Win8 SDK
@@ -1185,24 +1211,156 @@ void EnableHotkeys( THotkeys enable )
}
}
static void UpdateStartButtonPosition(const TaskbarInfo* taskBar, const WINDOWPOS* pPos)
{
if (IsStartButtonSmallIcons(taskBar->taskbarId) != IsTaskbarSmallIcons())
RecreateStartButton(taskBar->taskbarId);
RECT rcTask;
GetWindowRect(taskBar->taskBar, &rcTask);
MONITORINFO info;
UINT uEdge = GetTaskbarPosition(taskBar->taskBar, &info, NULL, NULL);
DWORD buttonFlags = SWP_NOACTIVATE | SWP_NOOWNERZORDER | SWP_NOSIZE;
if (IsWindowVisible(taskBar->taskBar))
buttonFlags |= SWP_SHOWWINDOW;
else
buttonFlags |= SWP_HIDEWINDOW;
APPBARDATA appbar = { sizeof(appbar) };
if (SHAppBarMessage(ABM_GETSTATE, &appbar) & ABS_AUTOHIDE)
{
bool bHide = false;
if (uEdge == ABE_LEFT)
bHide = (rcTask.right < info.rcMonitor.left + 5);
else if (uEdge == ABE_RIGHT)
bHide = (rcTask.left > info.rcMonitor.right - 5);
else if (uEdge == ABE_TOP)
bHide = (rcTask.bottom < info.rcMonitor.top + 5);
else
bHide = (rcTask.top > info.rcMonitor.bottom - 5);
if (bHide)
buttonFlags = (buttonFlags & ~SWP_SHOWWINDOW) | SWP_HIDEWINDOW;
}
if (uEdge == ABE_TOP || uEdge == ABE_BOTTOM)
{
if (rcTask.left < info.rcMonitor.left) rcTask.left = info.rcMonitor.left;
if (rcTask.right > info.rcMonitor.right) rcTask.right = info.rcMonitor.right;
}
else
{
if (rcTask.top < info.rcMonitor.top) rcTask.top = info.rcMonitor.top;
}
HWND zPos = NULL;
if (pPos->flags & SWP_NOZORDER)
buttonFlags |= SWP_NOZORDER;
else
{
zPos = pPos->hwndInsertAfter;
if (zPos == HWND_TOP && !(GetWindowLongPtr(taskBar->startButton, GWL_EXSTYLE) & WS_EX_TOPMOST))
zPos = HWND_TOPMOST;
if (zPos == HWND_TOPMOST && !(GetWindowLongPtr(taskBar->taskBar, GWL_EXSTYLE) & WS_EX_TOPMOST))
zPos = HWND_TOP;
if (zPos == HWND_BOTTOM)
buttonFlags |= SWP_NOZORDER;
if (zPos == taskBar->startButton)
buttonFlags |= SWP_NOZORDER;
}
if (!IsStartButtonSmallIcons(taskBar->taskbarId))
{
bool bClassic;
if (GetWinVersion() < WIN_VER_WIN8)
bClassic = !IsAppThemed();
else
{
HIGHCONTRAST contrast = { sizeof(contrast) };
bClassic = (SystemParametersInfo(SPI_GETHIGHCONTRAST, sizeof(contrast), &contrast, 0) && (contrast.dwFlags & HCF_HIGHCONTRASTON));
}
if (!bClassic)
{
if (uEdge == ABE_TOP)
OffsetRect(&rcTask, 0, -1);
else if (uEdge == ABE_BOTTOM)
OffsetRect(&rcTask, 0, 1);
}
}
RECT rcOldButton;
if (taskBar->oldButton)
GetWindowRect(taskBar->oldButton, &rcOldButton);
int x, y;
if (uEdge == ABE_LEFT || uEdge == ABE_RIGHT)
{
if (GetSettingInt(L"StartButtonType") != START_BUTTON_CUSTOM || !GetSettingBool(L"StartButtonAlign"))
x = (rcTask.left + rcTask.right - taskBar->startButtonSize.cx) / 2;
else if (uEdge == ABE_LEFT)
x = rcTask.left;
else
x = rcTask.right - taskBar->startButtonSize.cx;
y = taskBar->oldButton ? rcOldButton.top : rcTask.top;
}
else
{
if (GetWindowLongPtr(taskBar->rebar, GWL_EXSTYLE) & WS_EX_LAYOUTRTL)
x = (taskBar->oldButton ? rcOldButton.right : rcTask.right) - taskBar->startButtonSize.cx;
else
x = taskBar->oldButton ? rcOldButton.left : rcTask.left;
if (GetSettingInt(L"StartButtonType") != START_BUTTON_CUSTOM || !GetSettingBool(L"StartButtonAlign"))
y = (rcTask.top + rcTask.bottom - taskBar->startButtonSize.cy) / 2;
else if (uEdge == ABE_TOP)
y = rcTask.top;
else
y = rcTask.bottom - taskBar->startButtonSize.cy;
}
// Start button on Win11 is a bit shifted to the right
// We will shift our Aero button to cover original button
if (IsWin11() && (x == 0) && (GetStartButtonType() == START_BUTTON_AERO))
x += ScaleForDpi(taskBar->taskBar, 6);
RECT rcButton = { x, y, x + taskBar->startButtonSize.cx, y + taskBar->startButtonSize.cy };
RECT rc;
IntersectRect(&rc, &rcButton, &info.rcMonitor);
HRGN rgn = CreateRectRgn(rc.left - x, rc.top - y, rc.right - x, rc.bottom - y);
if (!SetWindowRgn(taskBar->startButton, rgn, FALSE))
{
AddTrackedObject(rgn);
DeleteObject(rgn);
}
SetWindowPos(taskBar->startButton, zPos, x, y, 0, 0, buttonFlags);
if (buttonFlags & SWP_SHOWWINDOW)
UpdateStartButton(taskBar->taskbarId);
}
static LRESULT CALLBACK SubclassWin81StartButton( HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam, UINT_PTR uIdSubclass, DWORD_PTR dwRefData )
{
TaskbarInfo* taskBar = GetTaskbarInfo((int)dwRefData);
if (uMsg==WM_WINDOWPOSCHANGING)
{
// keep the original start button hidden at all times
const TaskbarInfo *taskBar=GetTaskbarInfo((int)dwRefData);
if (taskBar && taskBar->bHideButton)
{
((WINDOWPOS*)lParam)->flags&=~SWP_SHOWWINDOW;
}
}
if (uMsg==WM_WINDOWPOSCHANGED)
{
if (taskBar && taskBar->bReplaceButton)
{
UpdateStartButtonPosition(taskBar,(WINDOWPOS*)lParam);
}
}
if (uMsg==WM_SIZE)
{
RECT rc;
GetWindowRect(hWnd,&rc);
rc.right-=rc.left;
rc.bottom-=rc.top;
TaskbarInfo *taskBar=GetTaskbarInfo((int)dwRefData);
if (taskBar && (taskBar->oldButtonSize.cx!=rc.right || taskBar->oldButtonSize.cy!=rc.bottom))
{
taskBar->oldButtonSize.cx=rc.right;
@@ -1466,6 +1624,15 @@ static void ComputeTaskbarColors( int *data )
static void ShowWinX( void )
{
if (IsWin11())
{
HWND hwnd=FindWindowEx(NULL,NULL,L"Shell_TrayWnd",NULL);
if (hwnd)
PostMessage(hwnd,WM_HOTKEY,590,MAKELPARAM(MOD_WIN,'X'));
return;
}
if (GetWinVersion()>=WIN_VER_WIN10)
{
CComPtr<IUnknown> pImmersiveShell;
@@ -1650,116 +1817,7 @@ static LRESULT CALLBACK SubclassTaskBarProc( HWND hWnd, UINT uMsg, WPARAM wParam
{
if (taskBar->bReplaceButton)
{
if (IsStartButtonSmallIcons(taskBar->taskbarId)!=IsTaskbarSmallIcons())
RecreateStartButton((int)dwRefData);
WINDOWPOS *pPos=(WINDOWPOS*)lParam;
RECT rcTask;
GetWindowRect(hWnd,&rcTask);
MONITORINFO info;
UINT uEdge=GetTaskbarPosition(hWnd,&info,NULL,NULL);
DWORD buttonFlags=SWP_NOACTIVATE|SWP_NOOWNERZORDER|SWP_NOSIZE;
if (IsWindowVisible(taskBar->taskBar))
buttonFlags|=SWP_SHOWWINDOW;
else
buttonFlags|=SWP_HIDEWINDOW;
APPBARDATA appbar={sizeof(appbar)};
if (SHAppBarMessage(ABM_GETSTATE,&appbar)&ABS_AUTOHIDE)
{
bool bHide=false;
if (uEdge==ABE_LEFT)
bHide=(rcTask.right<info.rcMonitor.left+5);
else if (uEdge==ABE_RIGHT)
bHide=(rcTask.left>info.rcMonitor.right-5);
else if (uEdge==ABE_TOP)
bHide=(rcTask.bottom<info.rcMonitor.top+5);
else
bHide=(rcTask.top>info.rcMonitor.bottom-5);
if (bHide)
buttonFlags=(buttonFlags&~SWP_SHOWWINDOW)|SWP_HIDEWINDOW;
}
if (uEdge==ABE_TOP || uEdge==ABE_BOTTOM)
{
if (rcTask.left<info.rcMonitor.left) rcTask.left=info.rcMonitor.left;
if (rcTask.right>info.rcMonitor.right) rcTask.right=info.rcMonitor.right;
}
else
{
if (rcTask.top<info.rcMonitor.top) rcTask.top=info.rcMonitor.top;
}
if (!IsStartButtonSmallIcons(taskBar->taskbarId))
{
bool bClassic;
if (GetWinVersion()<WIN_VER_WIN8)
bClassic=!IsAppThemed();
else
{
HIGHCONTRAST contrast={sizeof(contrast)};
bClassic=(SystemParametersInfo(SPI_GETHIGHCONTRAST,sizeof(contrast),&contrast,0) && (contrast.dwFlags&HCF_HIGHCONTRASTON));
}
if (!bClassic)
{
if (uEdge==ABE_TOP)
OffsetRect(&rcTask,0,-1);
else if (uEdge==ABE_BOTTOM)
OffsetRect(&rcTask,0,1);
}
}
HWND zPos=NULL;
if (pPos->flags&SWP_NOZORDER)
buttonFlags|=SWP_NOZORDER;
else
{
zPos=pPos->hwndInsertAfter;
if (zPos==HWND_TOP && !(GetWindowLongPtr(taskBar->startButton,GWL_EXSTYLE)&WS_EX_TOPMOST))
zPos=HWND_TOPMOST;
if (zPos==HWND_TOPMOST && !(GetWindowLongPtr(hWnd,GWL_EXSTYLE)&WS_EX_TOPMOST))
zPos=HWND_TOP;
if (zPos==HWND_BOTTOM)
buttonFlags|=SWP_NOZORDER;
if (zPos==taskBar->startButton)
buttonFlags|=SWP_NOZORDER;
}
int x, y;
if (uEdge==ABE_LEFT || uEdge==ABE_RIGHT)
{
if (GetSettingInt(L"StartButtonType")!=START_BUTTON_CUSTOM || !GetSettingBool(L"StartButtonAlign"))
x=(rcTask.left+rcTask.right-taskBar->startButtonSize.cx)/2;
else if (uEdge==ABE_LEFT)
x=rcTask.left;
else
x=rcTask.right-taskBar->startButtonSize.cx;
y=rcTask.top;
}
else
{
if (GetWindowLongPtr(taskBar->rebar,GWL_EXSTYLE)&WS_EX_LAYOUTRTL)
x=rcTask.right-taskBar->startButtonSize.cx;
else
x=rcTask.left;
if (GetSettingInt(L"StartButtonType")!=START_BUTTON_CUSTOM || !GetSettingBool(L"StartButtonAlign"))
y=(rcTask.top+rcTask.bottom-taskBar->startButtonSize.cy)/2;
else if (uEdge==ABE_TOP)
y=rcTask.top;
else
y=rcTask.bottom-taskBar->startButtonSize.cy;
}
RECT rcButton={x,y,x+taskBar->startButtonSize.cx,y+taskBar->startButtonSize.cy};
RECT rc;
IntersectRect(&rc,&rcButton,&info.rcMonitor);
HRGN rgn=CreateRectRgn(rc.left-x,rc.top-y,rc.right-x,rc.bottom-y);
if (!SetWindowRgn(taskBar->startButton,rgn,FALSE))
{
AddTrackedObject(rgn);
DeleteObject(rgn);
}
g_bAllowMoveButton=true;
SetWindowPos(taskBar->startButton,zPos,x,y,0,0,buttonFlags);
g_bAllowMoveButton=false;
if (buttonFlags&SWP_SHOWWINDOW)
UpdateStartButton(taskBar->taskbarId);
UpdateStartButtonPosition(taskBar,(WINDOWPOS*)lParam);
}
if (taskBar->oldButton && GetWinVersion()<WIN_VER_WIN10)
{
@@ -2871,6 +2929,9 @@ static void InitStartMenuDLL( void )
DWORD progThread=GetWindowThreadProcessId(g_ProgWin,NULL);
g_ProgHook=SetWindowsHookEx(WH_GETMESSAGE,HookProgManThread,NULL,progThread);
g_StartHook=SetWindowsHookEx(WH_GETMESSAGE,HookDesktopThread,NULL,GetCurrentThreadId());
if (IsWin11())
g_StartMouseHook=SetWindowsHookEx(WH_MOUSE,HookDesktopThreadMouse,NULL,GetCurrentThreadId());
HWND hwnd=FindWindow(L"OpenShellMenu.CStartHookWindow",L"StartHookWindow");
LoadLibrary(L"StartMenuDLL.dll"); // keep the DLL from unloading
if (hwnd) PostMessage(hwnd,WM_CLEAR,0,0); // tell the exe to unhook this hook
@@ -2992,39 +3053,6 @@ static void RecreateStartButton( size_t taskbarId )
continue;
if (taskBar.bRecreatingButton)
continue;
RECT rcTask;
GetWindowRect(taskBar.taskBar,&rcTask);
RECT rcTask2=rcTask;
MONITORINFO info;
UINT uEdge=GetTaskbarPosition(taskBar.taskBar,&info,NULL,NULL);
if (uEdge==ABE_TOP || uEdge==ABE_BOTTOM)
{
if (rcTask2.left<info.rcMonitor.left) rcTask2.left=info.rcMonitor.left;
if (rcTask2.right>info.rcMonitor.right) rcTask2.right=info.rcMonitor.right;
}
else
{
if (rcTask2.top<info.rcMonitor.top) rcTask2.top=info.rcMonitor.top;
}
if (!IsTaskbarSmallIcons())
{
bool bClassic;
if (GetWinVersion()<WIN_VER_WIN8)
bClassic=!IsAppThemed();
else
{
HIGHCONTRAST contrast={sizeof(contrast)};
bClassic=(SystemParametersInfo(SPI_GETHIGHCONTRAST,sizeof(contrast),&contrast,0) && (contrast.dwFlags&HCF_HIGHCONTRASTON));
}
if (!bClassic)
{
if (uEdge==ABE_TOP)
OffsetRect(&rcTask2,0,-1);
else if (uEdge==ABE_BOTTOM)
OffsetRect(&rcTask2,0,1);
}
}
taskBar.bRecreatingButton=true;
{
@@ -3033,7 +3061,7 @@ static void RecreateStartButton( size_t taskbarId )
RevokeDragDrop(taskBar.startButton);
DestroyStartButton(taskBar.taskbarId);
}
taskBar.startButton=CreateStartButton(taskBar.taskbarId,taskBar.taskBar,taskBar.rebar,rcTask2);
taskBar.startButton=CreateStartButton(taskBar.taskbarId,taskBar.taskBar,taskBar.rebar);
CStartMenuTarget *pNewTarget=new CStartMenuTarget(taskBar.taskbarId);
RegisterDragDrop(taskBar.startButton,pNewTarget);
pNewTarget->Release();
@@ -3049,6 +3077,8 @@ static void RecreateStartButton( size_t taskbarId )
taskBar.oldButtonSize.cy=rc.bottom-rc.top;
}
RECT rcTask;
GetWindowRect(taskBar.taskBar,&rcTask);
PostMessage(taskBar.taskBar,WM_SIZE,SIZE_RESTORED,MAKELONG(rcTask.right-rcTask.left,rcTask.bottom-rcTask.top));
}
}
@@ -3098,6 +3128,8 @@ static void CleanStartMenuDLL( void )
HWND hwnd=FindWindow(L"OpenShellMenu.CStartHookWindow",L"StartHookWindow");
UnhookWindowsHookEx(g_ProgHook);
UnhookWindowsHookEx(g_StartHook);
if (g_StartMouseHook) UnhookWindowsHookEx(g_StartMouseHook);
g_StartMouseHook=NULL;
if (g_AppManagerHook) UnhookWindowsHookEx(g_AppManagerHook);
g_AppManagerHook=NULL;
if (g_NewWindowHook) UnhookWindowsHookEx(g_NewWindowHook);
@@ -3119,7 +3151,8 @@ static void CleanStartMenuDLL( void )
if (it->second.oldButton)
{
RemoveWindowSubclass(it->second.oldButton,SubclassWin81StartButton,'CLSH');
SetWindowPos(it->second.oldButton,NULL,0,0,0,0,SWP_NOSIZE|SWP_NOZORDER);
if (GetWinVersion()<WIN_VER_WIN10 && GetTaskbarPosition(it->second.taskBar,NULL,NULL,NULL)==ABE_BOTTOM)
SetWindowPos(it->second.oldButton,NULL,0,0,0,0,SWP_NOSIZE|SWP_NOZORDER);
RevokeDragDrop(it->second.oldButton);
if (it->second.pOriginalTarget)
RegisterDragDrop(it->second.oldButton,it->second.pOriginalTarget);
@@ -3348,6 +3381,16 @@ static LRESULT CALLBACK HookProgManThread( int code, WPARAM wParam, LPARAM lPara
msg->message=WM_NULL;
if (control==OPEN_CLASSIC)
PostMessage(g_TaskBar,g_StartMenuMsg,MSG_TOGGLE,0);
else if (control==OPEN_CUSTOM)
{
CString commandText=GetSettingString(L"WinKeyCommand");
if (!commandText.IsEmpty())
{
wchar_t expandedCommand[_MAX_PATH]{};
::ExpandEnvironmentStrings(commandText, expandedCommand, _countof(expandedCommand));
ShellExecute(NULL,NULL,expandedCommand,NULL,NULL,SW_SHOWNORMAL);
}
}
}
}
}
@@ -3372,6 +3415,35 @@ static LRESULT CALLBACK HookProgManThread( int code, WPARAM wParam, LPARAM lPara
return CallNextHookEx(NULL,code,wParam,lParam);
}
// WH_MOUSE hook for taskbar thread (Win11+)
static LRESULT CALLBACK HookDesktopThreadMouse(int code, WPARAM wParam, LPARAM lParam)
{
if (code == HC_ACTION)
{
// we need to steal mouse messages that are issues in start button area
// so that they won't get to XAML framework that is handling original start button
auto info = (const MOUSEHOOKSTRUCT*)lParam;
{
auto taskBar = FindTaskBarInfoButton(info->hwnd); // click on start button
if (!taskBar)
{
taskBar = FindTaskBarInfoBar(GetAncestor(info->hwnd, GA_ROOT)); // click on taskbar
if (taskBar && !PointAroundStartButton(taskBar->taskbarId))
taskBar = NULL;
}
if (taskBar && (info->hwnd != taskBar->startButton) && taskBar->oldButton)
{
// steal messages from other than our custom button window
PostMessage(taskBar->oldButton, (UINT)wParam, 0, MAKELPARAM(info->pt.x, info->pt.y));
return 1;
}
}
}
return CallNextHookEx(NULL, code, wParam, lParam);
}
// WH_GETMESSAGE hook for the taskbar thread
static LRESULT CALLBACK HookDesktopThread( int code, WPARAM wParam, LPARAM lParam )
{
@@ -3431,6 +3503,16 @@ if (!g_bTrimHooks)
PostMessage(g_ProgWin,WM_SYSCOMMAND,SC_TASKLIST,'WSMK');
else if (control==OPEN_CORTANA)
OpenCortana();
else if (control==OPEN_CUSTOM)
{
CString commandText=GetSettingString(L"ShiftWinCommand");
if (!commandText.IsEmpty())
{
wchar_t expandedCommand[_MAX_PATH]{};
::ExpandEnvironmentStrings(commandText, expandedCommand, _countof(expandedCommand));
ShellExecute(NULL,NULL,expandedCommand,NULL,NULL,SW_SHOWNORMAL);
}
}
}
else if (msg->wParam==MSG_DRAG || msg->wParam==MSG_SHIFTDRAG)
{
@@ -3590,12 +3672,22 @@ if (!g_bTrimHooks)
// left or middle click on start button
FindWindowsMenu();
const wchar_t *name;
const wchar_t *command;
if (bMiddle)
{
name=L"MiddleClick";
command=L"MiddleClickCommand";
}
else if (GetKeyState(VK_SHIFT)<0)
{
name=L"ShiftClick";
command=L"ShiftClickCommand";
}
else
{
name=L"MouseClick";
command=L"MouseClickCommand";
}
int control=GetSettingInt(name);
if (control==OPEN_BOTH && GetWinVersion()>=WIN_VER_WIN10)
@@ -3611,6 +3703,16 @@ if (!g_bTrimHooks)
PostMessage(g_ProgWin,WM_SYSCOMMAND,SC_TASKLIST,'WSMM');
else if (control==OPEN_CORTANA)
OpenCortana();
else if (control==OPEN_CUSTOM)
{
CString commandText=GetSettingString(command);
if (!commandText.IsEmpty())
{
wchar_t expandedCommand[_MAX_PATH]{};
::ExpandEnvironmentStrings(commandText, expandedCommand, _countof(expandedCommand));
ShellExecute(NULL,NULL,expandedCommand,NULL,NULL,SW_SHOWNORMAL);
}
}
msg->message=WM_NULL;
}
}
@@ -3751,6 +3853,16 @@ if (!g_bTrimHooks)
FindWindowsMenu();
PostMessage(g_ProgWin,WM_SYSCOMMAND,SC_TASKLIST,'WSMM');
}
else if (control==OPEN_CUSTOM)
{
CString commandText=GetSettingString(L"HoverCommand");
if (!commandText.IsEmpty())
{
wchar_t expandedCommand[_MAX_PATH]{};
::ExpandEnvironmentStrings(commandText, expandedCommand, _countof(expandedCommand));
ShellExecute(NULL,NULL,expandedCommand,NULL,NULL,SW_SHOWNORMAL);
}
}
}
}
taskBar->bTimer=false;
@@ -3760,7 +3872,6 @@ if (!g_bTrimHooks)
// context menu
if (msg->message==WM_NCRBUTTONUP || msg->message==WM_RBUTTONUP)
{
CPoint pt0(GetMessagePos());
TaskbarInfo *taskBar=FindTaskBarInfoButton(msg->hwnd);
DWORD winVer=GetWinVersion();
if (!taskBar && winVer>=WIN_VER_WIN8)
@@ -3771,6 +3882,7 @@ if (!g_bTrimHooks)
}
if (taskBar)
{
CPoint pt0(GetMessagePos());
if (msg->message==WM_RBUTTONUP && msg->hwnd==taskBar->startButton && msg->lParam==MAKELPARAM(-1,-1))
{
RECT rc;
@@ -3805,13 +3917,18 @@ if (!g_bTrimHooks)
CMD_OPEN,
CMD_OPEN_ALL,
CMD_EXPLORER,
CMD_OPEN_PINNED,
};
// right-click on the start button - open the context menu (Settings, Help, Exit)
HMENU menu=CreatePopupMenu();
CString title=LoadStringEx(IDS_MENU_TITLE);
if (!title.IsEmpty())
CString titleFmt=LoadStringEx(IDS_MENU_TITLE);
if (!titleFmt.IsEmpty())
{
CString title;
DWORD ver=GetVersionEx(g_Instance);
title.Format(titleFmt,ver>>24,(ver>>16)&0xFF,ver&0xFFFF);
AppendMenu(menu,MF_STRING,0,title);
EnableMenuItem(menu,0,MF_BYPOSITION|MF_DISABLED);
SetMenuDefaultItem(menu,0,TRUE);
@@ -3825,6 +3942,8 @@ if (!g_bTrimHooks)
AppendMenu(menu,MF_STRING,CMD_OPEN,FindTranslation(L"Menu.Open",L"&Open"));
if (!SHRestricted(REST_NOCOMMONGROUPS))
AppendMenu(menu,MF_STRING,CMD_OPEN_ALL,FindTranslation(L"Menu.OpenAll",L"O&pen All Users"));
if (GetSettingInt(L"PinnedPrograms")==PINNED_PROGRAMS_PINNED)
AppendMenu(menu,MF_STRING,CMD_OPEN_PINNED,FindTranslation(L"Menu.OpenPinned",L"O&pen Pinned"));
AppendMenu(menu,MF_SEPARATOR,0,0);
}
if (GetSettingBool(L"EnableSettings"))
@@ -3871,6 +3990,16 @@ if (!g_bTrimHooks)
if (SUCCEEDED(ShGetKnownFolderPath((res==CMD_OPEN)?FOLDERID_StartMenu:FOLDERID_CommonStartMenu,&pPath)))
ShellExecute(NULL,L"open",pPath,NULL,NULL,SW_SHOWNORMAL);
}
if (res==CMD_OPEN_PINNED) // open pinned folder
{
SHELLEXECUTEINFO execute={sizeof(execute)};
CString path=GetSettingString(L"PinnedItemsPath");
execute.lpVerb=L"open";
execute.lpFile=path;
execute.nShow=SW_SHOWNORMAL;
execute.fMask=SEE_MASK_DOENVSUBST;
ShellExecuteEx(&execute);
}
if (res==CMD_EXPLORER)
{
CString path=GetSettingString(L"ExplorerPath");

View File

@@ -51,7 +51,7 @@ struct TaskbarInfo
int taskbarId;
HWND taskBar;
HWND startButton; // either own start button or the win7 start button (depending on bReplaceButton)
HWND oldButton; // win81 start button (child of taskBar)
HWND oldButton; // win8.1+ start button (child of taskBar)
HWND rebar;
HWND taskList;
HWND chevron;
@@ -61,8 +61,8 @@ struct TaskbarInfo
int pointerId;
bool bTimer;
bool bCustomLook;
bool bReplaceButton;
bool bHideButton;
bool bReplaceButton; // replace start button with own one
bool bHideButton; // hide old start button (if we have own button)
bool bRecreatingButton;
bool bThemeChanging;
std::vector<HWND> trayButtons; // ordered by Z order (for win10)

View File

@@ -427,7 +427,7 @@ BEGIN
IDS_SKIN_ERR_LOAD_FILE "Failed to load the variation skin file %s.\r\n"
IDS_SKIN_ERR_LOAD "Error loading %s\n%s"
IDS_SKIN_ERR_VERSION "The selected skin is not compatible with this version of the start menu.\r\n"
IDS_MENU_TITLE "== Open-Shell Menu =="
IDS_MENU_TITLE "Open-Shell Menu %d.%d.%d"
IDS_DEFAULT_SKIN "<No Skin>"
IDS_CONTROLS_SETTINGS "Controls"
IDS_OPEN_NOTHING "Nothing"
@@ -1044,7 +1044,7 @@ BEGIN
IDS_FOLDERS_FIRST "Show folders first"
IDS_FOLDERS_FIRST_TIP "When this is checked, the All Programs tree will show the folders first and the programs last"
IDS_PINNED_PROGRAMS "Pinned Programs folder"
IDS_PINNED_PROGRAMS_TIP "Select the location to store the pinned programs"
IDS_PINNED_PROGRAMS_TIP "Select the location to store pinned programs. After updating this setting, close this window in order to pin items through the context menu again"
IDS_FAST_ITEMS "Use Start Menu folder"
END
@@ -1082,7 +1082,7 @@ BEGIN
IDS_MIN_HEIGHT_TIP "The main menu will be at least as tall as this many search results"
IDS_GLASS_OVERRIDE "Override glass color"
IDS_GLASS_OVERRIDE_TIP "Check this to override the system glass color to use in the menu"
IDS_GLASS_COLOR "Menu glass color"
IDS_GLASS_COLOR "Menu glass color (RRGGBB)"
IDS_GLASS_COLOR_TIP "Select the glass color to use in the menu. How much this color affects the menu will depend on the selected skin"
IDS_GLASS_INTENSITY "Menu glass intensity"
IDS_GLASS_INTENSITY_TIP "Select the intensity (brightness) for the glass color in the menu (0 - dark, 100 - bright)"
@@ -1144,17 +1144,17 @@ BEGIN
IDS_STRING7024 "Shadows on glass#The text and the arrows in the second column of the main menu will have a drop shadow"
IDS_STRING7025 "Opaque"
IDS_STRING7026 "Main menu color"
IDS_STRING7027 "Custom color#Select custom color for the main menu"
IDS_STRING7027 "Custom color (RRGGBB)#Select custom color for the main menu"
IDS_STRING7028 "Sub-menu color"
IDS_STRING7029 "Custom color#Select custom color for the sub-menus"
IDS_STRING7029 "Custom color (RRGGBB)#Select custom color for the sub-menus"
IDS_STRING7030 "Silver"
IDS_STRING7031 "Gold"
IDS_STRING7032 "Steel"
IDS_STRING7033 "Titanium"
IDS_STRING7034 "Image for first column#Select custom image for the first column of the main menu"
IDS_STRING7035 "Image for second column#Select custom image for the second column of the main menu"
IDS_STRING7036 "Text color for first column#Select custom color for the first column of the main menu text"
IDS_STRING7037 "Text color for second column#Select custom color for the second column of the main menu text"
IDS_STRING7036 "Text color for first column (RRGGBB)#Select custom color for the first column of the main menu text"
IDS_STRING7037 "Text color for second column (RRGGBB)#Select custom color for the second column of the main menu text"
IDS_STRING7038 "Text size#Select custom size for the main menu text"
END
@@ -1249,7 +1249,7 @@ BEGIN
IDS_TASK_AEROGLASS_TIP "The taskbar will have glass transparency that is compatible with the Aero Glass mod"
IDS_TASK_OPACITY "Taskbar opacity"
IDS_TASK_OPACITY_TIP "Set the opacity for the taskbar (0 - transparent, 100 - opaque)"
IDS_TASK_COLOR "Taskbar color"
IDS_TASK_COLOR "Taskbar color (RRGGBB)"
IDS_TASK_COLOR_TIP "Set the color for the taskbar"
IDS_PCSETTINGS "Settings"
IDS_PCSETTINGS_TIP "Shows the modern Settings window"
@@ -1288,13 +1288,41 @@ BEGIN
IDS_TASK_BORDERS "Border sizes"
IDS_TASK_BORDERS_TIP "Select how many pixel on each side of the texture to exclude from stretching"
IDS_TASKBAR_SETTINGS "Taskbar"
IDS_TASK_TEXTCOLOR "Taskbar text color"
IDS_TASK_TEXTCOLOR "Taskbar text color (RRGGBB)"
IDS_TASK_TEXTCOLOR_TIP "Select the color for the text on the taskbar"
IDS_SELECT_LAST "Select the last item in shutdown menu"
IDS_SELECT_LAST_TIP "When this is checked, the last item will be selected by default when the shutdown menu is opened with the keyboard"
IDS_CLEAR_CACHE "Clear cached information"
END
STRINGTABLE
BEGIN
IDS_NO_DBLCLICK "Single-click to open folder shortcuts"
IDS_NO_DBLCLICK_TIP "When this is checked, single-clicking shortcuts (links) to folders will open them in explorer. Hovering over the shortcut will still expand sub-menus"
IDS_BOLD_SETTINGS "Highlight modified settings"
IDS_BOLD_SETTINGS_TIP "When this is checked, settings that have been modified will be highlighted in bold"
IDS_SEARCH_HINT "Custom search hint"
IDS_SEARCH_HINT_TIP "When this is checked, the hint text in the search box will be replaced"
IDS_NEW_SEARCH_HINT "Custom search hint text"
IDS_NEW_SEARCH_HINT_TIP "The text to replace the search hint with. Empty text is a valid option"
IDS_MORE_RESULTS "Enable ""See more results"" option"
IDS_MORE_RESULTS_TIP "When this is checked, the search results will include an option to do a more advanced search"
IDS_OPEN_CMD "Custom command"
IDS_OPEN_CMD_TIP "The action will run a user-defined command"
IDS_OPEN_CMD_TEXT "Command to run"
IDS_OPEN_CMD_TEXT_TIP "Enter the command to run when you use this control"
IDS_ITEM_LINKS "Display as a list of links"
IDS_ITEM_LINKS_TIP "This item will appear as a sub-menu showing only its top-level contents"
END
STRINGTABLE
BEGIN
IDS_OPEN_TRUE_PATH "Open pinned folders to their true path"
IDS_OPEN_TRUE_PATH_TIP "When this is checked, pinned folders will open to their true path instead of the path to their shortcut in the Pinned Programs folder"
IDS_PINNED_PATH "Pinned folder path"
IDS_PINNED_PATH_TIP "The path to use as the Pinned folder. If the path does not exist, it will be created (if possible) after opening the start menu. Close this window after updating this setting to update your context menu.\n\nNote: If you do not have permissions for the selected path, you will not be able to pin items until you take ownership of the new folder"
END
#endif // English (U.S.) resources
/////////////////////////////////////////////////////////////////////////////

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.1 KiB

After

Width:  |  Height:  |  Size: 4.1 KiB

View File

@@ -760,6 +760,26 @@
#define IDS_HOR_OFFSET_TIP 3663
#define IDS_VERT_OFFSET 3664
#define IDS_VERT_OFFSET_TIP 3665
#define IDS_NO_DBLCLICK 3666
#define IDS_NO_DBLCLICK_TIP 3667
#define IDS_BOLD_SETTINGS 3668
#define IDS_BOLD_SETTINGS_TIP 3669
#define IDS_SEARCH_HINT 3670
#define IDS_SEARCH_HINT_TIP 3671
#define IDS_NEW_SEARCH_HINT 3672
#define IDS_NEW_SEARCH_HINT_TIP 3673
#define IDS_MORE_RESULTS 3674
#define IDS_MORE_RESULTS_TIP 3675
#define IDS_OPEN_CMD 3676
#define IDS_OPEN_CMD_TIP 3677
#define IDS_OPEN_CMD_TEXT 3678
#define IDS_OPEN_CMD_TEXT_TIP 3679
#define IDS_ITEM_LINKS 3680
#define IDS_ITEM_LINKS_TIP 3681
#define IDS_OPEN_TRUE_PATH 3682
#define IDS_OPEN_TRUE_PATH_TIP 3683
#define IDS_PINNED_PATH 3684
#define IDS_PINNED_PATH_TIP 3685
#define IDS_STRING7001 7001
#define IDS_STRING7002 7002
#define IDS_STRING7003 7003

View File

@@ -280,7 +280,7 @@ static std::vector<uint8_t> ParseModernSettings()
CComPtr<IXMLDOMNode> next;
if (FAILED(node->get_nextSibling(&next)))
break;
node = next;
node = std::move(next);
}
}
}

View File

@@ -9,6 +9,7 @@
#include "stdafx.h"
#include "ModernSettings.h"
#include "ModernSettingsShellFolder.h"
#include "ResourceHelper.h"
#include <propkey.h>
#include <strsafe.h>
#include <Uxtheme.h>
@@ -181,7 +182,7 @@ HICON IconFromGlyph(UINT glyph, UINT size)
HDC dc = CreateCompatibleDC(nullptr);
SelectObject(dc, info.hbmColor);
HFONT font = CreateFontW(size, 0, 0, 0, 400, 0, 0, 0, 1, 0, 0, 0, 0, L"Segoe MDL2 Assets");
HFONT font = CreateFontW(size, 0, 0, 0, 400, 0, 0, 0, 1, 0, 0, 0, 0, IsWin11() ? L"Segoe Fluent Icons" : L"Segoe MDL2 Assets");
SelectObject(dc, font);
RECT rc{};

View File

@@ -91,7 +91,7 @@ STDMETHODIMP CStartMenuExt::Initialize( PCIDLIST_ABSOLUTE pidlFolder, IDataObjec
bUsePinned=(setting==1);
if (bUsePinned)
{
Strcpy(m_PinFolder1,_countof(m_PinFolder1),L"%APPDATA%\\OpenShell\\Pinned\\");
Sprintf(m_PinFolder1,_countof(m_PinFolder1),L"%s\\",GetSettingString(L"PinnedItemsPath"));
DoEnvironmentSubst(m_PinFolder1,_countof(m_PinFolder1));
m_PinFolder2[0]=0;
}

View File

@@ -57,6 +57,7 @@ CSetting g_Settings[]={
{L"DisablePinExt",CSetting::TYPE_BOOL,0,0,0},
{L"FolderStartMenu",CSetting::TYPE_STRING,0,0,L""},
{L"FolderCommonStartMenu",CSetting::TYPE_STRING,0,0,L""},
{L"PinnedItemsPath",CSetting::TYPE_DIRECTORY,0,0,L"%APPDATA%\\OpenShell\\Pinned"},
{L"Language",CSetting::TYPE_GROUP},
{L"Language",CSetting::TYPE_STRING,0,0,L"",CSetting::FLAG_COLD|CSetting::FLAG_SHARED},

View File

@@ -168,7 +168,7 @@ namespace DesktopNotificationManagerCompat
ComPtr<IToastNotificationHistory> nativeHistory;
RETURN_IF_FAILED(toastStatics2->get_History(&nativeHistory));
*history = std::unique_ptr<DesktopNotificationHistoryCompat>(new DesktopNotificationHistoryCompat(s_aumid.c_str(), nativeHistory));
*history = std::make_unique<DesktopNotificationHistoryCompat>(s_aumid.c_str(), nativeHistory);
return S_OK;
}
@@ -224,7 +224,7 @@ namespace DesktopNotificationManagerCompat
DesktopNotificationHistoryCompat::DesktopNotificationHistoryCompat(const wchar_t *aumid, ComPtr<IToastNotificationHistory> history)
{
m_aumid = std::wstring(aumid);
m_history = history;
m_history = std::move(history);
}
HRESULT DesktopNotificationHistoryCompat::Clear()

View File

@@ -1,4 +1,7 @@
version: 4.4.{build}
branches:
only:
- master
pull_requests:
do_not_increment_build_number: true
skip_tags: true
@@ -11,3 +14,12 @@ only_commits:
files:
- Src/
- Localization/
deploy:
- provider: GitHub
tag: v$(APPVEYOR_BUILD_VERSION)
release: $(APPVEYOR_BUILD_VERSION)
on:
APPVEYOR_ACCOUNT_NAME: passionate-coder
auth_token:
secure: D0QZnRZfea3qJlWOwrxE6M2jrbiSrOfz/6U7RzdeeG8N0qNDFKI7LFjYyw2I/PcR
prerelease: true