ReactOS 0.4.16-dev-125-g798ea90
CFolderOptions.cpp File Reference
#include <precomp.h>
#include <shdeprecated.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 1691 of file filetypes.cpp.

1696{
1697 LPNMLISTVIEW lppl;
1700 NEWEXT_DIALOG newext;
1701 EDITTYPE_DIALOG edittype;
1702
1703 switch (uMsg)
1704 {
1705 case WM_INITDIALOG:
1706 pEntry = FileTypesDlg_DoList(hwndDlg);
1707
1708 // Disable the Delete button if the listview is empty
1709 // the selected item should not be deleted by the user
1710 if (pEntry == NULL || (pEntry->EditFlags & 0x00000010)) // FTA_NoRemove
1712 return TRUE;
1713
1714 case WM_COMMAND:
1715 switch (LOWORD(wParam))
1716 {
1717 case IDC_FILETYPES_NEW:
1718 newext.hwndLV = GetDlgItem(hwndDlg, IDC_FILETYPES_LISTVIEW);
1720 hwndDlg, NewExtDlgProc, (LPARAM)&newext))
1721 {
1722 FileTypesDlg_AddExt(hwndDlg, newext.szExt, newext.szFileType);
1723 }
1724 break;
1725
1727 FileTypesDlg_OnDelete(hwndDlg);
1728 break;
1729
1732 if (pEntry)
1733 {
1734 ZeroMemory(&Info, sizeof(Info));
1736 Info.pcszFile = pEntry->FileExtension;
1737 Info.pcszClass = NULL;
1738 if (SHOpenWithDialog(hwndDlg, &Info) == S_OK)
1739 {
1742 PropSheet_Changed(GetParent(hwndDlg), hwndDlg);
1743 }
1744 }
1745 break;
1746
1748 edittype.hwndLV = GetDlgItem(hwndDlg, IDC_FILETYPES_LISTVIEW);
1749 edittype.pEntry = FileTypesDlg_GetEntry(edittype.hwndLV);
1750 if (edittype.pEntry)
1751 {
1753 hwndDlg, EditTypeDlgProc, (LPARAM)&edittype);
1754 }
1755 break;
1756 }
1757 break;
1758
1759 case WM_NOTIFY:
1760 lppl = (LPNMLISTVIEW) lParam;
1761 switch (lppl->hdr.code)
1762 {
1763 case LVN_KEYDOWN:
1764 {
1765 LV_KEYDOWN *pKeyDown = (LV_KEYDOWN *)lParam;
1766 if (pKeyDown->wVKey == VK_DELETE)
1767 {
1768 FileTypesDlg_OnDelete(hwndDlg);
1769 }
1770 break;
1771 }
1772
1773 case NM_DBLCLK:
1774 edittype.hwndLV = GetDlgItem(hwndDlg, IDC_FILETYPES_LISTVIEW);
1775 edittype.pEntry = FileTypesDlg_GetEntry(edittype.hwndLV);
1776 if (edittype.pEntry)
1777 {
1779 hwndDlg, EditTypeDlgProc, (LPARAM)&edittype);
1780 }
1781 break;
1782
1783 case LVN_DELETEALLITEMS:
1784 return FALSE; // send LVN_DELETEITEM
1785
1786 case LVN_DELETEITEM:
1788 if (pEntry)
1789 {
1790 DestroyIcon(pEntry->hIconLarge);
1791 DestroyIcon(pEntry->hIconSmall);
1793 }
1794 return FALSE;
1795
1796 case LVN_ITEMCHANGING:
1798 if (!pEntry)
1799 {
1800 return TRUE;
1801 }
1802
1803 if (!(lppl->uOldState & LVIS_FOCUSED) && (lppl->uNewState & LVIS_FOCUSED))
1804 {
1806 }
1807 break;
1808
1809 case PSN_SETACTIVE:
1810 // On page activation, set the focus to the listview
1812 break;
1813 }
1814 break;
1815 }
1816
1817 return FALSE;
1818}
HRESULT WINAPI SHOpenWithDialog(HWND hwndParent, const OPENASINFO *poainfo)
#define shell32_hInstance
WPARAM wParam
Definition: combotst.c:138
LPARAM lParam
Definition: combotst.c:139
#define NULL
Definition: types.h:112
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
#define GetProcessHeap()
Definition: compat.h:736
#define HeapFree(x, y, z)
Definition: compat.h:735
static void FileTypesDlg_OnItemChanging(HWND hwndDlg, PFILE_TYPE_ENTRY pEntry)
Definition: filetypes.cpp:1632
static void FileTypesDlg_OnDelete(HWND hwndDlg)
Definition: filetypes.cpp:1615
static INT_PTR CALLBACK NewExtDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
Definition: filetypes.cpp:528
static INT_PTR CALLBACK EditTypeDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
Definition: filetypes.cpp:1438
static PFILE_TYPE_ENTRY FileTypesDlg_GetEntry(HWND hListView, INT iItem=-1)
Definition: filetypes.cpp:1598
static VOID FileTypesDlg_UpdateAppInfo(HWND hwndDlg, PFILE_TYPE_ENTRY pEntry)
Definition: filetypes.cpp:1677
static PFILE_TYPE_ENTRY FileTypesDlg_DoList(HWND hwndDlg)
Definition: filetypes.cpp:1534
static BOOL FileTypesDlg_AddExt(HWND hwndDlg, LPCWSTR pszExt, LPCWSTR pszFileType)
Definition: filetypes.cpp:715
PLIST_ENTRY pEntry
Definition: fxioqueue.cpp:4484
#define S_OK
Definition: intsafe.h:52
#define LOWORD(l)
Definition: pedump.c:82
#define PropSheet_Changed(d, w)
Definition: prsht.h:344
#define PSN_SETACTIVE
Definition: prsht.h:115
#define NM_DBLCLK
Definition: commctrl.h:131
#define LVN_DELETEALLITEMS
Definition: commctrl.h:3139
#define LVN_ITEMCHANGING
Definition: commctrl.h:3135
struct tagNMLISTVIEW * LPNMLISTVIEW
#define LVN_KEYDOWN
Definition: commctrl.h:3189
#define LV_KEYDOWN
Definition: commctrl.h:3191
#define LVN_DELETEITEM
Definition: commctrl.h:3138
#define LVIS_FOCUSED
Definition: commctrl.h:2323
#define WM_NOTIFY
Definition: richedit.h:61
@ OAIF_REGISTER_EXT
Definition: shlobj.h:2681
@ OAIF_FORCE_REGISTRATION
Definition: shlobj.h:2683
#define IDC_FILETYPES_LISTVIEW
Definition: shresdef.h:444
#define IDD_NEWEXTENSION
Definition: shresdef.h:523
#define IDD_EDITTYPE
Definition: shresdef.h:524
#define IDC_FILETYPES_ADVANCED
Definition: shresdef.h:451
#define IDC_FILETYPES_DELETE
Definition: shresdef.h:446
#define IDC_FILETYPES_CHANGE
Definition: shresdef.h:449
#define IDC_FILETYPES_NEW
Definition: shresdef.h:445
PFILE_TYPE_ENTRY pEntry
Definition: filetypes.cpp:215
Definition: filetypes.cpp:33
UINT code
Definition: winuser.h:3162
HWND hwndFrom
Definition: winuser.h:3160
UINT uNewState
Definition: commctrl.h:3041
UINT uOldState
Definition: commctrl.h:3042
_Must_inspect_result_ _In_ WDFCHILDLIST _In_ PWDF_CHILD_LIST_ITERATOR _Out_ WDFDEVICE _Inout_opt_ PWDF_CHILD_RETRIEVE_INFO Info
Definition: wdfchildlist.h:690
#define ZeroMemory
Definition: winbase.h:1712
LONG_PTR LPARAM
Definition: windef.h:208
#define WM_COMMAND
Definition: winuser.h:1743
#define WM_INITDIALOG
Definition: winuser.h:1742
HWND WINAPI GetDlgItem(_In_opt_ HWND, _In_ int)
#define IDOK
Definition: winuser.h:833
HWND WINAPI SetFocus(_In_opt_ HWND)
BOOL WINAPI EnableWindow(_In_ HWND, _In_ BOOL)
HWND WINAPI GetParent(_In_ HWND)
#define VK_DELETE
Definition: winuser.h:2236
#define MAKEINTRESOURCEW(i)
Definition: winuser.h:582
INT_PTR WINAPI DialogBoxParamW(_In_opt_ HINSTANCE, _In_ LPCWSTR, _In_opt_ HWND, _In_opt_ DLGPROC, _In_ LPARAM)
BOOL WINAPI DestroyIcon(_In_ HICON)
Definition: cursoricon.c:2105

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

