ReactOS 0.4.15-dev-6679-g945ee4b
CMoveToMenu.cpp File Reference
#include "precomp.h"
Include dependency graph for CMoveToMenu.cpp:

Go to the source code of this file.

Functions

 WINE_DEFAULT_DEBUG_CHANNEL (shell)
 
static LRESULT CALLBACK WindowProc (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
 
static int CALLBACK BrowseCallbackProc (HWND hwnd, UINT uMsg, LPARAM lParam, LPARAM lpData)
 

Function Documentation

◆ BrowseCallbackProc()

static int CALLBACK BrowseCallbackProc ( HWND  hwnd,
UINT  uMsg,
LPARAM  lParam,
LPARAM  lpData 
)
static

Definition at line 68 of file CMoveToMenu.cpp.

69{
70 CMoveToMenu *this_ =
71 reinterpret_cast<CMoveToMenu *>(GetWindowLongPtr(hwnd, GWLP_USERDATA));
72
73 switch (uMsg)
74 {
76 {
78 this_ = reinterpret_cast<CMoveToMenu *>(lpData);
79
80 // Select initial directory
82 reinterpret_cast<LPARAM>(static_cast<LPCITEMIDLIST>(this_->m_pidlFolder)));
83
84 // Set caption
86 SetWindowTextW(hwnd, strCaption);
87
88 // Set OK button text
90 SetDlgItemText(hwnd, IDOK, strMove);
91
92 // Subclassing
93 this_->m_fnOldWndProc =
94 reinterpret_cast<WNDPROC>(
96
97 // Disable OK
99 break;
100 }
101 case BFFM_SELCHANGED:
102 {
103 if (!this_)
104 break;
105
107 LPCITEMIDLIST pidl = reinterpret_cast<LPCITEMIDLIST>(lParam);
108
109 szPath[0] = 0;
111
112 if (ILIsEqual(pidl, this_->m_pidlFolder))
114 else if (PathFileExistsW(szPath) || _ILIsDesktop(pidl))
116 else
118
119 // the text box will be updated later soon, ignore it
121 break;
122 }
123 }
124
125 return FALSE;
126}
BOOL _ILIsDesktop(LPCITEMIDLIST pidl)
Definition: CBandSite.h:24
static LRESULT CALLBACK WindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
Definition: CMoveToMenu.cpp:26
BOOL m_bIgnoreTextBoxChange
CComHeapPtr< ITEMIDLIST > m_pidlFolder
WNDPROC m_fnOldWndProc
LPARAM lParam
Definition: combotst.c:139
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
#define MAX_PATH
Definition: compat.h:34
BOOL WINAPI PathFileExistsW(LPCWSTR lpszPath)
Definition: path.c:1777
LPCWSTR szPath
Definition: env.c:37
__int3264 LONG_PTR
Definition: mstsclib_h.h:276
BOOL WINAPI SHGetPathFromIDListW(LPCITEMIDLIST pidl, LPWSTR pszPath)
Definition: pidl.c:1298
BOOL WINAPI ILIsEqual(LPCITEMIDLIST pidl1, LPCITEMIDLIST pidl2)
Definition: pidl.c:539
#define BFFM_SELCHANGED
Definition: shlobj.h:1168
#define BFFM_ENABLEOK
Definition: shlobj.h:1175
#define BFFM_SETSELECTION
Definition: shlobj.h:1187
#define BFFM_INITIALIZED
Definition: shlobj.h:1167
#define IDS_MOVEITEMS
Definition: shresdef.h:334
#define IDS_MOVEBUTTON
Definition: shresdef.h:335
const ITEMIDLIST UNALIGNED * LPCITEMIDLIST
Definition: shtypes.idl:42
#define GetWindowLongPtr
Definition: treelist.c:73
#define SetWindowLongPtr
Definition: treelist.c:70
#define GWLP_WNDPROC
Definition: treelist.c:66
#define GWLP_USERDATA
Definition: treelist.c:63
_In_ LONG _In_ HWND hwnd
Definition: winddi.h:4023
LONG_PTR LPARAM
Definition: windef.h:208
BOOL WINAPI PostMessageW(_In_opt_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
#define IDOK
Definition: winuser.h:824
BOOL WINAPI SetWindowTextW(_In_ HWND, _In_opt_ LPCWSTR)
#define MAKEINTRESOURCEW(i)
Definition: winuser.h:582
LRESULT(CALLBACK * WNDPROC)(HWND, UINT, WPARAM, LPARAM)
Definition: winuser.h:2896
#define SetDlgItemText
Definition: winuser.h:5839
LRESULT WINAPI SendMessageW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
__wchar_t WCHAR
Definition: xmlstorage.h:180

◆ WindowProc()

static LRESULT CALLBACK WindowProc ( HWND  hwnd,
UINT  uMsg,
WPARAM  wParam,
LPARAM  lParam 
)
static

Definition at line 26 of file CMoveToMenu.cpp.

27{
29 CMoveToMenu *this_ =
30 reinterpret_cast<CMoveToMenu *>(GetWindowLongPtr(hwnd, GWLP_USERDATA));
31
32 switch (uMsg)
33 {
34 case WM_COMMAND:
35 {
36 switch (LOWORD(wParam))
37 {
39 {
40 if (HIWORD(wParam) == EN_CHANGE)
41 {
42 if (!this_->m_bIgnoreTextBoxChange)
43 {
44 // get the text
46 StrTrimW(szPath, L" \t");
47
48 // update OK button
50 SendMessageW(hwnd, BFFM_ENABLEOK, 0, bValid);
51
52 return 0;
53 }
54
55 // reset flag
57 }
58 break;
59 }
60 }
61 break;
62 }
63 }
64 return CallWindowProcW(this_->m_fnOldWndProc, hwnd, uMsg, wParam, lParam);
65}
WPARAM wParam
Definition: combotst.c:138
BOOL WINAPI PathIsDirectoryW(LPCWSTR lpszPath)
Definition: path.c:1723
BOOL WINAPI StrTrimW(LPWSTR lpszStr, LPCWSTR lpszTrim)
Definition: string.c:1869
unsigned int BOOL
Definition: ntddk_ex.h:94
#define L(x)
Definition: ntvdm.h:50
#define LOWORD(l)
Definition: pedump.c:82
#define PathIsRelative
Definition: shlwapi.h:951
#define IDC_BROWSE_FOR_FOLDER_FOLDER_TEXT
Definition: shresdef.h:421
#define _countof(array)
Definition: sndvol32.h:68
#define HIWORD(l)
Definition: typedefs.h:247
UINT WINAPI GetDlgItemTextW(HWND hDlg, int nIDDlgItem, LPWSTR lpString, int nMaxCount)
Definition: dialog.c:2263
#define WM_COMMAND
Definition: winuser.h:1730
LRESULT WINAPI CallWindowProcW(_In_ WNDPROC, _In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
#define EN_CHANGE
Definition: winuser.h:2012

Referenced by BrowseCallbackProc().

◆ WINE_DEFAULT_DEBUG_CHANNEL()

WINE_DEFAULT_DEBUG_CHANNEL ( shell  )