13
13
#include < Uxtheme.h>
14
14
#include < VSStyle.h>
15
15
#include < propkey.h>
16
+ #include < propvarutil.h>
16
17
#include < htmlhelp.h>
17
18
#include < vector>
18
19
#include < map>
@@ -1108,7 +1109,7 @@ class CSettingsDlg: public CResizeableDlg<CSettingsDlg>
1108
1109
{
1109
1110
public:
1110
1111
CSettingsDlg ( void );
1111
- void Init ( CSetting *pSettings, ICustomSettings *pCustom, int tab );
1112
+ void Init ( CSetting *pSettings, ICustomSettings *pCustom, int tab, const wchar_t * appId );
1112
1113
1113
1114
BEGIN_MSG_MAP ( CSettingsDlg )
1114
1115
MESSAGE_HANDLER ( WM_INITDIALOG, OnInitDialog )
@@ -1182,6 +1183,7 @@ class CSettingsDlg: public CResizeableDlg<CSettingsDlg>
1182
1183
bool m_bIgnoreEdit;
1183
1184
bool m_bDirty;
1184
1185
CString m_FilterText;
1186
+ const wchar_t * m_AppId;
1185
1187
1186
1188
void AddTabs ( int name, const CSetting *pSelect=NULL );
1187
1189
void SetCurTab ( int index, bool bReset, const CSetting *pSelect=NULL );
@@ -1214,15 +1216,17 @@ CSettingsDlg::CSettingsDlg( void )
1214
1216
m_bOnTop=false ;
1215
1217
m_bIgnoreEdit=false ;
1216
1218
m_bDirty=false ;
1219
+ m_AppId=NULL ;
1217
1220
}
1218
1221
1219
- void CSettingsDlg::Init ( CSetting *pSettings, ICustomSettings *pCustom, int tab )
1222
+ void CSettingsDlg::Init ( CSetting *pSettings, ICustomSettings *pCustom, int tab, const wchar_t * appId )
1220
1223
{
1221
1224
m_pSettings=pSettings;
1222
1225
m_pCustom=pCustom;
1223
1226
m_InitialTab=tab;
1224
1227
m_FilterText.Empty ();
1225
1228
m_bDirty=false ;
1229
+ m_AppId=appId;
1226
1230
}
1227
1231
1228
1232
// 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
1246
1250
#ifdef _DEBUG
1247
1251
g_bUIThread=true ;
1248
1252
#endif
1249
- /*
1250
- // attempt to make the dialog have its own icon. doesn't work though. the icon changes, but to the default folder icon
1251
- CComPtr<IPropertyStore> pStore;
1252
- if (SUCCEEDED(SHGetPropertyStoreForWindow(m_hWnd,IID_IPropertyStore,(void**)&pStore)))
1253
+
1254
+ if (m_AppId)
1253
1255
{
1254
- PROPVARIANT val;
1255
- val.vt=VT_LPWSTR;
1256
- val.pwszVal=L"OpenShell.Settings.Dialog";
1257
- pStore->SetValue(PKEY_AppUserModel_ID,val);
1256
+ // attempt to make the dialog have its own icon
1257
+ CComPtr<IPropertyStore> pStore;
1258
+ if (SUCCEEDED (SHGetPropertyStoreForWindow (m_hWnd,IID_IPropertyStore,(void **)&pStore)))
1259
+ {
1260
+ PROPVARIANT val;
1261
+ InitPropVariantFromString (m_AppId,&val);
1262
+ pStore->SetValue (PKEY_AppUserModel_ID,val);
1263
+ }
1258
1264
}
1259
- */
1265
+
1260
1266
InitResize (MOVE_MODAL);
1261
1267
HMENU menu=GetSystemMenu (FALSE );
1262
1268
bool bAdded=false ;
@@ -1840,7 +1846,7 @@ bool CSettingsDlg::IsTabValid( void )
1840
1846
1841
1847
static CSettingsDlg g_SettingsDlg;
1842
1848
1843
- void EditSettings ( const wchar_t *title, bool bModal, int tab )
1849
+ void EditSettings ( const wchar_t *title, bool bModal, int tab, const wchar_t * appId )
1844
1850
{
1845
1851
if (g_SettingsDlg.m_hWnd )
1846
1852
{
@@ -1858,7 +1864,7 @@ void EditSettings( const wchar_t *title, bool bModal, int tab )
1858
1864
}
1859
1865
DLGTEMPLATE *pTemplate=LoadDialogEx (IDD_SETTINGS);
1860
1866
g_SettingsManager.ResetImageList ();
1861
- g_SettingsDlg.Init (g_SettingsManager.GetSettings (),g_SettingsManager.GetCustom (),tab);
1867
+ g_SettingsDlg.Init (g_SettingsManager.GetSettings (),g_SettingsManager.GetCustom (),tab,appId );
1862
1868
g_SettingsDlg.Create (NULL ,pTemplate);
1863
1869
g_SettingsDlg.SetWindowText (title);
1864
1870
g_SettingsDlg.SetWindowPos (HWND_TOPMOST,0 ,0 ,0 ,0 ,SWP_NOSIZE|SWP_NOMOVE|(g_SettingsDlg.GetOnTop ()?0 :SWP_NOZORDER)|SWP_SHOWWINDOW);
0 commit comments