ReactOS  0.4.15-dev-1203-g0e5a4d5
general.cpp File Reference
#include "precomp.h"
Include dependency graph for general.cpp:

Go to the source code of this file.

Classes

struct  REGSHELLSTATE
 
struct  GENERAL_DIALOG
 

Macros

#define REGSHELLSTATE_SIZE   0x24
 

Typedefs

typedef struct REGSHELLSTATE REGSHELLSTATE
 
typedef struct REGSHELLSTATEPREGSHELLSTATE
 
typedef struct GENERAL_DIALOG GENERAL_DIALOG
 
typedef struct GENERAL_DIALOGPGENERAL_DIALOG
 

Functions

 WINE_DEFAULT_DEBUG_CHANNEL (fprop)
 
BOOL WINAPI SHSettingsChanged (LPCVOID unused, LPCVOID inpRegKey)
 
static void IntGetDefaultShellState (REGSHELLSTATE &rss)
 
static BOOL IntSetShellStateSettings (BOOL bDoubleClick, BOOL bUseCommonTasks)
 
static BOOL IntGetShellStateSettings (BOOL &bDoubleClick, BOOL &bUseCommonTasks)
 
static BOOL IntSetUnderlineState (BOOL bIconUnderline)
 
static BOOL IntGetUnderlineState (VOID)
 
static BOOL IntSetNewWindowMode (BOOL bNewWindowMode)
 
static BOOL IntGetNewWindowMode (VOID)
 
static VOID GeneralDlg_UpdateIcons (HWND hDlg, UINT nCtrlID, PGENERAL_DIALOG pGeneral)
 
static void GeneralDlg_StoreToUI (HWND hwndDlg, BOOL bDoubleClick, BOOL bUseCommonTasks, BOOL bUnderline, BOOL bNewWindowMode, PGENERAL_DIALOG pGeneral)
 
static BOOL GeneralDlg_OnInitDialog (HWND hwndDlg, PGENERAL_DIALOG pGeneral)
 
static void GeneralDlg_OnRestoreDefaults (HWND hwndDlg, PGENERAL_DIALOG pGeneral)
 
static BOOL GeneralDlg_OnApply (HWND hwndDlg, PGENERAL_DIALOG pGeneral)
 
