29 Commits

Author SHA1 Message Date
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
36 changed files with 6857 additions and 7553 deletions

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

@@ -2,11 +2,10 @@
*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
@@ -24,7 +23,7 @@ If you just want to use it or looking for setup file, click here to download:
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

@@ -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

@@ -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 )
@@ -2714,6 +2721,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;
}
@@ -3034,6 +3064,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 +3118,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 +3134,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)
{
@@ -3131,7 +3177,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 +3235,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 +3423,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)
{
@@ -3458,7 +3508,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;

View File

@@ -385,5 +385,5 @@ 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 );

File diff suppressed because it is too large Load Diff

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;
}

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

@@ -589,7 +589,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 +609,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 +617,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 +704,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 +896,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 +978,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 +1076,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 +1907,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 +2597,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 +2607,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 +2617,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 +2867,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 +3274,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 +3305,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 +3569,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)
{
@@ -2818,9 +2826,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;
@@ -443,7 +445,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;
@@ -1084,7 +1089,8 @@ void CMenuContainer::AddStandardItems( void )
if (m_bSubMenu && pStdItem->id==s_ShutdownCommand)
continue;
if (pStdItem->id==MENU_COLUMN_BREAK && m_bTwoColumns)
const bool bTwoColumns = (!m_bSubMenu && s_Skin.TwoColumns);
if (pStdItem->id==MENU_COLUMN_BREAK && bTwoColumns)
mainIconSize=s_Skin.Main2_icon_size;
int stdOptions=GetStdOptions(pStdItem->id);
@@ -2237,7 +2243,7 @@ void CMenuContainer::AddJumpListItems( std::vector<MenuItem> &items )
{
ILFree(item.pItem1);
item.pItem1=pidl2.Detach();
pItem=pItem2;
pItem=std::move(pItem2);
}
}
}
@@ -2499,9 +2505,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 +2746,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 +2942,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 +2978,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 +5066,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 +6807,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 +6831,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)
{
@@ -7671,6 +7680,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 +7698,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 +8067,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 +8080,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

@@ -1742,7 +1742,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 +2437,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 +2725,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 +3158,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 +3310,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 +4147,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 +4265,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 +4334,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 +4350,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 +4366,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

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

View File

@@ -79,6 +79,7 @@ enum
OPEN_NOTHING,
OPEN_CLASSIC,
OPEN_WINDOWS,
OPEN_CUSTOM,
OPEN_BOTH,
OPEN_DESKTOP,
OPEN_CORTANA,
@@ -3348,6 +3349,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);
}
}
}
}
}
@@ -3431,6 +3442,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 +3611,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 +3642,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 +3792,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 +3811,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 +3821,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,6 +3856,7 @@ 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)
@@ -3825,6 +3877,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 +3925,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

@@ -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
@@ -1295,6 +1295,34 @@ BEGIN
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
/////////////////////////////////////////////////////////////////////////////

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

@@ -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