ReactOS  0.4.15-dev-1201-gb2cf5a4
folder_options.h File Reference
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

INT_PTR CALLBACK FolderOptionsGeneralDlg (HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
 
INT_PTR CALLBACK FolderOptionsViewDlg (HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
 
INT_PTR CALLBACK FolderOptionsFileTypesDlg (HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
 
HBITMAP Create24BppBitmap (HDC hDC, INT cx, INT cy)
 
HBITMAP BitmapFromIcon (HICON hIcon, INT cx, INT cy)
 
HBITMAP CreateCheckImage (HDC hDC, BOOL bCheck, BOOL bEnabled=TRUE)
 
HBITMAP CreateCheckMask (HDC hDC)
 
HBITMAP CreateRadioImage (HDC hDC, BOOL bCheck, BOOL bEnabled=TRUE)
 
HBITMAP CreateRadioMask (HDC hDC)
 

Variables

LPCWSTR g_pszShell32
 
LPCWSTR g_pszSpace
 

Function Documentation

◆ BitmapFromIcon()

HBITMAP BitmapFromIcon ( HICON  hIcon,
INT  cx,
INT  cy 
)

Definition at line 58 of file folder_options.cpp.

59 {
61  if (!hDC)
62  return NULL;
63 
65  if (!hbm)
66  {
67  DeleteDC(hDC);
68  return NULL;
69  }
70 
71  HGDIOBJ hbmOld = SelectObject(hDC, hbm);
72  {
73  RECT rc = { 0, 0, cx, cy };
74  FillRect(hDC, &rc, HBRUSH(COLOR_3DFACE + 1));
75  if (hIcon)
76  {
77  DrawIconEx(hDC, 0, 0, hIcon, cx, cy, 0, NULL, DI_NORMAL);
78  }
79  }
80  SelectObject(hDC, hbmOld);
81  DeleteDC(hDC);
82 
83  return hbm;
84 }
static HDC
Definition: imagelist.c:92
HGDIOBJ WINAPI SelectObject(_In_ HDC, _In_ HGDIOBJ)
Definition: dc.c:1499
HDC WINAPI CreateCompatibleDC(_In_opt_ HDC hdc)
HBITMAP Create24BppBitmap(HDC hDC, INT cx, INT cy)
#define COLOR_3DFACE
Definition: winuser.h:919
_Out_opt_ int _Out_opt_ int * cy
Definition: commctrl.h:581
smooth NULL
Definition: ftsmooth.c:416
BOOL WINAPI DrawIconEx(_In_ HDC, _In_ int, _In_ int, _In_ HICON, _In_ int, _In_ int, _In_ UINT, _In_opt_ HBRUSH, _In_ UINT)
Definition: cursoricon.c:1997
#define DI_NORMAL
Definition: wingdi.h:72
static HDC hDC
Definition: 3dtext.c:33
BOOL WINAPI DeleteDC(_In_ HDC)
HICON hIcon
Definition: msconfig.c:44
_In_ HBITMAP hbm
Definition: ntgdi.h:2776
_Out_opt_ int * cx
Definition: commctrl.h:581
static HBITMAP
Definition: button.c:44
int WINAPI FillRect(HDC, LPCRECT, HBRUSH)

Referenced by FileTypesDlg_OnItemChanging().

◆ Create24BppBitmap()

HBITMAP Create24BppBitmap ( HDC  hDC,
INT  cx,
INT  cy 
)

Definition at line 41 of file folder_options.cpp.

42 {
43  BITMAPINFO bi;
44  LPVOID pvBits;
45 
46  ZeroMemory(&bi, sizeof(bi));
47  bi.bmiHeader.biSize = sizeof(BITMAPINFOHEADER);
48  bi.bmiHeader.biWidth = cx;
49  bi.bmiHeader.biHeight = cy;
50  bi.bmiHeader.biPlanes = 1;
51  bi.bmiHeader.biBitCount = 24;
53 
54  HBITMAP hbm = CreateDIBSection(hDC, &bi, DIB_RGB_COLORS, &pvBits, NULL, 0);
55  return hbm;
56 }
BITMAPINFOHEADER bmiHeader
Definition: wingdi.h:1475
struct tagBITMAPINFOHEADER BITMAPINFOHEADER
#define ZeroMemory
Definition: winbase.h:1648
DWORD biCompression
Definition: amvideo.idl:35
_Out_opt_ int _Out_opt_ int * cy
Definition: commctrl.h:581
smooth NULL
Definition: ftsmooth.c:416
static HDC hDC
Definition: 3dtext.c:33
HBITMAP WINAPI CreateDIBSection(HDC hDC, CONST BITMAPINFO *BitmapInfo, UINT Usage, VOID **Bits, HANDLE hSection, DWORD dwOffset)
Definition: bitmap.c:197
_In_ HBITMAP hbm
Definition: ntgdi.h:2776
_Out_opt_ int * cx
Definition: commctrl.h:581
static HBITMAP
Definition: button.c:44
#define DIB_RGB_COLORS
Definition: wingdi.h:366
#define BI_RGB
Definition: precomp.h:47

Referenced by BitmapFromIcon(), CreateCheckImage(), and CreateRadioImage().

◆ CreateCheckImage()

HBITMAP CreateCheckImage ( HDC  hDC,
BOOL  bCheck,
BOOL  bEnabled = TRUE 
)

Definition at line 86 of file folder_options.cpp.

87 {
88  INT cxSmallIcon = GetSystemMetrics(SM_CXSMICON);
89  INT cySmallIcon = GetSystemMetrics(SM_CYSMICON);
90 
91  HBITMAP hbm = Create24BppBitmap(hDC, cxSmallIcon, cySmallIcon);
92  if (hbm == NULL)
93  return NULL; // failure
94 
95  RECT Rect, BoxRect;
96  SetRect(&Rect, 0, 0, cxSmallIcon, cySmallIcon);
97  BoxRect = Rect;
98  InflateRect(&BoxRect, -1, -1);
99 
100  HGDIOBJ hbmOld = SelectObject(hDC, hbm);
101  {
103  if (bCheck)
104  uState |= DFCS_CHECKED;
105  if (!bEnabled)
106  uState |= DFCS_INACTIVE;
107  DrawFrameControl(hDC, &BoxRect, DFC_BUTTON, uState);
108  }
109  SelectObject(hDC, hbmOld);
110 
111  return hbm; // success
112 }
#define DFCS_FLAT
Definition: winuser.h:510
BOOL WINAPI InflateRect(_Inout_ LPRECT, _In_ int, _In_ int)
#define DFC_BUTTON
Definition: winuser.h:476
#define DFCS_CHECKED
Definition: winuser.h:504
#define DFCS_INACTIVE
Definition: winuser.h:502
HGDIOBJ WINAPI SelectObject(_In_ HDC, _In_ HGDIOBJ)
Definition: dc.c:1499
#define SM_CYSMICON
Definition: winuser.h:1003
BOOL WINAPI DrawFrameControl(_In_ HDC, _Inout_ LPRECT, _In_ UINT, _In_ UINT)
int32_t INT
Definition: typedefs.h:58
HBITMAP Create24BppBitmap(HDC hDC, INT cx, INT cy)
smooth NULL
Definition: ftsmooth.c:416
#define DFCS_MONO
Definition: winuser.h:511
int WINAPI GetSystemMetrics(_In_ int)
#define SM_CXSMICON
Definition: winuser.h:1002
#define DFCS_BUTTONCHECK
Definition: winuser.h:496
static HDC hDC
Definition: 3dtext.c:33
BOOL WINAPI SetRect(_Out_ LPRECT, _In_ int, _In_ int, _In_ int, _In_ int)
_In_ HBITMAP hbm
Definition: ntgdi.h:2776
unsigned int UINT
Definition: ndis.h:50
static HBITMAP
Definition: button.c:44
struct Rect Rect

Referenced by ViewDlg_CreateTreeImageList().

◆ CreateCheckMask()

HBITMAP CreateCheckMask ( HDC  hDC)

Definition at line 114 of file folder_options.cpp.

115 {
116  INT cxSmallIcon = GetSystemMetrics(SM_CXSMICON);
117  INT cySmallIcon = GetSystemMetrics(SM_CYSMICON);
118 
119  HBITMAP hbm = CreateBitmap(cxSmallIcon, cySmallIcon, 1, 1, NULL);
120  if (hbm == NULL)
121  return NULL; // failure
122 
123  RECT Rect, BoxRect;
124  SetRect(&Rect, 0, 0, cxSmallIcon, cySmallIcon);
125  BoxRect = Rect;
126  InflateRect(&BoxRect, -1, -1);
127 
128  HGDIOBJ hbmOld = SelectObject(hDC, hbm);
129  {
131  FillRect(hDC, &BoxRect, HBRUSH(GetStockObject(BLACK_BRUSH)));
132  }
133  SelectObject(hDC, hbmOld);
134 
135  return hbm; // success
136 }
HGDIOBJ WINAPI GetStockObject(_In_ int)
BOOL WINAPI InflateRect(_Inout_ LPRECT, _In_ int, _In_ int)
HGDIOBJ WINAPI SelectObject(_In_ HDC, _In_ HGDIOBJ)
Definition: dc.c:1499
#define SM_CYSMICON
Definition: winuser.h:1003
#define WHITE_BRUSH
Definition: wingdi.h:901
int32_t INT
Definition: typedefs.h:58
smooth NULL
Definition: ftsmooth.c:416
#define BLACK_BRUSH
Definition: wingdi.h:895
int WINAPI GetSystemMetrics(_In_ int)
#define SM_CXSMICON
Definition: winuser.h:1002
static HDC hDC
Definition: 3dtext.c:33
BOOL WINAPI SetRect(_Out_ LPRECT, _In_ int, _In_ int, _In_ int, _In_ int)
_In_ HBITMAP hbm
Definition: ntgdi.h:2776
static HBITMAP
Definition: button.c:44
int WINAPI FillRect(HDC, LPCRECT, HBRUSH)
struct Rect Rect
HBITMAP WINAPI CreateBitmap(_In_ INT cx, _In_ INT cy, _In_ UINT cPlanes, _In_ UINT cBitsPerPel, _In_opt_ const VOID *pvBits)

Referenced by ViewDlg_CreateTreeImageList().

◆ CreateRadioImage()

HBITMAP CreateRadioImage ( HDC  hDC,
BOOL  bCheck,
BOOL  bEnabled = TRUE 
)

Definition at line 138 of file folder_options.cpp.

139 {
140  INT cxSmallIcon = GetSystemMetrics(SM_CXSMICON);
141  INT cySmallIcon = GetSystemMetrics(SM_CYSMICON);
142 
143  HBITMAP hbm = Create24BppBitmap(hDC, cxSmallIcon, cySmallIcon);
144  if (hbm == NULL)
145  return NULL; // failure
146 
147  RECT Rect, BoxRect;
148  SetRect(&Rect, 0, 0, cxSmallIcon, cySmallIcon);
149  BoxRect = Rect;
150  InflateRect(&BoxRect, -1, -1);
151 
152  HGDIOBJ hbmOld = SelectObject(hDC, hbm);
153  {
155  if (bCheck)
156  uState |= DFCS_CHECKED;
157  if (!bEnabled)
158  uState |= DFCS_INACTIVE;
159  DrawFrameControl(hDC, &BoxRect, DFC_BUTTON, uState);
160  }
161  SelectObject(hDC, hbmOld);
162 
163  return hbm; // success
164 }
#define DFCS_FLAT
Definition: winuser.h:510
BOOL WINAPI InflateRect(_Inout_ LPRECT, _In_ int, _In_ int)
#define DFC_BUTTON
Definition: winuser.h:476
#define DFCS_CHECKED
Definition: winuser.h:504
#define DFCS_INACTIVE
Definition: winuser.h:502
HGDIOBJ WINAPI SelectObject(_In_ HDC, _In_ HGDIOBJ)
Definition: dc.c:1499
#define SM_CYSMICON
Definition: winuser.h:1003
BOOL WINAPI DrawFrameControl(_In_ HDC, _Inout_ LPRECT, _In_ UINT, _In_ UINT)
int32_t INT
Definition: typedefs.h:58
HBITMAP Create24BppBitmap(HDC hDC, INT cx, INT cy)
smooth NULL
Definition: ftsmooth.c:416
#define DFCS_MONO
Definition: winuser.h:511
int WINAPI GetSystemMetrics(_In_ int)
#define SM_CXSMICON
Definition: winuser.h:1002
static HDC hDC
Definition: 3dtext.c:33
BOOL WINAPI SetRect(_Out_ LPRECT, _In_ int, _In_ int, _In_ int, _In_ int)
_In_ HBITMAP hbm
Definition: ntgdi.h:2776
unsigned int UINT
Definition: ndis.h:50
static HBITMAP
Definition: button.c:44
#define DFCS_BUTTONRADIOIMAGE
Definition: winuser.h:497
struct Rect Rect

Referenced by ViewDlg_CreateTreeImageList().

◆ CreateRadioMask()

HBITMAP CreateRadioMask ( HDC  hDC)

Definition at line 166 of file folder_options.cpp.

167 {
168  INT cxSmallIcon = GetSystemMetrics(SM_CXSMICON);
169  INT cySmallIcon = GetSystemMetrics(SM_CYSMICON);
170 
171  HBITMAP hbm = CreateBitmap(cxSmallIcon, cySmallIcon, 1, 1, NULL);
172  if (hbm == NULL)
173  return NULL; // failure
174 
175  RECT Rect, BoxRect;
176  SetRect(&Rect, 0, 0, cxSmallIcon, cySmallIcon);
177  BoxRect = Rect;
178  InflateRect(&BoxRect, -1, -1);
179 
180  HGDIOBJ hbmOld = SelectObject(hDC, hbm);
181  {
184  DrawFrameControl(hDC, &BoxRect, DFC_BUTTON, uState);
185  }
186  SelectObject(hDC, hbmOld);
187 
188  return hbm; // success
189 }
HGDIOBJ WINAPI GetStockObject(_In_ int)
#define DFCS_FLAT
Definition: winuser.h:510
BOOL WINAPI InflateRect(_Inout_ LPRECT, _In_ int, _In_ int)
#define DFC_BUTTON
Definition: winuser.h:476
HGDIOBJ WINAPI SelectObject(_In_ HDC, _In_ HGDIOBJ)
Definition: dc.c:1499
#define SM_CYSMICON
Definition: winuser.h:1003
#define WHITE_BRUSH
Definition: wingdi.h:901
BOOL WINAPI DrawFrameControl(_In_ HDC, _Inout_ LPRECT, _In_ UINT, _In_ UINT)
int32_t INT
Definition: typedefs.h:58
smooth NULL
Definition: ftsmooth.c:416
#define DFCS_MONO
Definition: winuser.h:511
int WINAPI GetSystemMetrics(_In_ int)
#define SM_CXSMICON
Definition: winuser.h:1002
static HDC hDC
Definition: 3dtext.c:33
BOOL WINAPI SetRect(_Out_ LPRECT, _In_ int, _In_ int, _In_ int, _In_ int)
_In_ HBITMAP hbm
Definition: ntgdi.h:2776
unsigned int UINT
Definition: ndis.h:50
static HBITMAP
Definition: button.c:44
#define DFCS_BUTTONRADIOMASK
Definition: winuser.h:498
int WINAPI FillRect(HDC, LPCRECT, HBRUSH)
struct Rect Rect
HBITMAP WINAPI CreateBitmap(_In_ INT cx, _In_ INT cy, _In_ UINT cPlanes, _In_ UINT cBitsPerPel, _In_opt_ const VOID *pvBits)

Referenced by ViewDlg_CreateTreeImageList().

◆ FolderOptionsFileTypesDlg()

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

Definition at line 1665 of file filetypes.cpp.

1670 {
1671  LPNMLISTVIEW lppl;
1672  PFILE_TYPE_ENTRY pEntry;
1673  OPENASINFO Info;
1674  NEWEXT_DIALOG newext;
1675  EDITTYPE_DIALOG edittype;
1676 
1677  switch (uMsg)
1678  {
1679  case WM_INITDIALOG:
1680  pEntry = FileTypesDlg_DoList(hwndDlg);
1681 
1682  // Disable the Delete button if the listview is empty
1683  // the selected item should not be deleted by the user
1684  if (pEntry == NULL || (pEntry->EditFlags & 0x00000010)) // FTA_NoRemove
1686  return TRUE;
1687 
1688  case WM_COMMAND:
1689  switch (LOWORD(wParam))
1690  {
1691  case IDC_FILETYPES_NEW:
1692  newext.hwndLV = GetDlgItem(hwndDlg, IDC_FILETYPES_LISTVIEW);
1694  hwndDlg, NewExtDlgProc, (LPARAM)&newext))
1695  {
1696  FileTypesDlg_AddExt(hwndDlg, newext.szExt, newext.szFileType);
1697  }
1698  break;
1699 
1700  case IDC_FILETYPES_DELETE:
1701  FileTypesDlg_OnDelete(hwndDlg);
1702  break;
1703 
1704  case IDC_FILETYPES_CHANGE:
1706  if (pEntry)
1707  {
1708  ZeroMemory(&Info, sizeof(Info));
1710  Info.pcszFile = pEntry->FileExtension;
1711  Info.pcszClass = NULL;
1712  SHOpenWithDialog(hwndDlg, &Info);
1713  }
1714  break;
1715 
1717  edittype.hwndLV = GetDlgItem(hwndDlg, IDC_FILETYPES_LISTVIEW);
1718  edittype.pEntry = FileTypesDlg_GetEntry(edittype.hwndLV);
1720  hwndDlg, EditTypeDlgProc, (LPARAM)&edittype);
1721  break;
1722  }
1723  break;
1724 
1725  case WM_NOTIFY:
1726  lppl = (LPNMLISTVIEW) lParam;
1727  switch (lppl->hdr.code)
1728  {
1729  case LVN_KEYDOWN:
1730  {
1731  LV_KEYDOWN *pKeyDown = (LV_KEYDOWN *)lParam;
1732  if (pKeyDown->wVKey == VK_DELETE)
1733  {
1734  FileTypesDlg_OnDelete(hwndDlg);
1735  }
1736  break;
1737  }
1738 
1739  case NM_DBLCLK:
1740  edittype.hwndLV = GetDlgItem(hwndDlg, IDC_FILETYPES_LISTVIEW);
1741  edittype.pEntry = FileTypesDlg_GetEntry(edittype.hwndLV);
1743  hwndDlg, EditTypeDlgProc, (LPARAM)&edittype);
1744  break;
1745 
1746  case LVN_DELETEALLITEMS:
1747  return FALSE; // send LVN_DELETEITEM
1748 
1749  case LVN_DELETEITEM:
1750  pEntry = FileTypesDlg_GetEntry(lppl->hdr.hwndFrom, lppl->iItem);
1751  if (pEntry)
1752  {
1753  DestroyIcon(pEntry->hIconLarge);
1754  DestroyIcon(pEntry->hIconSmall);
1755  HeapFree(GetProcessHeap(), 0, pEntry);
1756  }
1757  return FALSE;
1758 
1759  case LVN_ITEMCHANGING:
1760  pEntry = FileTypesDlg_GetEntry(lppl->hdr.hwndFrom, lppl->iItem);
1761  if (!pEntry)
1762  {
1763  return TRUE;
1764  }
1765 
1766  if (!(lppl->uOldState & LVIS_FOCUSED) && (lppl->uNewState & LVIS_FOCUSED))
1767  {
1768  FileTypesDlg_OnItemChanging(hwndDlg, pEntry);
1769  }
1770  break;
1771 
1772  case PSN_SETACTIVE:
1773  // On page activation, set the focus to the listview
1775  break;
1776  }
1777  break;
1778  }
1779 
1780  return FALSE;
1781 }
#define IDOK
Definition: winuser.h:824
INT_PTR WINAPI DialogBoxParamW(_In_opt_ HINSTANCE, _In_ LPCWSTR, _In_opt_ HWND, _In_opt_ DLGPROC, _In_ LPARAM)
UINT uNewState
Definition: commctrl.h:3032
BOOL WINAPI DestroyIcon(_In_ HICON)
Definition: cursoricon.c:2022
#define TRUE
Definition: types.h:120
static PFILE_TYPE_ENTRY FileTypesDlg_DoList(HWND hwndDlg)
Definition: filetypes.cpp:1527
PFILE_TYPE_ENTRY pEntry
Definition: filetypes.cpp:210
#define LV_KEYDOWN
Definition: commctrl.h:3182
DWORD EditFlags
Definition: filetypes.cpp:38
HICON hIconLarge
Definition: filetypes.cpp:40
#define ZeroMemory
Definition: winbase.h:1648
static void FileTypesDlg_OnItemChanging(HWND hwndDlg, PFILE_TYPE_ENTRY pEntry)
Definition: filetypes.cpp:1619
static BOOL FileTypesDlg_AddExt(HWND hwndDlg, LPCWSTR pszExt, LPCWSTR pszFileType)
Definition: filetypes.cpp:709
HWND WINAPI SetFocus(_In_opt_ HWND)
#define PSN_SETACTIVE
Definition: prsht.h:115
WPARAM wParam
Definition: combotst.c:138
struct TraceInfo Info
#define LVN_ITEMCHANGING
Definition: commctrl.h:3126
UINT code
Definition: winuser.h:3134
#define LVN_KEYDOWN
Definition: commctrl.h:3180
#define FALSE
Definition: types.h:117
HICON hIconSmall
Definition: filetypes.cpp:41
#define IDC_FILETYPES_ADVANCED
Definition: shresdef.h:401
WCHAR FileExtension[30]
Definition: filetypes.cpp:34
smooth NULL
Definition: ftsmooth.c:416
UINT uOldState
Definition: commctrl.h:3033
LONG_PTR LPARAM
Definition: windef.h:208
#define VK_DELETE
Definition: winuser.h:2208
static INT_PTR CALLBACK NewExtDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
Definition: filetypes.cpp:523
#define LVN_DELETEALLITEMS
Definition: commctrl.h:3130
static INT_PTR CALLBACK EditTypeDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
Definition: filetypes.cpp:1431
#define GetProcessHeap()
Definition: compat.h:595
HRESULT WINAPI SHOpenWithDialog(HWND hwndParent, const OPENASINFO *poainfo)
HWND WINAPI GetDlgItem(_In_opt_ HWND, _In_ int)
#define LVN_DELETEITEM
Definition: commctrl.h:3129
static PFILE_TYPE_ENTRY FileTypesDlg_GetEntry(HWND hListView, INT iItem=-1)
Definition: filetypes.cpp:1591
#define IDD_EDITTYPE
Definition: shresdef.h:467
#define IDC_FILETYPES_NEW
Definition: shresdef.h:395
#define WM_COMMAND
Definition: winuser.h:1722
HWND hwndFrom
Definition: winuser.h:3132
BOOL WINAPI EnableWindow(_In_ HWND, _In_ BOOL)
#define shell32_hInstance
#define IDC_FILETYPES_DELETE
Definition: shresdef.h:396
#define NM_DBLCLK
Definition: commctrl.h:131
struct tagNMLISTVIEW * LPNMLISTVIEW
#define IDC_FILETYPES_CHANGE
Definition: shresdef.h:399
#define IDC_FILETYPES_LISTVIEW
Definition: shresdef.h:394
#define MAKEINTRESOURCEW(i)
Definition: winuser.h:582
#define IDD_NEWEXTENSION
Definition: shresdef.h:466
Definition: filetypes.cpp:32
static void FileTypesDlg_OnDelete(HWND hwndDlg)
Definition: filetypes.cpp:1608
#define WM_INITDIALOG
Definition: winuser.h:1721
LPARAM lParam
Definition: combotst.c:139
#define LOWORD(l)
Definition: pedump.c:82
#define HeapFree(x, y, z)
Definition: compat.h:594
#define LVIS_FOCUSED
Definition: commctrl.h:2314
#define WM_NOTIFY
Definition: richedit.h:61

