18 Commits

Author SHA1 Message Date
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
33 changed files with 466 additions and 145 deletions

View File

@@ -24,7 +24,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) 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 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/).* *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]; wchar_t text[_MAX_PATH];
GetDlgItemText(IDC_COMBOLINK,text,_countof(text)); GetDlgItemText(IDC_COMBOLINK,text,_countof(text));
if (BrowseLinkHelper(m_hWnd,text)) if (BrowseLinkHelper(m_hWnd,text,false))
{ {
SetDlgItemText(IDC_COMBOLINK,text); SetDlgItemText(IDC_COMBOLINK,text);
SendMessage(WM_COMMAND,MAKEWPARAM(IDC_COMBOLINK,CBN_KILLFOCUS)); 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()) if (pProgress && pProgress->IsCanceled())
res=DOWNLOAD_CANCEL; res=DOWNLOAD_CANCEL;
const wchar_t *accept[]={L"*/*",NULL};
if (res==DOWNLOAD_OK) 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); 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) if (hRequest)
{ {

View File

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

View File

@@ -125,7 +125,7 @@ bool CSetting::IsEnabled( void ) const
if (operation=='>' && pSetting->GetValue().intVal<=val) if (operation=='>' && pSetting->GetValue().intVal<=val)
return false; 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) if (operation=='~' && *pSetting->GetValue().bstrVal==0)
return false; return false;
@@ -202,7 +202,7 @@ bool CSetting::ReadValue( CRegKey &regKey, const wchar_t *valName )
} }
// string // string
if (type>=CSetting::TYPE_STRING && type<CSetting::TYPE_MULTISTRING) if (type>=CSetting::TYPE_STRING && type!=CSetting::TYPE_MULTISTRING)
{ {
ULONG len; ULONG len;
if (regKey.QueryStringValue(valName,NULL,&len)==ERROR_SUCCESS) if (regKey.QueryStringValue(valName,NULL,&len)==ERROR_SUCCESS)
@@ -789,11 +789,14 @@ CString CSettingsManager::LoadSettingsXml( const wchar_t *fname )
} }
CComPtr<IXMLDOMNode> next; CComPtr<IXMLDOMNode> next;
child2->get_nextSibling(&next); child2->get_nextSibling(&next);
child2=next; child2=std::move(next);
} }
string.push_back(0); string.push_back(0);
pSetting->value=CComVariant(&string[0]); pSetting->value=CComVariant(&string[0]);
pSetting->flags&=~CSetting::FLAG_DEFAULT; if (pSetting->value==pSetting->defValue)
pSetting->flags|=CSetting::FLAG_DEFAULT;
else
pSetting->flags&=~CSetting::FLAG_DEFAULT;
} }
else else
{ {
@@ -806,7 +809,10 @@ CString CSettingsManager::LoadSettingsXml( const wchar_t *fname )
if (pSetting->type>=CSetting::TYPE_STRING) if (pSetting->type>=CSetting::TYPE_STRING)
{ {
pSetting->value=value; pSetting->value=value;
pSetting->flags&=~CSetting::FLAG_DEFAULT; if (pSetting->value==pSetting->defValue)
pSetting->flags|=CSetting::FLAG_DEFAULT;
else
pSetting->flags&=~CSetting::FLAG_DEFAULT;
} }
else if (pSetting->type==CSetting::TYPE_BOOL || (pSetting->type==CSetting::TYPE_INT && pSetting[1].type!=CSetting::TYPE_RADIO) || pSetting->type==CSetting::TYPE_HOTKEY || pSetting->type==CSetting::TYPE_HOTKEY_ANY || pSetting->type==CSetting::TYPE_COLOR) else if (pSetting->type==CSetting::TYPE_BOOL || (pSetting->type==CSetting::TYPE_INT && pSetting[1].type!=CSetting::TYPE_RADIO) || pSetting->type==CSetting::TYPE_HOTKEY || pSetting->type==CSetting::TYPE_HOTKEY_ANY || pSetting->type==CSetting::TYPE_COLOR)
{ {
@@ -815,7 +821,10 @@ CString CSettingsManager::LoadSettingsXml( const wchar_t *fname )
pSetting->value=CComVariant(val?1:0); pSetting->value=CComVariant(val?1:0);
else else
pSetting->value=CComVariant(val); pSetting->value=CComVariant(val);
pSetting->flags&=~CSetting::FLAG_DEFAULT; if (pSetting->value==pSetting->defValue)
pSetting->flags|=CSetting::FLAG_DEFAULT;
else
pSetting->flags&=~CSetting::FLAG_DEFAULT;
} }
else if (pSetting->type==CSetting::TYPE_INT && pSetting[1].type==CSetting::TYPE_RADIO) else if (pSetting->type==CSetting::TYPE_INT && pSetting[1].type==CSetting::TYPE_RADIO)
{ {
@@ -825,7 +834,10 @@ CString CSettingsManager::LoadSettingsXml( const wchar_t *fname )
if (_wcsicmp(pRadio->name,value.bstrVal)==0) if (_wcsicmp(pRadio->name,value.bstrVal)==0)
{ {
pSetting->value=CComVariant(val); pSetting->value=CComVariant(val);
pSetting->flags&=~CSetting::FLAG_DEFAULT; if (pSetting->value==pSetting->defValue)
pSetting->flags|=CSetting::FLAG_DEFAULT;
else
pSetting->flags&=~CSetting::FLAG_DEFAULT;
break; break;
} }
} }
@@ -839,7 +851,7 @@ CString CSettingsManager::LoadSettingsXml( const wchar_t *fname )
CComPtr<IXMLDOMNode> next; CComPtr<IXMLDOMNode> next;
if (child->get_nextSibling(&next)!=S_OK) if (child->get_nextSibling(&next)!=S_OK)
break; break;
child=next; child=std::move(next);
} }
if (ver<0x03090000) if (ver<0x03090000)
UpgradeSettings(false); UpgradeSettings(false);
@@ -1701,6 +1713,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; ofn.Flags=OFN_DONTADDTORECENT|OFN_ENABLESIZING|OFN_EXPLORER|OFN_FILEMUSTEXIST|OFN_HIDEREADONLY|OFN_NOCHANGEDIR;
if (GetOpenFileName(&ofn)) if (GetOpenFileName(&ofn))
{ {
SetCurTab(m_Index,true); // reload tab once to force-close any active edit boxes
CString error=g_SettingsManager.LoadSettingsXml(path); CString error=g_SettingsManager.LoadSettingsXml(path);
if (!error.IsEmpty()) if (!error.IsEmpty())
{ {
@@ -1710,7 +1723,7 @@ LRESULT CSettingsDlg::OnBackup( WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL&
::MessageBox(m_hWnd,text,LoadStringEx(IDS_ERROR_TITLE),MB_OK|MB_ICONERROR); ::MessageBox(m_hWnd,text,LoadStringEx(IDS_ERROR_TITLE),MB_OK|MB_ICONERROR);
} }
SetSettingsDirty(); SetSettingsDirty();
SetCurTab(m_Index,true); SetCurTab(m_Index,true); // reload tab again to show the new settings
} }
} }
if (res==3) if (res==3)
@@ -2208,7 +2221,7 @@ bool GetSettingBool( const CSetting &setting )
CString GetSettingString( 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) if (setting.value.vt!=VT_BSTR)
return CString(); return CString();
return setting.value.bstrVal; return setting.value.bstrVal;
@@ -2709,7 +2722,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); 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); fprintf_s(fAdmx,"\t\t\t\t<text id=\"Value\" valueName=\"%S\"/>\r\n",pSetting->name);
} }
@@ -2769,7 +2782,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); 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); 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_SOUND,
TYPE_FONT, TYPE_FONT,
TYPE_MULTISTRING, TYPE_MULTISTRING,
TYPE_DIRECTORY,
}; };
enum enum

View File

