ReactOS 0.4.15-dev-6052-g2626c72
appbar.c File Reference
#include <stdarg.h>
#include <windows.h>
#include "shellapi.h"
#include "wine/test.h"
Include dependency graph for appbar.c:

Go to the source code of this file.

Classes

struct  testwindow_info
 

Macros

#define MSG_APPBAR   WM_APP
 
#define test_window_rects(a, b)
 

Typedefs

typedef BOOL(* boolean_function) (void)
 

Functions

static HMONITOR (WINAPI *pMonitorFromWindow)(HWND
 
static HRESULT (WINAPI *pGetCurrentProcessExplicitAppUserModelID)(PWSTR *)
 
static void testwindow_setpos (HWND hwnd)
 
static LRESULT CALLBACK testwindow_wndproc (HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam)
 
static void do_events_until (boolean_function test)
 
static void do_events (void)
 
static BOOL no_appbars_intersect (void)
 
static BOOL got_expected_bottom (void)
 
static void register_testwindow_class (void)
 
static void test_setpos (void)
 
static void test_appbarget (void)
 
static void test_GetCurrentProcessExplicitAppUserModelID (void)
 
 START_TEST (appbar)
 

Variables

static const CHAR testwindow_class [] = "testwindow"
 
static DWORD
 
static struct testwindow_info windows [3]
 
static int expected_bottom
 

Macro Definition Documentation

◆ MSG_APPBAR

#define MSG_APPBAR   WM_APP

Definition at line 27 of file appbar.c.

◆ test_window_rects

#define test_window_rects (   a,
  b 
)
Value:
ok(!IntersectRect(&rc, &windows[a].allocated_rect, &windows[b].allocated_rect), \
"rectangles intersect %s / %s\n", wine_dbgstr_rect(&windows[a].allocated_rect), \
wine_dbgstr_rect(&windows[b].allocated_rect))
#define ok(value,...)
Definition: atltest.h:57
GLboolean GLboolean GLboolean b
Definition: glext.h:6204
GLboolean GLboolean GLboolean GLboolean a
Definition: glext.h:6204
static struct testwindow_info windows[3]
Definition: appbar.c:46
static __inline const char * wine_dbgstr_rect(const RECT *rect)
Definition: debug.h:219
BOOL WINAPI IntersectRect(_Out_ LPRECT, _In_ LPCRECT, _In_ LPCRECT)

Definition at line 197 of file appbar.c.

Typedef Documentation

◆ boolean_function

typedef BOOL(* boolean_function) (void)

Definition at line 34 of file appbar.c.

Function Documentation

◆ do_events()

static void do_events ( void  )
static

Definition at line 148 of file appbar.c.

149{
150 MSG msg;
151
152 while (PeekMessageA(&msg, NULL, 0, 0, PM_REMOVE))
153 {
156 }
157}
#define msg(x)
Definition: auth_time.c:54
#define NULL
Definition: types.h:112
TW_UINT32 TW_UINT16 TW_UINT16 MSG
Definition: twain.h:1829
LRESULT WINAPI DispatchMessageA(_In_ const MSG *)
BOOL WINAPI TranslateMessage(_In_ const MSG *)
#define PM_REMOVE
Definition: winuser.h:1186
BOOL WINAPI PeekMessageA(_Out_ LPMSG, _In_opt_ HWND, _In_ UINT, _In_ UINT, _In_ UINT)

Referenced by test_setpos().

◆ do_events_until()

static void do_events_until ( boolean_function  test)
static

Definition at line 122 of file appbar.c.

123{
124 MSG msg;
125 UINT_PTR timerid;
126 BOOL timedout=FALSE;
127
128 timerid = SetTimer(0, 0, 3000, NULL);
129
130 while (1)
131 {
132 while (PeekMessageA(&msg, NULL, 0, 0, PM_REMOVE))
133 {
134 if (msg.hwnd == 0 && msg.message == WM_TIMER && msg.wParam == timerid)
135 timedout = TRUE;
138 }
139 if (timedout || test())
140 break;
141 WaitMessage();
142 }
143
144 KillTimer(0, timerid);
145}
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
unsigned int BOOL
Definition: ntddk_ex.h:94
unsigned __int3264 UINT_PTR
Definition: mstsclib_h.h:274
#define test
Definition: rosglue.h:37
UINT_PTR WINAPI SetTimer(_In_opt_ HWND, _In_ UINT_PTR, _In_ UINT, _In_opt_ TIMERPROC)
#define WM_TIMER
Definition: winuser.h:1732
BOOL WINAPI WaitMessage(void)
Definition: ntwrapper.h:350
BOOL WINAPI KillTimer(_In_opt_ HWND, _In_ UINT_PTR)

