ReactOS 0.4.16-dev-329-g9223134
DesktopWindow Struct Reference

Implementation of the Explorer desktop window. More...

#include <desktop.h>

Inheritance diagram for DesktopWindow:
Collaboration diagram for DesktopWindow:

Public Types

typedef PreTranslateWindow super
 
- Public Types inherited from PreTranslateWindow
typedef Window super
 
- Public Types inherited from Window
typedef map< HWND, Window * > WindowMap
 
typedef Window *(* CREATORFUNC) (HWND)
 
typedef Window *(* CREATORFUNC_INFO) (HWND, const void *)
 
- 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 ICommDlgBrowser
typedef ICommDlgBrowserLPCOMMDLGBROWSER
 
- Public Types inherited from IServiceProvider
typedef IServiceProviderLPSERVICEPROVIDER
 
- Public Types inherited from IOleCommandTarget
enum  OLECMDF {
  OLECMDF_SUPPORTED = 0x1 , OLECMDF_ENABLED = 0x2 , OLECMDF_LATCHED = 0x4 , OLECMDF_NINCHED = 0x8 ,
  OLECMDF_INVISIBLE = 0x10 , OLECMDF_DEFHIDEONCTXTMENU = 0x20
}
 
enum  OLECMDTEXTF { OLECMDTEXTF_NONE = 0 , OLECMDTEXTF_NAME = 1 , OLECMDTEXTF_STATUS = 2 }
 
enum  OLECMDEXECOPT { OLECMDEXECOPT_DODEFAULT = 0 , OLECMDEXECOPT_PROMPTUSER = 1 , OLECMDEXECOPT_DONTPROMPTUSER = 2 , OLECMDEXECOPT_SHOWHELP = 3 }
 
enum  OLECMDID {
  OLECMDID_OPEN = 1 , OLECMDID_NEW = 2 , OLECMDID_SAVE = 3 , OLECMDID_SAVEAS = 4 ,
  OLECMDID_SAVECOPYAS = 5 , OLECMDID_PRINT = 6 , OLECMDID_PRINTPREVIEW = 7 , OLECMDID_PAGESETUP = 8 ,
  OLECMDID_SPELL = 9 , OLECMDID_PROPERTIES = 10 , OLECMDID_CUT = 11 , OLECMDID_COPY = 12 ,
  OLECMDID_PASTE = 13 , OLECMDID_PASTESPECIAL = 14 , OLECMDID_UNDO = 15 , OLECMDID_REDO = 16 ,
  OLECMDID_SELECTALL = 17 , OLECMDID_CLEARSELECTION = 18 , OLECMDID_ZOOM = 19 , OLECMDID_GETZOOMRANGE = 20 ,
  OLECMDID_UPDATECOMMANDS = 21 , OLECMDID_REFRESH = 22 , OLECMDID_STOP = 23 , OLECMDID_HIDETOOLBARS = 24 ,
  OLECMDID_SETPROGRESSMAX = 25 , OLECMDID_SETPROGRESSPOS = 26 , OLECMDID_SETPROGRESSTEXT = 27 , OLECMDID_SETTITLE = 28 ,
  OLECMDID_SETDOWNLOADSTATE = 29 , OLECMDID_STOPDOWNLOAD = 30 , OLECMDID_ONTOOLBARACTIVATED = 31 , OLECMDID_FIND = 32 ,
  OLECMDID_DELETE = 33 , OLECMDID_HTTPEQUIV = 34 , OLECMDID_HTTPEQUIV_DONE = 35 , OLECMDID_ENABLE_INTERACTION = 36 ,
  OLECMDID_ONUNLOAD = 37 , OLECMDID_PROPERTYBAG2 = 38 , OLECMDID_PREREFRESH = 39 , OLECMDID_SHOWSCRIPTERROR = 40 ,
  OLECMDID_SHOWMESSAGE = 41 , OLECMDID_SHOWFIND = 42 , OLECMDID_SHOWPAGESETUP = 43 , OLECMDID_SHOWPRINT = 44 ,
  OLECMDID_CLOSE = 45 , OLECMDID_ALLOWUILESSSAVEAS = 46 , OLECMDID_DONTDOWNLOADCSS = 47 , OLECMDID_UPDATEPAGESTATUS = 48 ,
  OLECMDID_PRINT2 = 49 , OLECMDID_PRINTPREVIEW2 = 50 , OLECMDID_SETPRINTTEMPLATE = 51 , OLECMDID_GETPRINTTEMPLATE = 52 ,
  OLECMDID_PAGEACTIONBLOCKED = 55 , OLECMDID_PAGEACTIONUIQUERY = 56 , OLECMDID_FOCUSVIEWCONTROLS = 57 , OLECMDID_FOCUSVIEWCONTROLSQUERY = 58 ,
  OLECMDID_SHOWPAGEACTIONMENU = 59 , OLECMDID_ADDTRAVELENTRY = 60 , OLECMDID_UPDATETRAVELENTRY = 61 , OLECMDID_UPDATEBACKFORWARDSTATE = 62 ,
  OLECMDID_OPTICAL_ZOOM = 63 , OLECMDID_OPTICAL_GETZOOMRANGE = 64 , OLECMDID_WINDOWSTATECHANGED = 65 , OLECMDID_ACTIVEXINSTALLSCOPE = 66 ,
  OLECMDID_UPDATETRAVELENTRY_DATARECOVERY = 67 , OLECMDID_SHOWTASKDLG = 68 , OLECMDID_POPSTATEEVENT = 69 , OLECMDID_VIEWPORT_MODE = 70 ,
  OLECMDID_LAYOUT_VIEWPORT_WIDTH = 71 , OLECMDID_VISUAL_VIEWPORT_EXCLUDE_BOTTOM = 72 , OLECMDID_USER_OPTICAL_ZOOM = 73 , OLECMDID_PAGEAVAILABLE = 74 ,
  OLECMDID_GETUSERSCALABLE = 75 , OLECMDID_UPDATE_CARET = 76 , OLECMDID_ENABLE_VISIBILITY = 77 , OLECMDID_MEDIA_PLAYBACK = 78
}
 
