ReactOS  0.4.15-dev-1177-g6cb3b62
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  {
75  case BFFM_INITIALIZED:
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>(
95  SetWindowLongPtr(hwnd, GWLP_WNDPROC, reinterpret_cast<LONG_PTR>(WindowProc)));
96 
97  // Disable OK
99  break;
100  }
101  case BFFM_SELCHANGED:
102  {
104  LPCITEMIDLIST pidl = reinterpret_cast<LPCITEMIDLIST>(lParam);
105 
106  szPath[0] = 0;
108 
109  if (ILIsEqual(pidl, this_->m_pidlFolder))
111  else if (PathFileExistsW(szPath) || _ILIsDesktop(pidl))
113  else
115 
116  // the text box will be updated later soon, ignore it
117  this_->m_bIgnoreTextBoxChange = TRUE;
118  break;
119  }
120  }
121 
122  return FALSE;
123 }
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
#define IDOK
Definition: winuser.h:824
BOOL m_bIgnoreTextBoxChange
#define TRUE
Definition: types.h:120
const ITEMIDLIST UNALIGNED * LPCITEMIDLIST
Definition: shtypes.idl:42
BOOL WINAPI SHGetPathFromIDListW(LPCITEMIDLIST pidl, LPWSTR pszPath)
Definition: pidl.c:1294
#define BFFM_INITIALIZED
Definition: shlobj.h:1163
CComHeapPtr< ITEMIDLIST > m_pidlFolder
BOOL WINAPI SetWindowTextW(_In_ HWND, _In_opt_ LPCWSTR)
BOOL WINAPI ILIsEqual(LPCITEMIDLIST pidl1, LPCITEMIDLIST pidl2)
Definition: pidl.c:535
#define SetWindowLongPtr
Definition: treelist.c:70
#define IDS_MOVEITEMS
Definition: shresdef.h:306
#define FALSE
Definition: types.h:117
#define BFFM_SETSELECTION
Definition: shlobj.h:1183
#define GWLP_USERDATA
Definition: treelist.c:63
static LRESULT CALLBACK WindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
Definition: CMoveToMenu.cpp:26
BOOL WINAPI PathFileExistsW(LPCWSTR lpszPath)
Definition: path.c:1756
BOOL _ILIsDesktop(LPCITEMIDLIST pidl)
Definition: CBandSite.h:24
#define IDS_MOVEBUTTON
Definition: shresdef.h:307
__wchar_t WCHAR
Definition: xmlstorage.h:180
#define MAX_PATH
Definition: compat.h:34
#define SetDlgItemText
Definition: winuser.h:5824
#define GWLP_WNDPROC
Definition: treelist.c:66
#define BFFM_ENABLEOK
Definition: shlobj.h:1171
WNDPROC m_fnOldWndProc
LPCWSTR szPath
Definition: env.c:35
#define BFFM_SELCHANGED
Definition: shlobj.h:1164
LRESULT WINAPI SendMessageW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
BOOL WINAPI PostMessageW(_In_opt_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
#define MAKEINTRESOURCEW(i)
Definition: winuser.h:582
#define GetWindowLongPtr
Definition: treelist.c:73
LPARAM lParam
Definition: combotst.c:139

Referenced by CMoveToMenu::DoMoveToFolder().

◆ 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 }
#define IDC_BROWSE_FOR_FOLDER_FOLDER_TEXT
Definition: shresdef.h:387
BOOL WINAPI PathIsDirectoryW(LPCWSTR lpszPath)
Definition: path.c:1702
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
UINT WINAPI GetDlgItemTextW(HWND hDlg, int nIDDlgItem, LPWSTR lpString, int nMaxCount)
Definition: dialog.c:2271
BOOL m_bIgnoreTextBoxChange
#define PathIsRelative
Definition: shlwapi.h:951
WPARAM wParam
Definition: combotst.c:138
#define FALSE
Definition: types.h:117
unsigned int BOOL
Definition: ntddk_ex.h:94
#define GWLP_USERDATA
Definition: treelist.c:63
__wchar_t WCHAR
Definition: xmlstorage.h:180
#define _countof(array)
Definition: sndvol32.h:68
#define MAX_PATH
Definition: compat.h:34
static const WCHAR L[]
Definition: oid.c:1250
#define WM_COMMAND
Definition: winuser.h:1722
#define BFFM_ENABLEOK
Definition: shlobj.h:1171
WNDPROC m_fnOldWndProc
LPCWSTR szPath
Definition: env.c:35
LRESULT WINAPI SendMessageW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
BOOL WINAPI StrTrimW(LPWSTR lpszStr, LPCWSTR lpszTrim)
Definition: string.c:1869
LRESULT WINAPI CallWindowProcW(_In_ WNDPROC, _In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
#define HIWORD(l)
Definition: typedefs.h:247
#define GetWindowLongPtr
Definition: treelist.c:73
LPARAM lParam
Definition: combotst.c:139
#define LOWORD(l)
Definition: pedump.c:82
#define EN_CHANGE
Definition: winuser.h:2004

Referenced by BrowseCallbackProc().

◆ WINE_DEFAULT_DEBUG_CHANNEL()

WINE_DEFAULT_DEBUG_CHANNEL ( shell  )