◆ FolderOptionsGeneralDlg()

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

Definition at line 331 of file general.cpp.

336{
337 static GENERAL_DIALOG general;
338
339 switch (uMsg)
340 {
341 case WM_INITDIALOG:
342 general.hTaskIcon = NULL;
343 general.hFolderIcon = NULL;
344 general.hClickIcon = NULL;
345 return GeneralDlg_OnInitDialog(hwndDlg, &general);
346
347 case WM_COMMAND:
348 switch (LOWORD(wParam))
349 {
358 if (HIWORD(wParam) == BN_CLICKED)
359 {
360 GeneralDlg_UpdateIcons(hwndDlg, LOWORD(wParam), &general);
361
362 // Enable the 'Apply' button
363 PropSheet_Changed(GetParent(hwndDlg), hwndDlg);
364 }
365 break;
367 if (HIWORD(wParam) == BN_CLICKED)
368 {
369 GeneralDlg_OnRestoreDefaults(hwndDlg, &general);
370
371 // Enable the 'Apply' button
372 PropSheet_Changed(GetParent(hwndDlg), hwndDlg);
373 }
374 break;
375 }
376 break;
377
378 case WM_NOTIFY:
379 {
380 LPNMHDR pnmh = (LPNMHDR)lParam;
381
382 switch (pnmh->code)
383 {
384 case PSN_SETACTIVE:
385 break;
386
387 case PSN_APPLY:
388 return GeneralDlg_OnApply(hwndDlg, &general);
389 }
390 break;
391 }
392
393 case WM_DESTROY:
394 DestroyIcon(general.hTaskIcon);
395 DestroyIcon(general.hFolderIcon);
396 DestroyIcon(general.hClickIcon);
397 break;
398
399 default:
400 return FALSE;
401 }
402 return FALSE;
403}
static BOOL GeneralDlg_OnInitDialog(HWND hwndDlg, PGENERAL_DIALOG pGeneral)
Definition: general.cpp:286
static VOID GeneralDlg_UpdateIcons(HWND hDlg, UINT nCtrlID, PGENERAL_DIALOG pGeneral)
Definition: general.cpp:160
static void GeneralDlg_OnRestoreDefaults(HWND hwndDlg, PGENERAL_DIALOG pGeneral)
Definition: general.cpp:302
static BOOL GeneralDlg_OnApply(HWND hwndDlg, PGENERAL_DIALOG pGeneral)
Definition: general.cpp:315
#define PSN_APPLY
Definition: prsht.h:117
#define IDC_FOLDER_OPTIONS_CLASSICFOLDERS
Definition: shresdef.h:418
#define IDC_FOLDER_OPTIONS_ULBROWSER
Definition: shresdef.h:423
#define IDC_FOLDER_OPTIONS_SINGLECLICK
Definition: shresdef.h:421
#define IDC_FOLDER_OPTIONS_COMMONTASKS
Definition: shresdef.h:417
#define IDC_FOLDER_OPTIONS_SAMEWINDOW
Definition: shresdef.h:419
#define IDC_FOLDER_OPTIONS_DOUBLECLICK
Definition: shresdef.h:422
#define IDC_FOLDER_OPTIONS_ULPOINT
Definition: shresdef.h:424
#define IDC_FOLDER_OPTIONS_RESTORE
Definition: shresdef.h:425
#define IDC_FOLDER_OPTIONS_OWNWINDOW
Definition: shresdef.h:420
HICON hFolderIcon
Definition: general.cpp:155
HICON hClickIcon
Definition: general.cpp:156
HICON hTaskIcon
Definition: general.cpp:154
#define HIWORD(l)
Definition: typedefs.h:247
struct tagNMHDR * LPNMHDR
#define BN_CLICKED
Definition: winuser.h:1928
#define WM_DESTROY
Definition: winuser.h:1612

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