INT_PTR CALLBACK FolderOptionsGeneralDlg (HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
 

Variables

static const LPCWSTR s_pszExplorerKey
 

Macro Definition Documentation

◆ REGSHELLSTATE_SIZE

#define REGSHELLSTATE_SIZE   0x24

Definition at line 32 of file general.cpp.

Typedef Documentation

◆ GENERAL_DIALOG

◆ PGENERAL_DIALOG

◆ PREGSHELLSTATE

◆ REGSHELLSTATE

Function Documentation

◆ FolderOptionsGeneralDlg()

INT_PTR CALLBACK FolderOptionsGeneralDlg ( HWND  hwndDlg,
UINT  uMsg,
WPARAM  wParam,
LPARAM  lParam 
)

Definition at line 365 of file general.cpp.

370 {
371  static GENERAL_DIALOG general;
372 
373  switch (uMsg)
374  {
375  case WM_INITDIALOG:
376  general.hTaskIcon = NULL;
377  general.hFolderIcon = NULL;
378  general.hClickIcon = NULL;
379  return GeneralDlg_OnInitDialog(hwndDlg, &general);
380 
381  case WM_COMMAND:
382  switch (LOWORD(wParam))
383  {
392  if (HIWORD(wParam) == BN_CLICKED)
393  {
394  GeneralDlg_UpdateIcons(hwndDlg, LOWORD(wParam), &general);
395 
396  // Enable the 'Apply' button
397  PropSheet_Changed(GetParent(hwndDlg), hwndDlg);
398  }
399  break;
401  if (HIWORD(wParam) == BN_CLICKED)
402  {
403  GeneralDlg_OnRestoreDefaults(hwndDlg, &general);
404 
405  // Enable the 'Apply' button
406  PropSheet_Changed(GetParent(hwndDlg), hwndDlg);
407  }
408  break;
409  }
410  break;
411 
412  case WM_NOTIFY:
413  {
414  LPNMHDR pnmh = (LPNMHDR)lParam;
415 
416  switch (pnmh->code)
417  {
418  case PSN_SETACTIVE:
419  break;
420 
421  case PSN_APPLY:
422  return GeneralDlg_OnApply(hwndDlg, &general);
423  }
424  break;
425  }
426 
427  case WM_DESTROY:
428  DestroyIcon(general.hTaskIcon);
429  DestroyIcon(general.hFolderIcon);
430  DestroyIcon(general.hClickIcon);
431  break;
432 
433  default:
434  return FALSE;
435  }
436  return FALSE;
437 }
#define IDC_FOLDER_OPTIONS_ULBROWSER
Definition: shresdef.h:373
static void GeneralDlg_OnRestoreDefaults(HWND hwndDlg, PGENERAL_DIALOG pGeneral)
Definition: general.cpp:338
#define IDC_FOLDER_OPTIONS_SAMEWINDOW
Definition: shresdef.h:369
BOOL WINAPI DestroyIcon(_In_ HICON)
Definition: cursoricon.c:2022
#define PSN_APPLY
Definition: prsht.h:117
#define IDC_FOLDER_OPTIONS_SINGLECLICK
Definition: shresdef.h:371
#define PSN_SETACTIVE
Definition: prsht.h:115
static BOOL GeneralDlg_OnApply(HWND hwndDlg, PGENERAL_DIALOG pGeneral)
Definition: general.cpp:351
HICON hFolderIcon
Definition: general.cpp:193
WPARAM wParam
Definition: combotst.c:138
struct tagNMHDR * LPNMHDR
UINT code
Definition: winuser.h:3134
HICON hClickIcon
Definition: general.cpp:194
#define FALSE
Definition: types.h:117
smooth NULL
Definition: ftsmooth.c:416
#define WM_DESTROY
Definition: winuser.h:1591
static VOID GeneralDlg_UpdateIcons(HWND hDlg, UINT nCtrlID, PGENERAL_DIALOG pGeneral)
Definition: general.cpp:198
#define IDC_FOLDER_OPTIONS_COMMONTASKS
Definition: shresdef.h:367
#define PropSheet_Changed(d, w)
Definition: prsht.h:344
#define BN_CLICKED
Definition: winuser.h:1907
#define WM_COMMAND
Definition: winuser.h:1722
HWND WINAPI GetParent(_In_ HWND)
static BOOL GeneralDlg_OnInitDialog(HWND hwndDlg, PGENERAL_DIALOG pGeneral)
Definition: general.cpp:322
HICON hTaskIcon
Definition: general.cpp:192
#define IDC_FOLDER_OPTIONS_RESTORE
Definition: shresdef.h:375
#define IDC_FOLDER_OPTIONS_ULPOINT
Definition: shresdef.h:374
#define HIWORD(l)
Definition: typedefs.h:247
#define WM_INITDIALOG
Definition: winuser.h:1721
LPARAM lParam
Definition: combotst.c:139
#define LOWORD(l)
Definition: pedump.c:82
#define IDC_FOLDER_OPTIONS_DOUBLECLICK
Definition: shresdef.h:372
#define WM_NOTIFY
Definition: richedit.h:61
#define IDC_FOLDER_OPTIONS_OWNWINDOW
Definition: shresdef.h:370
#define IDC_FOLDER_OPTIONS_CLASSICFOLDERS
Definition: shresdef.h:368

Referenced by CFolderOptions::AddPages(), and ShowFolderOptionsDialog().

◆ GeneralDlg_OnApply()

static BOOL GeneralDlg_OnApply ( HWND  hwndDlg,
PGENERAL_DIALOG  pGeneral 
)
static

Definition at line 351 of file general.cpp.

352 {
353  BOOL bDoubleClick = !(IsDlgButtonChecked(hwndDlg, IDC_FOLDER_OPTIONS_SINGLECLICK) == BST_CHECKED);
354  BOOL bUseCommonTasks = (IsDlgButtonChecked(hwndDlg, IDC_FOLDER_OPTIONS_COMMONTASKS) == BST_CHECKED);
356  BOOL bNewWindowMode = !(IsDlgButtonChecked(hwndDlg, IDC_FOLDER_OPTIONS_SAMEWINDOW) == BST_CHECKED);
357 
358  IntSetUnderlineState(bUnderline);
359  IntSetNewWindowMode(bNewWindowMode);
360  IntSetShellStateSettings(bDoubleClick, bUseCommonTasks);
361  return TRUE;
362 }
#define IDC_FOLDER_OPTIONS_SAMEWINDOW
Definition: shresdef.h:369
#define TRUE
Definition: types.h:120
#define IDC_FOLDER_OPTIONS_SINGLECLICK
Definition: shresdef.h:371
static BOOL IntSetShellStateSettings(BOOL bDoubleClick, BOOL bUseCommonTasks)
Definition: general.cpp:70
static BOOL IntSetNewWindowMode(BOOL bNewWindowMode)
Definition: general.cpp:168
unsigned int BOOL
Definition: ntddk_ex.h:94
UINT WINAPI IsDlgButtonChecked(_In_ HWND, _In_ int)
#define IDC_FOLDER_OPTIONS_COMMONTASKS
Definition: shresdef.h:367
#define BST_CHECKED
Definition: winuser.h:197
#define IDC_FOLDER_OPTIONS_ULPOINT
Definition: shresdef.h:374
static BOOL IntSetUnderlineState(BOOL bIconUnderline)
Definition: general.cpp:140

Referenced by FolderOptionsGeneralDlg().

◆ GeneralDlg_OnInitDialog()

static BOOL GeneralDlg_OnInitDialog ( HWND  hwndDlg,
PGENERAL_DIALOG  pGeneral 
)
static

Definition at line 322 of file general.cpp.

323 {
324  BOOL bDoubleClick = TRUE;
325  BOOL bUseCommonTasks = FALSE;
326  BOOL bUnderline = IntGetUnderlineState();
327  BOOL bNewWindowMode = IntGetNewWindowMode();
328 
329  IntGetShellStateSettings(bDoubleClick, bUseCommonTasks);
330 
331  GeneralDlg_StoreToUI(hwndDlg, bDoubleClick, bUseCommonTasks, bUnderline, bNewWindowMode, pGeneral);
332  GeneralDlg_UpdateIcons(hwndDlg, 0, pGeneral);
333 
334  return TRUE;
335 }
#define TRUE
Definition: types.h:120
static void GeneralDlg_StoreToUI(HWND hwndDlg, BOOL bDoubleClick, BOOL bUseCommonTasks, BOOL bUnderline, BOOL bNewWindowMode, PGENERAL_DIALOG pGeneral)
Definition: general.cpp:286
#define FALSE
Definition: types.h:117
unsigned int BOOL
Definition: ntddk_ex.h:94
static BOOL IntGetNewWindowMode(VOID)
Definition: general.cpp:178
static BOOL IntGetShellStateSettings(BOOL &bDoubleClick, BOOL &bUseCommonTasks)
Definition: general.cpp:113
static BOOL IntGetUnderlineState(VOID)
Definition: general.cpp:153
static VOID GeneralDlg_UpdateIcons(HWND hDlg, UINT nCtrlID, PGENERAL_DIALOG pGeneral)
Definition: general.cpp:198

Referenced by FolderOptionsGeneralDlg().

◆ GeneralDlg_OnRestoreDefaults()

static void GeneralDlg_OnRestoreDefaults ( HWND  hwndDlg,
PGENERAL_DIALOG  pGeneral 
)
static

Definition at line 338 of file general.cpp.

339 {
340  // default values
341  BOOL bDoubleClick = TRUE;
342  BOOL bUseCommonTasks = FALSE;
343  BOOL bUnderline = FALSE;
344  BOOL bNewWindowMode = FALSE;
345 
346  GeneralDlg_StoreToUI(hwndDlg, bDoubleClick, bUseCommonTasks, bUnderline, bNewWindowMode, pGeneral);
347  GeneralDlg_UpdateIcons(hwndDlg, 0, pGeneral);
348 }
#define TRUE
Definition: types.h:120
static void GeneralDlg_StoreToUI(HWND hwndDlg, BOOL bDoubleClick, BOOL bUseCommonTasks, BOOL bUnderline, BOOL bNewWindowMode, PGENERAL_DIALOG pGeneral)
Definition: general.cpp:286
#define FALSE
Definition: types.h:117
unsigned int BOOL
Definition: ntddk_ex.h:94
static VOID GeneralDlg_UpdateIcons(HWND hDlg, UINT nCtrlID, PGENERAL_DIALOG pGeneral)
Definition: general.cpp:198

Referenced by FolderOptionsGeneralDlg().

◆ GeneralDlg_StoreToUI()

static void GeneralDlg_StoreToUI ( HWND  hwndDlg,
BOOL  bDoubleClick,
BOOL  bUseCommonTasks,
BOOL  bUnderline,
BOOL  bNewWindowMode,
PGENERAL_DIALOG  pGeneral 
)
static

Definition at line 286 of file general.cpp.

288 {
289  if (bUseCommonTasks)
291  else
293 
294  if (bDoubleClick)
296  else
298 
299  if (bNewWindowMode)
301  else
303 
304  if (!bDoubleClick)
305  {
308  if (bUnderline)
310  else
312  }
313  else
314  {
318  }
319 }
#define IDC_FOLDER_OPTIONS_ULBROWSER
Definition: shresdef.h:373
#define IDC_FOLDER_OPTIONS_SAMEWINDOW
Definition: shresdef.h:369
#define TRUE
Definition: types.h:120
#define IDC_FOLDER_OPTIONS_SINGLECLICK
Definition: shresdef.h:371
#define FALSE
Definition: types.h:117
#define IDC_FOLDER_OPTIONS_COMMONTASKS
Definition: shresdef.h:367
HWND WINAPI GetDlgItem(_In_opt_ HWND, _In_ int)
BOOL WINAPI EnableWindow(_In_ HWND, _In_ BOOL)
#define IDC_FOLDER_OPTIONS_ULPOINT
Definition: shresdef.h:374
BOOL WINAPI CheckRadioButton(_In_ HWND, _In_ int, _In_ int, _In_ int)
#define IDC_FOLDER_OPTIONS_DOUBLECLICK
Definition: shresdef.h:372
#define IDC_FOLDER_OPTIONS_OWNWINDOW
Definition: shresdef.h:370
#define IDC_FOLDER_OPTIONS_CLASSICFOLDERS
Definition: shresdef.h:368

Referenced by GeneralDlg_OnInitDialog(), and GeneralDlg_OnRestoreDefaults().

◆ GeneralDlg_UpdateIcons()

static VOID GeneralDlg_UpdateIcons ( HWND  hDlg,
UINT  nCtrlID,
PGENERAL_DIALOG  pGeneral 
)
static

Definition at line 198 of file general.cpp.

199 {
200  HICON hTaskIcon = NULL, hFolderIcon = NULL, hClickIcon = NULL;
201  LPTSTR lpTaskIconName = NULL, lpFolderIconName = NULL, lpClickIconName = NULL;
202 
203  // Show task setting icon.
207  lpTaskIconName = MAKEINTRESOURCE(IDI_SHELL_CLASSIC_FOLDERS);
208 
209  if (lpTaskIconName)
210  {
211  hTaskIcon = (HICON)LoadImage(shell32_hInstance, lpTaskIconName,
212  IMAGE_ICON, 0, 0, LR_DEFAULTCOLOR);
213  if (hTaskIcon)
214  {
215  HWND hwndTaskIcon = GetDlgItem(hDlg, IDC_FOLDER_OPTIONS_TASKICON);
216  SendMessage(hwndTaskIcon, STM_SETIMAGE, IMAGE_ICON, (LPARAM)hTaskIcon);
217  }
218  }
219 
220  // Show Folder setting icons
224  lpFolderIconName = MAKEINTRESOURCE(IDI_SHELL_OPEN_IN_NEW_WINDOW);
225 
226  if (lpFolderIconName)
227  {
228  hFolderIcon = (HICON)LoadImage(shell32_hInstance, lpFolderIconName,
229  IMAGE_ICON, 0, 0, LR_DEFAULTCOLOR);
230  if (hFolderIcon)
231  {
232  HWND hwndFolderIcon = GetDlgItem(hDlg, IDC_FOLDER_OPTIONS_FOLDERICON);
233  SendMessage(hwndFolderIcon, STM_SETIMAGE, IMAGE_ICON, (LPARAM)hFolderIcon);
234  }
235  }
236 
237  // Show click setting icon
242 
243  if (lpClickIconName)
244  {
245  hClickIcon = (HICON)LoadImage(shell32_hInstance, lpClickIconName,
246  IMAGE_ICON, 0, 0, LR_DEFAULTCOLOR);
247  if (hClickIcon)
248  {
249  HWND hwndClickIcon = GetDlgItem(hDlg, IDC_FOLDER_OPTIONS_CLICKICON);
250  SendMessage(hwndClickIcon, STM_SETIMAGE, IMAGE_ICON, (LPARAM)hClickIcon);
251  }
252  }
253 
254  // Replace icons
255  if (hTaskIcon)
256  {
257  DestroyIcon(pGeneral->hTaskIcon);
258  pGeneral->hTaskIcon = hTaskIcon;
259  }
260  if (hFolderIcon)
261  {
262  DestroyIcon(pGeneral->hFolderIcon);
263  pGeneral->hFolderIcon = hFolderIcon;
264  }
265  if (hClickIcon)
266  {
267  DestroyIcon(pGeneral->hClickIcon);
268  pGeneral->hClickIcon = hClickIcon;
269  }
270 
271  if (nCtrlID == IDC_FOLDER_OPTIONS_SINGLECLICK)
272  {
275  }
276 
277  if (nCtrlID == IDC_FOLDER_OPTIONS_DOUBLECLICK)
278  {
282  }
283 }
#define MAKEINTRESOURCE
Definition: winuser.h:591
#define IDC_FOLDER_OPTIONS_ULBROWSER
Definition: shresdef.h:373
static HICON
Definition: imagelist.c:84
#define IMAGE_ICON
Definition: winuser.h:212
#define IDI_SHELL_DOUBLE_CLICK_TO_OPEN
Definition: shresdef.h:594
#define IDC_FOLDER_OPTIONS_SAMEWINDOW
Definition: shresdef.h:369
#define IDI_SHELL_SHOW_COMMON_TASKS
Definition: shresdef.h:589
BOOL WINAPI DestroyIcon(_In_ HICON)
Definition: cursoricon.c:2022
#define TRUE
Definition: types.h:120
#define IDC_FOLDER_OPTIONS_TASKICON
Definition: shresdef.h:364
#define IDI_SHELL_OPEN_IN_SOME_WINDOW
Definition: shresdef.h:591
#define IDC_FOLDER_OPTIONS_SINGLECLICK
Definition: shresdef.h:371
HICON hFolderIcon
Definition: general.cpp:193
CHAR * LPTSTR
Definition: xmlstorage.h:192
HICON hClickIcon
Definition: general.cpp:194
#define FALSE
Definition: types.h:117
#define IDI_SHELL_CLASSIC_FOLDERS
Definition: shresdef.h:590
smooth NULL
Definition: ftsmooth.c:416
LONG_PTR LPARAM
Definition: windef.h:208
UINT WINAPI IsDlgButtonChecked(_In_ HWND, _In_ int)
#define IDC_FOLDER_OPTIONS_COMMONTASKS
Definition: shresdef.h:367
HWND WINAPI GetDlgItem(_In_opt_ HWND, _In_ int)
#define IDI_SHELL_OPEN_IN_NEW_WINDOW
Definition: shresdef.h:592
BOOL WINAPI EnableWindow(_In_ HWND, _In_ BOOL)
#define shell32_hInstance
HICON hTaskIcon
Definition: general.cpp:192
#define STM_SETIMAGE
Definition: winuser.h:2075
#define BST_CHECKED
Definition: winuser.h:197
#define IDC_FOLDER_OPTIONS_ULPOINT
Definition: shresdef.h:374
#define SendMessage
Definition: winuser.h:5818
#define IDC_FOLDER_OPTIONS_FOLDERICON
Definition: shresdef.h:365
#define LoadImage
Definition: winuser.h:5790
BOOL WINAPI CheckRadioButton(_In_ HWND, _In_ int, _In_ int, _In_ int)
#define LR_DEFAULTCOLOR
Definition: winuser.h:1077
#define IDC_FOLDER_OPTIONS_DOUBLECLICK
Definition: shresdef.h:372
#define IDI_SHELL_SINGLE_CLICK_TO_OPEN
Definition: shresdef.h:593
#define IDC_FOLDER_OPTIONS_CLICKICON
Definition: shresdef.h:366
#define IDC_FOLDER_OPTIONS_OWNWINDOW
Definition: shresdef.h:370
#define IDC_FOLDER_OPTIONS_CLASSICFOLDERS
Definition: shresdef.h:368

Referenced by FolderOptionsGeneralDlg(), GeneralDlg_OnInitDialog(), and GeneralDlg_OnRestoreDefaults().

◆ IntGetDefaultShellState()

static void IntGetDefaultShellState ( REGSHELLSTATE rss)
static

Definition at line 44 of file general.cpp.

45 {
46  ZeroMemory(&rss, sizeof(rss));
48 
49  rss.ss.fShowAllObjects = TRUE;
50  rss.ss.fShowExtensions = TRUE;
51 
52  rss.ss.fShowCompColor = TRUE;
54  rss.ss.fShowInfoTip = TRUE;
55 
56  rss.ss.iSortDirection = 1;
57  rss.ss.version = 0xD;
58  rss.ss.fStartPanelOn = TRUE;
59 }
UINT version
Definition: shlobj.h:1490
BOOL fStartPanelOn
Definition: shlobj.h:1493
#define TRUE
Definition: types.h:120
BOOL fShowInfoTip
Definition: shlobj.h:1478
#define ZeroMemory
Definition: winbase.h:1648
SHELLSTATE ss
Definition: general.cpp:29
int iSortDirection
Definition: shlobj.h:1489
BOOL fShowAllObjects
Definition: shlobj.h:1466
BOOL fShowCompColor
Definition: shlobj.h:1471
#define REGSHELLSTATE_SIZE
Definition: general.cpp:32
BOOL fDoubleClickInWebView
Definition: shlobj.h:1472
DWORD dwSize
Definition: general.cpp:28
BOOL fShowExtensions
Definition: shlobj.h:1467

Referenced by IntSetShellStateSettings().

◆ IntGetNewWindowMode()

static BOOL IntGetNewWindowMode ( VOID  )
static

Definition at line 178 of file general.cpp.

179 {
181  if (!ReadCabinetState(&cs, sizeof(cs)))
182  return FALSE;
183 
184  return !!cs.fNewWindowMode;
185 }
BOOL WINAPI ReadCabinetState(CABINETSTATE *cs, int length)
Definition: shellord.c:1631
uint32_t cs
Definition: isohybrid.c:75
#define FALSE
Definition: types.h:117

Referenced by GeneralDlg_OnInitDialog().

◆ IntGetShellStateSettings()

static BOOL IntGetShellStateSettings ( BOOL bDoubleClick,
BOOL bUseCommonTasks 
)
static

Definition at line 113 of file general.cpp.

114 {
115  REGSHELLSTATE rss;
116  DWORD dwSize = sizeof(rss);
117  LSTATUS nStatus;
118  bDoubleClick = TRUE;
119  bUseCommonTasks = FALSE;
120 
121  // read ShellState
123  L"ShellState", NULL, &rss, &dwSize);
124  if (nStatus != ERROR_SUCCESS || rss.dwSize < REGSHELLSTATE_SIZE)
125  return FALSE;
126 
127  bDoubleClick = !!rss.ss.fDoubleClickInWebView;
128  bUseCommonTasks = !!rss.ss.fWebView;
129  return TRUE;
130 }
#define ERROR_SUCCESS
Definition: deptool.c:10
#define TRUE
Definition: types.h:120
#define HKEY_CURRENT_USER
Definition: winreg.h:11
static const LPCWSTR s_pszExplorerKey
Definition: general.cpp:34
SHELLSTATE ss
Definition: general.cpp:29
#define FALSE
Definition: types.h:117
smooth NULL
Definition: ftsmooth.c:416
#define REGSHELLSTATE_SIZE
Definition: general.cpp:32
unsigned long DWORD
Definition: ntddk_ex.h:95
static LSTATUS(WINAPI *pRegDeleteTreeW)(HKEY
static const WCHAR L[]
Definition: oid.c:1250
DWORD WINAPI SHGetValueW(HKEY hKey, LPCWSTR lpszSubKey, LPCWSTR lpszValue, LPDWORD pwType, LPVOID pvData, LPDWORD pcbData)
Definition: reg.c:1236
BOOL fDoubleClickInWebView
Definition: shlobj.h:1472
BOOL fWebView
Definition: shlobj.h:1480
DWORD dwSize
Definition: general.cpp:28
PSDBQUERYRESULT_VISTA PVOID DWORD * dwSize
Definition: env.c:54

Referenced by GeneralDlg_OnInitDialog().

◆ IntGetUnderlineState()

static BOOL IntGetUnderlineState ( VOID  )
static

Definition at line 153 of file general.cpp.

154 {
155  DWORD dwValue, dwDefault = 2, dwSize = sizeof(DWORD);
156  SHRegGetUSValue(s_pszExplorerKey, L"IconUnderline", NULL, &dwValue, &dwSize, FALSE, &dwDefault, sizeof(DWORD));
157  return dwValue == 3;
158 }
static const LPCWSTR s_pszExplorerKey
Definition: general.cpp:34
#define DWORD
Definition: nt_native.h:44
#define FALSE
Definition: types.h:117
smooth NULL
Definition: ftsmooth.c:416
unsigned long DWORD
Definition: ntddk_ex.h:95
static const WCHAR L[]
Definition: oid.c:1250
#define SHRegGetUSValue
Definition: shlwapi.h:534
PSDBQUERYRESULT_VISTA PVOID DWORD * dwSize
Definition: env.c:54

Referenced by GeneralDlg_OnInitDialog().

◆ IntSetNewWindowMode()

static BOOL IntSetNewWindowMode ( BOOL  bNewWindowMode)
static

Definition at line 168 of file general.cpp.

169 {
171  if (!ReadCabinetState(&cs, sizeof(cs)))
172  return FALSE;
173 
174  cs.fNewWindowMode = (bNewWindowMode ? TRUE : FALSE);
175  return WriteCabinetState(&cs);
176 }
BOOL WINAPI ReadCabinetState(CABINETSTATE *cs, int length)
Definition: shellord.c:1631
#define TRUE
Definition: types.h:120
uint32_t cs
Definition: isohybrid.c:75
#define FALSE
Definition: types.h:117
BOOL WINAPI WriteCabinetState(CABINETSTATE *cs)
Definition: shellord.c:1678

Referenced by GeneralDlg_OnApply().

◆ IntSetShellStateSettings()

static BOOL IntSetShellStateSettings ( BOOL  bDoubleClick,
BOOL  bUseCommonTasks 
)
static

Definition at line 70 of file general.cpp.

71 {
72  REGSHELLSTATE rss;
73  DWORD dwSize = sizeof(rss);
74  LSTATUS nStatus;
75 
76  // read ShellState
77  nStatus = SHGetValueW(HKEY_CURRENT_USER,
79  L"ShellState",
80  NULL,
81  &rss,
82  &dwSize);
83  if (nStatus != ERROR_SUCCESS || rss.dwSize < REGSHELLSTATE_SIZE)
84  {
86  }
87 
88  // update ShellState
89  rss.ss.fDoubleClickInWebView = (bDoubleClick ? TRUE : FALSE);
90  rss.ss.fWebView = (bUseCommonTasks ? TRUE : FALSE);
91 
92  // write ShellState
96  L"ShellState",
97  REG_BINARY,
98  &rss,
99  dwSize);
100  if (nStatus != ERROR_SUCCESS)
101  return FALSE;
102 
103  SHSettingsChanged(0, L"ShellState");
104  return TRUE;
105 }
DWORD WINAPI SHSetValueW(HKEY hKey, LPCWSTR lpszSubKey, LPCWSTR lpszValue, DWORD dwType, LPCVOID pvData, DWORD cbData)
Definition: reg.c:1306
#define ERROR_SUCCESS
Definition: deptool.c:10
#define REG_BINARY
Definition: nt_native.h:1496
#define TRUE
Definition: types.h:120
#define HKEY_CURRENT_USER
Definition: winreg.h:11
static const LPCWSTR s_pszExplorerKey
Definition: general.cpp:34
SHELLSTATE ss
Definition: general.cpp:29
#define FALSE
Definition: types.h:117
smooth NULL
Definition: ftsmooth.c:416
#define REGSHELLSTATE_SIZE
Definition: general.cpp:32
unsigned long DWORD
Definition: ntddk_ex.h:95
BOOL WINAPI SHSettingsChanged(LPCVOID unused, LPCVOID inpRegKey)
Definition: shpolicy.c:914
static LSTATUS(WINAPI *pRegDeleteTreeW)(HKEY
static const WCHAR L[]
Definition: oid.c:1250
DWORD WINAPI SHGetValueW(HKEY hKey, LPCWSTR lpszSubKey, LPCWSTR lpszValue, LPDWORD pwType, LPVOID pvData, LPDWORD pcbData)
Definition: reg.c:1236
BOOL fDoubleClickInWebView
Definition: shlobj.h:1472
BOOL fWebView
Definition: shlobj.h:1480
static void IntGetDefaultShellState(REGSHELLSTATE &rss)
Definition: general.cpp:44
DWORD dwSize
Definition: general.cpp:28
PSDBQUERYRESULT_VISTA PVOID DWORD * dwSize
Definition: env.c:54

Referenced by GeneralDlg_OnApply().

◆ IntSetUnderlineState()

static BOOL IntSetUnderlineState ( BOOL  bIconUnderline)
static

Definition at line 140 of file general.cpp.

141 {
142  LSTATUS Status;
143  DWORD dwValue = (bIconUnderline ? 3 : 2), dwSize = sizeof(DWORD);
144  Status = SHRegSetUSValue(s_pszExplorerKey, L"IconUnderline", REG_NONE,
146  if (Status != ERROR_SUCCESS)
147  return FALSE;
148 
149  SHSettingsChanged(0, L"Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\IconUnderline");
150  return TRUE;
151 }
#define ERROR_SUCCESS
Definition: deptool.c:10
#define TRUE
Definition: types.h:120
static const LPCWSTR s_pszExplorerKey
Definition: general.cpp:34
#define SHREGSET_HKLM
Definition: shlwapi.h:313
#define FALSE
Definition: types.h:117
#define SHREGSET_FORCE_HKCU
Definition: shlwapi.h:312
#define SHRegSetUSValue
Definition: shlwapi.h:556
unsigned long DWORD
Definition: ntddk_ex.h:95
BOOL WINAPI SHSettingsChanged(LPCVOID unused, LPCVOID inpRegKey)
Definition: shpolicy.c:914
static LSTATUS(WINAPI *pRegDeleteTreeW)(HKEY
Status
Definition: gdiplustypes.h:24
static const WCHAR L[]
Definition: oid.c:1250
#define REG_NONE
Definition: nt_native.h:1492
PSDBQUERYRESULT_VISTA PVOID DWORD * dwSize
Definition: env.c:54

Referenced by GeneralDlg_OnApply().

◆ SHSettingsChanged()

BOOL WINAPI SHSettingsChanged ( LPCVOID  unused,
LPCVOID  inpRegKey 
)

Definition at line 914 of file shpolicy.c.

915 {
916  TRACE("(%p, %p)\n", unused, inpRegKey);
917 
918  /* first check - if input is non-NULL and points to the secret
919  key string, then pass. Otherwise return 0.
920  */
921  if (inpRegKey != NULL)
922  {
923  if (SHELL_OsIsUnicode())
924  {
925  if (lstrcmpiW(inpRegKey, strRegistryPolicyW) &&
926  lstrcmpiW(inpRegKey, strPolicyW))
927  /* doesn't match, fail */
928  return FALSE;
929  }
930  else
931  {
932  if (lstrcmpiA(inpRegKey, strRegistryPolicyA) &&
933  lstrcmpiA(inpRegKey, strPolicyA))
934  /* doesn't match, fail */
935  return FALSE;
936  }
937  }
938 
939  return TRUE;
940 }
int WINAPI lstrcmpiA(LPCSTR lpString1, LPCSTR lpString2)
Definition: lstring.c:42
#define TRUE
Definition: types.h:120
static __inline BOOL SHELL_OsIsUnicode(void)
Definition: shell32_main.h:130
int WINAPI lstrcmpiW(LPCWSTR lpString1, LPCWSTR lpString2)
Definition: lstring.c:194
WORD unused[29]
Definition: crypt.c:1155
#define FALSE
Definition: types.h:117
static const CHAR strPolicyA[]
Definition: shpolicy.c:64
smooth NULL
Definition: ftsmooth.c:416
static const CHAR strRegistryPolicyA[]
Definition: shpolicy.c:59
#define TRACE(s)
Definition: solgame.cpp:4
static const WCHAR strPolicyW[]
Definition: shpolicy.c:65
static const WCHAR strRegistryPolicyW[]
Definition: shpolicy.c:60

Referenced by IntSetShellStateSettings(), and IntSetUnderlineState().

◆ WINE_DEFAULT_DEBUG_CHANNEL()

WINE_DEFAULT_DEBUG_CHANNEL ( fprop  )

Variable Documentation

◆ s_pszExplorerKey

const LPCWSTR s_pszExplorerKey
static
Initial value:
=
L"Software\\Microsoft\\Windows\\CurrentVersion\\Explorer"
static const WCHAR L[]
Definition: oid.c:1250

Definition at line 34 of file general.cpp.

Referenced by IntGetShellStateSettings(), IntGetUnderlineState(), IntSetShellStateSettings(), and IntSetUnderlineState().