mirror of
https://github.com/Open-Shell/Open-Shell-Menu.git
synced 2026-04-22 19:10:22 +10:00
Separate taskbar icon for Open-Shell menu settings dialog
It will be now separate from Explorer's icons in taskbar. Open-Shell icon will be displayed for better clarity. https://github.com/Open-Shell/Open-Shell-Menu/issues/31#issuecomment-1656611895
This commit is contained in:
@@ -13,6 +13,7 @@
|
|||||||
#include <Uxtheme.h>
|
#include <Uxtheme.h>
|
||||||
#include <VSStyle.h>
|
#include <VSStyle.h>
|
||||||
#include <propkey.h>
|
#include <propkey.h>
|
||||||
|
#include <propvarutil.h>
|
||||||
#include <htmlhelp.h>
|
#include <htmlhelp.h>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
#include <map>
|
#include <map>
|
||||||
@@ -1108,7 +1109,7 @@ class CSettingsDlg: public CResizeableDlg<CSettingsDlg>
|
|||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
CSettingsDlg( void );
|
CSettingsDlg( void );
|
||||||
void Init( CSetting *pSettings, ICustomSettings *pCustom, int tab );
|
void Init( CSetting *pSettings, ICustomSettings *pCustom, int tab, const wchar_t* appId );
|
||||||
|
|
||||||
BEGIN_MSG_MAP( CSettingsDlg )
|
BEGIN_MSG_MAP( CSettingsDlg )
|
||||||
MESSAGE_HANDLER( WM_INITDIALOG, OnInitDialog )
|
MESSAGE_HANDLER( WM_INITDIALOG, OnInitDialog )
|
||||||
@@ -1182,6 +1183,7 @@ private:
|
|||||||
bool m_bIgnoreEdit;
|
bool m_bIgnoreEdit;
|
||||||
bool m_bDirty;
|
bool m_bDirty;
|
||||||
CString m_FilterText;
|
CString m_FilterText;
|
||||||
|
const wchar_t* m_AppId;
|
||||||
|
|
||||||
void AddTabs( int name, const CSetting *pSelect=NULL );
|
void AddTabs( int name, const CSetting *pSelect=NULL );
|
||||||
void SetCurTab( int index, bool bReset, const CSetting *pSelect=NULL );
|
void SetCurTab( int index, bool bReset, const CSetting *pSelect=NULL );
|
||||||
@@ -1214,15 +1216,17 @@ CSettingsDlg::CSettingsDlg( void )
|
|||||||
m_bOnTop=false;
|
m_bOnTop=false;
|
||||||
m_bIgnoreEdit=false;
|
m_bIgnoreEdit=false;
|
||||||
m_bDirty=false;
|
m_bDirty=false;
|
||||||
|
m_AppId=NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
void CSettingsDlg::Init( CSetting *pSettings, ICustomSettings *pCustom, int tab )
|
void CSettingsDlg::Init( CSetting *pSettings, ICustomSettings *pCustom, int tab, const wchar_t* appId )
|
||||||
{
|
{
|
||||||
m_pSettings=pSettings;
|
m_pSettings=pSettings;
|
||||||
m_pCustom=pCustom;
|
m_pCustom=pCustom;
|
||||||
m_InitialTab=tab;
|
m_InitialTab=tab;
|
||||||
m_FilterText.Empty();
|
m_FilterText.Empty();
|
||||||
m_bDirty=false;
|
m_bDirty=false;
|
||||||
|
m_AppId=appId;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Subclass the tooltip to delay the tip when the mouse moves from one tree item to the next
|
// Subclass the tooltip to delay the tip when the mouse moves from one tree item to the next
|
||||||
@@ -1246,17 +1250,19 @@ LRESULT CSettingsDlg::OnInitDialog( UINT uMsg, WPARAM wParam, LPARAM lParam, BOO
|
|||||||
#ifdef _DEBUG
|
#ifdef _DEBUG
|
||||||
g_bUIThread=true;
|
g_bUIThread=true;
|
||||||
#endif
|
#endif
|
||||||
/*
|
|
||||||
// attempt to make the dialog have its own icon. doesn't work though. the icon changes, but to the default folder icon
|
if (m_AppId)
|
||||||
CComPtr<IPropertyStore> pStore;
|
|
||||||
if (SUCCEEDED(SHGetPropertyStoreForWindow(m_hWnd,IID_IPropertyStore,(void**)&pStore)))
|
|
||||||
{
|
{
|
||||||
PROPVARIANT val;
|
// attempt to make the dialog have its own icon
|
||||||
val.vt=VT_LPWSTR;
|
CComPtr<IPropertyStore> pStore;
|
||||||
val.pwszVal=L"OpenShell.Settings.Dialog";
|
if (SUCCEEDED(SHGetPropertyStoreForWindow(m_hWnd,IID_IPropertyStore,(void**)&pStore)))
|
||||||
pStore->SetValue(PKEY_AppUserModel_ID,val);
|
{
|
||||||
|
PROPVARIANT val;
|
||||||
|
InitPropVariantFromString(m_AppId,&val);
|
||||||
|
pStore->SetValue(PKEY_AppUserModel_ID,val);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
*/
|
|
||||||
InitResize(MOVE_MODAL);
|
InitResize(MOVE_MODAL);
|
||||||
HMENU menu=GetSystemMenu(FALSE);
|
HMENU menu=GetSystemMenu(FALSE);
|
||||||
bool bAdded=false;
|
bool bAdded=false;
|
||||||
@@ -1840,7 +1846,7 @@ bool CSettingsDlg::IsTabValid( void )
|
|||||||
|
|
||||||
static CSettingsDlg g_SettingsDlg;
|
static CSettingsDlg g_SettingsDlg;
|
||||||
|
|
||||||
void EditSettings( const wchar_t *title, bool bModal, int tab )
|
void EditSettings( const wchar_t *title, bool bModal, int tab, const wchar_t* appId )
|
||||||
{
|
{
|
||||||
if (g_SettingsDlg.m_hWnd)
|
if (g_SettingsDlg.m_hWnd)
|
||||||
{
|
{
|
||||||
@@ -1858,7 +1864,7 @@ void EditSettings( const wchar_t *title, bool bModal, int tab )
|
|||||||
}
|
}
|
||||||
DLGTEMPLATE *pTemplate=LoadDialogEx(IDD_SETTINGS);
|
DLGTEMPLATE *pTemplate=LoadDialogEx(IDD_SETTINGS);
|
||||||
g_SettingsManager.ResetImageList();
|
g_SettingsManager.ResetImageList();
|
||||||
g_SettingsDlg.Init(g_SettingsManager.GetSettings(),g_SettingsManager.GetCustom(),tab);
|
g_SettingsDlg.Init(g_SettingsManager.GetSettings(),g_SettingsManager.GetCustom(),tab,appId);
|
||||||
g_SettingsDlg.Create(NULL,pTemplate);
|
g_SettingsDlg.Create(NULL,pTemplate);
|
||||||
g_SettingsDlg.SetWindowText(title);
|
g_SettingsDlg.SetWindowText(title);
|
||||||
g_SettingsDlg.SetWindowPos(HWND_TOPMOST,0,0,0,0,SWP_NOSIZE|SWP_NOMOVE|(g_SettingsDlg.GetOnTop()?0:SWP_NOZORDER)|SWP_SHOWWINDOW);
|
g_SettingsDlg.SetWindowPos(HWND_TOPMOST,0,0,0,0,SWP_NOSIZE|SWP_NOMOVE|(g_SettingsDlg.GetOnTop()?0:SWP_NOZORDER)|SWP_SHOWWINDOW);
|
||||||
|
|||||||
@@ -129,7 +129,7 @@ void InitSettings( CSetting *pSettings, TSettingsComponent component, ICustomSet
|
|||||||
void LoadSettings( void );
|
void LoadSettings( void );
|
||||||
void SaveSettings( void );
|
void SaveSettings( void );
|
||||||
void UpdateDefaultSettings( void );
|
void UpdateDefaultSettings( void );
|
||||||
void EditSettings( const wchar_t *title, bool bModal, int tab );
|
void EditSettings( const wchar_t *title, bool bModal, int tab, const wchar_t *appId = nullptr );
|
||||||
void CloseSettings( void );
|
void CloseSettings( void );
|
||||||
void SetSettingsDirty( void );
|
void SetSettingsDirty( void );
|
||||||
void SelectSettingsTab( int tab, bool bAdvanced, const CSetting *pSelect );
|
void SelectSettingsTab( int tab, bool bAdvanced, const CSetting *pSelect );
|
||||||
|
|||||||
@@ -5272,7 +5272,7 @@ void EditSettings( bool bModal, int tab )
|
|||||||
Sprintf(title,_countof(title),LoadStringEx(IDS_SETTINGS_TITLE_VER),ver>>24,(ver>>16)&0xFF,ver&0xFFFF);
|
Sprintf(title,_countof(title),LoadStringEx(IDS_SETTINGS_TITLE_VER),ver>>24,(ver>>16)&0xFF,ver&0xFFFF);
|
||||||
else
|
else
|
||||||
Sprintf(title,_countof(title),LoadStringEx(IDS_SETTINGS_TITLE));
|
Sprintf(title,_countof(title),LoadStringEx(IDS_SETTINGS_TITLE));
|
||||||
EditSettings(title,bModal,tab);
|
EditSettings(title,bModal,tab,L"OpenShell.StartMenu.Settings");
|
||||||
}
|
}
|
||||||
|
|
||||||
bool DllImportSettingsXml( const wchar_t *fname )
|
bool DllImportSettingsXml( const wchar_t *fname )
|
||||||
|
|||||||
Reference in New Issue
Block a user