typedef IOleCommandTargetLPOLECOMMANDTARGET
 
typedef enum IOleCommandTarget::OLECMDF OLECMDF
 
typedef struct IOleCommandTarget::_tagOLECMD OLECMD
 
typedef struct IOleCommandTarget::_tagOLECMDTEXT OLECMDTEXT
 
typedef enum IOleCommandTarget::OLECMDTEXTF OLECMDTEXTF
 
typedef enum IOleCommandTarget::OLECMDEXECOPT OLECMDEXECOPT
 
typedef enum IOleCommandTarget::OLECMDID OLECMDID
 

Public Member Functions

 DesktopWindow (HWND hwnd)
 
 ~DesktopWindow ()
 
virtual HRESULT STDMETHODCALLTYPE GetWindow (HWND *lphwnd)
 
virtual HRESULT STDMETHODCALLTYPE QueryActiveShellView (IShellView **ppshv)
 
virtual HRESULT STDMETHODCALLTYPE GetControlWindow (UINT id, HWND *lphwnd)
 
virtual HRESULT STDMETHODCALLTYPE SendControlMsg (UINT id, UINT uMsg, WPARAM wParam, LPARAM lParam, LRESULT *pret)
 
- Public Member Functions inherited from PreTranslateWindow
 PreTranslateWindow (HWND)
 
 ~PreTranslateWindow ()
 
- Public Member Functions inherited from Window
 Window (HWND hwnd)
 
virtual ~Window ()
 
LRESULT SendParent (UINT nmsg, WPARAM wparam=0, LPARAM lparam=0)
 
LRESULT PostParent (UINT nmsg, WPARAM wparam=0, LPARAM lparam=0)
 
 Window (INT cx, INT cy, BOOL fAutoHide=FALSE)
 
virtual ~Window ()
 
