ReactOS 0.4.15-dev-8145-ga541a46
CDesktopBrowser Class Reference
Inheritance diagram for CDesktopBrowser:
Collaboration diagram for CDesktopBrowser:

Public Member Functions

 CDesktopBrowser ()
 
 ~CDesktopBrowser ()
 
HRESULT Initialize (IShellDesktopTray *ShellDeskx)
 
STDMETHOD() GetWindow (HWND *lphwnd) override
 
STDMETHOD() ContextSensitiveHelp (BOOL fEnterMode) override
 
STDMETHOD() InsertMenusSB (HMENU hmenuShared, LPOLEMENUGROUPWIDTHS lpMenuWidths) override
 
STDMETHOD() SetMenuSB (HMENU hmenuShared, HOLEMENU holemenuRes, HWND hwndActiveObject) override
 
STDMETHOD() RemoveMenusSB (HMENU hmenuShared) override
 
STDMETHOD() SetStatusTextSB (LPCOLESTR pszStatusText) override
 
STDMETHOD() EnableModelessSB (BOOL fEnable) override
 
STDMETHOD() TranslateAcceleratorSB (MSG *pmsg, WORD wID) override
 
STDMETHOD() BrowseObject (LPCITEMIDLIST pidl, UINT wFlags) override
 
STDMETHOD() GetViewStateStream (DWORD grfMode, IStream **ppStrm) override
 
STDMETHOD() GetControlWindow (UINT id, HWND *lphwnd) override
 
STDMETHOD() SendControlMsg (UINT id, UINT uMsg, WPARAM wParam, LPARAM lParam, LRESULT *pret) override
 
STDMETHOD() QueryActiveShellView (struct IShellView **ppshv) override
 
STDMETHOD() OnViewWindowActive (struct IShellView *ppshv) override
 
STDMETHOD() SetToolbarItems (LPTBBUTTON lpButtons, UINT nButtons, UINT uFlags) override
 
STDMETHOD() QueryService (REFGUID guidService, REFIID riid, void **ppvObject) override
 
LRESULT OnEraseBkgnd (UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
 
LRESULT OnSize (UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
 
LRESULT OnSettingChange (UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
 
LRESULT OnClose (UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
 
LRESULT OnOpenNewWindow (UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
 
LRESULT OnCommand (UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
 
LRESULT OnSetFocus (UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
 
LRESULT OnGetChangeNotifyServer (UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
 
LRESULT OnDeviceChange (UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
 
LRESULT OnShowOptionsDlg (UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
 
- Public Member Functions inherited from ATL::CComObjectRootEx< CComMultiThreadModelNoCS >
 ~CComObjectRootEx ()
 
ULONG InternalAddRef ()
 
ULONG InternalRelease ()
 
void Lock ()
 
void Unlock ()
 
HRESULT _AtlInitialConstruct ()
 
- Public Member Functions inherited from ATL::CComObjectRootBase
 CComObjectRootBase ()
 
 ~CComObjectRootBase ()
 
void SetVoid (void *)
 
HRESULT _AtlFinalConstruct ()
 
HRESULT FinalConstruct ()
 
void InternalFinalConstructAddRef ()
 
void InternalFinalConstructRelease ()
 
void FinalRelease ()
 
- Public Member Functions inherited from IShellBrowser
HRESULT InsertMenusSB ([in] HMENU hmenuShared, [in, out] LPOLEMENUGROUPWIDTHS lpMenuWidths)
 
HRESULT SetMenuSB ([in] HMENU hmenuShared, [in] HOLEMENU holemenuReserved, [in] HWND hwndActiveObject)
 
HRESULT RemoveMenusSB ([in] HMENU hmenuShared)
 
HRESULT SetStatusTextSB ([in, unique] LPCOLESTR pszStatusText)
 
HRESULT EnableModelessSB ([in] BOOL fEnable)
 
HRESULT TranslateAcceleratorSB ([in] MSG *pmsg, [in] WORD wID)
 
HRESULT BrowseObject ([in] PCUIDLIST_RELATIVE pidl, [in] UINT wFlags)
 
HRESULT GetViewStateStream ([in] DWORD grfMode, [out] IStream **ppStrm)
 
HRESULT GetControlWindow ([in] UINT id, [out] HWND *phwnd)
 
HRESULT SendControlMsg ([in] UINT id, [in] UINT uMsg, [in] WPARAM wParam, [in] LPARAM lParam, [in] LRESULT *pret)
 
HRESULT QueryActiveShellView ([out] IShellView **ppshv)
 
HRESULT OnViewWindowActive ([in] IShellView *pshv)
 
HRESULT SetToolbarItems ([in] LPTBBUTTONSB lpButtons, [in] UINT nButtons, [in] UINT uFlags)
 
HRESULT GetWindow ([out] HWND *phwnd)
 
HRESULT ContextSensitiveHelp ([in] BOOL fEnterMode)
 
- Public Member Functions inherited from IUnknown
HRESULT QueryInterface ([in] REFIID riid, [out, iid_is(riid)] void **ppvObject)
 
ULONG AddRef ()
 
ULONG Release ()
 
- Public Member Functions inherited from IServiceProvider
HRESULT QueryService ([in] REFGUID guidService, [in] REFIID riid, [out] void **ppvObject)
 
HRESULT RemoteQueryService ([in] REFGUID guidService, [in] REFIID riid, [out, iid_is(riid)] IUnknown **ppvObject)
 

Private Member Functions

LRESULT _NotifyTray (UINT uMsg, WPARAM wParam, LPARAM lParam)
 
HRESULT _Resize ()
 

Private Attributes

HACCEL m_hAccel
 
HWND m_hWndShellView
 
CComPtr< IShellDesktopTray > m_Tray
 
CComPtr< IShellViewm_ShellView
 
CComPtr< IOleWindowm_ChangeNotifyServer
 
HWND m_hwndChangeNotifyServer
 
DWORD m_dwDrives
 

Additional Inherited Members

- Public Types inherited from IShellBrowser
typedef IShellBrowserLPSHELLBROWSER
 
typedef LPARAM LPTBBUTTONSB
 
typedef LPTBBUTTON LPTBBUTTONSB
 
- Public Types inherited from IOleWindow
typedef IOleWindowLPOLEWINDOW
 
- Public Types inherited from IUnknown
typedef IUnknownLPUNKNOWN
 
- Public Types inherited from IServiceProvider
typedef IServiceProviderLPSERVICEPROVIDER
 
- Static Public Member Functions inherited from ATL::CComObjectRootBase
static void WINAPI ObjectMain (bool)
 
static const struct _ATL_CATMAP_ENTRYGetCategoryMap ()
 
static HRESULT WINAPI InternalQueryInterface (void *pThis, const _ATL_INTMAP_ENTRY *pEntries, REFIID iid, void **ppvObject)
 
- Public Attributes inherited from ATL::CComObjectRootBase
LONG m_dwRef
 

Detailed Description

Definition at line 36 of file CDesktopBrowser.cpp.

Constructor & Destructor Documentation

◆ CDesktopBrowser()

CDesktopBrowser::CDesktopBrowser ( )

Definition at line 117 of file CDesktopBrowser.cpp.

117 :
118 m_hAccel(NULL),
122{
123}
#define NULL
Definition: types.h:112
DWORD WINAPI GetLogicalDrives(void)
Definition: disk.c:110

◆ ~CDesktopBrowser()

CDesktopBrowser::~CDesktopBrowser ( )

Definition at line 125 of file CDesktopBrowser.cpp.

126{
128 {
129 m_ShellView->DestroyViewWindow();
130 }
131
133 {
135 }
136}
CComPtr< IShellView > m_ShellView
BOOL WINAPI DestroyWindow(_In_ HWND)

Member Function Documentation

◆ _NotifyTray()

LRESULT CDesktopBrowser::_NotifyTray ( UINT  uMsg,
WPARAM  wParam,
LPARAM  lParam 
)
private

Definition at line 354 of file CDesktopBrowser.cpp.

355{
356 HWND hWndTray;
357 HRESULT hRet;
358
359 hRet = m_Tray->GetTrayWindow(&hWndTray);
360 if (SUCCEEDED(hRet))
361 ::PostMessageW(hWndTray, uMsg, wParam, lParam);
362
363 return 0;
364}
CComPtr< IShellDesktopTray > m_Tray
WPARAM wParam
Definition: combotst.c:138
LPARAM lParam
Definition: combotst.c:139
#define SUCCEEDED(hr)
Definition: intsafe.h:50
BOOL WINAPI PostMessageW(_In_opt_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)

Referenced by OnClose(), OnCommand(), and OnShowOptionsDlg().

◆ _Resize()

HRESULT CDesktopBrowser::_Resize ( )
private

Definition at line 158 of file CDesktopBrowser.cpp.

159{
160 RECT rcNewSize;
161
162#ifdef MULTIMONITOR_SUPPORT
163
165 if (cMonitors == 1)
166 {
167 SystemParametersInfoW(SPI_GETWORKAREA, 0, &rcNewSize, 0);
168 }
169 else
170 {
171 SetRect(&rcNewSize,
176 }
177
178 ::MoveWindow(m_hWnd, rcNewSize.left, rcNewSize.top, rcNewSize.right - rcNewSize.left, rcNewSize.bottom - rcNewSize.top, TRUE);
179 ::MoveWindow(m_hWndShellView, 0, 0, rcNewSize.right - rcNewSize.left, rcNewSize.bottom - rcNewSize.top, TRUE);
180
181 if (cMonitors != 1)
182 {
183 CAtlList<RECT> list;
185 RECT* prcWorkAreas = new RECT[list.GetCount()];
186 int i = 0;
187 for (POSITION it = list.GetHeadPosition(); it; list.GetNext(it))
188 prcWorkAreas[i++] = list.GetAt(it);
189
191
193 }
194
195#else
196 SystemParametersInfoW(SPI_GETWORKAREA, 0, &rcNewSize, 0);
197 ::MoveWindow(m_hWnd, rcNewSize.left, rcNewSize.top, rcNewSize.right - rcNewSize.left, rcNewSize.bottom - rcNewSize.top, TRUE);
198 ::MoveWindow(m_hWndShellView, 0, 0, rcNewSize.right - rcNewSize.left, rcNewSize.bottom - rcNewSize.top, TRUE);
199
200#endif
201 return S_OK;
202}
Definition: list.h:37
#define TRUE
Definition: types.h:120
HWND hwndListView
Definition: eventvwr.c:66
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
#define S_OK
Definition: intsafe.h:52
unsigned int UINT
Definition: ndis.h:50
#define LVM_SETWORKAREAS
Definition: commctrl.h:2782
#define WC_LISTVIEW
Definition: commctrl.h:2259
#define list
Definition: rosglue.h:35
BOOL CALLBACK MonitorEnumProc(HMONITOR hMonitor, HDC hdcMonitor, RECT *rcMonitor, LPARAM Param)
Definition: screensave.c:33
LONG right
Definition: windef.h:308
LONG bottom
Definition: windef.h:309
LONG top
Definition: windef.h:307
LONG left
Definition: windef.h:306
LONG_PTR LPARAM
Definition: windef.h:208
#define SM_CYVIRTUALSCREEN
Definition: winuser.h:1039
BOOL WINAPI EnumDisplayMonitors(_In_opt_ HDC, _In_opt_ LPCRECT, _In_ MONITORENUMPROC, _In_ LPARAM)
#define SM_CXVIRTUALSCREEN
Definition: winuser.h:1038
HWND WINAPI FindWindowExW(_In_opt_ HWND, _In_opt_ HWND, _In_opt_ LPCWSTR, _In_opt_ LPCWSTR)
BOOL WINAPI SystemParametersInfoW(_In_ UINT uiAction, _In_ UINT uiParam, _Inout_opt_ PVOID pvParam, _In_ UINT fWinIni)
#define SM_XVIRTUALSCREEN
Definition: winuser.h:1036
#define SM_CMONITORS
Definition: winuser.h:1040
int WINAPI GetSystemMetrics(_In_ int)
BOOL WINAPI MoveWindow(_In_ HWND, _In_ int, _In_ int, _In_ int, _In_ int, _In_ BOOL)
LRESULT WINAPI SendMessageW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
#define SM_YVIRTUALSCREEN
Definition: winuser.h:1037
BOOL WINAPI SetRect(_Out_ LPRECT, _In_ int, _In_ int, _In_ int, _In_ int)

Referenced by Initialize(), and OnSettingChange().

◆ BrowseObject()

HRESULT STDMETHODCALLTYPE CDesktopBrowser::BrowseObject ( LPCITEMIDLIST  pidl,
UINT  wFlags 
)
override

Definition at line 297 of file CDesktopBrowser.cpp.

298{
299 /*
300 * We should use IShellWindows interface here in order to attempt to
301 * find an open shell window that shows the requested pidl and activate it
302 */
303
304 DWORD dwFlags = ((wFlags & SBSP_EXPLOREMODE) != 0) ? SH_EXPLORER_CMDLINE_FLAG_E : 0;
305 return SHOpenNewFrame(ILClone(pidl), NULL, 0, dwFlags);
306}
#define SH_EXPLORER_CMDLINE_FLAG_E
HRESULT WINAPI SHOpenNewFrame(LPITEMIDLIST pidl, IUnknown *paramC, long param10, DWORD dwFlags)
Definition: desktopipc.cpp:578
unsigned long DWORD
Definition: ntddk_ex.h:95
LPITEMIDLIST WINAPI ILClone(LPCITEMIDLIST pidl)
Definition: pidl.c:237
_In_ DWORD _Out_ _In_ WORD wFlags
Definition: wincon.h:531
_In_ PCCERT_CONTEXT _In_ DWORD dwFlags
Definition: wincrypt.h:1176

◆ ContextSensitiveHelp()

HRESULT STDMETHODCALLTYPE CDesktopBrowser::ContextSensitiveHelp ( BOOL  fEnterMode)
override

Implements IOleWindow.

Definition at line 260 of file CDesktopBrowser.cpp.

261{
262 return E_NOTIMPL;
263}
#define E_NOTIMPL
Definition: ddrawi.h:99

◆ EnableModelessSB()

HRESULT STDMETHODCALLTYPE CDesktopBrowser::EnableModelessSB ( BOOL  fEnable)
override

Implements IShellBrowser.

Definition at line 285 of file CDesktopBrowser.cpp.

286{
287 return E_NOTIMPL;
288}

◆ GetControlWindow()

HRESULT STDMETHODCALLTYPE CDesktopBrowser::GetControlWindow ( UINT  id,
HWND lphwnd 
)
override

Implements IShellBrowser.

Definition at line 313 of file CDesktopBrowser.cpp.

314{
315 if (lphwnd == NULL)
316 return E_POINTER;
317 return E_NOTIMPL;
318}
#define E_POINTER
Definition: winerror.h:2365

◆ GetViewStateStream()

HRESULT STDMETHODCALLTYPE CDesktopBrowser::GetViewStateStream ( DWORD  grfMode,
IStream **  ppStrm 
)
override

Implements IShellBrowser.

Definition at line 308 of file CDesktopBrowser.cpp.

309{
310 return E_NOTIMPL;
311}

◆ GetWindow()

HRESULT STDMETHODCALLTYPE CDesktopBrowser::GetWindow ( HWND lphwnd)
override

Implements IOleWindow.

Definition at line 252 of file CDesktopBrowser.cpp.

253{
254 if (lphwnd == NULL)
255 return E_POINTER;
256 *lphwnd = m_hWnd;
257 return S_OK;
258}

◆ Initialize()

HRESULT CDesktopBrowser::Initialize ( IShellDesktopTray *  ShellDeskx)

Definition at line 204 of file CDesktopBrowser.cpp.

205{
206 CComPtr<IShellFolder> psfDesktop;
207 HRESULT hRet;
208 hRet = SHGetDesktopFolder(&psfDesktop);
209 if (FAILED_UNEXPECTEDLY(hRet))
210 return hRet;
211
212 m_Tray = ShellDesk;
213
215 if (!m_hWnd)
216 return E_FAIL;
217
218 CSFV csfv = {sizeof(CSFV), psfDesktop};
220 if (FAILED_UNEXPECTEDLY(hRet))
221 return hRet;
222
223 m_Tray->RegisterDesktopWindow(m_hWnd);
224 if (FAILED_UNEXPECTEDLY(hRet))
225 return hRet;
226
228 RECT rcShellView = {0,0,0,0};
229 fs.ViewMode = FVM_ICON;
231 hRet = m_ShellView->CreateViewWindow(NULL, &fs, (IShellBrowser *)this, &rcShellView, &m_hWndShellView);
232 if (FAILED_UNEXPECTEDLY(hRet))
233 return hRet;
234
235 _Resize();
236
238
240
241#if 1
242 /* A Windows8+ specific hack */
245#endif
247 UpdateWindow();
248
249 return hRet;
250}
HRESULT WINAPI SHCreateShellFolderViewEx(LPCSFV psvcbi, IShellView **ppsv)
Definition: CDefView.cpp:4336
static const WCHAR szProgmanWindowName[]
HRESULT WINAPI SHGetDesktopFolder(IShellFolder **psf)
#define shell32_hInstance
@ Create
Definition: registry.c:563
#define E_FAIL
Definition: ddrawi.h:102
#define FAILED_UNEXPECTEDLY(hr)
Definition: precomp.h:121
#define fs
Definition: i386-dis.c:444
#define WS_POPUP
Definition: pedump.c:616
#define WS_CLIPSIBLINGS
Definition: pedump.c:618
#define WS_CLIPCHILDREN
Definition: pedump.c:619
struct _CSFV CSFV
@ FWF_NOSCROLL
Definition: shobjidl.idl:651
@ FWF_NOCLIENTEDGE
Definition: shobjidl.idl:650
@ FWF_TRANSPARENT
Definition: shobjidl.idl:649
@ FWF_DESKTOP
Definition: shobjidl.idl:646
@ FVM_ICON
Definition: shobjidl.idl:678
#define IDA_DESKBROWSER
Definition: shresdef.h:27
Definition: shlobj.h:1275
Definition: ffs.h:70
BOOL WINAPI ShowWindow(_In_ HWND, _In_ int)
#define WS_EX_TOOLWINDOW
Definition: winuser.h:404
BOOL WINAPI UpdateWindow(_In_ HWND)
HACCEL WINAPI LoadAcceleratorsW(_In_opt_ HINSTANCE, _In_ LPCWSTR)
#define SW_SHOW
Definition: winuser.h:775
#define MAKEINTRESOURCEW(i)
Definition: winuser.h:582

◆ InsertMenusSB()

HRESULT STDMETHODCALLTYPE CDesktopBrowser::InsertMenusSB ( HMENU  hmenuShared,
LPOLEMENUGROUPWIDTHS  lpMenuWidths 
)
override

Implements IShellBrowser.

Definition at line 265 of file CDesktopBrowser.cpp.

266{
267 return E_NOTIMPL;
268}

◆ OnClose()

LRESULT CDesktopBrowser::OnClose ( UINT  uMsg,
WPARAM  wParam,
LPARAM  lParam,
BOOL bHandled 
)

Definition at line 431 of file CDesktopBrowser.cpp.

432{
433 return _NotifyTray(TWM_DOEXITWINDOWS, 0, 0);
434}
LRESULT _NotifyTray(UINT uMsg, WPARAM wParam, LPARAM lParam)
#define TWM_DOEXITWINDOWS
Definition: undocshell.h:54

◆ OnCommand()

LRESULT CDesktopBrowser::OnCommand ( UINT  uMsg,
WPARAM  wParam,
LPARAM  lParam,
BOOL bHandled 
)

Definition at line 366 of file CDesktopBrowser.cpp.

367{
368 switch (LOWORD(wParam))
369 {
371 return _NotifyTray(TWM_DOEXITWINDOWS, 0, 0);
374 return _NotifyTray(TWM_CYCLEFOCUS, 1, 0xFFFFFFFF);
375 else
376 return _NotifyTray(TWM_CYCLEFOCUS, 1, 1);
379 break;
381 if (m_ShellView)
382 m_ShellView->Refresh();
383 break;
384 }
385
386 return 0;
387}
#define FCIDM_DESKBROWSER_REFRESH
Definition: desktop.c:14
#define LOWORD(l)
Definition: pedump.c:82
BOOL WINAPI SHFindFiles(PCIDLIST_ABSOLUTE pidlFolder, PCIDLIST_ABSOLUTE pidlSaveFile)
Definition: shellord.c:2262
#define FCIDM_DESKBROWSER_FOCUS
Definition: shresdef.h:817
#define FCIDM_DESKBROWSER_SEARCH
Definition: shresdef.h:818
#define FCIDM_DESKBROWSER_CLOSE
Definition: shresdef.h:816
#define TWM_CYCLEFOCUS
Definition: undocshell.h:55
#define VK_SHIFT
Definition: winuser.h:2202
SHORT WINAPI GetKeyState(_In_ int)

◆ OnDeviceChange()

LRESULT CDesktopBrowser::OnDeviceChange ( UINT  uMsg,
WPARAM  wParam,
LPARAM  lParam,
BOOL bHandled 
)

Definition at line 470 of file CDesktopBrowser.cpp.

471{
473 return 0;
474
475 DWORD dwDrives = ::GetLogicalDrives();
476 for (INT iDrive = 0; iDrive <= 'Z' - 'A'; ++iDrive)
477 {
479 DWORD dwBit = (1 << iDrive);
480 if (!(m_dwDrives & dwBit) && (dwDrives & dwBit)) // The drive is added
481 {
482 PathBuildRootW(szPath, iDrive);
484 }
485 else if ((m_dwDrives & dwBit) && !(dwDrives & dwBit)) // The drive is removed
486 {
487 PathBuildRootW(szPath, iDrive);
489 }
490 }
491
492 m_dwDrives = dwDrives;
493 return 0;
494}
EXTERN_C void WINAPI SHChangeNotify(LONG wEventId, UINT uFlags, LPCVOID dwItem1, LPCVOID dwItem2)
#define DBT_DEVICEARRIVAL
Definition: dbt.h:12
#define DBT_DEVICEREMOVECOMPLETE
Definition: dbt.h:16
#define MAX_PATH
Definition: compat.h:34
LPWSTR WINAPI PathBuildRootW(LPWSTR lpszPath, int drive)
Definition: path.c:348
LPCWSTR szPath
Definition: env.c:37
#define SHCNE_DRIVEREMOVED
Definition: shlobj.h:1890
#define SHCNE_DRIVEADD
Definition: shlobj.h:1891
#define SHCNF_PATHW
Definition: shlobj.h:1918
int32_t INT
Definition: typedefs.h:58
__wchar_t WCHAR
Definition: xmlstorage.h:180

◆ OnEraseBkgnd()

LRESULT CDesktopBrowser::OnEraseBkgnd ( UINT  uMsg,
WPARAM  wParam,
LPARAM  lParam,
BOOL bHandled 
)

Definition at line 390 of file CDesktopBrowser.cpp.

391{
392 return (LRESULT)PaintDesktop((HDC)wParam);
393}
static HDC
Definition: imagelist.c:92
LONG_PTR LRESULT
Definition: windef.h:209
BOOL WINAPI PaintDesktop(_In_ HDC)

◆ OnGetChangeNotifyServer()

LRESULT CDesktopBrowser::OnGetChangeNotifyServer ( UINT  uMsg,
WPARAM  wParam,
LPARAM  lParam,
BOOL bHandled 
)

Definition at line 453 of file CDesktopBrowser.cpp.

454{
457 {
460 return NULL;
461
464 return NULL;
465 }
467}
HRESULT CChangeNotifyServer_CreateInstance(REFIID riid, void **ppv)
CComPtr< IOleWindow > m_ChangeNotifyServer
unsigned int BOOL
Definition: ntddk_ex.h:94
HRESULT hres
Definition: protocol.c:465
#define BOOL
Definition: nt_native.h:43
_In_ int _In_ BOOL bCreate
Definition: shlobj.h:1519
BOOL WINAPI IsWindow(_In_opt_ HWND)
#define IID_PPV_ARG(Itype, ppType)

◆ OnOpenNewWindow()

LRESULT CDesktopBrowser::OnOpenNewWindow ( UINT  uMsg,
WPARAM  wParam,
LPARAM  lParam,
BOOL bHandled 
)

Definition at line 436 of file CDesktopBrowser.cpp.

437{
438 TRACE("Proxy Desktop message 1035 received.\n");
440 return 0;
441}
BOOL WINAPI SHOnCWMCommandLine(HANDLE hSharedInfo)
Definition: desktopipc.cpp:524
#define TRACE(s)
Definition: solgame.cpp:4

◆ OnSetFocus()

LRESULT CDesktopBrowser::OnSetFocus ( UINT  uMsg,
WPARAM  wParam,
LPARAM  lParam,
BOOL bHandled 
)

Definition at line 443 of file CDesktopBrowser.cpp.

444{
446 return 0;
447}
HWND WINAPI SetFocus(_In_opt_ HWND)

◆ OnSettingChange()

LRESULT CDesktopBrowser::OnSettingChange ( UINT  uMsg,
WPARAM  wParam,
LPARAM  lParam,
BOOL bHandled 
)

Definition at line 408 of file CDesktopBrowser.cpp.

409{
410 if (uMsg == WM_SETTINGCHANGE /* == WM_WININICHANGE */ &&
411 lstrcmpiW((LPCWSTR)lParam, L"Environment") == 0)
412 {
413 LPVOID lpEnvironment;
414 RegenerateUserEnvironment(&lpEnvironment, TRUE);
415 }
416
417 if (m_hWndShellView)
418 {
419 /* Forward the message */
421 }
422
423 if (uMsg == WM_SETTINGCHANGE && wParam == SPI_SETWORKAREA && m_hWndShellView != NULL)
424 {
425 _Resize();
426 }
427
428 return 0;
429}
int WINAPI lstrcmpiW(LPCWSTR str1, LPCWSTR str2)
Definition: locale.c:4261
#define L(x)
Definition: ntvdm.h:50
EXTERN_C BOOL WINAPI RegenerateUserEnvironment(LPVOID *lpEnvironment, BOOL bUpdateSelf)
Definition: shell32.cpp:71
#define WM_SETTINGCHANGE
Definition: winuser.h:1629
const WCHAR * LPCWSTR
Definition: xmlstorage.h:185

◆ OnShowOptionsDlg()

LRESULT CDesktopBrowser::OnShowOptionsDlg ( UINT  uMsg,
WPARAM  wParam,
LPARAM  lParam,
BOOL bHandled 
)

Definition at line 498 of file CDesktopBrowser.cpp.

499{
500 switch (wParam)
501 {
502 case 0:
503#if (NTDDI_VERSION >= NTDDI_VISTA)
504 case 2:
505 case 7:
506#endif
508 break;
509 case 1:
511 break;
512 }
513 return 0;
514}
VOID WINAPI ShowFolderOptionsDialog(UINT Page, BOOL Async)
Definition: misc.cpp:278
unsigned __int3264 UINT_PTR
Definition: mstsclib_h.h:274
#define TRAYCMD_TASKBAR_PROPERTIES
Definition: undocshell.h:838
#define WM_COMMAND
Definition: winuser.h:1740

◆ OnSize()

LRESULT CDesktopBrowser::OnSize ( UINT  uMsg,
WPARAM  wParam,
LPARAM  lParam,
BOOL bHandled 
)

Definition at line 395 of file CDesktopBrowser.cpp.

396{
397 if (wParam == SIZE_MINIMIZED)
398 {
399 /* Hey, we're the desktop!!! */
400 ::ShowWindow(m_hWnd, SW_RESTORE);
401 }
402
404
405 return 0;
406}
#define SIZE_MINIMIZED
Definition: winuser.h:2506
#define SW_RESTORE
Definition: winuser.h:779
BOOL WINAPI InvalidateRect(_In_opt_ HWND, _In_opt_ LPCRECT, _In_ BOOL)

◆ OnViewWindowActive()

HRESULT STDMETHODCALLTYPE CDesktopBrowser::OnViewWindowActive ( struct IShellView ppshv)
override

Implements IShellBrowser.

Definition at line 338 of file CDesktopBrowser.cpp.

339{
340 return E_NOTIMPL;
341}

◆ QueryActiveShellView()

HRESULT STDMETHODCALLTYPE CDesktopBrowser::QueryActiveShellView ( struct IShellView **  ppshv)
override

Implements IShellBrowser.

Definition at line 327 of file CDesktopBrowser.cpp.

328{
329 if (ppshv == NULL)
330 return E_POINTER;
331 *ppshv = m_ShellView;
332 if (*ppshv != NULL)
333 (*ppshv)->AddRef();
334
335 return S_OK;
336}

◆ QueryService()

HRESULT STDMETHODCALLTYPE CDesktopBrowser::QueryService ( REFGUID  guidService,
REFIID  riid,
void **  ppvObject 
)
override

Implements IServiceProvider.

Definition at line 348 of file CDesktopBrowser.cpp.

349{
350 /* FIXME - handle guidService */
351 return QueryInterface(riid, ppv);
352}
REFIID riid
Definition: atlbase.h:39
REFIID LPVOID * ppv
Definition: atlbase.h:39
HRESULT QueryInterface([in] REFIID riid, [out, iid_is(riid)] void **ppvObject)

◆ RemoveMenusSB()

HRESULT STDMETHODCALLTYPE CDesktopBrowser::RemoveMenusSB ( HMENU  hmenuShared)
override

Implements IShellBrowser.

Definition at line 275 of file CDesktopBrowser.cpp.

276{
277 return E_NOTIMPL;
278}

◆ SendControlMsg()

HRESULT STDMETHODCALLTYPE CDesktopBrowser::SendControlMsg ( UINT  id,
UINT  uMsg,
WPARAM  wParam,
LPARAM  lParam,
LRESULT pret 
)
override

Implements IShellBrowser.

Definition at line 320 of file CDesktopBrowser.cpp.

321{
322 if (pret == NULL)
323 return E_POINTER;
324 return E_NOTIMPL;
325}

◆ SetMenuSB()

HRESULT STDMETHODCALLTYPE CDesktopBrowser::SetMenuSB ( HMENU  hmenuShared,
HOLEMENU  holemenuRes,
HWND  hwndActiveObject 
)
override

Implements IShellBrowser.

Definition at line 270 of file CDesktopBrowser.cpp.

271{
272 return E_NOTIMPL;
273}

◆ SetStatusTextSB()

HRESULT STDMETHODCALLTYPE CDesktopBrowser::SetStatusTextSB ( LPCOLESTR  pszStatusText)
override

Implements IShellBrowser.

Definition at line 280 of file CDesktopBrowser.cpp.

281{
282 return E_NOTIMPL;
283}

◆ SetToolbarItems()

HRESULT STDMETHODCALLTYPE CDesktopBrowser::SetToolbarItems ( LPTBBUTTON  lpButtons,
UINT  nButtons,
UINT  uFlags 
)
override

Definition at line 343 of file CDesktopBrowser.cpp.

344{
345 return E_NOTIMPL;
346}

◆ TranslateAcceleratorSB()

HRESULT STDMETHODCALLTYPE CDesktopBrowser::TranslateAcceleratorSB ( MSG pmsg,
WORD  wID 
)
override

Implements IShellBrowser.

Definition at line 290 of file CDesktopBrowser.cpp.

291{
292 if (!::TranslateAcceleratorW(m_hWnd, m_hAccel, lpmsg))
293 return S_FALSE;
294 return S_OK;
295}
#define S_FALSE
Definition: winerror.h:2357
int WINAPI TranslateAcceleratorW(_In_ HWND, _In_ HACCEL, _In_ LPMSG)

Member Data Documentation

◆ m_ChangeNotifyServer

CComPtr<IOleWindow> CDesktopBrowser::m_ChangeNotifyServer
private

Definition at line 48 of file CDesktopBrowser.cpp.

Referenced by OnGetChangeNotifyServer().

◆ m_dwDrives

DWORD CDesktopBrowser::m_dwDrives
private

Definition at line 50 of file CDesktopBrowser.cpp.

Referenced by OnDeviceChange().

◆ m_hAccel

HACCEL CDesktopBrowser::m_hAccel
private

Definition at line 43 of file CDesktopBrowser.cpp.

Referenced by Initialize(), and TranslateAcceleratorSB().

◆ m_hwndChangeNotifyServer

HWND CDesktopBrowser::m_hwndChangeNotifyServer
private

Definition at line 49 of file CDesktopBrowser.cpp.

Referenced by OnGetChangeNotifyServer(), and ~CDesktopBrowser().

◆ m_hWndShellView

HWND CDesktopBrowser::m_hWndShellView
private

◆ m_ShellView

CComPtr<IShellView> CDesktopBrowser::m_ShellView
private

Definition at line 46 of file CDesktopBrowser.cpp.

Referenced by Initialize(), OnCommand(), QueryActiveShellView(), and ~CDesktopBrowser().

◆ m_Tray

CComPtr<IShellDesktopTray> CDesktopBrowser::m_Tray
private

Definition at line 45 of file CDesktopBrowser.cpp.

Referenced by _NotifyTray(), and Initialize().


The documentation for this class was generated from the following file: