15 #define ATLASSUME(x) do { \
16 trace("ATLASSUME(%s) %s.\n", #x, ((x) ? "success" : "failure")); \
18 #define ATLASSERT(x) do { \
19 trace("ATLASSERT(%s) %s.\n", #x, ((x) ? "success" : "failure")); \
27 #define INVALID_HWND ((HWND)(ULONG_PTR)0xDEADBEEFDEADBEEFULL)
29 #define INVALID_HWND ((HWND)(ULONG_PTR)0xDEADBEEF)
34class CMyCtrl1 :
public CWindowImpl<CMyCtrl1, CWindow>
57 :
public CContainedWindowT<CWindowImpl<CMyCtrl2, CWindow> >
109 ok(hwnd1 !=
NULL,
"hwnd1 was NULL\n");
110 fn1 = Ctrl1.m_pfnSuperWindowProc;
112 b = Ctrl1.SubclassWindow(hwnd1);
114 ok(Ctrl1.m_hWnd == hwnd1,
"Ctrl1.m_hWnd was %p\n", Ctrl1.m_hWnd);
115 fn1 = Ctrl1.m_pfnSuperWindowProc;
117 hwnd2 = Ctrl1.UnsubclassWindow();
118 ok(hwnd1 == hwnd2,
"hwnd1 != hwnd2\n");
119 fn2 = Ctrl1.m_pfnSuperWindowProc;
120 ok(fn1 != fn2,
"fn1 == fn2\n");
123 ok(Ctrl1.m_hWnd ==
NULL,
"hwnd != NULL\n");
130 ok(hwnd1 !=
NULL,
"hwnd1 was NULL\n");
131 fn1 = Ctrl1.m_pfnSuperWindowProc;
133 b = Ctrl1.SubclassWindow(hwnd1);
135 ok(Ctrl1.m_hWnd == hwnd1,
"Ctrl1.m_hWnd was %p\n", Ctrl1.m_hWnd);
136 fn1 = Ctrl1.m_pfnSuperWindowProc;
139 hwnd2 = Ctrl1.UnsubclassWindow();
140 ok(hwnd2 ==
NULL,
"hwnd2 was %p\n", hwnd2);
141 fn2 = Ctrl1.m_pfnSuperWindowProc;
142 ok(fn2 == fn1,
"fn2 was %p\n", fn2);
144 ok(Ctrl1.m_hWnd ==
NULL,
"hwnd != NULL\n");
151 ok(hwnd1 !=
NULL,
"hwnd1 was NULL\n");
152 fn1 = Ctrl1.m_pfnSuperWindowProc;
154 b = Ctrl1.SubclassWindow(hwnd1);
156 ok(Ctrl1.m_hWnd == hwnd1,
"Ctrl1.m_hWnd was %p\n", Ctrl1.m_hWnd);
157 fn1 = Ctrl1.m_pfnSuperWindowProc;
159 hwnd2 = Ctrl1.UnsubclassWindow();
160 ok(hwnd1 == hwnd2,
"hwnd1 != hwnd2\n");
161 fn2 = Ctrl1.m_pfnSuperWindowProc;
162 ok(fn1 != fn2,
"fn1 == fn2\n");
165 ok(Ctrl1.m_hWnd ==
NULL,
"hwnd != NULL\n");
172 ok(hwnd1 !=
NULL,
"hwnd1 was NULL\n");
173 fn1 = Ctrl1.m_pfnSuperWindowProc;
175 b = Ctrl1.SubclassWindow(hwnd1);
177 ok(Ctrl1.m_hWnd == hwnd1,
"Ctrl1.m_hWnd was %p\n", Ctrl1.m_hWnd);
178 fn1 = Ctrl1.m_pfnSuperWindowProc;
181 hwnd2 = Ctrl1.UnsubclassWindow();
182 ok(hwnd2 ==
NULL,
"hwnd2 was %p\n", hwnd2);
183 fn2 = Ctrl1.m_pfnSuperWindowProc;
184 ok(fn1 == fn2,
"fn1 != fn2\n");
186 ok(Ctrl1.m_hWnd ==
NULL,
"hwnd != NULL\n");
193 ok(hwnd1 !=
NULL,
"hwnd1 was NULL\n");
194 fn1 = Ctrl1.m_pfnSuperWindowProc;
196 b = Ctrl1.SubclassWindow(hwnd1);
198 ok(Ctrl1.m_hWnd == hwnd1,
"Ctrl1.m_hWnd was %p\n", Ctrl1.m_hWnd);
200 hwnd2 = Ctrl1.UnsubclassWindow();
201 ok(hwnd1 == hwnd2,
"hwnd1 != hwnd2\n");
202 fn2 = Ctrl1.m_pfnSuperWindowProc;
203 ok(fn1 == fn2,
"fn2 was %p\n", fn2);
206 ok(Ctrl1.m_hWnd ==
NULL,
"hwnd != NULL\n");
216 ok(hwnd1 !=
NULL,
"hwnd1 was NULL\n");
217 fn1 = Ctrl2.m_pfnSuperWindowProc;
219 b = Ctrl2.SubclassWindow(hwnd1);
221 ok(Ctrl2.m_hWnd == hwnd1,
"Ctrl2.m_hWnd was %p\n", Ctrl2.m_hWnd);
222 fn1 = Ctrl2.m_pfnSuperWindowProc;
224 hwnd2 = Ctrl2.UnsubclassWindow(
FALSE);
225 ok(hwnd1 == hwnd2,
"hwnd1 != hwnd2\n");
226 fn2 = Ctrl2.m_pfnSuperWindowProc;
227 ok(fn1 != fn2,
"fn1 == fn2\n");
230 ok(Ctrl2.m_hWnd ==
NULL,
"Ctrl2.m_hWnd was %p\n", Ctrl2.m_hWnd);
237 ok(hwnd1 !=
NULL,
"hwnd1 was NULL\n");
238 fn1 = Ctrl2.m_pfnSuperWindowProc;
240 b = Ctrl2.SubclassWindow(hwnd1);
242 ok(Ctrl2.m_hWnd == hwnd1,
"Ctrl2.m_hWnd was %p\n", Ctrl2.m_hWnd);
243 fn1 = Ctrl2.m_pfnSuperWindowProc;
246 hwnd2 = Ctrl2.UnsubclassWindow(
FALSE);
247 ok(hwnd2 ==
NULL,
"hwnd2 was %p\n", hwnd2);
248 fn2 = Ctrl2.m_pfnSuperWindowProc;
249 ok(fn1 == fn2,
"fn1 == fn2\n");
250 ok(Ctrl2.m_hWnd ==
NULL,
"Ctrl2.m_hWnd was %p\n", Ctrl2.m_hWnd);
252 ok(Ctrl2.m_hWnd ==
NULL,
"Ctrl2.m_hWnd was %p\n", Ctrl2.m_hWnd);
259 ok(hwnd1 !=
NULL,
"hwnd1 was NULL\n");
260 fn1 = Ctrl2.m_pfnSuperWindowProc;
262 b = Ctrl2.SubclassWindow(hwnd1);
264 ok(Ctrl2.m_hWnd == hwnd1,
"Ctrl2.m_hWnd was %p\n", Ctrl2.m_hWnd);
265 fn1 = Ctrl2.m_pfnSuperWindowProc;
267 hwnd2 = Ctrl2.UnsubclassWindow(
FALSE);
268 ok(hwnd1 == hwnd2,
"hwnd1 != hwnd2\n");
269 fn2 = Ctrl2.m_pfnSuperWindowProc;
270 ok(fn1 != fn2,
"fn1 == fn2\n");
272 ok(Ctrl2.m_hWnd ==
NULL,
"Ctrl2.m_hWnd was %p\n", Ctrl2.m_hWnd);
274 ok(Ctrl2.m_hWnd ==
NULL,
"Ctrl2.m_hWnd was %p\n", Ctrl2.m_hWnd);
281 ok(hwnd1 !=
NULL,
"hwnd1 was NULL\n");
282 fn1 = Ctrl2.m_pfnSuperWindowProc;
284 b = Ctrl2.SubclassWindow(hwnd1);
286 ok(Ctrl2.m_hWnd == hwnd1,
"Ctrl2.m_hWnd was %p\n", Ctrl2.m_hWnd);
287 fn1 = Ctrl2.m_pfnSuperWindowProc;
290 hwnd2 = Ctrl2.UnsubclassWindow(
FALSE);
291 ok(hwnd2 ==
NULL,
"hwnd2 was %p\n", hwnd2);
292 fn2 = Ctrl2.m_pfnSuperWindowProc;
294 ok(Ctrl2.m_hWnd ==
NULL,
"Ctrl2.m_hWnd was %p\n", Ctrl2.m_hWnd);
296 ok(Ctrl2.m_hWnd ==
NULL,
"Ctrl2.m_hWnd was %p\n", Ctrl2.m_hWnd);
303 ok(hwnd1 !=
NULL,
"hwnd1 was NULL\n");
304 fn1 = Ctrl2.m_pfnSuperWindowProc;
306 b = Ctrl2.SubclassWindow(hwnd1);
308 ok(Ctrl2.m_hWnd == hwnd1,
"Ctrl2.m_hWnd was %p\n", Ctrl2.m_hWnd);
310 hwnd2 = Ctrl2.UnsubclassWindow(
FALSE);
311 ok(hwnd1 == hwnd2,
"hwnd1 != hwnd2\n");
312 fn2 = Ctrl2.m_pfnSuperWindowProc;
314 ok(Ctrl2.m_hWnd ==
NULL,
"hwnd != NULL\n");
316 ok(Ctrl2.m_hWnd ==
NULL,
"hwnd != NULL\n");
326 ok(hwnd1 !=
NULL,
"hwnd1 was NULL\n");
327 fn1 = Ctrl2.m_pfnSuperWindowProc;
329 b = Ctrl2.SubclassWindow(hwnd1);
331 ok(Ctrl2.m_hWnd == hwnd1,
"Ctrl2.m_hWnd was %p\n", Ctrl2.m_hWnd);
332 fn1 = Ctrl2.m_pfnSuperWindowProc;
334 hwnd2 = Ctrl2.UnsubclassWindow(
TRUE);
335 ok(hwnd1 == hwnd2,
"hwnd1 != hwnd2\n");
336 fn2 = Ctrl2.m_pfnSuperWindowProc;
337 ok(fn1 != fn2,
"fn1 == fn2\n");
339 ok(Ctrl2.m_hWnd ==
NULL,
"Ctrl2.m_hWnd was %p\n", Ctrl2.m_hWnd);
341 ok(Ctrl2.m_hWnd ==
NULL,
"Ctrl2.m_hWnd was %p\n", Ctrl2.m_hWnd);
348 ok(hwnd1 !=
NULL,
"hwnd1 was NULL\n");
349 fn1 = Ctrl2.m_pfnSuperWindowProc;
351 b = Ctrl2.SubclassWindow(hwnd1);
353 ok(Ctrl2.m_hWnd == hwnd1,
"Ctrl2.m_hWnd was %p\n", Ctrl2.m_hWnd);
354 fn1 = Ctrl2.m_pfnSuperWindowProc;
357 hwnd2 = Ctrl2.UnsubclassWindow(
TRUE);
358 ok(hwnd2 ==
NULL,
"hwnd2 was %p\n", hwnd2);
359 fn2 = Ctrl2.m_pfnSuperWindowProc;
361 ok(Ctrl2.m_hWnd ==
NULL,
"Ctrl2.m_hWnd was %p\n", Ctrl2.m_hWnd);
363 ok(Ctrl2.m_hWnd ==
NULL,
"Ctrl2.m_hWnd was %p\n", Ctrl2.m_hWnd);
370 ok(hwnd1 !=
NULL,
"hwnd1 was NULL\n");
371 fn1 = Ctrl2.m_pfnSuperWindowProc;
373 b = Ctrl2.SubclassWindow(hwnd1);
375 ok(Ctrl2.m_hWnd == hwnd1,
"Ctrl2.m_hWnd was %p\n", Ctrl2.m_hWnd);
376 fn1 = Ctrl2.m_pfnSuperWindowProc;
378 hwnd2 = Ctrl2.UnsubclassWindow(
TRUE);
379 ok(hwnd1 == hwnd2,
"hwnd1 != hwnd2\n");
380 fn2 = Ctrl2.m_pfnSuperWindowProc;
381 ok(fn1 != fn2,
"fn1 == fn2\n");
383 ok(Ctrl2.m_hWnd ==
NULL,
"Ctrl2.m_hWnd was %p\n", Ctrl2.m_hWnd);
385 ok(Ctrl2.m_hWnd ==
NULL,
"Ctrl2.m_hWnd was %p\n", Ctrl2.m_hWnd);
392 ok(hwnd1 !=
NULL,
"hwnd1 was NULL\n");
393 fn1 = Ctrl2.m_pfnSuperWindowProc;
395 b = Ctrl2.SubclassWindow(hwnd1);
397 ok(Ctrl2.m_hWnd == hwnd1,
"Ctrl2.m_hWnd was %p\n", Ctrl2.m_hWnd);
398 fn1 = Ctrl2.m_pfnSuperWindowProc;
401 hwnd2 = Ctrl2.UnsubclassWindow(
TRUE);
402 ok(hwnd2 ==
NULL,
"hwnd2 was %p\n", hwnd2);
403 fn2 = Ctrl2.m_pfnSuperWindowProc;
405 ok(Ctrl2.m_hWnd ==
NULL,
"Ctrl2.m_hWnd was %p\n", Ctrl2.m_hWnd);
407 ok(Ctrl2.m_hWnd ==
NULL,
"Ctrl2.m_hWnd was %p\n", Ctrl2.m_hWnd);
414 ok(hwnd1 !=
NULL,
"hwnd1 was NULL\n");
415 fn1 = Ctrl2.m_pfnSuperWindowProc;
417 b = Ctrl2.SubclassWindow(hwnd1);
419 ok(Ctrl2.m_hWnd == hwnd1,
"Ctrl2.m_hWnd was %p\n", Ctrl2.m_hWnd);
421 hwnd2 = Ctrl2.UnsubclassWindow(
TRUE);
422 ok(hwnd1 == hwnd2,
"hwnd1 != hwnd2\n");
423 fn2 = Ctrl2.m_pfnSuperWindowProc;
425 ok(Ctrl2.m_hWnd ==
NULL,
"hwnd != NULL\n");
427 ok(Ctrl2.m_hWnd ==
NULL,
"hwnd != NULL\n");
static HWND MyCreateWindow(DWORD style)
static LRESULT CALLBACK MyWindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
#define ok_int(expression, result)
static LPCWSTR GetWndClassName()
static LPCWSTR GetWndClassName()
HMODULE WINAPI GetModuleHandleW(LPCWSTR lpModuleName)
GLboolean GLboolean GLboolean b
#define BEGIN_MSG_MAP(theClass)
#define SubclassWindow(hwnd, lpfn)
LRESULT WINAPI DefWindowProcW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
LRESULT WINAPI DefWindowProcA(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
#define CreateWindowW(a, b, c, d, e, f, g, h, i, j, k)
LRESULT(CALLBACK * WNDPROC)(HWND, UINT, WPARAM, LPARAM)
BOOL WINAPI DestroyWindow(_In_ HWND)