virtual LRESULT CALLBACK WindowProcDx (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
 
void DoAction ()
 
- Public Member Functions inherited from IShellBrowserImpl
 IShellBrowserImpl ()
 
virtual ~IShellBrowserImpl ()
 
virtual HRESULT STDMETHODCALLTYPE QueryInterface (REFIID iid, void **ppvObject)
 
virtual ULONG STDMETHODCALLTYPE AddRef ()
 
virtual ULONG STDMETHODCALLTYPE Release ()
 
virtual HRESULT STDMETHODCALLTYPE ContextSensitiveHelp (BOOL fEnterMode)
 
virtual HRESULT STDMETHODCALLTYPE OnDefaultCommand (IShellView *ppshv)
 
virtual HRESULT STDMETHODCALLTYPE OnStateChange (IShellView *ppshv, ULONG uChange)
 
virtual HRESULT STDMETHODCALLTYPE IncludeObject (IShellView *ppshv, LPCITEMIDLIST pidl)
 
virtual HRESULT STDMETHODCALLTYPE InsertMenusSB (HMENU hmenuShared, LPOLEMENUGROUPWIDTHS lpMenuWidths)
 
virtual HRESULT STDMETHODCALLTYPE SetMenuSB (HMENU hmenuShared, HOLEMENU holemenuReserved, HWND hwndActiveObject)
 
virtual HRESULT STDMETHODCALLTYPE RemoveMenusSB (HMENU hmenuShared)
 
virtual HRESULT STDMETHODCALLTYPE SetStatusTextSB (LPCOLESTR lpszStatusText)
 
virtual HRESULT STDMETHODCALLTYPE EnableModelessSB (BOOL fEnable)
 
virtual HRESULT STDMETHODCALLTYPE BrowseObject (LPCITEMIDLIST pidl, UINT wFlags)
 
virtual HRESULT STDMETHODCALLTYPE GetViewStateStream (DWORD grfMode, LPSTREAM *ppStrm)
 
virtual HRESULT STDMETHODCALLTYPE OnViewWindowActive (IShellView *ppshv)
 
virtual HRESULT STDMETHODCALLTYPE SetToolbarItems (LPTBBUTTON lpButtons, UINT nButtons, UINT uFlags)
 
virtual HRESULT STDMETHODCALLTYPE TranslateAcceleratorSB (LPMSG lpmsg, WORD wID)
 
virtual HRESULT STDMETHODCALLTYPE QueryService (REFGUID guidService, REFIID riid, void **ppvObject)
 
virtual HRESULT STDMETHODCALLTYPE QueryStatus (const GUID *pguidCmdGroup, ULONG cCmds, OLECMD prgCmds[], OLECMDTEXT *pCmdText)
 
virtual HRESULT STDMETHODCALLTYPE Exec (const GUID *pguidCmdGroup, DWORD nCmdID, DWORD nCmdexecopt, VARIANT *pvaIn, VARIANT *pvaOut)
 
- 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)
 
HRESULT QueryInterface ([in] REFIID riid, [out, iid_is(riid)] void **ppvObject)
 
ULONG AddRef ()
 
ULONG Release ()
 
- Public Member Functions inherited from ICommDlgBrowser
HRESULT OnDefaultCommand ([in] IShellView *shv)
 
HRESULT OnStateChange ([in] IShellView *shv, [in] ULONG uChange)
 
HRESULT IncludeObject ([in] IShellView *shv, [in] PCUITEMID_CHILD pidl)
 
- 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)
 
HRESULT QueryStatus ([in, unique] const GUID *pguidCmdGroup, [in] ULONG cCmds, [in, out, size_is(cCmds)] OLECMD prgCmds[], [in, out, unique] OLECMDTEXT *pCmdText)
 
HRESULT Exec ([in, unique] const GUID *pguidCmdGroup, [in] DWORD nCmdID, [in] DWORD nCmdexecopt, [in, unique] VARIANT *pvaIn, [in, out, unique] VARIANT *pvaOut)
 

Static Public Member Functions

static HWND Create ()
 
- Static Public Member Functions inherited from Window
static HWND Create (CREATORFUNC creator, DWORD dwExStyle, LPCTSTR lpClassName, LPCTSTR lpWindowName, DWORD dwStyle, int x, int y, int w, int h, HWND hwndParent=0, HMENU hMenu=0)
 
static HWND Create (CREATORFUNC_INFO creator, const void *info, DWORD dwExStyle, LPCTSTR lpClassName, LPCTSTR lpWindowName, DWORD dwStyle, int x, int y, int w, int h, HWND hwndParent=0, HMENU hMenu=0)
 
