ReactOS 0.4.15-dev-5666-gc548b97
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;
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
1701 FileTypesDlg_OnDelete(hwndDlg);
1702 break;
1703
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:
1751 if (pEntry)
1752 {
1753 DestroyIcon(pEntry->hIconLarge);
1754 DestroyIcon(pEntry->hIconSmall);
1756 }
1757 return FALSE;
1758
1759 case LVN_ITEMCHANGING:
1761 if (!pEntry)
1762 {
1763 return TRUE;
1764 }
1765
1766 if (!(lppl->uOldState & LVIS_FOCUSED) && (lppl->uNewState & LVIS_FOCUSED))
1767 {
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}
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:1619
static void FileTypesDlg_OnDelete(HWND hwndDlg)
Definition: filetypes.cpp:1608
static INT_PTR CALLBACK NewExtDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
Definition: filetypes.cpp:523
static INT_PTR CALLBACK EditTypeDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
Definition: filetypes.cpp:1431
static PFILE_TYPE_ENTRY FileTypesDlg_GetEntry(HWND hListView, INT iItem=-1)
Definition: filetypes.cpp:1591
static PFILE_TYPE_ENTRY FileTypesDlg_DoList(HWND hwndDlg)
Definition: filetypes.cpp:1527
static BOOL FileTypesDlg_AddExt(HWND hwndDlg, LPCWSTR pszExt, LPCWSTR pszFileType)
Definition: filetypes.cpp:709
PLIST_ENTRY pEntry
Definition: fxioqueue.cpp:4484
#define LOWORD(l)
Definition: pedump.c:82
#define PSN_SETACTIVE
Definition: prsht.h:115
#define NM_DBLCLK
Definition: commctrl.h:131
#define LVN_DELETEALLITEMS
Definition: commctrl.h:3134
#define LVN_ITEMCHANGING
Definition: commctrl.h:3130
struct tagNMLISTVIEW * LPNMLISTVIEW
#define LVN_KEYDOWN
Definition: commctrl.h:3184
#define LV_KEYDOWN
Definition: commctrl.h:3186
#define LVN_DELETEITEM
Definition: commctrl.h:3133
#define LVIS_FOCUSED
Definition: commctrl.h:2318
#define WM_NOTIFY
Definition: richedit.h:61
@ OAIF_REGISTER_EXT
Definition: shlobj.h:2533
@ OAIF_ALLOW_REGISTRATION
Definition: shlobj.h:2532
#define IDC_FILETYPES_LISTVIEW
Definition: shresdef.h:420
#define IDD_NEWEXTENSION
Definition: shresdef.h:499
#define IDD_EDITTYPE
Definition: shresdef.h:500
#define IDC_FILETYPES_ADVANCED
Definition: shresdef.h:427
#define IDC_FILETYPES_DELETE
Definition: shresdef.h:422
#define IDC_FILETYPES_CHANGE
Definition: shresdef.h:425
#define IDC_FILETYPES_NEW
Definition: shresdef.h:421
PFILE_TYPE_ENTRY pEntry
Definition: filetypes.cpp:210
Definition: filetypes.cpp:33
UINT code
Definition: winuser.h:3149
HWND hwndFrom
Definition: winuser.h:3147
UINT uNewState
Definition: commctrl.h:3036
UINT uOldState
Definition: commctrl.h:3037
_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:1670
LONG_PTR LPARAM
Definition: windef.h:208
#define WM_COMMAND
Definition: winuser.h:1730
#define WM_INITDIALOG
Definition: winuser.h:1729
HWND WINAPI GetDlgItem(_In_opt_ HWND, _In_ int)
#define IDOK
Definition: winuser.h:824
HWND WINAPI SetFocus(_In_opt_ HWND)
BOOL WINAPI EnableWindow(_In_ HWND, _In_ BOOL)
#define VK_DELETE
Definition: winuser.h:2223
#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:2022

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}
static BOOL GeneralDlg_OnInitDialog(HWND hwndDlg, PGENERAL_DIALOG pGeneral)
Definition: general.cpp:322
static VOID GeneralDlg_UpdateIcons(HWND hDlg, UINT nCtrlID, PGENERAL_DIALOG pGeneral)
Definition: general.cpp:198
static void GeneralDlg_OnRestoreDefaults(HWND hwndDlg, PGENERAL_DIALOG pGeneral)
Definition: general.cpp:338
static BOOL GeneralDlg_OnApply(HWND hwndDlg, PGENERAL_DIALOG pGeneral)
Definition: general.cpp:351
#define PropSheet_Changed(d, w)
Definition: prsht.h:344
#define PSN_APPLY
Definition: prsht.h:117
#define IDC_FOLDER_OPTIONS_CLASSICFOLDERS
Definition: shresdef.h:394
#define IDC_FOLDER_OPTIONS_ULBROWSER
Definition: shresdef.h:399
#define IDC_FOLDER_OPTIONS_SINGLECLICK
Definition: shresdef.h:397
#define IDC_FOLDER_OPTIONS_COMMONTASKS
Definition: shresdef.h:393
#define IDC_FOLDER_OPTIONS_SAMEWINDOW
Definition: shresdef.h:395
#define IDC_FOLDER_OPTIONS_DOUBLECLICK
Definition: shresdef.h:398
#define IDC_FOLDER_OPTIONS_ULPOINT
Definition: shresdef.h:400
#define IDC_FOLDER_OPTIONS_RESTORE
Definition: shresdef.h:401
#define IDC_FOLDER_OPTIONS_OWNWINDOW
Definition: shresdef.h:396
HICON hFolderIcon
Definition: general.cpp:193
HICON hClickIcon
Definition: general.cpp:194
HICON hTaskIcon
Definition: general.cpp:192
#define HIWORD(l)
Definition: typedefs.h:247
struct tagNMHDR * LPNMHDR
HWND WINAPI GetParent(_In_ HWND)
#define BN_CLICKED
Definition: winuser.h:1915
#define WM_DESTROY
Definition: winuser.h:1599

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

