ReactOS 0.4.15-dev-6661-gcc6e444
desktop.h
Go to the documentation of this file.
1/*
2 * Copyright 2003, 2004 Martin Fuchs
3 *
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Lesser General Public
6 * License as published by the Free Software Foundation; either
7 * version 2.1 of the License, or (at your option) any later version.
8 *
9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Lesser General Public License for more details.
13 *
14 * You should have received a copy of the GNU Lesser General Public
15 * License along with this library; if not, write to the Free Software
16 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
17 */
18
19
20 //
21 // Explorer clone
22 //
23 // desktop.h
24 //
25 // Martin Fuchs, 09.08.2003
26 //
27
28
29#define PM_SET_ICON_ALGORITHM (WM_APP+0x19)
30#define PM_GET_ICON_ALGORITHM (WM_APP+0x1A)
31#define PM_DISPLAY_VERSION (WM_APP+0x24)
32
33
36{
38
40
41protected:
43
45
47};
48
49
52{
54
57
58 static HWND Create();
59
61 {
62 *lphwnd = _hwnd;
63 return S_OK;
64 }
65
67 {
69 *ppshv = _pShellView;
70 return S_OK;
71 }
72
74 {
75 return E_NOTIMPL;
76 }
77
79 {
80 return E_NOTIMPL;
81 }
82
83protected:
86
88 WindowHandle _desktopBar;
89
90 virtual HRESULT OnDefaultCommand(LPIDA pida);
91};
92
93
96{
98
99public:
100 DesktopDropTarget(HWND hTargetWnd) : super(hTargetWnd) {}
101
102 virtual bool OnDrop(FORMATETC* pFmtEtc, STGMEDIUM& medium, DWORD *pdwEffect)
103 {
104 if (pFmtEtc->cfFormat==CF_HDROP && medium.tymed==TYMED_HGLOBAL) {
105 HDROP hDrop = (HDROP)GlobalLock(medium.hGlobal);
106
107 if (hDrop) {
108 TCHAR szFileName[MAX_PATH];
109
110 UINT cFiles = DragQueryFile(hDrop, 0xFFFFFFFF, NULL, 0);
111
112 for(UINT i=0; i<cFiles; ++i) {
113 DragQueryFile(hDrop, i, szFileName, sizeof(szFileName) / sizeof(szFileName[0]));
114
115 if (DROPEFFECT_COPY & *pdwEffect) {
116 // copy the file or dir
117
119
120 } else if (DROPEFFECT_MOVE & *pdwEffect) {
121 // move the file or dir
122
124
125 }
126 }
127 //DragFinish(hDrop); // base class calls ReleaseStgMedium
128 }
129
130 GlobalUnlock(medium.hGlobal);
131 }
132
133 //@@TreeView_SelectDropTarget(m_hTargetWnd, NULL);
134
135 return true; //let base free the medium
136 }
137
139 /* [in] */ DWORD grfKeyState,
140 /* [in] */ POINTL pt,
141 /* [out][in] */ DWORD __RPC_FAR *pdwEffect)
142 {
143 TVHITTESTINFO hit;
144 hit.pt.x = pt.x;
145 hit.pt.y = pt.y;
147 hit.flags = TVHT_ONITEM;
148
149 /*@@
150 HTREEITEM hItem = TreeView_HitTest(m_hTargetWnd,&hit);
151
152 if (hItem != NULL)
153 TreeView_SelectDropTarget(m_hTargetWnd, hItem);
154 */
155
156 return super::DragOver(grfKeyState, pt, pdwEffect);
157 }
158
160 {
161 //@@ TreeView_SelectDropTarget(m_hTargetWnd, NULL);
162
163 return super::DragLeave();
164 }
165};
166
167
169struct DesktopShellView : public ExtContextMenuHandlerT<SubclassedWindow>
170{
172
173 DesktopShellView(HWND hwnd, IShellView* pShellView);
175
176 bool InitDragDrop();
177
178protected:
180
182 int Command(int id, int code);
183 int Notify(int id, NMHDR* pnmh);
184
185 bool DoContextMenu(int x, int y);
187 void PositionIcons(int dir=1);
188
189 void refresh();
190
193};
@ lparam
Definition: SystemMenu.c:31
@ wparam
Definition: SystemMenu.c:30
unsigned int dir
Definition: maze.c:112
#define CF_HDROP
Definition: constants.h:410
#define STDMETHODCALLTYPE
Definition: bdasup.h:9
OLE drop target for the desktop window.
Definition: desktop.h:96
virtual bool OnDrop(FORMATETC *pFmtEtc, STGMEDIUM &medium, DWORD *pdwEffect)
Definition: desktop.h:102
virtual HRESULT STDMETHODCALLTYPE DragLeave(void)
Definition: desktop.h:159
IDropTargetImpl super
Definition: desktop.h:97
DesktopDropTarget(HWND hTargetWnd)
Definition: desktop.h:100
virtual HRESULT STDMETHODCALLTYPE DragOver(DWORD grfKeyState, POINTL pt, DWORD __RPC_FAR *pdwEffect)
Definition: desktop.h:138
implementation of IDropTarget interface
Definition: dragdropimpl.h:169
virtual HRESULT STDMETHODCALLTYPE DragLeave()
virtual HRESULT STDMETHODCALLTYPE DragOver(DWORD grfKeyState, POINTL pt, DWORD __RPC_FAR *pdwEffect)
WPARAM wParam
Definition: combotst.c:138
LPARAM lParam
Definition: combotst.c:139
#define E_NOTIMPL
Definition: ddrawi.h:99
#define NULL
Definition: types.h:112
#define MAX_PATH
Definition: compat.h:34
#define pt(x, y)
Definition: drawing.c:79
unsigned long DWORD
Definition: ntddk_ex.h:95
GLint GLint GLint GLint GLint x
Definition: gl.h:1548
GLint GLint GLint GLint GLint GLint y
Definition: gl.h:1548
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
LPVOID NTAPI GlobalLock(HGLOBAL hMem)
Definition: heapmem.c:755
BOOL NTAPI GlobalUnlock(HGLOBAL hMem)
Definition: heapmem.c:1190
const DWORD DROPEFFECT_COPY
Definition: oleidl.idl:930
const DWORD DROPEFFECT_MOVE
Definition: oleidl.idl:931
ULONG AddRef()
#define S_OK
Definition: intsafe.h:52
HDC hdc
Definition: main.c:9
static HDC
Definition: imagelist.c:92
unsigned int UINT
Definition: ndis.h:50
#define TVHT_ONITEM
Definition: commctrl.h:3527
#define __RPC_FAR
Definition: rpc.h:56
#define DragQueryFile
Definition: shellapi.h:683
subclassed background window behind the visible desktop window
Definition: desktop.h:36
int _display_version
Definition: desktop.h:46
LRESULT WndProc(UINT nmsg, WPARAM wparam, LPARAM lparam)
Definition: desktop.cpp:269
void DrawDesktopBkgnd(HDC hdc)
Definition: desktop.cpp:301
SubclassedWindow super
Definition: desktop.h:37
Definition: shlobj.h:503
Definition: shell.h:41
subclassed ShellView window
Definition: desktop.h:170
ExtContextMenuHandlerT< SubclassedWindow > super
Definition: desktop.h:171
int Notify(int id, NMHDR *pnmh)
Definition: desktop.cpp:607
bool DoContextMenu(int x, int y)
Definition: desktop.cpp:612
HRESULT DoDesktopContextMenu(int x, int y)
Definition: desktop.cpp:654
void PositionIcons(int dir=1)
Definition: desktop.cpp:757
bool InitDragDrop()
Definition: desktop.cpp:547
LRESULT WndProc(UINT nmsg, WPARAM wparam, LPARAM lparam)
Definition: desktop.cpp:576
HWND _hwndListView
Definition: desktop.h:191
IShellView * _pShellView
Definition: desktop.h:179
Implementation of the Explorer desktop window.
Definition: desktop.h:52
virtual HRESULT STDMETHODCALLTYPE SendControlMsg(UINT id, UINT uMsg, WPARAM wParam, LPARAM lParam, LRESULT *pret)
Definition: desktop.h:78
virtual HRESULT OnDefaultCommand(LPIDA pida)
Definition: desktop.cpp:509
static HWND Create()
Definition: desktop.cpp:326
IShellView * _pShellView
Definition: desktop.h:87
virtual HRESULT STDMETHODCALLTYPE GetWindow(HWND *lphwnd)
Definition: desktop.h:60
virtual HRESULT STDMETHODCALLTYPE QueryActiveShellView(IShellView **ppshv)
Definition: desktop.h:66
PreTranslateWindow super
Definition: desktop.h:53
WindowHandle _desktopBar
Definition: desktop.h:88
virtual HRESULT STDMETHODCALLTYPE GetControlWindow(UINT id, HWND *lphwnd)
Definition: desktop.h:73
LRESULT WndProc(UINT nmsg, WPARAM wparam, LPARAM lparam)
Definition: desktop.cpp:431
Implementation of IShellBrowser and ICommDlgBrowser interfaces for explorer child windows (see ShellB...
Definition: inflate.c:139
long y
Definition: polytest.cpp:48
long x
Definition: polytest.cpp:48
_In_ LONG _In_ HWND hwnd
Definition: winddi.h:4023
LONG_PTR LPARAM
Definition: windef.h:208
LONG_PTR LRESULT
Definition: windef.h:209
UINT_PTR WPARAM
Definition: windef.h:207
BOOL WINAPI ScreenToClient(_In_ HWND, _Inout_ LPPOINT)
char TCHAR
Definition: xmlstorage.h:189