Referenced by test_setpos().

◆ got_expected_bottom()

static BOOL got_expected_bottom ( void  )
static

Definition at line 176 of file appbar.c.

177{
178 return (no_appbars_intersect() && windows[1].allocated_rect.bottom == expected_bottom);
179}
static BOOL no_appbars_intersect(void)
Definition: appbar.c:159
static int expected_bottom
Definition: appbar.c:48

Referenced by test_setpos().

◆ HMONITOR()

static HMONITOR ( WINAPI pMonitorFromWindow)
static

◆ HRESULT()

static HRESULT ( WINAPI pGetCurrentProcessExplicitAppUserModelID)
static

◆ no_appbars_intersect()

static BOOL no_appbars_intersect ( void  )
static

Definition at line 159 of file appbar.c.

160{
161 int i, j;
162 RECT rc;
163
164 for (i=0; i<2; i++)
165 {
166 for (j=i+1; j<3; j++)
167 {
168 if (windows[i].registered && windows[j].registered &&
169 IntersectRect(&rc, &windows[i].allocated_rect, &windows[j].allocated_rect))
170 return FALSE;
171 }
172 }
173 return TRUE;
174}
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
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 GLint GLint j
Definition: glfuncs.h:250

Referenced by got_expected_bottom(), and test_setpos().

◆ register_testwindow_class()

static void register_testwindow_class ( void  )
static

Definition at line 181 of file appbar.c.

182{
183 WNDCLASSEXA cls;
184
185 ZeroMemory(&cls, sizeof(cls));
186 cls.cbSize = sizeof(cls);
187 cls.style = 0;
189 cls.hInstance = NULL;
191 cls.hbrBackground = (HBRUSH) COLOR_WINDOW;
193
194 RegisterClassExA(&cls);
195}
static LRESULT CALLBACK testwindow_wndproc(HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam)
Definition: appbar.c:102
static const CHAR testwindow_class[]
Definition: appbar.c:29
HINSTANCE hInstance
Definition: winuser.h:3196
HCURSOR hCursor
Definition: winuser.h:3198
UINT style
Definition: winuser.h:3192
UINT cbSize
Definition: winuser.h:3191
WNDPROC lpfnWndProc
Definition: winuser.h:3193
LPCSTR lpszClassName
Definition: winuser.h:3201
HBRUSH hbrBackground
Definition: winuser.h:3199
#define ZeroMemory
Definition: winbase.h:1670
#define COLOR_WINDOW
Definition: winuser.h:912
#define IDC_ARROW
Definition: winuser.h:682
ATOM WINAPI RegisterClassExA(_In_ CONST WNDCLASSEXA *)
HCURSOR WINAPI LoadCursorA(_In_opt_ HINSTANCE, _In_ LPCSTR)
Definition: cursoricon.c:2059
char * LPSTR
Definition: xmlstorage.h:182

Referenced by START_TEST().

◆ START_TEST()

START_TEST ( appbar  )

Definition at line 436 of file appbar.c.

437{
438 HMODULE huser32, hshell32;
439
440 huser32 = GetModuleHandleA("user32.dll");
441 hshell32 = GetModuleHandleA("shell32.dll");
442 pMonitorFromWindow = (void*)GetProcAddress(huser32, "MonitorFromWindow");
443 pGetCurrentProcessExplicitAppUserModelID = (void*)GetProcAddress(hshell32, "GetCurrentProcessExplicitAppUserModelID");
444
446
447 test_setpos();
450}
#define GetProcAddress(x, y)
Definition: compat.h:753
HMODULE WINAPI DECLSPEC_HOTPATCH GetModuleHandleA(LPCSTR lpModuleName)
Definition: loader.c:812
static HMODULE huser32
Definition: profile.c:34
static void test_appbarget(void)
Definition: appbar.c:360
static void register_testwindow_class(void)
Definition: appbar.c:181
static void test_setpos(void)
Definition: appbar.c:202
static void test_GetCurrentProcessExplicitAppUserModelID(void)
Definition: appbar.c:415

