ReactOS  0.4.14-dev-614-gbfd8a84
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 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 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:3032
BOOL WINAPI DestroyIcon(_In_ HICON)
Definition: cursoricon.c:2022
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:1642
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
HINSTANCE shell32_hInstance
Definition: misc.cpp:82
HICON hIconSmall
Definition: filetypes.cpp:41
#define IDC_FILETYPES_ADVANCED
Definition: shresdef.h:387
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:403
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:453
#define IDC_FILETYPES_NEW
Definition: shresdef.h:381
#define WM_COMMAND
Definition: winuser.h:1722
HWND hwndFrom
Definition: winuser.h:3132
BOOL WINAPI EnableWindow(_In_ HWND, _In_ BOOL)
#define IDC_FILETYPES_DELETE
Definition: shresdef.h:382
#define NM_DBLCLK
Definition: commctrl.h:131
struct tagNMLISTVIEW * LPNMLISTVIEW
#define IDC_FILETYPES_CHANGE
Definition: shresdef.h:385
#define IDC_FILETYPES_LISTVIEW
Definition: shresdef.h:380
#define MAKEINTRESOURCEW(i)
Definition: winuser.h:582
#define IDD_NEWEXTENSION
Definition: shresdef.h:452
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:402
#define LVIS_FOCUSED
Definition: commctrl.h:2314
#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:359
static void GeneralDlg_OnRestoreDefaults(HWND hwndDlg, PGENERAL_DIALOG pGeneral)
Definition: general.cpp:338
#define IDC_FOLDER_OPTIONS_SAMEWINDOW
Definition: shresdef.h:355
BOOL WINAPI DestroyIcon(_In_ HICON)
Definition: cursoricon.c:2022
#define PSN_APPLY
Definition: prsht.h:117
#define IDC_FOLDER_OPTIONS_SINGLECLICK
Definition: shresdef.h:357
#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
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:353
#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:361
#define IDC_FOLDER_OPTIONS_ULPOINT
Definition: shresdef.h:360
#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:358
#define WM_NOTIFY
Definition: richedit.h:61
#define IDC_FOLDER_OPTIONS_OWNWINDOW
Definition: shresdef.h:356
#define IDC_FOLDER_OPTIONS_CLASSICFOLDERS
Definition: shresdef.h:354

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:444
#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:3718
#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:3709
#define WM_NOTIFY
Definition: richedit.h:61

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

◆ WINE_DEFAULT_DEBUG_CHANNEL()

WINE_DEFAULT_DEBUG_CHANNEL ( fprop  )