◆ FolderOptionsViewDlg()

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

Definition at line 932 of file view.cpp.

937{
940
941 switch (uMsg)
942 {
943 case WM_INITDIALOG:
944 return ViewDlg_OnInitDialog(hwndDlg);
945
946 case WM_COMMAND:
947 switch (LOWORD(wParam))
948 {
949 case IDC_VIEW_RESTORE_DEFAULTS: // Restore Defaults
951 break;
952 }
953 break;
954
955 case WM_NOTIFY:
956 switch (LPNMHDR(lParam)->code)
957 {
958 case NM_CLICK: // clicked on treeview
960 break;
961
962 case NM_CUSTOMDRAW: // custom draw (for graying)
966 return Result;
967
968 case TVN_KEYDOWN: // key is down
970 break;
971
972 case PSN_APPLY: // [Apply] is clicked
973 ViewDlg_Apply(hwndDlg);
974 break;
975
976 default:
977 break;
978 }
979 break;
980 }
981
982 return FALSE;
983}
void Draw(HDC aDc)
Definition: magnifier.c:359
#define TVN_KEYDOWN
Definition: commctrl.h:3713
#define NM_CLICK
Definition: commctrl.h:130
#define NM_CUSTOMDRAW
Definition: commctrl.h:137
#define TV_KEYDOWN
Definition: commctrl.h:3722
#define IDC_VIEW_RESTORE_DEFAULTS
Definition: shresdef.h:484
Definition: inflate.c:139
#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:718
static VOID ViewDlg_RestoreDefaults(HWND hwndDlg)
Definition: view.cpp:764
static BOOL ViewDlg_OnInitDialog(HWND hwndDlg)
Definition: view.cpp:621
static INT_PTR ViewDlg_OnTreeCustomDraw(HWND hwndDlg, NMTVCUSTOMDRAW *Draw)
Definition: view.cpp:734
static VOID ViewDlg_Apply(HWND hwndDlg)
Definition: view.cpp:869
static VOID ViewDlg_OnTreeViewClick(HWND hwndDlg)
Definition: view.cpp:696
#define DWLP_MSGRESULT
Definition: winuser.h:864
_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

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

◆ WINE_DEFAULT_DEBUG_CHANNEL()

WINE_DEFAULT_DEBUG_CHANNEL ( fprop  )