@@ -1156,7 +1156,7 @@ HRESULT STDMETHODCALLTYPE CBrowseLinkEvents::OnButtonClicked( IFileDialogCustomi
{ {
pfd->GetFolder(&pItem); pfd->GetFolder(&pItem);
} }
m_pResult=pItem; m_pResult=std::move(pItem);
pfd->Close(S_FALSE); pfd->Close(S_FALSE);
return S_OK; return S_OK;
} }
@@ -1216,7 +1216,7 @@ bool BrowseCommandHelper( HWND parent, wchar_t *text )
return false; return false;
} }
bool BrowseLinkHelper( HWND parent, wchar_t *text ) bool BrowseLinkHelper( HWND parent, wchar_t *text, bool bFoldersOnly )
{ {
DoEnvironmentSubst(text,_MAX_PATH); DoEnvironmentSubst(text,_MAX_PATH);
@@ -1227,16 +1227,22 @@ bool BrowseLinkHelper( HWND parent, wchar_t *text )
if (!pCustomize) if (!pCustomize)
return false; return false;
pDialog->SetTitle(LoadStringEx(IDS_PICK_LINK_TITLE)); pDialog->SetTitle(LoadStringEx(bFoldersOnly?IDS_PICK_LINK_FOLDER:IDS_PICK_LINK_TITLE));
pDialog->SetOkButtonLabel(LoadStringEx(IDS_PICK_LINK_FILE)); if (!bFoldersOnly) // add separate buttons for selecting files/folders to the dialog
wchar_t button[256]; {
Sprintf(button,_countof(button),L" %s ",LoadStringEx(IDS_PICK_LINK_FOLDER)); pDialog->SetOkButtonLabel(LoadStringEx(IDS_PICK_LINK_FILE));
pCustomize->AddPushButton(101,button); wchar_t button[256];
Sprintf(button,_countof(button),L" %s ",LoadStringEx(IDS_PICK_LINK_FOLDER));
pCustomize->AddPushButton(101,button);
}
CBrowseLinkEvents events; CBrowseLinkEvents events;
DWORD cookie; DWORD cookie;
pDialog->Advise(&events,&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,'|'); const wchar_t *c=wcschr(text,'|');
if (c) if (c)
@@ -1822,7 +1828,10 @@ void CCustomTreeDlg::SerializeData( void )
if ((m_pSetting->flags&CSetting::FLAG_DEFAULT) || wcscmp(strNew,strOld)!=0) if ((m_pSetting->flags&CSetting::FLAG_DEFAULT) || wcscmp(strNew,strOld)!=0)
SetSettingsDirty(); SetSettingsDirty();
m_pSetting->value=CComVariant(strNew); m_pSetting->value=CComVariant(strNew);
m_pSetting->flags&=~CSetting::FLAG_DEFAULT; if (m_pSetting->value==m_pSetting->defValue)
m_pSetting->flags|=CSetting::FLAG_DEFAULT;
else
m_pSetting->flags&=~CSetting::FLAG_DEFAULT;
ItemsChanged(); ItemsChanged();
} }
@@ -2271,6 +2280,7 @@ public:
EDIT_HOTKEY_ANY, EDIT_HOTKEY_ANY,
EDIT_COLOR, EDIT_COLOR,
EDIT_FONT, EDIT_FONT,
EDIT_DIRECTORY,
}; };
BEGIN_MSG_MAP( CTreeSettingsDlg ) BEGIN_MSG_MAP( CTreeSettingsDlg )
@@ -2714,6 +2724,29 @@ LRESULT CTreeSettingsDlg::OnBrowse( WORD wNotifyCode, WORD wID, HWND hWndCtl, BO
m_EditBox.SetFocus(); m_EditBox.SetFocus();
m_bIgnoreFocus=false; 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; return 0;
} }
@@ -2778,7 +2811,10 @@ void CTreeSettingsDlg::ToggleItem( HTREEITEM hItem, bool bDefault )
{ {
CSettingsLockWrite lock; CSettingsLockWrite lock;
pSetting->value=CComVariant(state?0:1); pSetting->value=CComVariant(state?0:1);
pSetting->flags&=~CSetting::FLAG_DEFAULT; if (pSetting->value==pSetting->defValue)
pSetting->flags|=CSetting::FLAG_DEFAULT;
else
pSetting->flags&=~CSetting::FLAG_DEFAULT;
SetSettingsDirty(); SetSettingsDirty();
} }
if (pSetting->flags&CSetting::FLAG_CALLBACK) if (pSetting->flags&CSetting::FLAG_CALLBACK)
@@ -2802,7 +2838,10 @@ void CTreeSettingsDlg::ToggleItem( HTREEITEM hItem, bool bDefault )
{ {
CSettingsLockWrite lock; CSettingsLockWrite lock;
pTarget->value=CComVariant(val); pTarget->value=CComVariant(val);
pTarget->flags&=~CSetting::FLAG_DEFAULT; if (pTarget->value==pTarget->defValue)
pTarget->flags|=CSetting::FLAG_DEFAULT;
else
pTarget->flags&=~CSetting::FLAG_DEFAULT;
SetSettingsDirty(); SetSettingsDirty();
} }
if (pParent->flags&CSetting::FLAG_CALLBACK) if (pParent->flags&CSetting::FLAG_CALLBACK)
@@ -3013,7 +3052,10 @@ void CTreeSettingsDlg::ApplyEditBox( void )
if (pSetting->value.vt!=VT_I4 || pSetting->value.intVal!=val) if (pSetting->value.vt!=VT_I4 || pSetting->value.intVal!=val)
{ {
pSetting->value=CComVariant(val); pSetting->value=CComVariant(val);
pSetting->flags&=~CSetting::FLAG_DEFAULT; if (pSetting->value==pSetting->defValue)
pSetting->flags|=CSetting::FLAG_DEFAULT;
else
pSetting->flags&=~CSetting::FLAG_DEFAULT;
} }
} }
else if (pSetting->type==CSetting::TYPE_COLOR) else if (pSetting->type==CSetting::TYPE_COLOR)
@@ -3023,7 +3065,10 @@ void CTreeSettingsDlg::ApplyEditBox( void )
if (pSetting->value.vt!=VT_I4 || pSetting->value.intVal!=val) if (pSetting->value.vt!=VT_I4 || pSetting->value.intVal!=val)
{ {
pSetting->value=CComVariant(val); pSetting->value=CComVariant(val);
pSetting->flags&=~CSetting::FLAG_DEFAULT; if (pSetting->value==pSetting->defValue)
pSetting->flags|=CSetting::FLAG_DEFAULT;
else
pSetting->flags&=~CSetting::FLAG_DEFAULT;
} }
} }
else if (pSetting->type==CSetting::TYPE_HOTKEY || pSetting->type==CSetting::TYPE_HOTKEY_ANY) else if (pSetting->type==CSetting::TYPE_HOTKEY || pSetting->type==CSetting::TYPE_HOTKEY_ANY)
@@ -3031,7 +3076,24 @@ void CTreeSettingsDlg::ApplyEditBox( void )
if (pSetting->value.vt!=VT_I4 || pSetting->value.intVal!=g_HotKey) if (pSetting->value.vt!=VT_I4 || pSetting->value.intVal!=g_HotKey)
{ {
pSetting->value=CComVariant(g_HotKey); pSetting->value=CComVariant(g_HotKey);
pSetting->flags&=~CSetting::FLAG_DEFAULT; if (pSetting->value==pSetting->defValue)
pSetting->flags|=CSetting::FLAG_DEFAULT;
else
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 else
@@ -3039,7 +3101,10 @@ void CTreeSettingsDlg::ApplyEditBox( void )
if (pSetting->value.vt!=VT_BSTR || str!=pSetting->value.bstrVal) if (pSetting->value.vt!=VT_BSTR || str!=pSetting->value.bstrVal)
{ {
pSetting->value=CComVariant(str); pSetting->value=CComVariant(str);
pSetting->flags&=~CSetting::FLAG_DEFAULT; if (pSetting->value==pSetting->defValue)
pSetting->flags|=CSetting::FLAG_DEFAULT;
else
pSetting->flags&=~CSetting::FLAG_DEFAULT;
} }
} }
SetSettingsDirty(); SetSettingsDirty();
@@ -3074,7 +3139,7 @@ void CTreeSettingsDlg::ItemSelected( HTREEITEM hItem, CSetting *pSetting, bool b
val=valVar.intVal; val=valVar.intVal;
Sprintf(text,_countof(text),L"%d",val); 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) if (valVar.vt==VT_BSTR)
Strcpy(text,_countof(text),valVar.bstrVal); Strcpy(text,_countof(text),valVar.bstrVal);
@@ -3090,8 +3155,10 @@ void CTreeSettingsDlg::ItemSelected( HTREEITEM hItem, CSetting *pSetting, bool b
mode=EDIT_BITMAP_JPG; mode=EDIT_BITMAP_JPG;
else if (pSetting->type==CSetting::TYPE_SOUND) else if (pSetting->type==CSetting::TYPE_SOUND)
mode=EDIT_SOUND; mode=EDIT_SOUND;
else else if (pSetting->type==CSetting::TYPE_FONT)
mode=EDIT_FONT; mode=EDIT_FONT;
else
mode=EDIT_DIRECTORY;
} }
else if (pSetting->type==CSetting::TYPE_HOTKEY || pSetting->type==CSetting::TYPE_HOTKEY_ANY) else if (pSetting->type==CSetting::TYPE_HOTKEY || pSetting->type==CSetting::TYPE_HOTKEY_ANY)
{ {
@@ -3131,7 +3198,7 @@ void CTreeSettingsDlg::ItemSelected( HTREEITEM hItem, CSetting *pSetting, bool b
m_pEditSetting=pSetting; 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; RECT rc2=rc;
int width=(rc2.bottom-rc2.top)*3/2; int width=(rc2.bottom-rc2.top)*3/2;
@@ -3189,14 +3256,15 @@ void CTreeSettingsDlg::UpdateEditPosition( void )
DeleteDC(hdc); DeleteDC(hdc);
DWORD margins=(DWORD)m_EditBox.SendMessage(EM_GETMARGINS); DWORD margins=(DWORD)m_EditBox.SendMessage(EM_GETMARGINS);
size.cx+=HIWORD(margins)+LOWORD(margins)+12; 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; size.cx+=width;
if (m_EditMode==EDIT_SOUND) if (m_EditMode==EDIT_SOUND)
size.cx+=width*2; size.cx+=width*2;
if (size.cx<w) if (size.cx<w)
rc.right=rc.left+size.cx; 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; RECT rc2=rc;
rc2.left=rc2.right-width; rc2.left=rc2.right-width;
@@ -3376,6 +3444,9 @@ void CTreeSettingsDlg::UpdateGroup( const CSetting *pModified )
bool bDefault=pSetting->IsDefault(); bool bDefault=pSetting->IsDefault();
const CComVariant &valVar=pSetting->GetValue(); const CComVariant &valVar=pSetting->GetValue();
// check if modified items should be bold
bool bBoldSettings=GetSettingBool(L"BoldSettings");
// calculate text // calculate text
if (pSetting!=m_pEditSetting) if (pSetting!=m_pEditSetting)
{ {
@@ -3458,7 +3529,7 @@ void CTreeSettingsDlg::UpdateGroup( const CSetting *pModified )
DeleteDC(hdc); DeleteDC(hdc);
DeleteDC(hdcMask); 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 (!bEnabled)
{ {
if (pSetting->type!=CSetting::TYPE_COLOR) image|=SETTING_STATE_DISABLED; 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; extern const GUID FOLDERID_DesktopRoot;
bool BrowseCommandHelper( HWND parent, wchar_t *text ); 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 ); bool BrowseIconHelper( HWND parent, wchar_t *text );

View File

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

View File

@@ -16,9 +16,7 @@ CMenuAccessible::CMenuAccessible( CMenuContainer *pOwner )
CreateStdAccessibleObject(pOwner->m_hWnd,OBJID_CLIENT,IID_IAccessible,(void**)&m_pStdAccessible); CreateStdAccessibleObject(pOwner->m_hWnd,OBJID_CLIENT,IID_IAccessible,(void**)&m_pStdAccessible);
} }
CMenuAccessible::~CMenuAccessible( void ) CMenuAccessible::~CMenuAccessible( void ) = default;
{
}
void CMenuAccessible::Reset( void ) 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"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"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"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"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"fonts",0,NULL,NULL,NULL,&FOLDERID_Fonts},
{L"desktop",0,NULL,NULL,NULL,&FOLDERID_Desktop}, {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"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}, {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"downloads",0,NULL,L"$Menu.DownloadTip",NULL,&FOLDERID_Downloads},
{L"games",0,NULL,L"$Menu.GamesTip",NULL,&FOLDERID_Games,NULL,StdMenuItem::MENU_TRACK}, {L"games",0,NULL,L"$Menu.GamesTip",NULL,&FOLDERID_Games,NULL,StdMenuItem::MENU_TRACK},
{L"links",0,NULL,NULL,NULL,&FOLDERID_Links}, {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_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"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"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"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}, {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_SINGLE=1, // this item never has sub-menu
ITEM_FOLDER=2, // this item always has sub-menu ITEM_FOLDER=2, // this item always has sub-menu
ITEM_COMPUTER=4, // this item can be expanded only one level 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; const wchar_t *command;
int nameID; int nameID;

View File

@@ -903,7 +903,7 @@ HRESULT STDMETHODCALLTYPE CMenuContainer::Drop( IDataObject *pDataObj, DWORD grf
else if (i<before) else if (i<before)
skip++; skip++;
} }
SortMenuItem ins(L"",FNV_HASH0,false,false,folderIndex*2,0); SortMenuItem ins(L"",FNV_HASH0,false,false,false,folderIndex*2,0);
items.insert(items.begin()+(before-skip),ins); items.insert(items.begin()+(before-skip),ins);
SaveItemOrder(items); SaveItemOrder(items);
} }

View File

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

View File

@@ -589,7 +589,7 @@ void CItemManager::Init( void )
m_RootGames=L"::{ED228FDF-9EA8-4870-83B1-96B02CFE0D52}\\"; m_RootGames=L"::{ED228FDF-9EA8-4870-83B1-96B02CFE0D52}\\";
wchar_t text[_MAX_PATH]; 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)); DoEnvironmentSubst(text,_countof(text));
m_RootStartMenu3=text; m_RootStartMenu3=text;
StringUpper(m_RootStartMenu3); StringUpper(m_RootStartMenu3);
@@ -609,7 +609,7 @@ void CItemManager::Init( void )
{ {
int width, height; int width, height;
pList->GetIconSize(&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()); std::sort(m_ListSizes.begin(),m_ListSizes.end());
@@ -617,7 +617,7 @@ void CItemManager::Init( void )
CreateDefaultIcons(); CreateDefaultIcons();
LoadCacheFile(); 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.bIconOnly=true;
item.smallIcon=m_DefaultSmallIcon; item.smallIcon=m_DefaultSmallIcon;
item.largeIcon=m_DefaultLargeIcon; item.largeIcon=m_DefaultLargeIcon;
@@ -704,21 +704,21 @@ void CItemManager::CreateDefaultIcons( void )
icon.bitmap=BitmapFromIcon(LoadShellIcon(index,SMALL_ICON_SIZE),SMALL_ICON_SIZE); icon.bitmap=BitmapFromIcon(LoadShellIcon(index,SMALL_ICON_SIZE),SMALL_ICON_SIZE);
else else
icon.bitmap=NULL; 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; icon.sizeType=ICON_SIZE_TYPE_LARGE;
if (index>=0) if (index>=0)
icon.bitmap=BitmapFromIcon(LoadShellIcon(index,LARGE_ICON_SIZE),LARGE_ICON_SIZE); icon.bitmap=BitmapFromIcon(LoadShellIcon(index,LARGE_ICON_SIZE),LARGE_ICON_SIZE);
else else
icon.bitmap=NULL; 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; icon.sizeType=ICON_SIZE_TYPE_EXTRA_LARGE;
if (index>=0) if (index>=0)
icon.bitmap=BitmapFromIcon(LoadShellIcon(index,EXTRA_LARGE_ICON_SIZE),EXTRA_LARGE_ICON_SIZE); icon.bitmap=BitmapFromIcon(LoadShellIcon(index,EXTRA_LARGE_ICON_SIZE),EXTRA_LARGE_ICON_SIZE);
else else
icon.bitmap=NULL; 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 ) CItemManager::LoadIconData &CItemManager::GetLoadIconData( void )
@@ -896,7 +896,7 @@ const CItemManager::ItemInfo *CItemManager::GetItemInfo( IShellItem *pItem, PIDL
} }
if (!pInfo) 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->pidl.Clone(pidl);
pInfo->path=path; pInfo->path=path;
pInfo->PATH=PATH; pInfo->PATH=PATH;
@@ -978,7 +978,7 @@ const CItemManager::ItemInfo *CItemManager::GetItemInfo( CString path, int refre
} }
if (!pInfo) if (!pInfo)
{ {
pInfo=&m_ItemInfos.insert(std::pair<unsigned int,ItemInfo>(hash,ItemInfo()))->second; pInfo=&m_ItemInfos.emplace(hash,ItemInfo())->second;
if (!PATH.IsEmpty()) if (!PATH.IsEmpty())
MenuParseDisplayName(path,&pInfo->pidl,NULL,NULL); MenuParseDisplayName(path,&pInfo->pidl,NULL,NULL);
if (pInfo->pidl) if (pInfo->pidl)
@@ -1076,7 +1076,7 @@ const CItemManager::ItemInfo *CItemManager::GetCustomIcon( const wchar_t *locati
} }
if (!pInfo) 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->bIconOnly=true;
pInfo->bTemp=bTemp; pInfo->bTemp=bTemp;
pInfo->iconPath=location; 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) if (SUCCEEDED(store->GetValue(PKEY_MetroAppLauncher, &val)) && (val.vt == VT_I4 || val.vt == VT_UI4) && val.intVal)
{ {
newInfo.bLink = false; newInfo.bLink = false;
pItem = target; pItem = std::move(target);
pStore = store; pStore = store;
} }
PropVariantClear(&val); PropVariantClear(&val);
@@ -2597,7 +2597,7 @@ void CItemManager::StoreInCache( unsigned int hash, const wchar_t *path, HBITMAP
if ((refreshFlags&INFO_SMALL_ICON) && hSmallBitmap) 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->sizeType=ICON_SIZE_TYPE_SMALL;
pInfo->bTemp=bTemp; pInfo->bTemp=bTemp;
pInfo->bMetro=bMetro; pInfo->bMetro=bMetro;
@@ -2607,7 +2607,7 @@ void CItemManager::StoreInCache( unsigned int hash, const wchar_t *path, HBITMAP
} }
if ((refreshFlags&INFO_LARGE_ICON) && hLargeBitmap) 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->sizeType=ICON_SIZE_TYPE_LARGE;
pInfo->bTemp=bTemp; pInfo->bTemp=bTemp;
pInfo->bMetro=bMetro; 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) 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->sizeType=ICON_SIZE_TYPE_EXTRA_LARGE;
pInfo->bTemp=bTemp; pInfo->bTemp=bTemp;
pInfo->bMetro=bMetro; pInfo->bMetro=bMetro;
@@ -2867,7 +2867,8 @@ void CItemManager::PreloadItemsThread( void )
else if (g_CacheFolders[i].folder==FOLDERID_ClassicPinned) else if (g_CacheFolders[i].folder==FOLDERID_ClassicPinned)
{ {
if (GetSettingInt(L"PinnedPrograms")!=PINNED_PROGRAMS_PINNED) continue; 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)); DoEnvironmentSubst(path,_countof(path));
if (FAILED(SHParseDisplayName(path,NULL,&pidl,0,NULL)) || !pidl) continue; if (FAILED(SHParseDisplayName(path,NULL,&pidl,0,NULL)) || !pidl) continue;
if (FAILED(SHCreateItemFromIDList(pidl,IID_IShellItem,(void**)&pFolder)) || !pFolder) continue; if (FAILED(SHCreateItemFromIDList(pidl,IID_IShellItem,(void**)&pFolder)) || !pFolder) continue;
@@ -3273,7 +3274,7 @@ void CItemManager::LoadCacheFile( void )
bError=true; bError=true;
break; 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 else
{ {
@@ -3304,7 +3305,7 @@ void CItemManager::LoadCacheFile( void )
bError=true; bError=true;
break; 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.writestamp=data.writestamp;
info.createstamp=data.createstamp; info.createstamp=data.createstamp;
@@ -3568,7 +3569,7 @@ void CItemManager::ClearCache( void )
m_IconInfos.clear(); m_IconInfos.clear();
m_MetroItemInfos10.clear(); m_MetroItemInfos10.clear();
CreateDefaultIcons(); 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.bIconOnly=true;
item.smallIcon=m_DefaultSmallIcon; item.smallIcon=m_DefaultSmallIcon;
item.largeIcon=m_DefaultLargeIcon; item.largeIcon=m_DefaultLargeIcon;

View File

@@ -470,7 +470,6 @@ STDAPI ShGetKnownFolderItem(REFKNOWNFOLDERID rfid, IShellItem **ppItem );
HBITMAP ColorizeMonochromeImage(HBITMAP bitmap, DWORD color); HBITMAP ColorizeMonochromeImage(HBITMAP bitmap, DWORD color);
#define TASKBAR_PINNED_ROOT L"%APPDATA%\\Microsoft\\Internet Explorer\\Quick Launch\\User Pinned\\TaskBar" #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 STARTSCREEN_COMMAND L"startscreen.lnk"
#define USERASSIST_LINKS_KEY L"Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\UserAssist\\{F4E57C4B-2036-45F0-A9AB-443BCFE33D9F}\\Count" #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" #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 "Settings.h"
#include "SettingsUI.h" #include "SettingsUI.h"
#include "SettingsUIHelper.h" #include "SettingsUIHelper.h"
#include "FileHelper.h"
#include "Translations.h" #include "Translations.h"
#include "LogManager.h" #include "LogManager.h"
#include "FNVHash.h" #include "FNVHash.h"
@@ -2782,12 +2783,19 @@ void CMenuContainer::ActivateItem( int index, TActivateType type, const POINT *p
info.lpVerb=MAKEINTRESOURCEA(res-verbOffset); info.lpVerb=MAKEINTRESOURCEA(res-verbOffset);
info.lpVerbW=MAKEINTRESOURCEW(res-verbOffset); info.lpVerbW=MAKEINTRESOURCEW(res-verbOffset);
info.nShow=SW_SHOWNORMAL; 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]; wchar_t dir[_MAX_PATH];
if (SHGetPathFromIDList(pItemPidl1,dir)) if (SHGetPathFromIDList(pItemPidl1,dir))
{ {
PathRemoveFileSpec(dir); if (_stricmp(command,"open")==0 && GetSettingBool(L"OpenTruePath") && GetFakeFolder(targetlnkPath,_countof(targetlnkPath),dir))
if (GetFileAttributes(dir)!=INVALID_FILE_ATTRIBUTES) bOpenTruePath=true;
info.lpDirectoryW=dir; else
{
PathRemoveFileSpec(dir);
if (GetFileAttributes(dir)!=INVALID_FILE_ATTRIBUTES)
info.lpDirectoryW=dir;
}
} }
if (pPt) if (pPt)
{ {
@@ -2818,9 +2826,20 @@ void CMenuContainer::ActivateItem( int index, TActivateType type, const POINT *p
::SetForegroundWindow(g_OwnerWindow); ::SetForegroundWindow(g_OwnerWindow);
::SetWindowPos(g_OwnerWindow,HWND_TOPMOST,rc.left,rc.top,rc.right-rc.left,rc.bottom-rc.top,0); ::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); LOG_MENU(LOG_EXECUTE,L"Invoke command, ptr=%p, command='%S'",this,command);
HRESULT hr=pInvokeMenu->InvokeCommand((LPCMINVOKECOMMANDINFO)&info); bool executeSuccess;
LOG_MENU(LOG_EXECUTE,L"Invoke command, ptr=%p, res=%d",this,hr); if (bOpenTruePath) // we are trying to open a fake folder, directly open target.lnk instead
if (type==ACTIVATE_EXECUTE && SUCCEEDED(hr)) {
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) if (bTrackRecent)
{ {

View File

@@ -315,6 +315,7 @@ bool CMenuContainer::s_bShowTopEmpty=false;
bool CMenuContainer::s_bNoDragDrop=false; bool CMenuContainer::s_bNoDragDrop=false;
bool CMenuContainer::s_bNoContextMenu=false; bool CMenuContainer::s_bNoContextMenu=false;
bool CMenuContainer::s_bExpandLinks=false; bool CMenuContainer::s_bExpandLinks=false;
bool CMenuContainer::s_bSingleClickFolders=false;
bool CMenuContainer::s_bLogicalSort=false; bool CMenuContainer::s_bLogicalSort=false;
bool CMenuContainer::s_bExtensionSort=false; bool CMenuContainer::s_bExtensionSort=false;
bool CMenuContainer::s_bAllPrograms=false; bool CMenuContainer::s_bAllPrograms=false;
@@ -334,6 +335,7 @@ bool CMenuContainer::s_bDragMovable;
bool CMenuContainer::s_bRightDrag; bool CMenuContainer::s_bRightDrag;
bool CMenuContainer::s_bLockWorkArea; bool CMenuContainer::s_bLockWorkArea;
bool CMenuContainer::s_bPendingSearchEnter; bool CMenuContainer::s_bPendingSearchEnter;
bool CMenuContainer::s_bMoreResults;
std::vector<CMenuContainer*> CMenuContainer::s_Menus; std::vector<CMenuContainer*> CMenuContainer::s_Menus;
volatile HWND CMenuContainer::s_FirstMenu, CMenuContainer::s_SearchMenu; volatile HWND CMenuContainer::s_FirstMenu, CMenuContainer::s_SearchMenu;
CSearchManager::SearchResults CMenuContainer::s_SearchResults; CSearchManager::SearchResults CMenuContainer::s_SearchResults;
@@ -443,7 +445,10 @@ LRESULT CALLBACK CMenuContainer::SubclassSearchBox( HWND hWnd, UINT uMsg, WPARAM
SetBkColor(hdc,GetSysColor(COLOR_WINDOW)); SetBkColor(hdc,GetSysColor(COLOR_WINDOW));
SetBkMode(hdc,TRANSPARENT); SetBkMode(hdc,TRANSPARENT);
SetTextColor(hdc,s_Skin.Search_text_colors[1]); 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); SelectObject(hdc,font0);
} }
return res; return res;
@@ -856,7 +861,8 @@ void CMenuContainer::AddFirstFolder( IShellItem *pFolder, std::vector<MenuItem>
if (bLibrary) flags&=~SFGAO_STREAM; if (bLibrary) flags&=~SFGAO_STREAM;
item.bLink=(flags&SFGAO_LINK)!=0; item.bLink=(flags&SFGAO_LINK)!=0;
item.bFolder=(!(options&CONTAINER_CONTROLPANEL) && !(options&CONTAINER_NOSUBFOLDERS) && (flags&SFGAO_FOLDER) && (!(flags&(SFGAO_STREAM|SFGAO_LINK)) || (s_bExpandLinks && item.bLink))); item.bFolderLink=(flags&SFGAO_FOLDER && (!(flags&(SFGAO_STREAM|SFGAO_LINK)) || (s_bExpandLinks && item.bLink)));
item.bFolder=(!(options&CONTAINER_CONTROLPANEL) && !(options&CONTAINER_NOSUBFOLDERS) && item.bFolderLink);
{ {
CItemManager::RWLock lock(&g_ItemManager,false,CItemManager::RWLOCK_ITEMS); CItemManager::RWLock lock(&g_ItemManager,false,CItemManager::RWLOCK_ITEMS);
if (item.pItemInfo->IsMetroLink()) if (item.pItemInfo->IsMetroLink())
@@ -1084,7 +1090,8 @@ void CMenuContainer::AddStandardItems( void )
if (m_bSubMenu && pStdItem->id==s_ShutdownCommand) if (m_bSubMenu && pStdItem->id==s_ShutdownCommand)
continue; 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; mainIconSize=s_Skin.Main2_icon_size;
int stdOptions=GetStdOptions(pStdItem->id); int stdOptions=GetStdOptions(pStdItem->id);
@@ -2237,7 +2244,7 @@ void CMenuContainer::AddJumpListItems( std::vector<MenuItem> &items )
{ {
ILFree(item.pItem1); ILFree(item.pItem1);
item.pItem1=pidl2.Detach(); item.pItem1=pidl2.Detach();
pItem=pItem2; pItem=std::move(pItem2);
} }
} }
} }
@@ -2499,9 +2506,9 @@ void CMenuContainer::InitItems( void )
m_Items.resize(MAX_MENU_ITEMS); 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}"); unsigned int AdminToolsHash=CalcFNVHash(L"::{D20EA4E1-3957-11D2-A40B-0C5020524153}");
for (std::vector<MenuItem>::iterator it=m_Items.begin();it!=m_Items.end();++it) for (std::vector<MenuItem>::iterator it=m_Items.begin();it!=m_Items.end();++it)
if (it->nameHash==AdminToolsHash) if (it->nameHash==AdminToolsHash)
@@ -2740,9 +2747,9 @@ bool CMenuContainer::InitSearchItems( void )
{ {
sepHeight=s_Skin.ItemSettings[s_Skin.More_bitmap_Size.cx?MenuSkin::LIST_SEPARATOR_SPLIT:MenuSkin::LIST_SEPARATOR].itemHeight; 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; 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=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()) if (!s_SearchResults.bSearching && !HasMoreResults())
maxHeight+=itemHeight; maxHeight+=itemHeight;
} }
@@ -2936,25 +2943,28 @@ bool CMenuContainer::InitSearchItems( void )
if (s_bWin7Style) if (s_bWin7Style)
{ {
UpdateAccelerators(m_OriginalCount,(int)m_Items.size()); UpdateAccelerators(m_OriginalCount,(int)m_Items.size());
MenuItem &item=m_Items[m_SearchIndex-m_SearchItemCount+1]; if (s_bMoreResults)
if (s_SearchResults.bSearching)
{ {
item.id=MENU_SEARCH_EMPTY; MenuItem &item=m_Items[m_SearchIndex-m_SearchItemCount+1];
item.name=FindTranslation(L"Menu.Searching",L"Searching..."); if (s_SearchResults.bSearching)
item.pItemInfo=g_ItemManager.GetCustomIcon(L"imageres.dll,8",CItemManager::ICON_SIZE_TYPE_SMALL); {
} item.id=MENU_SEARCH_EMPTY;
else item.name=FindTranslation(L"Menu.Searching",L"Searching...");
{ item.pItemInfo=g_ItemManager.GetCustomIcon(L"imageres.dll,8",CItemManager::ICON_SIZE_TYPE_SMALL);
item.id=MENU_MORE_RESULTS; }
item.name=FindTranslation(L"Menu.MoreResults",L"See more results"); else
item.pItemInfo=g_ItemManager.GetCustomIcon(L"imageres.dll,177",CItemManager::ICON_SIZE_TYPE_SMALL); {
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 else
{ {
m_ScrollCount=(int)m_Items.size(); m_ScrollCount=(int)m_Items.size();
bool bInternet=GetSettingBool(L"SearchInternet"); bool bInternet=GetSettingBool(L"SearchInternet");
if (s_SearchResults.bSearching) if (s_bMoreResults && s_SearchResults.bSearching)
{ {
MenuItem item(MENU_SEARCH_EMPTY); MenuItem item(MENU_SEARCH_EMPTY);
item.name=FindTranslation(L"Menu.Searching",L"Searching..."); item.name=FindTranslation(L"Menu.Searching",L"Searching...");
@@ -2969,7 +2979,7 @@ bool CMenuContainer::InitSearchItems( void )
item.name=FindTranslation(L"Menu.NoMatch",L"No items match your search."); item.name=FindTranslation(L"Menu.NoMatch",L"No items match your search.");
m_Items.push_back(item); m_Items.push_back(item);
} }
if (HasMoreResults()) if (s_bMoreResults && HasMoreResults())
{ {
{ {
MenuItem item(MENU_SEPARATOR); MenuItem item(MENU_SEPARATOR);
@@ -5057,7 +5067,7 @@ void CMenuContainer::UpdateSearchResults( bool bForceShowAll )
g_SearchManager.BeginSearch(s_SearchResults.currentString); g_SearchManager.BeginSearch(s_SearchResults.currentString);
s_SearchResults.bSearching=true; s_SearchResults.bSearching=true;
s_bPendingSearchEnter=false; s_bPendingSearchEnter=false;
if (s_bWin7Style) if (s_bWin7Style && s_bMoreResults)
{ {
MenuItem &item=m_Items[m_SearchIndex-m_SearchItemCount+1]; MenuItem &item=m_Items[m_SearchIndex-m_SearchItemCount+1];
item.id=MENU_SEARCH_EMPTY; item.id=MENU_SEARCH_EMPTY;
@@ -6798,7 +6808,7 @@ LRESULT CMenuContainer::OnLButtonDblClick( UINT uMsg, WPARAM wParam, LPARAM lPar
ClientToScreen(&pt); ClientToScreen(&pt);
if (s_bWin7Style && item.id==MENU_PROGRAMS) // only single clicks for All Programs if (s_bWin7Style && item.id==MENU_PROGRAMS) // only single clicks for All Programs
OnLButtonDown(WM_LBUTTONDOWN,wParam,lParam,bHandled); 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); ActivateItem(index,ACTIVATE_EXECUTE,&pt);
return 0; return 0;
} }
@@ -6822,7 +6832,7 @@ LRESULT CMenuContainer::OnLButtonUp( UINT uMsg, WPARAM wParam, LPARAM lParam, BO
const MenuItem &item=m_Items[index]; const MenuItem &item=m_Items[index];
POINT pt2=pt; POINT pt2=pt;
ClientToScreen(&pt2); 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) if (item.jumpIndex>=0 && m_bHotArrow)
{ {
@@ -7671,6 +7681,7 @@ HWND CMenuContainer::ToggleStartMenu( int taskbarId, bool bKeyboard, bool bAllPr
g_ItemManager.ResetTempIcons(); g_ItemManager.ResetTempIcons();
s_ScrollMenus=GetSettingInt(L"ScrollType"); s_ScrollMenus=GetSettingInt(L"ScrollType");
s_bExpandLinks=GetSettingBool(L"ExpandFolderLinks"); s_bExpandLinks=GetSettingBool(L"ExpandFolderLinks");
s_bSingleClickFolders=GetSettingBool(L"SingleClickFolders");
s_bLogicalSort=GetSettingBool(L"NumericSort"); s_bLogicalSort=GetSettingBool(L"NumericSort");
s_MaxRecentDocuments=GetSettingInt(L"MaxRecentDocuments"); s_MaxRecentDocuments=GetSettingInt(L"MaxRecentDocuments");
s_ShellFormat=RegisterClipboardFormat(CFSTR_SHELLIDLIST); s_ShellFormat=RegisterClipboardFormat(CFSTR_SHELLIDLIST);
@@ -7688,6 +7699,7 @@ HWND CMenuContainer::ToggleStartMenu( int taskbarId, bool bKeyboard, bool bAllPr
s_bDisableHover=false; s_bDisableHover=false;
s_bDragClosed=false; s_bDragClosed=false;
s_bPendingSearchEnter=false; s_bPendingSearchEnter=false;
s_bMoreResults=GetSettingBool(L"MoreResults");
InitTouchHelper(); InitTouchHelper();
bool bRemote=GetSystemMetrics(SM_REMOTESESSION)!=0; bool bRemote=GetSystemMetrics(SM_REMOTESESSION)!=0;
@@ -8056,7 +8068,8 @@ HWND CMenuContainer::ToggleStartMenu( int taskbarId, bool bKeyboard, bool bAllPr
} }
else 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)); DoEnvironmentSubst(path,_countof(path));
SHCreateDirectory(NULL,path); SHCreateDirectory(NULL,path);
s_PinFolder=path; s_PinFolder=path;
@@ -8068,7 +8081,8 @@ HWND CMenuContainer::ToggleStartMenu( int taskbarId, bool bKeyboard, bool bAllPr
{ {
bool bPinned=GetSettingInt(L"PinnedPrograms")==PINNED_PROGRAMS_PINNED; bool bPinned=GetSettingInt(L"PinnedPrograms")==PINNED_PROGRAMS_PINNED;
bool bShortcut=GetSettingBool(L"StartScreenShortcut"); 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)); DoEnvironmentSubst(path,_countof(path));
if (bPinned) if (bPinned)
{ {

View File

@@ -453,7 +453,7 @@ private:
drawType=MenuSkin::COLUMN1_ITEM; drawType=MenuSkin::COLUMN1_ITEM;
column=row=0; column=row=0;
memset(&itemRect,0,sizeof(itemRect)); memset(&itemRect,0,sizeof(itemRect));
bFolder=bLink=bPrograms=bAlignBottom=bBreak=bInline=bInlineFirst=bInlineLast=bSplit=bHasJumpList=bMetroLink=bMetroApp=bBlankSeparator=bNew=bStartScreen=bCustomAccelerator=false; bFolder=bLink=bFolderLink=bPrograms=bAlignBottom=bBreak=bInline=bInlineFirst=bInlineLast=bSplit=bHasJumpList=bMetroLink=bMetroApp=bBlankSeparator=bNew=bStartScreen=bCustomAccelerator=false;
priority=0; priority=0;
pItem1=pItem2=NULL; pItem1=pItem2=NULL;
mfuHash=0; mfuHash=0;
@@ -477,6 +477,7 @@ private:
RECT itemRect; RECT itemRect;
bool bFolder:1; // this is a folder - draw arrow bool bFolder:1; // this is a folder - draw arrow
bool bLink:1; // this is a link (if a link to a folder is expanded it is always single-column) bool bLink:1; // this is a link (if a link to a folder is expanded it is always single-column)
bool bFolderLink:1; // this is a folder that is not explicitly expandable - used for sorting the list-of-links style
bool bPrograms:1; // this item is part of the Start Menu folder hierarchy bool bPrograms:1; // this item is part of the Start Menu folder hierarchy
bool bAlignBottom:1; // two-column menu: this item is aligned to the bottom bool bAlignBottom:1; // two-column menu: this item is aligned to the bottom
bool bBreak:1; // two-column menu: this item starts the second column bool bBreak:1; // two-column menu: this item starts the second column
@@ -512,8 +513,8 @@ private:
if (priority>item.priority) return false; if (priority>item.priority) return false;
if (row<item.row) return true; if (row<item.row) return true;
if (row>item.row) return false; if (row>item.row) return false;
if ((bFolder && !bHasJumpList) && !(item.bFolder && !item.bHasJumpList)) return true; if (((bFolder || bFolderLink) && !bHasJumpList) && !((item.bFolder || item.bFolderLink) && !item.bHasJumpList)) return true;
if (!(bFolder && !bHasJumpList) && (item.bFolder && !item.bHasJumpList)) return false; if (!((bFolder || bFolderLink) && !bHasJumpList) && ((item.bFolder || item.bFolderLink) && !item.bHasJumpList)) return false;
if (drive && !item.drive) return true; if (drive && !item.drive) return true;
if (!drive && item.drive) return false; if (!drive && item.drive) return false;
if (drive && item.drive) return drive<item.drive; if (drive && item.drive) return drive<item.drive;
@@ -578,18 +579,19 @@ private:
CString name; CString name;
unsigned int nameHash; unsigned int nameHash;
bool bFolder; bool bFolder;
bool bFolderLink;
bool bHasJumpList; bool bHasJumpList;
char priority; char priority;
char drive; char drive;
SortMenuItem( const CString &_name, unsigned _nameHash, bool _bFolder, bool _bHasJumpList, char _priority ,char _drive) { name=_name; nameHash=_nameHash; bFolder=_bFolder; bHasJumpList=_bHasJumpList; priority=_priority; drive=_drive; } SortMenuItem( const CString &_name, unsigned _nameHash, bool _bFolder, bool _bFolderLink, bool _bHasJumpList, char _priority ,char _drive) { name=_name; nameHash=_nameHash; bFolder=_bFolder; bFolderLink=_bFolderLink; bHasJumpList=_bHasJumpList; priority=_priority; drive=_drive; }
SortMenuItem( const MenuItem &item ) { name=item.name; nameHash=item.nameHash; bFolder=item.bFolder; bHasJumpList=item.bHasJumpList; priority=item.priority; drive=item.drive; } SortMenuItem( const MenuItem &item ) { name=item.name; nameHash=item.nameHash; bFolder=item.bFolder; bFolderLink=item.bFolderLink; bHasJumpList=item.bHasJumpList; priority=item.priority; drive=item.drive; }
bool operator<( const SortMenuItem &x ) const bool operator<( const SortMenuItem &x ) const
{ {
if (priority<x.priority) return true; if (priority<x.priority) return true;
if (priority>x.priority) return false; if (priority>x.priority) return false;
if ((bFolder && !bHasJumpList) && !(x.bFolder && !x.bHasJumpList)) return true; if (((bFolder || bFolderLink) && !bHasJumpList) && !((x.bFolder || x.bFolderLink) && !x.bHasJumpList)) return true;
if (!(bFolder && !bHasJumpList) && (x.bFolder && !x.bHasJumpList)) return false; if (!((bFolder || bFolderLink) && !bHasJumpList) && ((x.bFolder || x.bFolderLink) && !x.bHasJumpList)) return false;
if (drive && !x.drive) return true; if (drive && !x.drive) return true;
if (!drive && x.drive) return false; if (!drive && x.drive) return false;
if (drive && x.drive) return drive<x.drive; if (drive && x.drive) return drive<x.drive;
@@ -876,6 +878,7 @@ private:
static bool s_bNoDragDrop; // disables drag/drop static bool s_bNoDragDrop; // disables drag/drop
static bool s_bNoContextMenu; // disables the context menu static bool s_bNoContextMenu; // disables the context menu
static bool s_bExpandLinks; // expand links to folders 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_bLogicalSort; // use StrCmpLogical instead of CompareString
static bool s_bExtensionSort; // sort file names by extension static bool s_bExtensionSort; // sort file names by extension
static bool s_bAllPrograms; // this is the All Programs menu of the Windows start menu static bool s_bAllPrograms; // this is the All Programs menu of the Windows start menu
@@ -895,6 +898,7 @@ private:
static bool s_bRightDrag; // dragging with the right mouse button static bool s_bRightDrag; // dragging with the right mouse button
static bool s_bLockWorkArea; // changes to the work area are ignored 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_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_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 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) 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; CComPtr<IXMLDOMNode> pNext;
if (pScopeItem->get_nextSibling(&pNext)!=S_OK) if (pScopeItem->get_nextSibling(&pNext)!=S_OK)
break; break;
pScopeItem=pNext; pScopeItem=std::move(pNext);
} }
return true; return true;
} }
@@ -639,7 +639,8 @@ void CSearchManager::SearchThread( void )
// pinned folder // pinned folder
if (searchRequest.bPinnedFolder) 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); DoEnvironmentSubst(path,_MAX_PATH);
CComPtr<IShellItem> pFolder; CComPtr<IShellItem> pFolder;
if (SUCCEEDED(SHCreateItemFromParsingName(path,NULL,IID_IShellItem,(void**)&pFolder))) if (SUCCEEDED(SHCreateItemFromParsingName(path,NULL,IID_IShellItem,(void**)&pFolder)))
@@ -798,7 +799,7 @@ void CSearchManager::SearchThread( void )
CSession session; CSession session;
if (SUCCEEDED(dataSource.OpenFromInitializationString(L"provider=Search.CollatorDSO.1;EXTENDED PROPERTIES=\"Application=Windows\"")) && SUCCEEDED(session.Open(dataSource))) 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) if (searchRequest.bSearchMetroSettings && !m_bMetroSettingsFound)
{ {
@@ -1104,7 +1105,7 @@ void CSearchManager::SearchThread( void )
command0.Close(); command0.Close();
continue; 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()) if (it->roots.empty())
continue; continue;
@@ -1122,7 +1123,7 @@ void CSearchManager::SearchThread( void )
else else
{ {
len+=Strcpy(query+len,_countof(query)-len,L" AND System.Search.Store='FILE' AND System.ItemType!='.settingcontent-ms'"); 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) if (it2->categoryHash==CATEGORY_METROSETTING)
continue; continue;

View File

@@ -36,7 +36,7 @@ public:
struct SearchCategory struct SearchCategory
{ {
SearchCategory( void ) {} SearchCategory( void ) = default;
SearchCategory( const SearchCategory &cat ) SearchCategory( const SearchCategory &cat )
{ {
search.Clone(cat.search); 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]; wchar_t text[_MAX_PATH];
GetDlgItemText(IDC_COMBOLINK,text,_countof(text)); GetDlgItemText(IDC_COMBOLINK,text,_countof(text));
if (BrowseLinkHelper(m_hWnd,text)) if (BrowseLinkHelper(m_hWnd,text,false))
{ {
SetDlgItemText(IDC_COMBOLINK,text); SetDlgItemText(IDC_COMBOLINK,text);
SendMessage(WM_COMMAND,MAKEWPARAM(IDC_COMBOLINK,CBN_KILLFOCUS)); 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]; wchar_t text[_MAX_PATH];
GetDlgItemText(IDC_EDITLINK2,text,_countof(text)); GetDlgItemText(IDC_EDITLINK2,text,_countof(text));
if (BrowseLinkHelper(m_hWnd,text)) if (BrowseLinkHelper(m_hWnd,text,false))
{ {
SetDlgItemText(IDC_EDITLINK2,text); SetDlgItemText(IDC_EDITLINK2,text);
SendMessage(WM_COMMAND,MAKEWPARAM(IDC_EDITLINK2,EN_KILLFOCUS)); SendMessage(WM_COMMAND,MAKEWPARAM(IDC_EDITLINK2,EN_KILLFOCUS));
@@ -2725,8 +2725,11 @@ void CCustomMenuDlg7::CItemList::UpdateItem( int index )
str=LoadStringEx(IDS_ITEM_SHOW2); str=LoadStringEx(IDS_ITEM_SHOW2);
else if ((menuItem.settings&StdMenuItem::MENU_NOEXPAND) && !(g_StdCommands7[menuItem.stdItemIndex].flags&CStdCommand7::ITEM_FOLDER)) else if ((menuItem.settings&StdMenuItem::MENU_NOEXPAND) && !(g_StdCommands7[menuItem.stdItemIndex].flags&CStdCommand7::ITEM_FOLDER))
str=LoadStringEx(IDS_ITEM_SHOW); str=LoadStringEx(IDS_ITEM_SHOW);
else if ((menuItem.settings&StdMenuItem::MENU_SINGLE_EXPAND) && (g_StdCommands7[menuItem.stdItemIndex].flags&CStdCommand7::ITEM_COMPUTER)) else if ((menuItem.settings&StdMenuItem::MENU_SINGLE_EXPAND) && !(g_StdCommands7[menuItem.stdItemIndex].flags&CStdCommand7::ITEM_NODRIVES))
str=LoadStringEx(IDS_ITEM_DRIVES); if (g_StdCommands7[menuItem.stdItemIndex].flags&CStdCommand7::ITEM_COMPUTER)
str=LoadStringEx(IDS_ITEM_DRIVES);
else
str=LoadStringEx(IDS_ITEM_LINKS);
else else
str=LoadStringEx(IDS_ITEM_MENU); str=LoadStringEx(IDS_ITEM_MENU);
ListView_SetItemText(m_hWnd,index,2,(wchar_t*)(const wchar_t*)str); 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) if (m_Column==2)
{ {
// state // state
CString str;
menuItem.settings&=~CEditMenuDlg7::SETTINGS_MASK; menuItem.settings&=~CEditMenuDlg7::SETTINGS_MASK;
if (sel==0) if (sel==0)
menuItem.settings|=StdMenuItem::MENU_ITEM_DISABLED; menuItem.settings|=StdMenuItem::MENU_ITEM_DISABLED;
else if (sel==1 && !(g_StdCommands7[menuItem.stdItemIndex].flags&(CStdCommand7::ITEM_SINGLE|CStdCommand7::ITEM_FOLDER))) else if (sel==1 && !(g_StdCommands7[menuItem.stdItemIndex].flags&(CStdCommand7::ITEM_SINGLE|CStdCommand7::ITEM_FOLDER)))
menuItem.settings|=StdMenuItem::MENU_NOEXPAND; 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; menuItem.settings|=StdMenuItem::MENU_SINGLE_EXPAND;
} }
UpdateItem(m_Line); UpdateItem(m_Line);
@@ -3308,12 +3310,17 @@ void CCustomMenuDlg7::CItemList::CreateCombo( int line, int column )
str=LoadStringEx(IDS_ITEM_DRIVES); str=LoadStringEx(IDS_ITEM_DRIVES);
m_Combo.SendMessage(CB_ADDSTRING,0,(LPARAM)(const wchar_t*)str); 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) if (menuItem.settings&StdMenuItem::MENU_ITEM_DISABLED)
m_Combo.SendMessage(CB_SETCURSEL,0); m_Combo.SendMessage(CB_SETCURSEL,0);
else if ((g_StdCommands7[menuItem.stdItemIndex].flags&(CStdCommand7::ITEM_SINGLE|CStdCommand7::ITEM_FOLDER)) || (menuItem.settings&StdMenuItem::MENU_NOEXPAND)) else if ((g_StdCommands7[menuItem.stdItemIndex].flags&(CStdCommand7::ITEM_SINGLE|CStdCommand7::ITEM_FOLDER)) || (menuItem.settings&StdMenuItem::MENU_NOEXPAND))
m_Combo.SendMessage(CB_SETCURSEL,1); 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); m_Combo.SendMessage(CB_SETCURSEL,3);
else else
m_Combo.SendMessage(CB_SETCURSEL,2); m_Combo.SendMessage(CB_SETCURSEL,2);
@@ -3617,7 +3624,10 @@ void CCustomMenuDlg7::SerializeData( void )
stringBuilder.push_back(0); stringBuilder.push_back(0);
CSettingsLockWrite lock; CSettingsLockWrite lock;
m_pSetting->value=CComVariant(&stringBuilder[0]); m_pSetting->value=CComVariant(&stringBuilder[0]);
m_pSetting->flags&=~CSetting::FLAG_DEFAULT; if (m_pSetting->value==m_pSetting->defValue)
m_pSetting->flags|=CSetting::FLAG_DEFAULT;
else
m_pSetting->flags&=~CSetting::FLAG_DEFAULT;
SetSettingsDirty(); SetSettingsDirty();
} }
@@ -3844,7 +3854,10 @@ LRESULT CMenuStyleDlg::OnClick( WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL&
CheckDlgButton(IDC_RADIO_CLASSIC,pSetting->value.intVal==MENU_CLASSIC1?BST_CHECKED:BST_UNCHECKED); CheckDlgButton(IDC_RADIO_CLASSIC,pSetting->value.intVal==MENU_CLASSIC1?BST_CHECKED:BST_UNCHECKED);
CheckDlgButton(IDC_RADIO_TWO_COLUMNS,pSetting->value.intVal==MENU_CLASSIC2?BST_CHECKED:BST_UNCHECKED); CheckDlgButton(IDC_RADIO_TWO_COLUMNS,pSetting->value.intVal==MENU_CLASSIC2?BST_CHECKED:BST_UNCHECKED);
CheckDlgButton(IDC_RADIO_WIN7,pSetting->value.intVal==MENU_WIN7?BST_CHECKED:BST_UNCHECKED); CheckDlgButton(IDC_RADIO_WIN7,pSetting->value.intVal==MENU_WIN7?BST_CHECKED:BST_UNCHECKED);
pSetting->flags&=~CSetting::FLAG_DEFAULT; if (pSetting->value==pSetting->defValue)
pSetting->flags|=CSetting::FLAG_DEFAULT;
else
pSetting->flags&=~CSetting::FLAG_DEFAULT;
SetSettingsDirty(); SetSettingsDirty();
SetSettingsStyle(styleFlag,CSetting::FLAG_MENU_MASK); SetSettingsStyle(styleFlag,CSetting::FLAG_MENU_MASK);
@@ -3862,7 +3875,10 @@ LRESULT CMenuStyleDlg::OnEnabled( WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL
CSettingsLockWrite lock; CSettingsLockWrite lock;
CSetting *pSetting=FindSetting(L"EnableStartButton"); CSetting *pSetting=FindSetting(L"EnableStartButton");
pSetting->value=CComVariant(bEnabled); pSetting->value=CComVariant(bEnabled);
pSetting->flags&=~CSetting::FLAG_DEFAULT; if (pSetting->value==pSetting->defValue)
pSetting->flags|=CSetting::FLAG_DEFAULT;
else
pSetting->flags&=~CSetting::FLAG_DEFAULT;
SetSettingsDirty(); SetSettingsDirty();
} }
Update(false); Update(false);
@@ -3901,7 +3917,10 @@ LRESULT CMenuStyleDlg::OnButtonStyle( WORD wNotifyCode, WORD wID, HWND hWndCtl,
CSettingsLockWrite lock; CSettingsLockWrite lock;
CSetting *pSetting=FindSetting(L"StartButtonType"); CSetting *pSetting=FindSetting(L"StartButtonType");
pSetting->value=CComVariant(style); pSetting->value=CComVariant(style);
pSetting->flags&=~CSetting::FLAG_DEFAULT; if (pSetting->value==pSetting->defValue)
pSetting->flags|=CSetting::FLAG_DEFAULT;
else
pSetting->flags&=~CSetting::FLAG_DEFAULT;
SetSettingsDirty(); SetSettingsDirty();
} }
Update(false); Update(false);
@@ -3925,7 +3944,10 @@ LRESULT CMenuStyleDlg::OnPick( WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL& b
CSettingsLockWrite lock; CSettingsLockWrite lock;
CSetting *pSetting=FindSetting(L"StartButtonPath"); CSetting *pSetting=FindSetting(L"StartButtonPath");
pSetting->value=CComVariant(path); pSetting->value=CComVariant(path);
pSetting->flags&=~CSetting::FLAG_DEFAULT; if (pSetting->value==pSetting->defValue)
pSetting->flags|=CSetting::FLAG_DEFAULT;
else
pSetting->flags&=~CSetting::FLAG_DEFAULT;
SetSettingsDirty(); SetSettingsDirty();
} }
Update(true); Update(true);
@@ -4140,38 +4162,50 @@ CSetting g_Settings[]={
{L"Nothing",CSetting::TYPE_RADIO,IDS_OPEN_NOTHING,IDS_OPEN_NOTHING_TIP}, {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"ClassicMenu",CSetting::TYPE_RADIO,IDS_OPEN_CSM,IDS_OPEN_CSM_TIP},
{L"WindowsMenu",CSetting::TYPE_RADIO,IDS_OPEN_WSM,IDS_OPEN_WSM_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"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"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"Nothing",CSetting::TYPE_RADIO,IDS_OPEN_NOTHING,IDS_OPEN_NOTHING_TIP},
{L"ClassicMenu",CSetting::TYPE_RADIO,IDS_OPEN_CSM,IDS_OPEN_CSM_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"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"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"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"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"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"Nothing",CSetting::TYPE_RADIO,IDS_OPEN_NOTHING,IDS_OPEN_NOTHING_TIP},
{L"ClassicMenu",CSetting::TYPE_RADIO,IDS_OPEN_CSM,IDS_OPEN_CSM_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"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"Both",CSetting::TYPE_RADIO,IDS_OPEN_BOTH,IDS_OPEN_BOTH_TIP},
{L"Desktop",CSetting::TYPE_RADIO,IDS_OPEN_DESKTOP,IDS_OPEN_DESKTOP_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"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"Nothing",CSetting::TYPE_RADIO,IDS_OPEN_NOTHING,IDS_OPEN_NOTHING_TIP},
{L"ClassicMenu",CSetting::TYPE_RADIO,IDS_OPEN_CSM,IDS_OPEN_CSM_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"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"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"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"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"MiddleClick",CSetting::TYPE_INT,IDS_MCLICK,IDS_MCLICK_TIP,0},
{L"Nothing",CSetting::TYPE_RADIO,IDS_OPEN_NOTHING,IDS_OPEN_NOTHING_TIP}, {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"ClassicMenu",CSetting::TYPE_RADIO,IDS_OPEN_CSM,IDS_OPEN_CSM_TIP},
{L"WindowsMenu",CSetting::TYPE_RADIO,IDS_OPEN_WSM,IDS_OPEN_WSM_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"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"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"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"Hover",CSetting::TYPE_INT,IDS_HOVER,IDS_HOVER_TIP,0},
{L"Nothing",CSetting::TYPE_RADIO,IDS_OPEN_NOTHING,IDS_OPEN_NOTHING_TIP}, {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"ClassicMenu",CSetting::TYPE_RADIO,IDS_OPEN_CSM,IDS_OPEN_CSM_TIP},
{L"WindowsMenu",CSetting::TYPE_RADIO,IDS_OPEN_WSM,IDS_OPEN_WSM_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"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"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}, {L"CSMHotkey",CSetting::TYPE_HOTKEY,IDS_CSM_HOTKEY,IDS_CSM_HOTKEY_TIP,0},
@@ -4246,6 +4280,7 @@ CSetting g_Settings[]={
{L"PinnedPrograms",CSetting::TYPE_INT,IDS_PINNED_PROGRAMS,IDS_PINNED_PROGRAMS_TIP,PINNED_PROGRAMS_PINNED}, {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"FastItems",CSetting::TYPE_RADIO,IDS_FAST_ITEMS,IDS_FAST_ITEMS_TIP},
{L"PinnedItems",CSetting::TYPE_RADIO,IDS_PINNED_ITEMS,IDS_PINNED_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"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"None",CSetting::TYPE_RADIO,IDS_NO_RECENT,IDS_NO_RECENT_TIP},
{L"Recent",CSetting::TYPE_RADIO,IDS_SHOW_RECENT,IDS_SHOW_RECENT_TIP}, {L"Recent",CSetting::TYPE_RADIO,IDS_SHOW_RECENT,IDS_SHOW_RECENT_TIP},
@@ -4314,11 +4349,14 @@ CSetting g_Settings[]={
{L"UserNameCommand",CSetting::TYPE_STRING,IDS_NAME_COMMAND,IDS_NAME_COMMAND_TIP,L"control nusrmgr.cpl"}, {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"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"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"EnableTouch",CSetting::TYPE_BOOL,IDS_ENABLE_TOUCH,IDS_ENABLE_TOUCH_TIP,1},
{L"EnableAccessibility",CSetting::TYPE_BOOL,IDS_ACCESSIBILITY,IDS_ACCESSIBILITY_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"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"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"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"ReportSkinErrors",CSetting::TYPE_BOOL,IDS_SKIN_ERRORS,IDS_SKIN_ERRORS_TIP,0},
{L"SearchBoxSettings",CSetting::TYPE_GROUP,IDS_SEARCH_BOX}, {L"SearchBoxSettings",CSetting::TYPE_GROUP,IDS_SEARCH_BOX},
@@ -4327,6 +4365,8 @@ CSetting g_Settings[]={
{L"Normal",CSetting::TYPE_RADIO,IDS_SEARCH_BOX_SHOW,IDS_SEARCH_BOX_SHOW_TIP}, {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"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"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"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"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"}, {L"SearchResultsMax",CSetting::TYPE_INT,IDS_SEARCH_MAX3,IDS_SEARCH_MAX_TIP3,20,CSetting::FLAG_MENU_CLASSIC_BOTH,L"SearchBox"},
@@ -4341,6 +4381,7 @@ CSetting g_Settings[]={
{L"SearchContents",CSetting::TYPE_BOOL,IDS_SEARCH_CONTENTS,IDS_SEARCH_CONTENTS_TIP,1,0,L"#SearchFiles",L"SearchFiles"}, {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"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"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"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 {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
@@ -4545,7 +4586,10 @@ void UpgradeSettings( bool bShared )
items.Replace(L"Command=recent_items\n",L"Command=recent_programs\n"); items.Replace(L"Command=recent_items\n",L"Command=recent_programs\n");
items.Replace(L"Command=control_panel_categories\n",L"Command=control_panel\n"); items.Replace(L"Command=control_panel_categories\n",L"Command=control_panel\n");
pSettingItems->value=items; pSettingItems->value=items;
pSettingItems->flags&=~CSetting::FLAG_DEFAULT; if (pSettingItems->value==pSettingItems->defValue)
pSettingItems->flags|=CSetting::FLAG_DEFAULT;
else
pSettingItems->flags&=~CSetting::FLAG_DEFAULT;
} }
// set initial menu style // set initial menu style
@@ -4553,7 +4597,10 @@ void UpgradeSettings( bool bShared )
if (!pSettingStyle->IsLocked()) if (!pSettingStyle->IsLocked())
{ {
pSettingStyle->value=(bTwoColumns?1:0); pSettingStyle->value=(bTwoColumns?1:0);
pSettingStyle->flags&=~CSetting::FLAG_DEFAULT; if (pSettingStyle->value==pSettingStyle->defValue)
pSettingStyle->flags|=CSetting::FLAG_DEFAULT;
else
pSettingStyle->flags&=~CSetting::FLAG_DEFAULT;
SetSettingsStyle(bTwoColumns?CSetting::FLAG_MENU_CLASSIC2:CSetting::FLAG_MENU_CLASSIC1,CSetting::FLAG_MENU_MASK); SetSettingsStyle(bTwoColumns?CSetting::FLAG_MENU_CLASSIC2:CSetting::FLAG_MENU_CLASSIC1,CSetting::FLAG_MENU_MASK);
} }
@@ -4565,7 +4612,10 @@ void UpgradeSettings( bool bShared )
if (!pSetting->IsDefault()) if (!pSetting->IsDefault())
{ {
pSettingSkin->value=pSetting->value; pSettingSkin->value=pSetting->value;
pSettingSkin->flags&=~CSetting::FLAG_DEFAULT; if (pSettingSkin->value==pSettingSkin->defValue)
pSettingSkin->flags|=CSetting::FLAG_DEFAULT;
else
pSettingSkin->flags&=~CSetting::FLAG_DEFAULT;
} }
} }
CSetting *pSettingOpt=FindSetting(bTwoColumns?L"SkinOptionsC2":L"SkinOptionsC1"); CSetting *pSettingOpt=FindSetting(bTwoColumns?L"SkinOptionsC2":L"SkinOptionsC1");
@@ -4575,7 +4625,10 @@ void UpgradeSettings( bool bShared )
if (!pSetting->IsDefault()) if (!pSetting->IsDefault())
{ {
pSettingOpt->value=pSetting->value; pSettingOpt->value=pSetting->value;
pSettingOpt->flags&=~CSetting::FLAG_DEFAULT; if (pSettingOpt->value==pSettingOpt->defValue)
pSettingOpt->flags|=CSetting::FLAG_DEFAULT;
else
pSettingOpt->flags&=~CSetting::FLAG_DEFAULT;
} }
} }
CSetting *pSettingVar=FindSetting(bTwoColumns?L"SkinVariationC2":L"SkinVariationC1"); CSetting *pSettingVar=FindSetting(bTwoColumns?L"SkinVariationC2":L"SkinVariationC1");
@@ -4585,7 +4638,10 @@ void UpgradeSettings( bool bShared )
if (!pSetting->IsDefault()) if (!pSetting->IsDefault())
{ {
pSettingVar->value=pSetting->value; pSettingVar->value=pSetting->value;
pSettingVar->flags&=~CSetting::FLAG_DEFAULT; if (pSettingVar->value==pSettingVar->defValue)
pSettingVar->flags|=CSetting::FLAG_DEFAULT;
else
pSettingVar->flags&=~CSetting::FLAG_DEFAULT;
} }
} }
@@ -4597,7 +4653,10 @@ void UpgradeSettings( bool bShared )
if (!pSetting->IsDefault()) if (!pSetting->IsDefault())
{ {
pSettingSkin->value=pSetting->value; pSettingSkin->value=pSetting->value;
pSettingSkin->flags&=~CSetting::FLAG_DEFAULT; if (pSettingSkin->value==pSettingSkin->defValue)
pSettingSkin->flags|=CSetting::FLAG_DEFAULT;
else
pSettingSkin->flags&=~CSetting::FLAG_DEFAULT;
} }
} }
pSettingOpt=FindSetting(L"SkinOptionsA"); pSettingOpt=FindSetting(L"SkinOptionsA");
@@ -4607,7 +4666,10 @@ void UpgradeSettings( bool bShared )
if (!pSetting->IsDefault()) if (!pSetting->IsDefault())
{ {
pSettingOpt->value=pSetting->value; pSettingOpt->value=pSetting->value;
pSettingOpt->flags&=~CSetting::FLAG_DEFAULT; if (pSettingOpt->value==pSettingOpt->defValue)
pSettingOpt->flags|=CSetting::FLAG_DEFAULT;
else
pSettingOpt->flags&=~CSetting::FLAG_DEFAULT;
} }
} }
pSettingVar=FindSetting(L"SkinVariationA"); pSettingVar=FindSetting(L"SkinVariationA");
@@ -4617,7 +4679,10 @@ void UpgradeSettings( bool bShared )
if (!pSetting->IsDefault()) if (!pSetting->IsDefault())
{ {
pSettingVar->value=pSetting->value; pSettingVar->value=pSetting->value;
pSettingVar->flags&=~CSetting::FLAG_DEFAULT; if (pSettingVar->value==pSettingVar->defValue)
pSettingVar->flags|=CSetting::FLAG_DEFAULT;
else
pSettingVar->flags&=~CSetting::FLAG_DEFAULT;
} }
} }
} }

View File

@@ -1778,7 +1778,7 @@ bool MenuSkin::LoadSkin( HMODULE hMod, const wchar_t *variation, const wchar_t *
var.label=token; var.label=token;
if (var.labelEn.IsEmpty()) if (var.labelEn.IsEmpty())
var.labelEn=var.label; 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); LOG_MENU(LOG_OPEN,L"Variation found: name=%s, id=%d",token,res);
} }
else else

View File

@@ -79,6 +79,7 @@ enum
OPEN_NOTHING, OPEN_NOTHING,
OPEN_CLASSIC, OPEN_CLASSIC,
OPEN_WINDOWS, OPEN_WINDOWS,
OPEN_CUSTOM,
OPEN_BOTH, OPEN_BOTH,
OPEN_DESKTOP, OPEN_DESKTOP,
OPEN_CORTANA, OPEN_CORTANA,
@@ -3348,6 +3349,16 @@ static LRESULT CALLBACK HookProgManThread( int code, WPARAM wParam, LPARAM lPara
msg->message=WM_NULL; msg->message=WM_NULL;
if (control==OPEN_CLASSIC) if (control==OPEN_CLASSIC)
PostMessage(g_TaskBar,g_StartMenuMsg,MSG_TOGGLE,0); 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'); PostMessage(g_ProgWin,WM_SYSCOMMAND,SC_TASKLIST,'WSMK');
else if (control==OPEN_CORTANA) else if (control==OPEN_CORTANA)
OpenCortana(); 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) else if (msg->wParam==MSG_DRAG || msg->wParam==MSG_SHIFTDRAG)
{ {
@@ -3590,12 +3611,22 @@ if (!g_bTrimHooks)
// left or middle click on start button // left or middle click on start button
FindWindowsMenu(); FindWindowsMenu();
const wchar_t *name; const wchar_t *name;
const wchar_t *command;
if (bMiddle) if (bMiddle)
{
name=L"MiddleClick"; name=L"MiddleClick";
command=L"MiddleClickCommand";
}
else if (GetKeyState(VK_SHIFT)<0) else if (GetKeyState(VK_SHIFT)<0)
{
name=L"ShiftClick"; name=L"ShiftClick";
command=L"ShiftClickCommand";
}
else else
{
name=L"MouseClick"; name=L"MouseClick";
command=L"MouseClickCommand";
}
int control=GetSettingInt(name); int control=GetSettingInt(name);
if (control==OPEN_BOTH && GetWinVersion()>=WIN_VER_WIN10) if (control==OPEN_BOTH && GetWinVersion()>=WIN_VER_WIN10)
@@ -3611,6 +3642,16 @@ if (!g_bTrimHooks)
PostMessage(g_ProgWin,WM_SYSCOMMAND,SC_TASKLIST,'WSMM'); PostMessage(g_ProgWin,WM_SYSCOMMAND,SC_TASKLIST,'WSMM');
else if (control==OPEN_CORTANA) else if (control==OPEN_CORTANA)
OpenCortana(); 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; msg->message=WM_NULL;
} }
} }
@@ -3751,6 +3792,16 @@ if (!g_bTrimHooks)
FindWindowsMenu(); FindWindowsMenu();
PostMessage(g_ProgWin,WM_SYSCOMMAND,SC_TASKLIST,'WSMM'); 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; taskBar->bTimer=false;
@@ -3760,7 +3811,6 @@ if (!g_bTrimHooks)
// context menu // context menu
if (msg->message==WM_NCRBUTTONUP || msg->message==WM_RBUTTONUP) if (msg->message==WM_NCRBUTTONUP || msg->message==WM_RBUTTONUP)
{ {
CPoint pt0(GetMessagePos());
TaskbarInfo *taskBar=FindTaskBarInfoButton(msg->hwnd); TaskbarInfo *taskBar=FindTaskBarInfoButton(msg->hwnd);
DWORD winVer=GetWinVersion(); DWORD winVer=GetWinVersion();
if (!taskBar && winVer>=WIN_VER_WIN8) if (!taskBar && winVer>=WIN_VER_WIN8)
@@ -3771,6 +3821,7 @@ if (!g_bTrimHooks)
} }
if (taskBar) if (taskBar)
{ {
CPoint pt0(GetMessagePos());
if (msg->message==WM_RBUTTONUP && msg->hwnd==taskBar->startButton && msg->lParam==MAKELPARAM(-1,-1)) if (msg->message==WM_RBUTTONUP && msg->hwnd==taskBar->startButton && msg->lParam==MAKELPARAM(-1,-1))
{ {
RECT rc; RECT rc;
@@ -3805,6 +3856,7 @@ if (!g_bTrimHooks)
CMD_OPEN, CMD_OPEN,
CMD_OPEN_ALL, CMD_OPEN_ALL,
CMD_EXPLORER, CMD_EXPLORER,
CMD_OPEN_PINNED,
}; };
// right-click on the start button - open the context menu (Settings, Help, Exit) // 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")); AppendMenu(menu,MF_STRING,CMD_OPEN,FindTranslation(L"Menu.Open",L"&Open"));
if (!SHRestricted(REST_NOCOMMONGROUPS)) if (!SHRestricted(REST_NOCOMMONGROUPS))
AppendMenu(menu,MF_STRING,CMD_OPEN_ALL,FindTranslation(L"Menu.OpenAll",L"O&pen All Users")); 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); AppendMenu(menu,MF_SEPARATOR,0,0);
} }
if (GetSettingBool(L"EnableSettings")) if (GetSettingBool(L"EnableSettings"))
@@ -3871,6 +3925,16 @@ if (!g_bTrimHooks)
if (SUCCEEDED(ShGetKnownFolderPath((res==CMD_OPEN)?FOLDERID_StartMenu:FOLDERID_CommonStartMenu,&pPath))) if (SUCCEEDED(ShGetKnownFolderPath((res==CMD_OPEN)?FOLDERID_StartMenu:FOLDERID_CommonStartMenu,&pPath)))
ShellExecute(NULL,L"open",pPath,NULL,NULL,SW_SHOWNORMAL); 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) if (res==CMD_EXPLORER)
{ {
CString path=GetSettingString(L"ExplorerPath"); CString path=GetSettingString(L"ExplorerPath");

View File

@@ -1044,7 +1044,7 @@ BEGIN
IDS_FOLDERS_FIRST "Show folders first" 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_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 "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" IDS_FAST_ITEMS "Use Start Menu folder"
END END
@@ -1295,6 +1295,34 @@ BEGIN
IDS_CLEAR_CACHE "Clear cached information" IDS_CLEAR_CACHE "Clear cached information"
END 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 from their defaults 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 #endif // English (U.S.) resources
///////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////

View File

@@ -760,6 +760,26 @@
#define IDS_HOR_OFFSET_TIP 3663 #define IDS_HOR_OFFSET_TIP 3663
#define IDS_VERT_OFFSET 3664 #define IDS_VERT_OFFSET 3664
#define IDS_VERT_OFFSET_TIP 3665 #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_STRING7001 7001
#define IDS_STRING7002 7002 #define IDS_STRING7002 7002
#define IDS_STRING7003 7003 #define IDS_STRING7003 7003

View File

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

View File

@@ -91,7 +91,7 @@ STDMETHODIMP CStartMenuExt::Initialize( PCIDLIST_ABSOLUTE pidlFolder, IDataObjec
bUsePinned=(setting==1); bUsePinned=(setting==1);
if (bUsePinned) 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)); DoEnvironmentSubst(m_PinFolder1,_countof(m_PinFolder1));
m_PinFolder2[0]=0; m_PinFolder2[0]=0;
} }

View File

@@ -57,6 +57,7 @@ CSetting g_Settings[]={
{L"DisablePinExt",CSetting::TYPE_BOOL,0,0,0}, {L"DisablePinExt",CSetting::TYPE_BOOL,0,0,0},
{L"FolderStartMenu",CSetting::TYPE_STRING,0,0,L""}, {L"FolderStartMenu",CSetting::TYPE_STRING,0,0,L""},
{L"FolderCommonStartMenu",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_GROUP},
{L"Language",CSetting::TYPE_STRING,0,0,L"",CSetting::FLAG_COLD|CSetting::FLAG_SHARED}, {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; ComPtr<IToastNotificationHistory> nativeHistory;
RETURN_IF_FAILED(toastStatics2->get_History(&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; return S_OK;
} }
@@ -224,7 +224,7 @@ namespace DesktopNotificationManagerCompat
DesktopNotificationHistoryCompat::DesktopNotificationHistoryCompat(const wchar_t *aumid, ComPtr<IToastNotificationHistory> history) DesktopNotificationHistoryCompat::DesktopNotificationHistoryCompat(const wchar_t *aumid, ComPtr<IToastNotificationHistory> history)
{ {
m_aumid = std::wstring(aumid); m_aumid = std::wstring(aumid);
m_history = history; m_history = std::move(history);
} }
HRESULT DesktopNotificationHistoryCompat::Clear() HRESULT DesktopNotificationHistoryCompat::Clear()

View File

@@ -1,4 +1,7 @@
version: 4.4.{build} version: 4.4.{build}
branches:
only:
- master
pull_requests: pull_requests:
do_not_increment_build_number: true do_not_increment_build_number: true
skip_tags: true skip_tags: true
@@ -11,3 +14,10 @@ only_commits:
files: files:
- Src/ - Src/
- Localization/ - Localization/
deploy:
- provider: GitHub
tag: v$(APPVEYOR_BUILD_VERSION)
release: $(APPVEYOR_BUILD_VERSION)
auth_token:
secure: 01CsOFRdj9KFb1hp/RlFK/F1UzGhzwGQfok6OoqcL1ipbOwRF//Phbdm7iaFVWIx
prerelease: true