◆ test_appbarget()

static void test_appbarget ( void  )
static

Definition at line 360 of file appbar.c.

361{
362 APPBARDATA abd;
363 HWND hwnd, foregnd, unset_hwnd;
365
366 memset(&abd, 0xcc, sizeof(abd));
367 memset(&unset_hwnd, 0xcc, sizeof(unset_hwnd));
368 abd.cbSize = sizeof(abd);
369 abd.uEdge = ABE_BOTTOM;
370
372 ok(hwnd == NULL || IsWindow(hwnd), "ret %p which is not a window\n", hwnd);
373 ok(abd.hWnd == unset_hwnd, "hWnd overwritten %p\n",abd.hWnd);
374
375 if (!pMonitorFromWindow)
376 {
377 win_skip("MonitorFromWindow is not available\n");
378 }
379 else
380 {
381 /* Presumably one can pass a hwnd with ABM_GETAUTOHIDEBAR to specify a monitor.
382 Pass the foreground window and check */
383 foregnd = GetForegroundWindow();
384 if(foregnd)
385 {
386 abd.hWnd = foregnd;
388 ok(hwnd == NULL || IsWindow(hwnd), "ret %p which is not a window\n", hwnd);
389 ok(abd.hWnd == foregnd, "hWnd overwritten\n");
390 if(hwnd)
391 {
392 HMONITOR appbar_mon, foregnd_mon;
393 appbar_mon = pMonitorFromWindow(hwnd, MONITOR_DEFAULTTONEAREST);
394 foregnd_mon = pMonitorFromWindow(foregnd, MONITOR_DEFAULTTONEAREST);
395 ok(appbar_mon == foregnd_mon, "Windows on different monitors\n");
396 }
397 }
398 }
399
400 memset(&abd, 0xcc, sizeof(abd));
401 abd.cbSize = sizeof(abd);
403 if(ret)
404 {
405 ok(abd.hWnd == (HWND)0xcccccccc, "hWnd overwritten\n");
406 ok(abd.uEdge <= ABE_BOTTOM ||
407 broken(abd.uEdge == 0xcccccccc), /* Some Win95 and NT4 */
408 "uEdge not returned\n");
409 ok(abd.rc.left != 0xcccccccc, "rc not updated\n");
410 }
411
412 return;
413}
#define broken(x)
Definition: _sntprintf.h:21
HANDLE HWND
Definition: compat.h:19
UINT_PTR WINAPI SHAppBarMessage(DWORD msg, PAPPBARDATA data)
Definition: appbar.c:64
#define win_skip
Definition: test.h:160
#define memset(x, y, z)
Definition: compat.h:39
#define ABE_BOTTOM
Definition: shellapi.h:20
#define ABM_GETTASKBARPOS
Definition: shellapi.h:64
#define ABM_GETAUTOHIDEBAR
Definition: shellapi.h:66
DWORD cbSize
Definition: shellapi.h:214
HWND hWnd
Definition: shellapi.h:215
UINT uEdge
Definition: shellapi.h:217
LONG left
Definition: windef.h:306
int ret
_In_ LONG _In_ HWND hwnd
Definition: winddi.h:4023
BOOL WINAPI IsWindow(_In_opt_ HWND)
HWND WINAPI GetForegroundWindow(void)
Definition: ntwrapper.h:392

Referenced by START_TEST().

◆ test_GetCurrentProcessExplicitAppUserModelID()

static void test_GetCurrentProcessExplicitAppUserModelID ( void  )
static

Definition at line 415 of file appbar.c.

