ReactOS  0.4.15-dev-4857-g47842d7
shell32_apitest_sub.h
Go to the documentation of this file.
1 #pragma once
2 
3 #include <shlwapi.h>
4 #include <stdlib.h>
5 #include <stdio.h>
6 #include <strsafe.h>
7 
8 #define TEMP_FILE L"shell-notify-temporary.txt"
9 #define CLASSNAME L"SHChangeNotify testcase window"
10 #define EVENT_NAME L"SHChangeNotify testcase event"
11 
12 #define WM_SHELL_NOTIFY (WM_USER + 100)
13 #define WM_GET_NOTIFY_FLAGS (WM_USER + 101)
14 #define WM_CLEAR_FLAGS (WM_USER + 102)
15 #define WM_SET_PATHS (WM_USER + 103)
16 
17 typedef enum TYPE
18 {
27 } TYPE;
28 
29 typedef enum DIRTYPE
30 {
35 } DIRTYPE;
36 
38 {
40 
41  switch (iDir)
42  {
43  case DIRTYPE_NULL:
44  break;
45 
46  case DIRTYPE_DESKTOP:
48  break;
49 
50  case DIRTYPE_MYCOMPUTER:
52  break;
53 
56  break;
57  }
58 
59  return ret;
60 }
61 
62 static inline LPWSTR DoGetDir(DIRTYPE iDir)
63 {
64  static size_t s_index = 0;
65  static WCHAR s_pathes[3][MAX_PATH];
66  LPWSTR psz = s_pathes[s_index];
67  LPITEMIDLIST pidl = DoGetPidl(iDir);
68  psz[0] = 0;
69  SHGetPathFromIDListW(pidl, psz);
70  CoTaskMemFree(pidl);
71  s_index = (s_index + 1) % _countof(s_pathes);
72  return psz;
73 }
74 
75 static inline HWND DoWaitForWindow(LPCWSTR clsname, LPCWSTR text, BOOL bClosing, BOOL bForce)
76 {
77  HWND hwnd = NULL;
78  for (INT i = 0; i < 50; ++i)
79  {
80  hwnd = FindWindowW(clsname, text);
81  if (bClosing)
82  {
83  if (!hwnd)
84  break;
85 
86  if (bForce)
87  PostMessage(hwnd, WM_CLOSE, 0, 0);
88  }
89  else
90  {
91  if (hwnd)
92  break;
93  }
94 
95  Sleep(1);
96  }
97  return hwnd;
98 }
VOID WINAPI DECLSPEC_HOTPATCH Sleep(IN DWORD dwMilliseconds)
Definition: synch.c:790
VOID WINAPI CoTaskMemFree(LPVOID ptr)
Definition: ifs.c:442
const WCHAR * LPCWSTR
Definition: xmlstorage.h:185
#define CSIDL_DESKTOP
Definition: shlobj.h:2012
static HWND DoWaitForWindow(LPCWSTR clsname, LPCWSTR text, BOOL bClosing, BOOL bForce)
const WCHAR * text
Definition: package.c:1743
BOOL WINAPI SHGetPathFromIDListW(LPCITEMIDLIST pidl, LPWSTR pszPath)
Definition: pidl.c:1294
int32_t INT
Definition: typedefs.h:58
#define CSIDL_DRIVES
Definition: shlobj.h:2028
unsigned int BOOL
Definition: ntddk_ex.h:94
#define PostMessage
Definition: winuser.h:5812
__wchar_t WCHAR
Definition: xmlstorage.h:180
HWND WINAPI FindWindowW(_In_opt_ LPCWSTR, _In_opt_ LPCWSTR)
HRESULT WINAPI SHGetSpecialFolderLocation(HWND hwndOwner, INT nFolder, LPITEMIDLIST *ppidl)
Definition: shellpath.c:2984
#define _countof(array)
Definition: sndvol32.h:68
#define WM_CLOSE
Definition: winuser.h:1608
#define MAX_PATH
Definition: compat.h:34
int ret
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
TYPE
Definition: eventcreate.c:651
LPITEMIDLIST DoGetPidl(DIRTYPE iDir)
#define NULL
Definition: types.h:112
#define CSIDL_PERSONAL
Definition: shlobj.h:2017
WCHAR * LPWSTR
Definition: xmlstorage.h:184
_In_ LONG _In_ HWND hwnd
Definition: winddi.h:4022
ITEMIDLIST UNALIGNED * LPITEMIDLIST
Definition: shtypes.idl:41
static LPWSTR DoGetDir(DIRTYPE iDir)