ReactOS 0.4.16-dev-125-g798ea90
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 MAIN_CLASSNAME L"SHChangeNotify main window"
9#define SUB_CLASSNAME L"SHChangeNotify sub-window"
10
11#define WM_SHELL_NOTIFY (WM_USER + 100)
12
13#define NUM_STAGE 10
14
15static inline BOOL FindSubProgram(LPWSTR pszSubProgram, DWORD cchSubProgram)
16{
17 GetModuleFileNameW(NULL, pszSubProgram, cchSubProgram);
18 PathRemoveFileSpecW(pszSubProgram);
19 PathAppendW(pszSubProgram, L"shell32_apitest_sub.exe");
20
21 if (!PathFileExistsW(pszSubProgram))
22 {
23 PathRemoveFileSpecW(pszSubProgram);
24 PathAppendW(pszSubProgram, L"testdata\\shell32_apitest_sub.exe");
25
26 if (!PathFileExistsW(pszSubProgram))
27 return FALSE;
28 }
29
30 return TRUE;
31}
32
33static inline HWND DoWaitForWindow(LPCWSTR clsname, LPCWSTR text, BOOL bClosing, BOOL bForce)
34{
35 HWND hwnd = NULL;
36 for (INT i = 0; i < 50; ++i)
37 {
38 hwnd = FindWindowW(clsname, text);
39 if (bClosing)
40 {
41 if (!hwnd)
42 break;
43
44 if (bForce)
46 }
47 else
48 {
49 if (hwnd)
50 break;
51 }
52
53 Sleep(1);
54 }
55 return hwnd;
56}
#define NULL
Definition: types.h:112
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
DWORD WINAPI GetModuleFileNameW(HINSTANCE hModule, LPWSTR lpFilename, DWORD nSize)
Definition: loader.c:600
const WCHAR * text
Definition: package.c:1794
BOOL WINAPI PathRemoveFileSpecW(LPWSTR lpszPath)
Definition: path.c:629
BOOL WINAPI PathFileExistsW(LPCWSTR lpszPath)
Definition: path.c:1777
unsigned int BOOL
Definition: ntddk_ex.h:94
unsigned long DWORD
Definition: ntddk_ex.h:95
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 L(x)
Definition: ntvdm.h:50
#define PathAppendW
Definition: pathcch.h:309
static HWND DoWaitForWindow(LPCWSTR clsname, LPCWSTR text, BOOL bClosing, BOOL bForce)
static BOOL FindSubProgram(LPWSTR pszSubProgram, DWORD cchSubProgram)
VOID WINAPI DECLSPEC_HOTPATCH Sleep(IN DWORD dwMilliseconds)
Definition: synch.c:790
int32_t INT
Definition: typedefs.h:58
_In_ LONG _In_ HWND hwnd
Definition: winddi.h:4023
#define WM_CLOSE
Definition: winuser.h:1624
#define PostMessage
Definition: winuser.h:5844
HWND WINAPI FindWindowW(_In_opt_ LPCWSTR, _In_opt_ LPCWSTR)
WCHAR * LPWSTR
Definition: xmlstorage.h:184
const WCHAR * LPCWSTR
Definition: xmlstorage.h:185