◆ FolderOptionsViewDlg()

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

Definition at line 953 of file view.cpp.

958{
961
962 switch (uMsg)
963 {
964 case WM_INITDIALOG:
966
967 case WM_COMMAND:
968 switch (LOWORD(wParam))
969 {
970 case IDC_VIEW_RESTORE_DEFAULTS: // Restore Defaults
972 break;
973
976 {
979 if (pFO)
980 hr = pFO->ApplyDefFolderSettings(LOWORD(wParam) == IDC_VIEW_RESET_ALL);
981 if (FAILED(hr))
982 SHELL_ErrorBox(hwndDlg, hr);
983 break;
984 }
985 }
986 break;
987
988 case WM_NOTIFY:
989 switch (LPNMHDR(lParam)->code)
990 {
991 case NM_CLICK: // clicked on treeview
993 break;
994
995 case NM_CUSTOMDRAW: // custom draw (for graying)
999 return Result;
1000
1001 case TVN_KEYDOWN: // key is down
1003 break;
1004
1005 case PSN_APPLY: // [Apply] is clicked
1006 ViewDlg_Apply(hwndDlg);
1007 break;
1008
1009 default:
1010 break;
1011 }
1012 break;
1013 }
1014
1015 return FALSE;
1016}
#define ERROR_NOT_SUPPORTED
Definition: compat.h:100
FxFileObject * pFO
#define FAILED(hr)
Definition: intsafe.h:51
void Draw(HDC aDc)
Definition: magnifier.c:359
#define LPPROPSHEETPAGE
Definition: prsht.h:390
#define TVN_KEYDOWN
Definition: commctrl.h:3718
#define NM_CLICK
Definition: commctrl.h:130
#define NM_CUSTOMDRAW
Definition: commctrl.h:137
#define TV_KEYDOWN
Definition: commctrl.h:3727
HRESULT hr
Definition: shlfolder.c:183
#define IDC_VIEW_RESET_ALL
Definition: shresdef.h:506
#define IDC_VIEW_RESTORE_DEFAULTS
Definition: shresdef.h:508
#define IDC_VIEW_APPLY_TO_ALL
Definition: shresdef.h:505
#define GetWindowLongPtr
Definition: treelist.c:73
#define SetWindowLongPtr
Definition: treelist.c:70
int32_t INT_PTR
Definition: typedefs.h:64
static void ViewDlg_OnTreeViewKeyDown(HWND hwndDlg, TV_KEYDOWN *KeyDown)
Definition: view.cpp:728
static VOID ViewDlg_RestoreDefaults(HWND hwndDlg)
Definition: view.cpp:774
static INT_PTR ViewDlg_OnTreeCustomDraw(HWND hwndDlg, NMTVCUSTOMDRAW *Draw)
Definition: view.cpp:744
static VOID ViewDlg_Apply(HWND hwndDlg)
Definition: view.cpp:890
static BOOL ViewDlg_OnInitDialog(HWND hwndDlg, LPPROPSHEETPAGE psp)
Definition: view.cpp:621
static VOID ViewDlg_OnTreeViewClick(HWND hwndDlg)
Definition: view.cpp:706
#define HRESULT_FROM_WIN32(x)
Definition: winerror.h:92
#define GWL_USERDATA
Definition: winuser.h:864
#define DWLP_MSGRESULT
Definition: winuser.h:873
_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:409

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

◆ WINE_DEFAULT_DEBUG_CHANNEL()

WINE_DEFAULT_DEBUG_CHANNEL ( fprop  )