ReactOS 0.4.15-dev-7889-g76290a6
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 1673 of file filetypes.cpp.

1678{
1679 LPNMLISTVIEW lppl;
1682 NEWEXT_DIALOG newext;
1683 EDITTYPE_DIALOG edittype;
1684
1685 switch (uMsg)
1686 {
1687 case WM_INITDIALOG:
1688 pEntry = FileTypesDlg_DoList(hwndDlg);
1689
1690 // Disable the Delete button if the listview is empty
1691 // the selected item should not be deleted by the user
1692 if (pEntry == NULL || (pEntry->EditFlags & 0x00000010)) // FTA_NoRemove
1694 return TRUE;
1695
1696 case WM_COMMAND:
1697 switch (LOWORD(wParam))
1698 {
1699 case IDC_FILETYPES_NEW:
1700 newext.hwndLV = GetDlgItem(hwndDlg, IDC_FILETYPES_LISTVIEW);
1702 hwndDlg, NewExtDlgProc, (LPARAM)&newext))
1703 {
1704 FileTypesDlg_AddExt(hwndDlg, newext.szExt, newext.szFileType);
1705 }
1706 break;
1707
1709 FileTypesDlg_OnDelete(hwndDlg);
1710 break;
1711
1714 if (pEntry)
1715 {
1716 ZeroMemory(&Info, sizeof(Info));
1718 Info.pcszFile = pEntry->FileExtension;
1719 Info.pcszClass = NULL;
1720 SHOpenWithDialog(hwndDlg, &Info);
1721 }
1722 break;
1723
1725 edittype.hwndLV = GetDlgItem(hwndDlg, IDC_FILETYPES_LISTVIEW);
1726 edittype.pEntry = FileTypesDlg_GetEntry(edittype.hwndLV);
1727 if (edittype.pEntry)
1728 {
1730 hwndDlg, EditTypeDlgProc, (LPARAM)&edittype);
1731 }
1732 break;
1733 }
1734 break;
1735
1736 case WM_NOTIFY:
1737 lppl = (LPNMLISTVIEW) lParam;
1738 switch (lppl->hdr.code)
1739 {
1740 case LVN_KEYDOWN:
1741 {
1742 LV_KEYDOWN *pKeyDown = (LV_KEYDOWN *)lParam;
1743 if (pKeyDown->wVKey == VK_DELETE)
1744 {
1745 FileTypesDlg_OnDelete(hwndDlg);
1746 }
1747 break;
1748 }
1749
1750 case NM_DBLCLK:
1751 edittype.hwndLV = GetDlgItem(hwndDlg, IDC_FILETYPES_LISTVIEW);
1752 edittype.pEntry = FileTypesDlg_GetEntry(edittype.hwndLV);
1753 if (edittype.pEntry)
1754 {
1756 hwndDlg, EditTypeDlgProc, (LPARAM)&edittype);
1757 }
1758 break;
1759
1760 case LVN_DELETEALLITEMS:
1761 return FALSE; // send LVN_DELETEITEM
1762
1763 case LVN_DELETEITEM:
1765 if (pEntry)
1766 {
1767 DestroyIcon(pEntry->hIconLarge);
1768 DestroyIcon(pEntry->hIconSmall);
1770 }
1771 return FALSE;
1772
1773 case LVN_ITEMCHANGING:
1775 if (!pEntry)
1776 {
1777 return TRUE;
1778 }
1779
1780 if (!(lppl->uOldState & LVIS_FOCUSED) && (lppl->uNewState & LVIS_FOCUSED))
1781 {
1783 }
1784 break;
1785
1786 case PSN_SETACTIVE:
1787 // On page activation, set the focus to the listview
1789 break;
1790 }
1791 break;
1792 }
1793
1794 return FALSE;
1795}
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:1627
static void FileTypesDlg_OnDelete(HWND hwndDlg)
Definition: filetypes.cpp:1610
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:1433
static PFILE_TYPE_ENTRY FileTypesDlg_GetEntry(HWND hListView, INT iItem=-1)
Definition: filetypes.cpp:1593
static PFILE_TYPE_ENTRY FileTypesDlg_DoList(HWND hwndDlg)
Definition: filetypes.cpp:1529
static BOOL FileTypesDlg_AddExt(HWND hwndDlg, LPCWSTR pszExt, LPCWSTR pszFileType)
Definition: filetypes.cpp:710
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:2666
@ OAIF_ALLOW_REGISTRATION
Definition: shlobj.h:2665
#define IDC_FILETYPES_LISTVIEW
Definition: shresdef.h:441
#define IDD_NEWEXTENSION
Definition: shresdef.h:520
#define IDD_EDITTYPE
Definition: shresdef.h:521
#define IDC_FILETYPES_ADVANCED
Definition: shresdef.h:448
#define IDC_FILETYPES_DELETE
Definition: shresdef.h:443
#define IDC_FILETYPES_CHANGE
Definition: shresdef.h:446
#define IDC_FILETYPES_NEW
Definition: shresdef.h:442
PFILE_TYPE_ENTRY pEntry
Definition: filetypes.cpp:210
Definition: filetypes.cpp:33
UINT code
Definition: winuser.h:3159
HWND hwndFrom
Definition: winuser.h:3157
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:1712
LONG_PTR LPARAM
Definition: windef.h:208
#define WM_COMMAND
Definition: winuser.h:1740
#define WM_INITDIALOG
Definition: winuser.h:1739
HWND WINAPI GetDlgItem(_In_opt_ HWND, _In_ int)
#define IDOK
Definition: winuser.h:830
HWND WINAPI SetFocus(_In_opt_ HWND)
BOOL WINAPI EnableWindow(_In_ HWND, _In_ BOOL)
#define VK_DELETE
Definition: winuser.h:2233
#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:2053

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