416{
417 WCHAR *appid;
418 HRESULT hr;
419
420 if (!pGetCurrentProcessExplicitAppUserModelID)
421 {
422 win_skip("GetCurrentProcessExplicitAppUserModelID() is not supported.\n");
423 return;
424 }
425
426 if (0) /* crashes on native */
427 hr = pGetCurrentProcessExplicitAppUserModelID(NULL);
428
429 appid = (void*)0xdeadbeef;
430 hr = pGetCurrentProcessExplicitAppUserModelID(&appid);
432 ok(hr == E_FAIL, "got 0x%08x\n", hr);
433 ok(appid == NULL, "got %p\n", appid);
434}
#define E_FAIL
Definition: ddrawi.h:102
char * appid
Definition: mkisofs.c:161
#define todo_wine
Definition: custom.c:79
HRESULT hr
Definition: shlfolder.c:183
__wchar_t WCHAR
Definition: xmlstorage.h:180

Referenced by START_TEST().

◆ test_setpos()

static void test_setpos ( void  )
static

Definition at line 202 of file appbar.c.

203{
204 APPBARDATA abd;
205 RECT rc;
206 int screen_width, screen_height;
207 BOOL ret;
208 int org_bottom1;
209
210 screen_width = GetSystemMetrics(SM_CXSCREEN);
211 screen_height = GetSystemMetrics(SM_CYSCREEN);
212
213 /* create and register windows[0] */
216 NULL, NULL, NULL, NULL);
217 ok(windows[0].hwnd != NULL, "couldn't create window\n");
218 do_events();
219 abd.cbSize = sizeof(abd);
220 abd.hWnd = windows[0].hwnd;
222 ret = SHAppBarMessage(ABM_NEW, &abd);
223 ok(ret == TRUE, "SHAppBarMessage returned %i\n", ret);
224
225 /* ABM_NEW should return FALSE if the window is already registered */
226 ret = SHAppBarMessage(ABM_NEW, &abd);
227 ok(ret == FALSE, "SHAppBarMessage returned %i\n", ret);
228 do_events();
229
230 /* dock windows[0] to the bottom of the screen */
231 windows[0].registered = TRUE;
232 windows[0].to_be_deleted = FALSE;
233 windows[0].edge = ABE_BOTTOM;
234 SetRect(&windows[0].desired_rect, 0, screen_height - 15, screen_width, screen_height);
237 do_events();
238
239 /* create and register windows[1] */
242 NULL, NULL, NULL, NULL);
243 ok(windows[1].hwnd != NULL, "couldn't create window\n");
244 abd.hWnd = windows[1].hwnd;
245 ret = SHAppBarMessage(ABM_NEW, &abd);
246 ok(ret == TRUE, "SHAppBarMessage returned %i\n", ret);
247
248 /* dock windows[1] to the bottom of the screen */
249 windows[1].registered = TRUE;
250 windows[1].to_be_deleted = FALSE;
251 windows[1].edge = ABE_BOTTOM;
252 SetRect(&windows[1].desired_rect, 0, screen_height - 10, screen_width, screen_height);
255
256 /* the windows are adjusted to they don't overlap */
258 test_window_rects(0, 1);
259
260 /* make windows[0] larger, forcing windows[1] to move out of its way */
261 windows[0].desired_rect.top = screen_height - 20;
264 test_window_rects(0, 1);
265
266 /* create and register windows[2] */
269 NULL, NULL, NULL, NULL);
270 ok(windows[2].hwnd != NULL, "couldn't create window\n");
271 do_events();
272
273 abd.hWnd = windows[2].hwnd;
274 ret = SHAppBarMessage(ABM_NEW, &abd);
275 ok(ret == TRUE, "SHAppBarMessage returned %i\n", ret);
276
277 /* dock windows[2] to the bottom of the screen */
278 windows[2].registered = TRUE;
279 windows[2].to_be_deleted = FALSE;
280 windows[2].edge = ABE_BOTTOM;
281 SetRect(&windows[2].desired_rect, 0, screen_height - 10, screen_width, screen_height);
284
286 test_window_rects(0, 1);
287 test_window_rects(0, 2);
288 test_window_rects(1, 2);
289
290 /* move windows[2] to the right side of the screen */
291 windows[2].edge = ABE_RIGHT;
292 SetRect(&windows[2].desired_rect, screen_width - 15, 0, screen_width, screen_height);
294
296 test_window_rects(0, 1);
297 test_window_rects(0, 2);
298 test_window_rects(1, 2);
299
300 /* move windows[1] to the top of the screen */
301 windows[1].edge = ABE_TOP;
302 SetRect(&windows[1].desired_rect, 0, 0, screen_width, 15);
304
306 test_window_rects(0, 1);
307 test_window_rects(0, 2);
308 test_window_rects(1, 2);
309
310 /* move windows[1] back to the bottom of the screen */
311 windows[1].edge = ABE_BOTTOM;
312 SetRect(&windows[1].desired_rect, 0, screen_height - 10, screen_width, screen_height);
314
316 test_window_rects(0, 1);
317 test_window_rects(0, 2);
318 test_window_rects(1, 2);
319
320 /* removing windows[0] will cause windows[1] to move down into its space */
321 expected_bottom = max(windows[0].allocated_rect.bottom, windows[1].allocated_rect.bottom);
322 org_bottom1 = windows[1].allocated_rect.bottom;
323 ok(windows[0].allocated_rect.bottom > windows[1].allocated_rect.bottom,
324 "Expected windows[0] to be lower than windows[1]\n");
325
326 abd.hWnd = windows[0].hwnd;
327 windows[0].to_be_deleted = TRUE;
329 ok(ret == TRUE, "SHAppBarMessage returned %i\n", ret);
330 windows[0].registered = FALSE;
332
334
335 if (windows[1].allocated_rect.bottom == org_bottom1)
336 win_skip("Some broken Vista boxes don't move the higher appbar down\n");
337 else
338 ok(windows[1].allocated_rect.bottom == expected_bottom,
339 "windows[1]'s bottom is %i, expected %i\n",
340 windows[1].allocated_rect.bottom, expected_bottom);
341
342 test_window_rects(1, 2);
343
344 /* remove the other windows */
345 abd.hWnd = windows[1].hwnd;
346 windows[1].to_be_deleted = TRUE;
348 ok(ret == TRUE, "SHAppBarMessage returned %i\n", ret);
349 windows[1].registered = FALSE;
351
352 abd.hWnd = windows[2].hwnd;
353 windows[2].to_be_deleted = TRUE;
355 ok(ret == TRUE, "SHAppBarMessage returned %i\n", ret);
356 windows[2].registered = FALSE;
358}
static BOOL got_expected_bottom(void)
Definition: appbar.c:176
#define test_window_rects(a, b)
Definition: appbar.c:197
static void do_events(void)
Definition: appbar.c:148
#define MSG_APPBAR
Definition: appbar.c:27
static void do_events_until(boolean_function test)
Definition: appbar.c:122
static void testwindow_setpos(HWND hwnd)
Definition: appbar.c:50
__int3264 LONG_PTR
Definition: mstsclib_h.h:276
#define WS_POPUP
Definition: pedump.c:616
#define WS_VISIBLE
Definition: pedump.c:620
#define WS_EX_TOPMOST
Definition: pedump.c:647
#define ABE_RIGHT
Definition: shellapi.h:19
#define ABE_TOP
Definition: shellapi.h:18
#define ABM_REMOVE
Definition: shellapi.h:60
#define ABM_NEW
Definition: shellapi.h:59
UINT uCallbackMessage
Definition: shellapi.h:216
#define max(a, b)
Definition: svc.c:63
#define GWLP_USERDATA
Definition: treelist.c:63
#define SetWindowLongPtrA
Definition: winuser.h:5335
HWND WINAPI CreateWindowExA(_In_ DWORD dwExStyle, _In_opt_ LPCSTR lpClassName, _In_opt_ LPCSTR lpWindowName, _In_ DWORD dwStyle, _In_ int X, _In_ int Y, _In_ int nWidth, _In_ int nHeight, _In_opt_ HWND hWndParent, _In_opt_ HMENU hMenu, _In_opt_ HINSTANCE hInstance, _In_opt_ LPVOID lpParam)
#define SM_CYSCREEN
Definition: winuser.h:954
#define WS_EX_TOOLWINDOW
Definition: winuser.h:404
#define SM_CXSCREEN
Definition: winuser.h:953
BOOL WINAPI DestroyWindow(_In_ HWND)
int WINAPI GetSystemMetrics(_In_ int)
BOOL WINAPI SetRect(_Out_ LPRECT, _In_ int, _In_ int, _In_ int, _In_ int)

Referenced by START_TEST().

◆ testwindow_setpos()

static void testwindow_setpos ( HWND  hwnd)
static

Definition at line 50 of file appbar.c.

51{
53 APPBARDATA abd;
54 BOOL ret;
55
56 ok(info != NULL, "got unexpected ABN_POSCHANGED notification\n");
57
58 if (!info || !info->registered)
59 {
60 return;
61 }
62
63 if (info->to_be_deleted)
64 {
65 win_skip("Some Win95 and NT4 systems send messages to removed taskbars\n");
66 return;
67 }
68
69 abd.cbSize = sizeof(abd);
70 abd.hWnd = hwnd;
71 abd.uEdge = info->edge;
72 abd.rc = info->desired_rect;
74 ok(ret == TRUE, "SHAppBarMessage returned %i\n", ret);
75 switch (info->edge)
76 {
77 case ABE_BOTTOM:
78 ok(info->desired_rect.top == abd.rc.top, "ABM_QUERYPOS changed top of rect from %i to %i\n", info->desired_rect.top, abd.rc.top);
79 abd.rc.top = abd.rc.bottom - (info->desired_rect.bottom - info->desired_rect.top);
80 break;
81 case ABE_LEFT:
82 ok(info->desired_rect.right == abd.rc.right, "ABM_QUERYPOS changed right of rect from %i to %i\n", info->desired_rect.right, abd.rc.right);
83 abd.rc.right = abd.rc.left + (info->desired_rect.right - info->desired_rect.left);
84 break;
85 case ABE_RIGHT:
86 ok(info->desired_rect.left == abd.rc.left, "ABM_QUERYPOS changed left of rect from %i to %i\n", info->desired_rect.left, abd.rc.left);
87 abd.rc.left = abd.rc.right - (info->desired_rect.right - info->desired_rect.left);
88 break;
89 case ABE_TOP:
90 ok(info->desired_rect.bottom == abd.rc.bottom, "ABM_QUERYPOS changed bottom of rect from %i to %i\n", info->desired_rect.bottom, abd.rc.bottom);
91 abd.rc.bottom = abd.rc.top + (info->desired_rect.bottom - info->desired_rect.top);
92 break;
93 }
94
96 ok(ret == TRUE, "SHAppBarMessage returned %i\n", ret);
97
98 info->allocated_rect = abd.rc;
99 MoveWindow(hwnd, abd.rc.left, abd.rc.top, abd.rc.right-abd.rc.left, abd.rc.bottom-abd.rc.top, TRUE);
100}
#define ABM_SETPOS
Definition: shellapi.h:62
#define ABE_LEFT
Definition: shellapi.h:17
#define ABM_QUERYPOS
Definition: shellapi.h:61
LONG right
Definition: windef.h:308
LONG bottom
Definition: windef.h:309
LONG top
Definition: windef.h:307
#define GetWindowLongPtrA
Definition: winuser.h:4818
BOOL WINAPI MoveWindow(_In_ HWND, _In_ int, _In_ int, _In_ int, _In_ int, _In_ BOOL)

Referenced by test_setpos(), and testwindow_wndproc().

◆ testwindow_wndproc()

static LRESULT CALLBACK testwindow_wndproc ( HWND  hwnd,
UINT  msg,
WPARAM  wparam,
LPARAM  lparam 
)
static

Definition at line 102 of file appbar.c.

103{
104 switch(msg)
105 {
106 case MSG_APPBAR:
107 {
108 switch(wparam)
109 {
110 case ABN_POSCHANGED:
112 break;
113 }
114 return 0;
115 }
116 }
117
119}
static UINT WPARAM wparam
Definition: combo.c:716
static UINT WPARAM LPARAM lparam
Definition: combo.c:716
#define ABN_POSCHANGED
Definition: shellapi.h:70
LRESULT WINAPI DefWindowProcA(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)

Referenced by register_testwindow_class().

Variable Documentation

◆ DWORD

Definition at line 31 of file appbar.c.

◆ expected_bottom

int expected_bottom
static

Definition at line 48 of file appbar.c.

Referenced by got_expected_bottom(), and test_setpos().

◆ testwindow_class

const CHAR testwindow_class[] = "testwindow"
static

Definition at line 29 of file appbar.c.

Referenced by register_testwindow_class(), and test_setpos().

◆ windows