#include "shelltest.h"
#include "shell32_apitest_sub.h"
#include <assert.h>
Go to the source code of this file.
|
LPITEMIDLIST | DoGetPidl (INT iDir) |
|
static BOOL | OnCreate (HWND hwnd) |
|
static BOOL | InitSHCN (HWND hwnd) |
|
static void | UnInitSHCN (HWND hwnd) |
|
static void | OnCommand (HWND hwnd, UINT id) |
|
static void | OnDestroy (HWND hwnd) |
|
static BOOL | DoSendData (LONG lEvent, LPCITEMIDLIST pidl1, LPCITEMIDLIST pidl2) |
|
static void | DoShellNotify (HWND hwnd, PIDLIST_ABSOLUTE pidl1, PIDLIST_ABSOLUTE pidl2, LONG lEvent) |
|
static INT_PTR | OnShellNotify (HWND hwnd, WPARAM wParam, LPARAM lParam) |
|
static LRESULT CALLBACK | SubWindowProc (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam) |
|
INT APIENTRY | wWinMain (HINSTANCE hInstance, HINSTANCE hPrevInstance, LPWSTR lpCmdLine, INT nCmdShow) |
|
◆ EVENTS
◆ DIRTYPE
◆ DIRTYPE
Enumerator |
---|
DIRTYPE_DESKTOP | |
DIRTYPE_DESKTOP_DIR | |
DIRTYPE_DRIVES | |
DIRTYPE_PRINTERS | |
DIRTYPE_DIR1 | |
DIRTYPE_MAX | |
Definition at line 14 of file shell32_apitest_sub.cpp.
◆ DoGetPidl()
Definition at line 32 of file shell32_apitest_sub.cpp.
33{
35
36 switch (iDir)
37 {
39 {
41 break;
42 }
44 {
48 break;
49 }
51 {
53 break;
54 }
56 {
58 break;
59 }
61 {
66 break;
67 }
68 default:
69 {
71 break;
72 }
73 }
74
76}
HRESULT WINAPI SHGetSpecialFolderLocation(HWND hwndOwner, INT nFolder, LPITEMIDLIST *ppidl)
BOOL WINAPI SHGetSpecialFolderPathW(HWND hwndOwner, LPWSTR szPath, int nFolder, BOOL bCreate)
LPITEMIDLIST WINAPI ILCreateFromPathW(LPCWSTR path)
#define CSIDL_DESKTOPDIRECTORY
ITEMIDLIST UNALIGNED * LPITEMIDLIST
Referenced by OnCreate().
◆ DoSendData()
Definition at line 252 of file shell32_apitest_sub.cpp.
253{
255 DWORD cbTotal =
sizeof(
lEvent) +
sizeof(cbPidl1) +
sizeof(cbPidl2) + cbPidl1 + cbPidl2;
259
261
264
265 *(
DWORD*)pb = cbPidl1;
266 pb += sizeof(cbPidl1);
267
268 *(
DWORD*)pb = cbPidl2;
269 pb += sizeof(cbPidl2);
270
272 pb += cbPidl1;
273
275 pb += cbPidl2;
276
278
280 CopyData.
dwData = 0xBEEFCAFE;
281 CopyData.
cbData = cbTotal;
284
287}
HLOCAL NTAPI LocalAlloc(UINT uFlags, SIZE_T dwBytes)
HLOCAL NTAPI LocalFree(HLOCAL hMem)
_In_ HCRYPTHASH _In_ BOOL _In_ DWORD _Inout_updates_bytes_to_ pdwDataLen BYTE * pbData
LRESULT WINAPI SendMessageW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
Referenced by DoShellNotify().
◆ DoShellNotify()
◆ InitSHCN()
Definition at line 88 of file shell32_apitest_sub.cpp.
89{
92
97 {
98 case 0:
99 {
104 break;
105 }
106 case 1:
107 {
112 break;
113 }
114 case 2:
115 {
120 break;
121 }
122 case 3:
123 {
128 break;
129 }
130 case 4:
131 {
136 break;
137 }
138 case 5:
139 {
144 break;
145 }
146 case 6:
147 {
152 break;
153 }
154 case 7:
155 {
160 break;
161 }
162 case 8:
163 {
168 break;
169 }
170 case 9:
171 {
177 break;
178 }
179 default:
180 {
182 break;
183 }
184 }
185
189
191}
EXTERN_C ULONG WINAPI SHChangeNotifyRegister(HWND hwnd, INT fSources, LONG wEventMask, UINT uMsg, INT cItems, SHChangeNotifyEntry *lpItems)
static LPITEMIDLIST s_pidl[DIRTYPE_MAX]
#define SHCNRF_RecursiveInterrupt
#define SHCNRF_NewDelivery
#define SHCNRF_ShellLevel
#define SHCNRF_InterruptLevel
Referenced by OnCommand().
◆ OnCommand()
Definition at line 202 of file shell32_apitest_sub.cpp.
203{
204 switch (id)
205 {
207 {
210 {
212 break;
213 }
217 break;
218 }
220 {
225 break;
226 }
228 {
232 break;
233 }
234 }
235}
static void UnInitSHCN(HWND hwnd)
static BOOL InitSHCN(HWND hwnd)
BOOL WINAPI PostMessageW(_In_opt_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
BOOL WINAPI DestroyWindow(_In_ HWND)
Referenced by SubWindowProc().
◆ OnCreate()
Definition at line 78 of file shell32_apitest_sub.cpp.
79{
81
84
86}
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
LPITEMIDLIST DoGetPidl(INT iDir)
Referenced by SubWindowProc().
◆ OnDestroy()
Definition at line 237 of file shell32_apitest_sub.cpp.
238{
240
242 {
245 }
246
248
250}
VOID WINAPI CoTaskMemFree(LPVOID ptr)
__analysis_noreturn void WINAPI PostQuitMessage(_In_ int)
Referenced by SubWindowProc().
◆ OnShellNotify()
Definition at line 297 of file shell32_apitest_sub.cpp.
298{
302 if (hLock)
303 {
306 }
307 else
308 {
311 }
313}
EXTERN_C HANDLE WINAPI SHChangeNotification_Lock(HANDLE hTicket, DWORD dwOwnerPID, LPITEMIDLIST **lppidls, LPLONG lpwEventId)
EXTERN_C BOOL WINAPI SHChangeNotification_Unlock(HANDLE hLock)
static void DoShellNotify(HWND hwnd, PIDLIST_ABSOLUTE pidl1, PIDLIST_ABSOLUTE pidl2, LONG lEvent)
Referenced by SubWindowProc().
◆ SubWindowProc()
Definition at line 315 of file shell32_apitest_sub.cpp.
316{
317 switch (uMsg)
318 {
321
324 break;
325
328
331 break;
332
333 default:
335 }
336 return 0;
337}
static BOOL OnCreate(HWND hwnd)
static void OnCommand(HWND hwnd, UINT id)
static void OnDestroy(HWND hwnd)
static INT_PTR OnShellNotify(HWND hwnd, WPARAM wParam, LPARAM lParam)
Referenced by wWinMain().
◆ UnInitSHCN()
◆ wWinMain()
Definition at line 340 of file shell32_apitest_sub.cpp.
345{
347 return 0;
348
356 {
358 return -1;
359 }
360
365 {
367 return -2;
368 }
369
372
375 {
378 }
379
380 return 0;
381}
int WINAPI lstrcmpiW(LPCWSTR str1, LPCWSTR str2)
#define WS_OVERLAPPEDWINDOW
static LRESULT CALLBACK SubWindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
TW_UINT32 TW_UINT16 TW_UINT16 MSG
BOOL WINAPI TranslateMessage(_In_ const MSG *)
BOOL WINAPI ShowWindow(_In_ HWND, _In_ int)
BOOL WINAPI GetMessageW(_Out_ LPMSG, _In_opt_ HWND, _In_ UINT, _In_ UINT)
ATOM WINAPI RegisterClassW(_In_ CONST WNDCLASSW *)
HCURSOR WINAPI LoadCursorW(_In_opt_ HINSTANCE, _In_ LPCWSTR)
BOOL WINAPI UpdateWindow(_In_ HWND)
#define CreateWindowW(a, b, c, d, e, f, g, h, i, j, k)
LRESULT WINAPI DispatchMessageW(_In_ const MSG *)
HICON WINAPI LoadIconW(_In_opt_ HINSTANCE hInstance, _In_ LPCWSTR lpIconName)
◆ s_hMainWnd
◆ s_hSubWnd
◆ s_iStage
◆ s_pidl
◆ s_uRegID