static Windowcreate_mdi_child (const ChildWndInfo &info, const MDICREATESTRUCT &mcs, CREATORFUNC_INFO creator)
 
static LRESULT CALLBACK WindowWndProc (HWND hwnd, UINT nmsg, WPARAM wparam, LPARAM lparam)
 
static INT_PTR CALLBACK DialogProc (HWND hwnd, UINT nmsg, WPARAM wparam, LPARAM lparam)
 
static Windowget_window (HWND hwnd)
 get window controller from window handle
 
template<typename CLASS >
static CLASS * get_window (HWND hwnd)
 
static void register_pretranslate (HWND hwnd)
 
static void unregister_pretranslate (HWND hwnd)
 
static BOOL pretranslate_msg (LPMSG pmsg)
 
static void register_dialog (HWND hwnd)
 
static void unregister_dialog (HWND hwnd)
 
static BOOL dispatch_dialog_msg (LPMSG pmsg)
 
static int MessageLoop ()
 
static void CancelModes ()
 
static BOOL DoRegisterClass (HINSTANCE hInstance)
 
static HWND DoCreateMainWnd (HINSTANCE hInstance, LPCTSTR pszText, INT cx, INT cy, DWORD style=WS_POPUP|WS_THICKFRAME|WS_CLIPCHILDREN, DWORD exstyle=WS_EX_WINDOWEDGE|WS_EX_TOOLWINDOW|WS_EX_TOPMOST, BOOL fAutoHide=FALSE)
 
static INT DoMainLoop ()
 
static WindowGetAppbarData (HWND hwnd)
 