◆ FolderOptionsGeneralDlg()

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

Definition at line 362 of file general.cpp.

367{
368 static GENERAL_DIALOG general;
369
370 switch (uMsg)
371 {
372 case WM_INITDIALOG:
373 general.hTaskIcon = NULL;
374 general.hFolderIcon = NULL;
375 general.hClickIcon = NULL;
376 return GeneralDlg_OnInitDialog(hwndDlg, &general);
377
378 case WM_COMMAND:
379 switch (LOWORD(wParam))
380 {
389 if (HIWORD(wParam) == BN_CLICKED)
390 {
391 GeneralDlg_UpdateIcons(hwndDlg, LOWORD(wParam), &general);
392
393 // Enable the 'Apply' button
394 PropSheet_Changed(GetParent(hwndDlg), hwndDlg);
395 }
396 break;
398 if (HIWORD(wParam) == BN_CLICKED)
399 {
400 GeneralDlg_OnRestoreDefaults(hwndDlg, &general);
401
402 // Enable the 'Apply' button
403 PropSheet_Changed(GetParent(hwndDlg), hwndDlg);
404 }
405 break;
406 }
407 break;
408
409 case WM_NOTIFY:
410 {
411 LPNMHDR pnmh = (LPNMHDR)lParam;
412
413 switch (pnmh->code)
414 {
415 case PSN_SETACTIVE:
416 break;
417
418 case PSN_APPLY:
419 return GeneralDlg_OnApply(hwndDlg, &general);
420 }
421 break;
422 }
423
424 case WM_DESTROY:
425 DestroyIcon(general.hTaskIcon);
426 DestroyIcon(general.hFolderIcon);
427 DestroyIcon(general.hClickIcon);
428 break;
429
430 default:
431 return FALSE;
432 }
433 return FALSE;
434}
static BOOL GeneralDlg_OnInitDialog(HWND hwndDlg, PGENERAL_DIALOG pGeneral)
Definition: general.cpp:319
static VOID GeneralDlg_UpdateIcons(HWND hDlg, UINT nCtrlID, PGENERAL_DIALOG pGeneral)
Definition: general.cpp:195
static void GeneralDlg_OnRestoreDefaults(HWND hwndDlg, PGENERAL_DIALOG pGeneral)
Definition: general.cpp:335
static BOOL GeneralDlg_OnApply(HWND hwndDlg, PGENERAL_DIALOG pGeneral)
Definition: general.cpp:348
#define PropSheet_Changed(d, w)
Definition: prsht.h:344
#define PSN_APPLY
Definition: prsht.h:117
#define IDC_FOLDER_OPTIONS_CLASSICFOLDERS
Definition: shresdef.h:415
#define IDC_FOLDER_OPTIONS_ULBROWSER
Definition: shresdef.h:420
#define IDC_FOLDER_OPTIONS_SINGLECLICK
Definition: shresdef.h:418
#define IDC_FOLDER_OPTIONS_COMMONTASKS
Definition: shresdef.h:414
#define IDC_FOLDER_OPTIONS_SAMEWINDOW
Definition: shresdef.h:416
#define IDC_FOLDER_OPTIONS_DOUBLECLICK
Definition: shresdef.h:419
#define IDC_FOLDER_OPTIONS_ULPOINT
Definition: shresdef.h:421
#define IDC_FOLDER_OPTIONS_RESTORE
Definition: shresdef.h:422
#define IDC_FOLDER_OPTIONS_OWNWINDOW
Definition: shresdef.h:417
HICON hFolderIcon
Definition: general.cpp:190
HICON hClickIcon
Definition: general.cpp:191
HICON hTaskIcon
Definition: general.cpp:189
#define HIWORD(l)
Definition: typedefs.h:247
struct tagNMHDR * LPNMHDR
HWND WINAPI GetParent(_In_ HWND)
#define BN_CLICKED
Definition: winuser.h:1925
#define WM_DESTROY
Definition: winuser.h:1609

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

◆ 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:505
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:870
_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  )