ReactOS 0.4.16-dev-122-g325d74c
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() GetPropertyBag (long flags, REFIID riid, void **ppv) override
 
void SetTopBrowser () const
 
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)
 
LRESULT OnSaveState (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 127 of file CDesktopBrowser.cpp.

127 :
128 m_hAccel(NULL),
132{
134}
void SetTopBrowser() const
#define NULL
Definition: types.h:112
DWORD WINAPI GetLogicalDrives(void)
Definition: disk.c:110

◆ ~CDesktopBrowser()

CDesktopBrowser::~CDesktopBrowser ( )

Definition at line 136 of file CDesktopBrowser.cpp.

137{
139 {
140 m_ShellView->DestroyViewWindow();
141 }
142
144 {
146 }
147}
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 372 of file CDesktopBrowser.cpp.

373{
374 HWND hWndTray;
375 HRESULT hRet;
376
377 hRet = m_Tray->GetTrayWindow(&hWndTray);
378 if (SUCCEEDED(hRet))
379 ::PostMessageW(hWndTray, uMsg, wParam, lParam);
380
381 return 0;
382}
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 169 of file CDesktopBrowser.cpp.

170{
171 RECT rcNewSize;
172
173#ifdef MULTIMONITOR_SUPPORT
174
176 if (cMonitors == 1)
177 {
178 SystemParametersInfoW(SPI_GETWORKAREA, 0, &rcNewSize, 0);
179 }
180 else
181 {
182 SetRect(&rcNewSize,
187 }
188
189 ::MoveWindow(m_hWnd, rcNewSize.left, rcNewSize.top, rcNewSize.right - rcNewSize.left, rcNewSize.bottom - rcNewSize.top, TRUE);
190 ::MoveWindow(m_hWndShellView, 0, 0, rcNewSize.right - rcNewSize.left, rcNewSize.bottom - rcNewSize.top, TRUE);
191
192 if (cMonitors != 1)
193 {
194 CAtlList<RECT> list;
196 RECT* prcWorkAreas = new RECT[list.GetCount()];
197 int i = 0;
198 for (POSITION it = list.GetHeadPosition(); it; list.GetNext(it))
199 prcWorkAreas[i++] = list.GetAt(it);
200
202
204 }
205
206#else
207 SystemParametersInfoW(SPI_GETWORKAREA, 0, &rcNewSize, 0);
208 ::MoveWindow(m_hWnd, rcNewSize.left, rcNewSize.top, rcNewSize.right - rcNewSize.left, rcNewSize.bottom - rcNewSize.top, TRUE);
209 ::MoveWindow(m_hWndShellView, 0, 0, rcNewSize.right - rcNewSize.left, rcNewSize.bottom - rcNewSize.top, TRUE);
210
211#endif
212 return S_OK;
213}
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:2787
#define WC_LISTVIEW
Definition: commctrl.h:2264
#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:1042
BOOL WINAPI EnumDisplayMonitors(_In_opt_ HDC, _In_opt_ LPCRECT, _In_ MONITORENUMPROC, _In_ LPARAM)
#define SM_CXVIRTUALSCREEN
Definition: winuser.h:1041
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:1039
#define SM_CMONITORS
Definition: winuser.h:1043
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:1040
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 309 of file CDesktopBrowser.cpp.

310{
311 /*
312 * We should use IShellWindows interface here in order to attempt to
313 * find an open shell window that shows the requested pidl and activate it
314 */
315
316 DWORD dwFlags = ((wFlags & SBSP_EXPLOREMODE) != 0) ? SH_EXPLORER_CMDLINE_FLAG_E : 0;
317 return SHOpenNewFrame(ILClone(pidl), NULL, 0, dwFlags);
318}
#define SH_EXPLORER_CMDLINE_FLAG_E
HRESULT WINAPI SHOpenNewFrame(LPITEMIDLIST pidl, IUnknown *paramC, long param10, DWORD dwFlags)
Definition: desktopipc.cpp:591
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 272 of file CDesktopBrowser.cpp.

273{
274 return E_NOTIMPL;
275}
#define E_NOTIMPL
Definition: ddrawi.h:99

◆ EnableModelessSB()

HRESULT STDMETHODCALLTYPE CDesktopBrowser::EnableModelessSB ( BOOL  fEnable)
override

Implements IShellBrowser.

Definition at line 297 of file CDesktopBrowser.cpp.

298{
299 return E_NOTIMPL;
300}

◆ GetControlWindow()

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

Implements IShellBrowser.

Definition at line 325 of file CDesktopBrowser.cpp.

326{
327 if (lphwnd == NULL)
328 return E_POINTER;
329 return E_NOTIMPL;
330}
#define E_POINTER
Definition: winerror.h:2365

◆ GetPropertyBag()

HRESULT STDMETHODCALLTYPE CDesktopBrowser::GetPropertyBag ( long  flags,
REFIID  riid,
void **  ppv 
)
override

Definition at line 360 of file CDesktopBrowser.cpp.

361{
362 ITEMIDLIST deskpidl = {};
363 return SHGetViewStatePropertyBag(&deskpidl, L"Desktop", flags | SHGVSPB_ROAM, riid, ppv);
364}
HRESULT WINAPI SHGetViewStatePropertyBag(LPCITEMIDLIST pidl, LPWSTR bag_name, DWORD flags, REFIID riid, void **ppv)
Definition: ordinal.c:5222
GLbitfield flags
Definition: glext.h:7161
REFIID riid
Definition: atlbase.h:39
REFIID LPVOID * ppv
Definition: atlbase.h:39
#define L(x)
Definition: ntvdm.h:50

◆ GetViewStateStream()

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

Implements IShellBrowser.

Definition at line 320 of file CDesktopBrowser.cpp.

321{
322 return E_NOTIMPL;
323}

◆ GetWindow()

HRESULT STDMETHODCALLTYPE CDesktopBrowser::GetWindow ( HWND lphwnd)
override

Implements IOleWindow.

Definition at line 264 of file CDesktopBrowser.cpp.

265{
266 if (lphwnd == NULL)
267 return E_POINTER;
268 *lphwnd = m_hWnd;
269 return S_OK;
270}

◆ Initialize()

HRESULT CDesktopBrowser::Initialize ( IShellDesktopTray *  ShellDeskx)

Definition at line 215 of file CDesktopBrowser.cpp.

216{
217 CComPtr<IShellFolder> psfDesktop;
218 HRESULT hRet;
219 hRet = SHGetDesktopFolder(&psfDesktop);
220 if (FAILED_UNEXPECTEDLY(hRet))
221 return hRet;
222
223 m_Tray = ShellDesk;
224
226 if (!m_hWnd)
227 return E_FAIL;
228
229 hRet = psfDesktop->CreateViewObject(m_hWnd, IID_PPV_ARG(IShellView, &m_ShellView));
230 if (FAILED_UNEXPECTEDLY(hRet))
231 return hRet;
232
233 m_Tray->RegisterDesktopWindow(m_hWnd);
234 if (FAILED_UNEXPECTEDLY(hRet))
235 return hRet;
236
237 BOOL fHideIcons = SHELL_GetSetting(SSF_HIDEICONS, fHideIcons);
239 RECT rcShellView = {0,0,0,0};
240 fs.ViewMode = FVM_ICON;
242 FWF_AUTOARRANGE | (fHideIcons ? FWF_NOICONS : 0);
243 hRet = m_ShellView->CreateViewWindow(NULL, &fs, (IShellBrowser *)this, &rcShellView, &m_hWndShellView);
244 if (FAILED_UNEXPECTEDLY(hRet))
245 return hRet;
246
247 _Resize();
248
250
252
253#if 1
254 /* A Windows8+ specific hack */
257#endif
259 UpdateWindow();
260
261 return hRet;
262}
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
unsigned int BOOL
Definition: ntddk_ex.h:94
#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
#define SHELL_GetSetting(pss, ssf, field)
Definition: shellutils.h:828
#define SSF_HIDEICONS
Definition: shlobj.h:1617
@ FWF_AUTOARRANGE
Definition: shobjidl.idl:642
@ FWF_NOSCROLL
Definition: shobjidl.idl:652
@ FWF_NOCLIENTEDGE
Definition: shobjidl.idl:651
@ FWF_NOICONS
Definition: shobjidl.idl:654
@ FWF_TRANSPARENT
Definition: shobjidl.idl:650
@ FWF_DESKTOP
Definition: shobjidl.idl:647
@ FVM_ICON
Definition: shobjidl.idl:679
#define IDA_DESKBROWSER
Definition: shresdef.h:27
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:778
#define MAKEINTRESOURCEW(i)
Definition: winuser.h:582
#define IID_PPV_ARG(Itype, ppType)

◆ InsertMenusSB()

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

Implements IShellBrowser.

Definition at line 277 of file CDesktopBrowser.cpp.

278{
279 return E_NOTIMPL;
280}

◆ OnClose()

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

Definition at line 449 of file CDesktopBrowser.cpp.

450{
451 return _NotifyTray(TWM_DOEXITWINDOWS, 0, 0);
452}
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 384 of file CDesktopBrowser.cpp.

385{
386 switch (LOWORD(wParam))
387 {
389 return _NotifyTray(TWM_DOEXITWINDOWS, 0, 0);
392 return _NotifyTray(TWM_CYCLEFOCUS, 1, 0xFFFFFFFF);
393 else
394 return _NotifyTray(TWM_CYCLEFOCUS, 1, 1);
397 break;
399 if (m_ShellView)
400 m_ShellView->Refresh();
401 break;
402 }
403
404 return 0;
405}
#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:2462
#define FCIDM_DESKBROWSER_FOCUS
Definition: shresdef.h:820
#define FCIDM_DESKBROWSER_SEARCH
Definition: shresdef.h:821
#define FCIDM_DESKBROWSER_CLOSE
Definition: shresdef.h:819
#define TWM_CYCLEFOCUS
Definition: undocshell.h:55
#define VK_SHIFT
Definition: winuser.h:2205
SHORT WINAPI GetKeyState(_In_ int)

◆ OnDeviceChange()

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

Definition at line 488 of file CDesktopBrowser.cpp.

489{
491 return 0;
492
493 DWORD dwDrives = ::GetLogicalDrives();
494 for (INT iDrive = 0; iDrive <= 'Z' - 'A'; ++iDrive)
495 {
497 DWORD dwBit = (1 << iDrive);
498 if (!(m_dwDrives & dwBit) && (dwDrives & dwBit)) // The drive is added
499 {
500 PathBuildRootW(szPath, iDrive);
502 }
503 else if ((m_dwDrives & dwBit) && !(dwDrives & dwBit)) // The drive is removed
504 {
505 PathBuildRootW(szPath, iDrive);
507 }
508 }
509
510 m_dwDrives = dwDrives;
511 return 0;
512}
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:1897
#define SHCNE_DRIVEADD
Definition: shlobj.h:1898
#define SHCNF_PATHW
Definition: shlobj.h:1925
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 408 of file CDesktopBrowser.cpp.

409{
410 return (LRESULT)PaintDesktop((HDC)wParam);
411}
static HDC
Definition: imagelist.c:88
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 471 of file CDesktopBrowser.cpp.

472{
475 {
478 return NULL;
479
482 return NULL;
483 }
485}
HRESULT CChangeNotifyServer_CreateInstance(REFIID riid, void **ppv)
CComPtr< IOleWindow > m_ChangeNotifyServer
HRESULT hres
Definition: protocol.c:465
#define BOOL
Definition: nt_native.h:43
_In_ int _In_ BOOL bCreate
Definition: shlobj.h:1520
BOOL WINAPI IsWindow(_In_opt_ HWND)

◆ OnOpenNewWindow()

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

Definition at line 454 of file CDesktopBrowser.cpp.

455{
456 TRACE("Proxy Desktop message 1035 received.\n");
458 return 0;
459}
BOOL WINAPI SHOnCWMCommandLine(HANDLE hSharedInfo)
Definition: desktopipc.cpp:537
#define TRACE(s)
Definition: solgame.cpp:4

◆ OnSaveState()

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

Definition at line 534 of file CDesktopBrowser.cpp.

535{
537 m_ShellView->SaveViewState();
538 return 0;
539}
@ REST_NOSAVESET
Definition: shlobj.h:1645
DWORD WINAPI SHRestricted(RESTRICTIONS rest)
Definition: shpolicy.c:150

◆ OnSetFocus()

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

Definition at line 461 of file CDesktopBrowser.cpp.

462{
464 return 0;
465}
HWND WINAPI SetFocus(_In_opt_ HWND)

◆ OnSettingChange()

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

Definition at line 426 of file CDesktopBrowser.cpp.

427{
428 if (uMsg == WM_SETTINGCHANGE /* == WM_WININICHANGE */ &&
429 lstrcmpiW((LPCWSTR)lParam, L"Environment") == 0)
430 {
431 LPVOID lpEnvironment;
432 RegenerateUserEnvironment(&lpEnvironment, TRUE);
433 }
434
435 if (m_hWndShellView)
436 {
437 /* Forward the message */
439 }
440
441 if (uMsg == WM_SETTINGCHANGE && wParam == SPI_SETWORKAREA && m_hWndShellView != NULL)
442 {
443 _Resize();
444 }
445
446 return 0;
447}
int WINAPI lstrcmpiW(LPCWSTR str1, LPCWSTR str2)
Definition: locale.c:4261
EXTERN_C BOOL WINAPI RegenerateUserEnvironment(LPVOID *lpEnvironment, BOOL bUpdateSelf)
Definition: shell32.cpp:71
#define WM_SETTINGCHANGE
Definition: winuser.h:1632
const WCHAR * LPCWSTR
Definition: xmlstorage.h:185

◆ OnShowOptionsDlg()

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

Definition at line 516 of file CDesktopBrowser.cpp.

517{
518 switch (wParam)
519 {
520 case 0:
521#if (NTDDI_VERSION >= NTDDI_VISTA)
522 case 2:
523 case 7:
524#endif
526 break;
527 case 1:
529 break;
530 }
531 return 0;
532}
VOID WINAPI ShowFolderOptionsDialog(UINT Page, BOOL Async)
Definition: misc.cpp:265
unsigned __int3264 UINT_PTR
Definition: mstsclib_h.h:274
#define TRAYCMD_TASKBAR_PROPERTIES
Definition: undocshell.h:869
#define WM_COMMAND
Definition: winuser.h:1743

◆ OnSize()

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

Definition at line 413 of file CDesktopBrowser.cpp.

414{
415 if (wParam == SIZE_MINIMIZED)
416 {
417 /* Hey, we're the desktop!!! */
418 ::ShowWindow(m_hWnd, SW_RESTORE);
419 }
420
422
423 return 0;
424}
#define SIZE_MINIMIZED
Definition: winuser.h:2509
#define SW_RESTORE
Definition: winuser.h:782
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 350 of file CDesktopBrowser.cpp.

351{
352 return E_NOTIMPL;
353}

◆ QueryActiveShellView()

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

Implements IShellBrowser.

Definition at line 339 of file CDesktopBrowser.cpp.

340{
341 if (ppshv == NULL)
342 return E_POINTER;
343 *ppshv = m_ShellView;
344 if (*ppshv != NULL)
345 (*ppshv)->AddRef();
346
347 return S_OK;
348}

◆ QueryService()

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

Implements IServiceProvider.

Definition at line 366 of file CDesktopBrowser.cpp.

367{
368 /* FIXME - handle guidService (SID_STopLevelBrowser for IShellBrowserService etc) */
369 return QueryInterface(riid, ppv);
370}
HRESULT QueryInterface([in] REFIID riid, [out, iid_is(riid)] void **ppvObject)

◆ RemoveMenusSB()

HRESULT STDMETHODCALLTYPE CDesktopBrowser::RemoveMenusSB ( HMENU  hmenuShared)
override

Implements IShellBrowser.

Definition at line 287 of file CDesktopBrowser.cpp.

288{
289 return E_NOTIMPL;
290}

◆ SendControlMsg()

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

Implements IShellBrowser.

Definition at line 332 of file CDesktopBrowser.cpp.

333{
334 if (pret == NULL)
335 return E_POINTER;
336 return E_NOTIMPL;
337}

◆ SetMenuSB()

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

Implements IShellBrowser.

Definition at line 282 of file CDesktopBrowser.cpp.

283{
284 return E_NOTIMPL;
285}

◆ SetStatusTextSB()

HRESULT STDMETHODCALLTYPE CDesktopBrowser::SetStatusTextSB ( LPCOLESTR  pszStatusText)
override

Implements IShellBrowser.

Definition at line 292 of file CDesktopBrowser.cpp.

293{
294 return E_NOTIMPL;
295}

◆ SetToolbarItems()

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

Definition at line 355 of file CDesktopBrowser.cpp.

356{
357 return E_NOTIMPL;
358}

◆ SetTopBrowser()

void CDesktopBrowser::SetTopBrowser ( ) const
inline

Definition at line 84 of file CDesktopBrowser.cpp.

84{}

Referenced by CDesktopBrowser().

◆ TranslateAcceleratorSB()

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

Implements IShellBrowser.

Definition at line 302 of file CDesktopBrowser.cpp.

303{
304 if (!::TranslateAcceleratorW(m_hWnd, m_hAccel, lpmsg))
305 return S_FALSE;
306 return S_OK;
307}
#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 49 of file CDesktopBrowser.cpp.

Referenced by OnGetChangeNotifyServer().

◆ m_dwDrives

DWORD CDesktopBrowser::m_dwDrives
private

Definition at line 51 of file CDesktopBrowser.cpp.

Referenced by OnDeviceChange().

◆ m_hAccel

HACCEL CDesktopBrowser::m_hAccel
private

Definition at line 44 of file CDesktopBrowser.cpp.

Referenced by Initialize(), and TranslateAcceleratorSB().

◆ m_hwndChangeNotifyServer

HWND CDesktopBrowser::m_hwndChangeNotifyServer
private

Definition at line 50 of file CDesktopBrowser.cpp.

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

◆ m_hWndShellView

HWND CDesktopBrowser::m_hWndShellView
private

◆ m_ShellView

CComPtr<IShellView> CDesktopBrowser::m_ShellView
private

◆ m_Tray

CComPtr<IShellDesktopTray> CDesktopBrowser::m_Tray
private

Definition at line 46 of file CDesktopBrowser.cpp.

Referenced by _NotifyTray(), and Initialize().


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