static LRESULT CALLBACK WindowProc (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
 
static DWORD WINAPI ActionThreadFunc (LPVOID args)
 

Protected Member Functions

LRESULT Init (LPCREATESTRUCT pcs)
 
LRESULT WndProc (UINT nmsg, WPARAM wparam, LPARAM lparam)
 
virtual HRESULT OnDefaultCommand (LPIDA pida)
 
- Protected Member Functions inherited from Window
virtual LRESULT Init (LPCREATESTRUCT pcs)
 
virtual LRESULT WndProc (UINT nmsg, WPARAM wparam, LPARAM lparam)
 
virtual int Command (int id, int code)
 
virtual int Notify (int id, NMHDR *pnmh)
 
void OnCommand (HWND hwnd, int id, HWND hwndCtl, UINT codeNotify)
 
void OnPaint (HWND hwnd)
 
void OnRButtonDown (HWND hwnd, BOOL fDoubleClick, int x, int y, UINT keyFlags)
 
void OnKey (HWND hwnd, UINT vk, BOOL fDown, int cRepeat, UINT flags)
 
void OnAppBarCallback (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
 
BOOL AppBar_Register (HWND hwnd)
 
BOOL AppBar_UnRegister (HWND hwnd)
 
BOOL AppBar_SetAutoHide (HWND hwnd, BOOL fHide)
 
BOOL AppBar_AutoHide (HWND hwnd)
 
BOOL AppBar_NoAutoHide (HWND hwnd)
 
BOOL AppBar_SetSide (HWND hwnd, UINT uSide)
 
void AppBar_SetAlwaysOnTop (HWND hwnd, BOOL fOnTop)
 
void AppBar_Hide (HWND hwnd)
 
void AppBar_UnHide (HWND hwnd)
 
void AppBar_SetAutoHideTimer (HWND hwnd)
 
void AppBar_SetAutoUnhideTimer (HWND hwnd)
 
void AppBar_Size (HWND hwnd)
 
void AppBar_QueryPos (HWND hwnd, LPRECT lprc)
 
void AppBar_QuerySetPos (UINT uEdge, LPRECT lprc, PAPPBARDATA pabd, BOOL fMove)
 
void AppBar_PosChanged (PAPPBARDATA pabd)
 
BOOL OnCreate (HWND hwnd, LPCREATESTRUCT lpCreateStruct)
 
void OnActivate (HWND hwnd, UINT state, HWND hwndActDeact, BOOL fMinimized)
 
void OnWindowPosChanged (HWND hwnd, const LPWINDOWPOS lpwpos)
 
void OnSize (HWND hwnd, UINT state, int cx, int cy)
 
void OnMove (HWND hwnd, int x, int y)
 
void OnNCDestroy (HWND hwnd)
 
void OnTimer (HWND hwnd, UINT id)
 
UINT OnNCHitTest (HWND hwnd, int x, int y)
 
void OnLButtonDown (HWND hwnd, BOOL fDoubleClick, int x, int y, UINT keyFlags)
 
void OnMouseMove (HWND hwnd, int x, int y, UINT keyFlags)
 
void OnLButtonUp (HWND hwnd, int x, int y, UINT keyFlags)
 
void GetWorkArea (LPRECT prc) const
 
virtual HRESULT OnDefaultCommand (LPIDA pida)
 

Protected Attributes

IShellView_pShellView
 
WindowHandle _desktopBar
 
- Protected Attributes inherited from Window
HWND m_hwnd
 
BOOL m_fAutoHide
 
BOOL m_fOnTop
 
BOOL m_fHiding
 
UINT m_uSide
 
LONG m_cxWidth
 
LONG m_cyHeight
 
LONG m_cxSave
 
LONG m_cySave
 
BOOL m_fAppBarRegd
 
BOOL m_fMoving
 
BOOL m_bDragged
 
POINT m_ptDragOn
 
RECT m_rcAppBar
 
RECT m_rcDrag
 
- Protected Attributes inherited from IShellBrowserImpl
DWORD _dwRef
 

Additional Inherited Members

- Public Attributes inherited from Window
IAccessible IAccessible_iface
 
IOleWindow IOleWindow_iface
 
IEnumVARIANT IEnumVARIANT_iface
 
LONG ref
 
- Public Attributes inherited from IShellBrowserImpl
IShellBrowser IShellBrowser_iface
 
ICommDlgBrowser ICommDlgBrowser_iface
 
IServiceProvider IServiceProvider_iface
 
LONG ref
 
HWND hwndOwner
 
- Static Protected Member Functions inherited from Window
static Windowcreate_controller (HWND hwnd)
 create controller for a new window
 
static StaticWindowDataGetStaticWindowData ()
 
static LRESULT CALLBACK MDICBTHookProc (int code, WPARAM wparam, LPARAM lparam)
 
static LRESULT CALLBACK PropSheetCBTHookProc (int code, WPARAM wparam, LPARAM lparam)
 
- Static Protected Attributes inherited from Window
static WindowMap s_wnd_map
 
static const voids_new_info = NULL
 
static CREATORFUNC s_window_creator = NULL
 
static HHOOK s_hcbtHook = 0
 
static WindowSet s_pretranslate_windows
 
static WindowSet s_dialogs
 

Detailed Description

Implementation of the Explorer desktop window.

Definition at line 51 of file desktop.h.

Member Typedef Documentation

◆ super

Definition at line 53 of file desktop.h.

Constructor & Destructor Documentation

◆ DesktopWindow()

DesktopWindow::DesktopWindow ( HWND  hwnd)

Definition at line 313 of file desktop.cpp.

314 : super(hwnd)
315{
317}
#define NULL
Definition: types.h:112
IShellView * _pShellView
Definition: desktop.h:87
PreTranslateWindow super
Definition: desktop.h:53
_In_ LONG _In_ HWND hwnd
Definition: winddi.h:4023

◆ ~DesktopWindow()

DesktopWindow::~DesktopWindow ( )

Definition at line 319 of file desktop.cpp.

320{
321 if (_pShellView)
323}
ULONG Release()

Member Function Documentation

◆ Create()

HWND DesktopWindow::Create ( )
static

Definition at line 326 of file desktop.cpp.

327{
328 static IconWindowClass wcDesktop(TEXT("Progman"), IDI_REACTOS, CS_DBLCLKS);
329 /* (disabled because of small ugly temporary artefacts when hiding start menu)
330 wcDesktop.hbrBackground = (HBRUSH)(COLOR_BACKGROUND+1); */
331
334
336 WS_EX_TOOLWINDOW, wcDesktop, TEXT("Program Manager"), WS_POPUP|WS_VISIBLE, //|WS_CLIPCHILDREN for SDI frames
337 0, 0, width, height, 0);
338
339 // work around to display desktop bar in Wine
341
342 // work around for Windows NT, Win 98, ...
343 // Without this the desktop has mysteriously only a size of 800x600 pixels.
344 MoveWindow(hwndDesktop, 0, 0, width, height, TRUE);
345
346 return hwndDesktop;
347}
#define TRUE
Definition: types.h:120
GLint GLint GLsizei GLsizei height
Definition: gl.h:1546
GLint GLint GLsizei width
Definition: gl.h:1546
#define TEXT(s)
Definition: k32.h:26
#define GET_WINDOW(CLASS, hwnd)
Definition: window.h:88
#define WINDOW_CREATOR(WND_CLASS)
Definition: window.h:202
#define IDI_REACTOS
Definition: osk_res.h:21
#define WS_POPUP
Definition: pedump.c:616
#define WS_VISIBLE
Definition: pedump.c:620
Implementation of the Explorer desktop window.
Definition: desktop.h:52
WindowHandle _desktopBar
Definition: desktop.h:88
window class with specified icon from resources
Definition: window.h:259
static HWND Create(CREATORFUNC creator, DWORD dwExStyle, LPCTSTR lpClassName, LPCTSTR lpWindowName, DWORD dwStyle, int x, int y, int w, int h, HWND hwndParent=0, HMENU hMenu=0)
Definition: window.cpp:87
BOOL WINAPI ShowWindow(_In_ HWND, _In_ int)
#define SM_CYSCREEN
Definition: winuser.h:963
#define WS_EX_TOOLWINDOW
Definition: winuser.h:404
#define CS_DBLCLKS
Definition: winuser.h:651
#define SW_SHOW
Definition: winuser.h:778
#define SM_CXSCREEN
Definition: winuser.h:962
int WINAPI GetSystemMetrics(_In_ int)
BOOL WINAPI MoveWindow(_In_ HWND, _In_ int, _In_ int, _In_ int, _In_ int, _In_ BOOL)

Referenced by _tWinMain().

◆ GetControlWindow()

virtual HRESULT STDMETHODCALLTYPE DesktopWindow::GetControlWindow ( UINT  id,
HWND lphwnd 
)
inlinevirtual

Implements IShellBrowser.

Definition at line 73 of file desktop.h.

74 {
75 return E_NOTIMPL;
76 }
#define E_NOTIMPL
Definition: ddrawi.h:99

◆ GetWindow()

virtual HRESULT STDMETHODCALLTYPE DesktopWindow::GetWindow ( HWND lphwnd)
inlinevirtual

Implements IOleWindow.

Definition at line 60 of file desktop.h.

61 {
62 *lphwnd = _hwnd;
63 return S_OK;
64 }
#define S_OK
Definition: intsafe.h:52

◆ Init()

LRESULT DesktopWindow::Init ( LPCREATESTRUCT  pcs)
protectedvirtual
Todo:
use IShellBrowser::GetViewStateStream() to restore previous view state -> see SHOpenRegStream()

Reimplemented from Window.

Definition at line 350 of file desktop.cpp.

351{
352 if (super::Init(pcs))
353 return 1;
354
355 HRESULT hr = GetDesktopFolder()->CreateViewObject(_hwnd, IID_IShellView, (void**)&_pShellView);
356/* also possible:
357 SFV_CREATE sfv_create;
358
359 sfv_create.cbSize = sizeof(SFV_CREATE);
360 sfv_create.pshf = GetDesktopFolder();
361 sfv_create.psvOuter = NULL;
362 sfv_create.psfvcb = NULL;
363
364 HRESULT hr = SHCreateShellFolderView(&sfv_create, &_pShellView);
365*/
366 HWND hWndView = 0;
367
368 if (SUCCEEDED(hr)) {
370
371 fs.ViewMode = FVM_ICON;
373
374 ClientRect rect(_hwnd);
375
376 hr = _pShellView->CreateViewWindow(NULL, &fs, this, &rect, &hWndView);
377
379
380 if (SUCCEEDED(hr)) {
381 g_Globals._hwndShellView = hWndView;
382
383 // subclass shellview window
384 new DesktopShellView(hWndView, _pShellView);
385
386 _pShellView->UIActivate(SVUIA_ACTIVATE_FOCUS);
387
388 /*
389 IShellView2* pShellView2;
390
391 hr = _pShellView->QueryInterface(IID_IShellView2, (void**)&pShellView2);
392
393 SV2CVW2_PARAMS params;
394 params.cbSize = sizeof(SV2CVW2_PARAMS);
395 params.psvPrev = _pShellView;
396 params.pfs = &fs;
397 params.psbOwner = this;
398 params.prcView = &rect;
399 params.pvid = params.pvid;//@@
400
401 hr = pShellView2->CreateViewWindow2(&params);
402 params.pvid;
403 */
404
405 /*
406 IFolderView* pFolderView;
407
408 hr = _pShellView->QueryInterface(IID_IFolderView, (void**)&pFolderView);
409
410 if (SUCCEEDED(hr)) {
411 hr = pFolderView->GetAutoArrange();
412 hr = pFolderView->SetCurrentViewMode(FVM_DETAILS);
413 }
414 */
415 }
416 }
417
418 if (hWndView && SetShellWindowEx)
419 SetShellWindowEx(_hwnd, hWndView);
420 else if (SetShellWindow)
421 SetShellWindow(_hwnd);
422
423 // create the explorer bar
426
427 return 0;
428}
#define fs
Definition: i386-dis.c:444
HRESULT CreateViewWindow([in] IShellView *psvPrevious, [in] LPCFOLDERSETTINGS lpfs, [in] IShellBrowser *psb, [out] RECT *prcView, [out] HWND *phWnd)
HRESULT UIActivate([in] UINT uState)
#define SUCCEEDED(hr)
Definition: intsafe.h:50
ExplorerGlobals g_Globals
Definition: explorer.cpp:52
ShellFolder & GetDesktopFolder()
HRESULT hr
Definition: shlfolder.c:183
@ FWF_SNAPTOGRID
Definition: shobjidl.idl:644
@ FWF_NOSCROLL
Definition: shobjidl.idl:652
@ FWF_NOCLIENTEDGE
Definition: shobjidl.idl:651
@ FWF_BESTFITWINDOW
Definition: shobjidl.idl:646
@ FWF_DESKTOP
Definition: shobjidl.idl:647
@ FVM_ICON
Definition: shobjidl.idl:679
& rect
Definition: startmenu.cpp:1413
static HWND Create()
Definition: desktopbar.cpp:64
subclassed ShellView window
Definition: desktop.h:170
HWND _hwndDesktopBar
Definition: globals.h:287
HWND _hwndShellView
Definition: globals.h:288
virtual LRESULT Init(LPCREATESTRUCT pcs)
Definition: window.cpp:241
Definition: ffs.h:70
BOOL WINAPI SetShellWindow(HWND)
Definition: desktop.c:641
BOOL WINAPI SetShellWindowEx(HWND, HWND)
Definition: ntwrapper.h:58

◆ OnDefaultCommand()

HRESULT DesktopWindow::OnDefaultCommand ( LPIDA  pida)
protectedvirtual

Reimplemented from IShellBrowserImpl.

Definition at line 509 of file desktop.cpp.

510{
511#ifndef ROSSHELL // in shell-only-mode fall through and let shell32 handle the command
513 return S_OK;
514#endif
515
516 return E_NOTIMPL;
517}
static int OpenShellFolders(LPIDA pida, HWND hFrameWnd)
Definition: mainframe.cpp:77

◆ QueryActiveShellView()

virtual HRESULT STDMETHODCALLTYPE DesktopWindow::QueryActiveShellView ( IShellView **  ppshv)
inlinevirtual

Implements IShellBrowser.

Definition at line 66 of file desktop.h.

67 {
69 *ppshv = _pShellView;
70 return S_OK;
71 }
ULONG AddRef()

◆ SendControlMsg()

virtual HRESULT STDMETHODCALLTYPE DesktopWindow::SendControlMsg ( UINT  id,
UINT  uMsg,
WPARAM  wParam,
LPARAM  lParam,
LRESULT pret 
)
inlinevirtual

Implements IShellBrowser.

Definition at line 78 of file desktop.h.

79 {
80 return E_NOTIMPL;
81 }

◆ WndProc()

LRESULT DesktopWindow::WndProc ( UINT  nmsg,
WPARAM  wparam,
LPARAM  lparam 
)
protectedvirtual
Todo:
use IShellBrowser::GetViewStateStream() and _pShellView->SaveViewState() to store view state

Reimplemented from Window.

Definition at line 431 of file desktop.cpp.

432{
433 switch(nmsg) {
434 case WM_LBUTTONDBLCLK:
435 case WM_RBUTTONDBLCLK:
436 case WM_MBUTTONDBLCLK:
438 break;
439
440 case WM_DISPLAYCHANGE:
441 MoveWindow(_hwnd, 0, 0, LOWORD(lparam), HIWORD(lparam), TRUE);
444 break;
445
447 return (LRESULT)static_cast<IShellBrowser*>(this);
448
449 case WM_DESTROY:
450
452
453 if (SetShellWindow)
455 break;
456
457 case WM_CLOSE:
459 break;
460
461 case WM_SYSCOMMAND:
462 if (wparam == SC_TASKLIST) {
463 if (_desktopBar)
465 }
466 goto def;
467
469 // redraw background window - it's done by system
470 //InvalidateRect(g_Globals._hwndShellView, NULL, TRUE);
471
472 // forward message to common controls
475 break;
476
477 case WM_SETTINGCHANGE:
479 break;
480
481 case PM_TRANSLATE_MSG:
482 {
483 /* TranslateAccelerator is called for all explorer windows that are open
484 so we have to decide if this is the correct recipient */
485 LPMSG lpmsg = (LPMSG)lparam;
486 HWND hwnd = lpmsg->hwnd;
487
488 while(hwnd)
489 {
490 if(hwnd == _hwnd)
491 break;
492
494 }
495
496 if (hwnd)
497 return _pShellView->TranslateAccelerator(lpmsg) == S_OK;
498 return false;
499 }
500
501 default: def:
502 return super::WndProc(nmsg, wparam, lparam);
503 }
504
505 return 0;
506}
@ lparam
Definition: SystemMenu.c:31
@ wparam
Definition: SystemMenu.c:30
#define DESKTOPBARBAR_HEIGHT
Definition: desktopbar.h:33
#define WM_GETISHELLBROWSER
Definition: filedlg.c:200
void ShowExitWindowsDialog(HWND hwndOwner)
Definition: startmenu.cpp:2128
HRESULT TranslateAccelerator([in] MSG *pmsg)
void explorer_show_frame(int cmdShow, LPTSTR lpCmdLine)
Definition: explorer.cpp:707
#define PM_TRANSLATE_MSG
Definition: window.h:266
#define LOWORD(l)
Definition: pedump.c:82
virtual LRESULT WndProc(UINT nmsg, WPARAM wparam, LPARAM lparam)
Definition: window.cpp:280
HWND hwnd
Definition: winuser.h:3117
#define HIWORD(l)
Definition: typedefs.h:247
LONG_PTR LRESULT
Definition: windef.h:209
#define SW_SHOWNORMAL
Definition: winuser.h:773
#define WM_CLOSE
Definition: winuser.h:1624
#define WM_SYSCOMMAND
Definition: winuser.h:1744
#define WM_LBUTTONDBLCLK
Definition: winuser.h:1781
#define WM_RBUTTONDBLCLK
Definition: winuser.h:1784
#define SC_TASKLIST
Definition: winuser.h:2602
#define WM_SYSCOLORCHANGE
Definition: winuser.h:1629
#define WM_SETTINGCHANGE
Definition: winuser.h:1632
#define SendMessage
Definition: winuser.h:5855
#define WM_MBUTTONDBLCLK
Definition: winuser.h:1787
struct tagMSG * LPMSG
HWND WINAPI GetParent(_In_ HWND)
#define WM_DESTROY
Definition: winuser.h:1612

Member Data Documentation

◆ _desktopBar

WindowHandle DesktopWindow::_desktopBar
protected

Definition at line 88 of file desktop.h.

Referenced by Create(), Init(), and WndProc().

◆ _pShellView

IShellView* DesktopWindow::_pShellView
protected

Definition at line 87 of file desktop.h.

Referenced by DesktopWindow(), Init(), QueryActiveShellView(), WndProc(), and ~DesktopWindow().


The documentation for this struct was generated from the following files: