ReactOS  0.4.14-dev-41-g31d7680
CFolderOptions.cpp File Reference
#include <precomp.h>
Include dependency graph for CFolderOptions.cpp:

Go to the source code of this file.

Functions

 WINE_DEFAULT_DEBUG_CHANNEL (fprop)
 
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)
 

Function Documentation

◆ FolderOptionsFileTypesDlg()

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

Definition at line 1664 of file filetypes.cpp.

1669 {
1670  LPNMLISTVIEW lppl;
1671  PFILE_TYPE_ENTRY pEntry;
1672  OPENASINFO Info;
1673  NEWEXT_DIALOG newext;
1674  EDITTYPE_DIALOG edittype;
1675 
1676  switch (uMsg)
1677  {
1678  case WM_INITDIALOG:
1679  pEntry = FileTypesDlg_DoList(hwndDlg);
1680 
1681  // Disable the Delete button if the listview is empty
1682  // the selected item should not be deleted by the user
1683  if (pEntry == NULL || (pEntry->EditFlags & 0x00000010)) // FTA_NoRemove
1685  return TRUE;
1686 
1687  case WM_COMMAND:
1688  switch (LOWORD(wParam))
1689  {
1690  case IDC_FILETYPES_NEW:
1691  newext.hwndLV = GetDlgItem(hwndDlg, IDC_FILETYPES_LISTVIEW);
1693  hwndDlg, NewExtDlgProc, (LPARAM)&newext))
1694  {
1695  FileTypesDlg_AddExt(hwndDlg, newext.szExt, newext.szFileType);
1696  }
1697  break;
1698 
1699  case IDC_FILETYPES_DELETE:
1700  FileTypesDlg_OnDelete(hwndDlg);
1701  break;
1702 
1703  case IDC_FILETYPES_CHANGE:
1705  if (pEntry)
1706  {
1707  ZeroMemory(&Info, sizeof(Info));
1709  Info.pcszFile = pEntry->FileExtension;
1710  Info.pcszClass = NULL;
1711  SHOpenWithDialog(hwndDlg, &Info);
1712  }
1713  break;
1714 
1716  edittype.hwndLV = GetDlgItem(hwndDlg, IDC_FILETYPES_LISTVIEW);
1717  edittype.pEntry = FileTypesDlg_GetEntry(edittype.hwndLV);
1719  hwndDlg, EditTypeDlgProc, (LPARAM)&edittype);
1720  break;
1721  }
1722  break;
1723 
1724  case WM_NOTIFY:
1725  lppl = (LPNMLISTVIEW) lParam;
1726  switch (lppl->hdr.code)
1727  {
1728  case LVN_KEYDOWN:
1729  {
1730  LV_KEYDOWN *pKeyDown = (LV_KEYDOWN *)lParam;
1731  if (pKeyDown->wVKey == VK_DELETE)
1732  {
1733  FileTypesDlg_OnDelete(hwndDlg);
1734  }
1735  break;
1736  }
1737 
1738  case NM_DBLCLK:
1739  edittype.hwndLV = GetDlgItem(hwndDlg, IDC_FILETYPES_LISTVIEW);
1740  edittype.pEntry = FileTypesDlg_GetEntry(edittype.hwndLV);
1742  hwndDlg, EditTypeDlgProc, (LPARAM)&edittype);
1743  break;
1744 
1745  case LVN_DELETEALLITEMS:
1746  return FALSE; // send LVN_DELETEITEM
1747 
1748  case LVN_DELETEITEM:
1749  pEntry = FileTypesDlg_GetEntry(lppl->hdr.hwndFrom, lppl->iItem);
1750  if (pEntry)
1751  {
1752  DestroyIcon(pEntry->hIconLarge);
1753  DestroyIcon(pEntry->hIconSmall);
1754  HeapFree(GetProcessHeap(), 0, pEntry);
1755  }
1756  return FALSE;
1757 
1758  case LVN_ITEMCHANGING:
1759  pEntry = FileTypesDlg_GetEntry(lppl->hdr.hwndFrom, lppl->iItem);
1760  if (!pEntry)
1761  {
1762  return TRUE;
1763  }
1764 
1765  if (!(lppl->uOldState & LVIS_FOCUSED) && (lppl->uNewState & LVIS_FOCUSED))
1766  {
1767  FileTypesDlg_OnItemChanging(hwndDlg, pEntry);
1768  }
1769  break;
1770 
1771  case PSN_SETACTIVE:
1772  // On page activation, set the focus to the listview
1774  break;
1775  }
1776  break;
1777  }
1778 
1779  return FALSE;
1780 }
#define TRUE
Definition: types.h:120
#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:3008
BOOL WINAPI DestroyIcon(_In_ HICON)
Definition: cursoricon.c:2022
static PFILE_TYPE_ENTRY FileTypesDlg_DoList(HWND hwndDlg)
Definition: filetypes.cpp:1526
PFILE_TYPE_ENTRY pEntry
Definition: filetypes.cpp:210
#define LV_KEYDOWN
Definition: commctrl.h:3158
DWORD EditFlags
Definition: filetypes.cpp:38
HICON hIconLarge
Definition: filetypes.cpp:40
#define ZeroMemory
Definition: winbase.h:1635
static void FileTypesDlg_OnItemChanging(HWND hwndDlg, PFILE_TYPE_ENTRY pEntry)
Definition: filetypes.cpp:1618
static BOOL FileTypesDlg_AddExt(HWND hwndDlg, LPCWSTR pszExt, LPCWSTR pszFileType)
Definition: filetypes.cpp:708
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:3102
UINT code
Definition: winuser.h:3133
#define LVN_KEYDOWN
Definition: commctrl.h:3156
HINSTANCE shell32_hInstance
Definition: misc.cpp:82
HICON hIconSmall
Definition: filetypes.cpp:41
#define IDC_FILETYPES_ADVANCED
Definition: shresdef.h:375
WCHAR FileExtension[30]
Definition: filetypes.cpp:34
smooth NULL
Definition: ftsmooth.c:416
UINT uOldState
Definition: commctrl.h:3009
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:3106
static INT_PTR CALLBACK EditTypeDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
Definition: filetypes.cpp:1430
#define GetProcessHeap()
Definition: compat.h:395
HRESULT WINAPI SHOpenWithDialog(HWND hwndParent, const OPENASINFO *poainfo)
HWND WINAPI GetDlgItem(_In_opt_ HWND, _In_ int)
#define LVN_DELETEITEM
Definition: commctrl.h:3105
static PFILE_TYPE_ENTRY FileTypesDlg_GetEntry(HWND hListView, INT iItem=-1)
Definition: filetypes.cpp:1590
#define IDD_EDITTYPE
Definition: shresdef.h:441
#define IDC_FILETYPES_NEW
Definition: shresdef.h:369
#define WM_COMMAND
Definition: winuser.h:1722
HWND hwndFrom
Definition: winuser.h:3131
BOOL WINAPI EnableWindow(_In_ HWND, _In_ BOOL)
#define IDC_FILETYPES_DELETE
Definition: shresdef.h:370
#define NM_DBLCLK
Definition: commctrl.h:131
struct tagNMLISTVIEW * LPNMLISTVIEW
#define IDC_FILETYPES_CHANGE
Definition: shresdef.h:373
#define IDC_FILETYPES_LISTVIEW
Definition: shresdef.h:368
#define MAKEINTRESOURCEW(i)
Definition: winuser.h:582
#define IDD_NEWEXTENSION
Definition: shresdef.h:440
Definition: filetypes.cpp:32
static void FileTypesDlg_OnDelete(HWND hwndDlg)
Definition: filetypes.cpp:1607
#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:394
#define LVIS_FOCUSED
Definition: commctrl.h:2290
#define WM_NOTIFY
Definition: richedit.h:61

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

◆ 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:347
static void GeneralDlg_OnRestoreDefaults(HWND hwndDlg, PGENERAL_DIALOG pGeneral)
Definition: general.cpp:338
#define IDC_FOLDER_OPTIONS_SAMEWINDOW
Definition: shresdef.h:343
BOOL WINAPI DestroyIcon(_In_ HICON)
Definition: cursoricon.c:2022
#define PSN_APPLY
Definition: prsht.h:117
#define IDC_FOLDER_OPTIONS_SINGLECLICK
Definition: shresdef.h:345
#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:3133
HICON hClickIcon
Definition: general.cpp:194
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:341
#define PropSheet_Changed(d, w)
Definition: prsht.h:326
#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:349
#define IDC_FOLDER_OPTIONS_ULPOINT
Definition: shresdef.h:348
#define HIWORD(l)
Definition: typedefs.h:246
#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:346
#define WM_NOTIFY
Definition: richedit.h:61
#define IDC_FOLDER_OPTIONS_OWNWINDOW
Definition: shresdef.h:344
#define IDC_FOLDER_OPTIONS_CLASSICFOLDERS
Definition: shresdef.h:342

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

◆ 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:432
#define PSN_APPLY
Definition: prsht.h:117
int32_t INT_PTR
Definition: typedefs.h:62
#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
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:3694
#define NM_CUSTOMDRAW
Definition: commctrl.h:137
#define WM_COMMAND
Definition: winuser.h:1722
#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:3685
#define WM_NOTIFY
Definition: richedit.h:61

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

◆ WINE_DEFAULT_DEBUG_CHANNEL()

WINE_DEFAULT_DEBUG_CHANNEL ( fprop  )