◆ 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

◆ FolderOptionsViewDlg()

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

Definition at line 934 of file view.cpp.

939 {
940  INT_PTR Result;
942 
943  switch (uMsg)
944  {
945  case WM_INITDIALOG:
946  return ViewDlg_OnInitDialog(hwndDlg);
947 
948  case WM_COMMAND:
949  switch (LOWORD(wParam))
950  {
951  case IDC_VIEW_RESTORE_DEFAULTS: // Restore Defaults
952  ViewDlg_RestoreDefaults(hwndDlg);
953  break;
954  }
955  break;
956 
957  case WM_NOTIFY:
958  switch (LPNMHDR(lParam)->code)
959  {
960  case NM_CLICK: // clicked on treeview
961  ViewDlg_OnTreeViewClick(hwndDlg);
962  break;
963 
964  case NM_CUSTOMDRAW: // custom draw (for graying)
968  return Result;
969 
970  case TVN_KEYDOWN: // key is down
972  break;
973 
974  case PSN_APPLY: // [Apply] is clicked
975  ViewDlg_Apply(hwndDlg);
976  break;
977 
978  default:
979  break;
980  }
981  break;
982  }
983 
984  return FALSE;
985 }
static VOID ViewDlg_RestoreDefaults(HWND hwndDlg)
Definition: view.cpp:766
void Draw(HDC aDc)
Definition: magnifier.c:359
#define IDC_VIEW_RESTORE_DEFAULTS
Definition: shresdef.h:458
#define PSN_APPLY
Definition: prsht.h:117
int32_t INT_PTR
Definition: typedefs.h:64
#define SetWindowLongPtr
Definition: treelist.c:70
WPARAM wParam
Definition: combotst.c:138
#define DWLP_MSGRESULT
Definition: winuser.h:864
struct tagNMHDR * LPNMHDR
static VOID ViewDlg_OnTreeViewClick(HWND hwndDlg)
Definition: view.cpp:698
#define FALSE
Definition: types.h:117
static BOOL ViewDlg_OnInitDialog(HWND hwndDlg)
Definition: view.cpp:623
_At_(*)(_In_ PWSK_CLIENT Client, _In_opt_ PUNICODE_STRING NodeName, _In_opt_ PUNICODE_STRING ServiceName, _In_opt_ ULONG NameSpace, _In_opt_ GUID *Provider, _In_opt_ PADDRINFOEXW Hints, _Outptr_ PADDRINFOEXW *Result, _In_opt_ PEPROCESS OwningProcess, _In_opt_ PETHREAD OwningThread, _Inout_ PIRP Irp Result)(Mem)) NTSTATUS(WSKAPI *PFN_WSK_GET_ADDRESS_INFO
Definition: wsk.h:426
static void ViewDlg_OnTreeViewKeyDown(HWND hwndDlg, TV_KEYDOWN *KeyDown)
Definition: view.cpp:720
#define TV_KEYDOWN
Definition: commctrl.h:3718
#define NM_CUSTOMDRAW
Definition: commctrl.h:137
#define WM_COMMAND
Definition: winuser.h:1722
Definition: inflate.c:139
#define NM_CLICK
Definition: commctrl.h:130
static VOID ViewDlg_Apply(HWND hwndDlg)
Definition: view.cpp:871
static INT_PTR ViewDlg_OnTreeCustomDraw(HWND hwndDlg, NMTVCUSTOMDRAW *Draw)
Definition: view.cpp:736
#define WM_INITDIALOG
Definition: winuser.h:1721
LPARAM lParam
Definition: combotst.c:139
#define LOWORD(l)
Definition: pedump.c:82
#define TVN_KEYDOWN
Definition: commctrl.h:3709
#define WM_NOTIFY
Definition: richedit.h:61

Variable Documentation

◆ g_pszShell32

LPCWSTR g_pszShell32

Definition at line 33 of file folder_options.cpp.

Referenced by GetFileTypeIconsEx(), and SetFileTypeEntryDefaultIcon().

◆ g_pszSpace