}
}
+static const struct
+{
+ const char name[9];
+ int value;
+ int badvalue;
+} extra_values[] =
+{
+ {"#32770",30,30}, /* Dialog */
+#ifdef _WIN64
+ {"Edit",8,8},
+#else
+ {"Edit",6,8}, /* Windows XP 64-bit returns 8 also to 32-bit applications */
+#endif
+};
+
+static void test_extra_values(void)
+{
+ int i;
+ for(i=0; i< sizeof(extra_values)/sizeof(extra_values[0]); i++)
+ {
+ WNDCLASSEX wcx;
+ BOOL ret = GetClassInfoEx(NULL,extra_values[i].name,&wcx);
+
+ ok( ret, "GetClassInfo (0) failed for global class %s\n", extra_values[i].name);
+ if (!ret) continue;
+ ok(extra_values[i].value == wcx.cbWndExtra || broken(extra_values[i].badvalue == wcx.cbWndExtra),
+ "expected %d, got %d\n", extra_values[i].value, wcx.cbWndExtra);
+ }
+}
+
START_TEST(class)
{
HANDLE hInstance = GetModuleHandleA( NULL );
+ test_extra_values();
+
if (!GetModuleHandleW(0))
{
trace("Class test is incompatible with Win9x implementation, skipping\n");
executed = TRUE;
- lparam = ReuseDDElParam(lparam, WM_DDE_EXECUTE, WM_DDE_ACK, DDE_FACK, HIWORD(lparam));
+ lparam = ReuseDDElParam(lparam, WM_DDE_EXECUTE, WM_DDE_ACK, DDE_FACK, lparam);
PostMessageA(client, WM_DDE_ACK, (WPARAM)hwnd, lparam);
break;
SetWindowPos( window, HWND_TOPMOST, 0, 0, 0, 0, SWP_NOSIZE|SWP_NOMOVE );
SetForegroundWindow( window );
- hook = SetWindowsHookExA(WH_KEYBOARD_LL, hook_proc, GetModuleHandleA( NULL ), 0);
+ if (!(hook = SetWindowsHookExA(WH_KEYBOARD_LL, hook_proc, GetModuleHandleA( NULL ), 0)))
+ {
+ DestroyWindow(window);
+ win_skip("WH_KEYBOARD_LL is not supported\n");
+ return;
+ }
/* must process all initial messages, otherwise X11DRV_KeymapNotify unsets
* key state set by SendInput(). */
hLB = create_listbox(LBS_OWNERDRAWFIXED | WS_CHILD | WS_VISIBLE, parent);
assert(hLB);
+ SetForegroundWindow(hLB);
UpdateWindow(hLB);
/* make height short enough */
static LRESULT WINAPI menu_ownerdraw_wnd_proc(HWND hwnd, UINT msg,
WPARAM wparam, LPARAM lparam)
{
+ static HMENU hmenupopup;
switch (msg)
{
case WM_INITMENUPOPUP:
gflag_initmenupopup++;
+ hmenupopup = (HMENU) wparam;
break;
case WM_ENTERMENULOOP:
gflag_entermenuloop++;
{
ok( lparam || broken(!lparam), /* win9x, nt4 */
"Menu window handle is NULL!\n");
+ if( lparam) {
+ HMENU hmenu = (HMENU)SendMessageA( (HWND)lparam, MN_GETHMENU, 0, 0);
+ ok( hmenupopup == hmenu, "MN_GETHMENU returns %p expected %p\n",
+ hmenu, hmenupopup);
+ }
PostMessage(hwnd, WM_CANCELMODE, 0, 0);
return TRUE;
}
{ WM_CONTEXTMENU, sent|lparam, /*hwnd*/0, (LPARAM)-1 },
{ 0 }
};
+static const struct message WmVkF10Seq[] = {
+ { HCBT_KEYSKIPPED, hook|wparam|lparam|optional, VK_F10, 1 }, /* XP */
+ { WM_SYSKEYDOWN, wparam|lparam, VK_F10, 1 },
+ { WM_SYSKEYDOWN, sent|wparam|lparam, VK_F10, 0x00000001 },
+ { HCBT_KEYSKIPPED, hook|wparam|lparam|optional, VK_F10, 0xc0000001 }, /* XP */
+ { WM_SYSKEYUP, wparam|lparam, VK_F10, 0xc0000001 },
+ { WM_SYSKEYUP, sent|wparam|lparam, VK_F10, 0xc0000001 },
+ { WM_SYSCOMMAND, sent|defwinproc|wparam, SC_KEYMENU },
+ { HCBT_SYSCOMMAND, hook },
+ { WM_ENTERMENULOOP, sent|defwinproc|wparam|lparam, 0, 0 },
+ { EVENT_SYSTEM_CAPTURESTART, winevent_hook|wparam|lparam, 0, 0 },
+ { WM_INITMENU, sent|defwinproc },
+ { EVENT_SYSTEM_MENUSTART, winevent_hook|wparam|lparam, OBJID_SYSMENU, 0 },
+ { WM_MENUSELECT, sent|defwinproc|wparam, MAKEWPARAM(0,MF_SYSMENU|MF_POPUP|MF_HILITE) },
+ { EVENT_OBJECT_FOCUS, winevent_hook|wparam|lparam, OBJID_SYSMENU, 1 },
+
+ { HCBT_KEYSKIPPED, hook|wparam|lparam|optional, VK_F10, 0x10000001 }, /* XP */
+
+ { HCBT_KEYSKIPPED, hook|wparam|lparam|optional, VK_F10, 1 }, /* XP */
+ { EVENT_OBJECT_FOCUS, winevent_hook|wparam|lparam, OBJID_SYSMENU, 0 },
+ { EVENT_SYSTEM_CAPTUREEND, winevent_hook|wparam|lparam, 0, 0, },
+ { WM_CAPTURECHANGED, sent|defwinproc },
+ { WM_MENUSELECT, sent|defwinproc|wparam|optional, MAKEWPARAM(0,0xffff) },
+ { EVENT_SYSTEM_MENUEND, winevent_hook|wparam|lparam, OBJID_SYSMENU, 0 },
+ { WM_EXITMENULOOP, sent|defwinproc },
+ { HCBT_KEYSKIPPED, hook|wparam|lparam|optional, VK_F10, 0xc0000001 }, /* XP */
+ { WM_SYSKEYUP, wparam|lparam, VK_F10, 0xc0000001 },
+ { WM_SYSKEYUP, sent|wparam|lparam, VK_F10, 0xc0000001 },
+ { 0 }
+};
static void pump_msg_loop(HWND hwnd, HACCEL hAccel)
{
pump_msg_loop(hwnd, 0);
ok_sequence(WmVkAppsSeq, "VK_APPS press/release", FALSE);
+ trace("testing VK_F10 press/release\n");
+ keybd_event(VK_F10, 0, 0, 0);
+ keybd_event(VK_F10, 0, KEYEVENTF_KEYUP, 0);
+ keybd_event(VK_F10, 0, 0, 0);
+ keybd_event(VK_F10, 0, KEYEVENTF_KEYUP, 0);
+ pump_msg_loop(hwnd, 0);
+ ok_sequence(WmVkF10Seq, "VK_F10 press/release", TRUE);
+
trace("testing Shift+MouseButton press/release\n");
/* first, move mouse pointer inside of the window client area */
GetClientRect(hwnd, &rc);
DestroyWindow( owner );
}
+static BOOL CALLBACK enum_proc( HWND hwnd, LPARAM lParam)
+{
+ (*(LPINT)lParam)++;
+ if (*(LPINT)lParam > 2) return FALSE;
+ return TRUE;
+}
+static DWORD CALLBACK enum_thread( void *arg )
+{
+ INT count;
+ HWND hwnd[3];
+ BOOL ret;
+ MSG msg;
+
+ PeekMessage( &msg, 0, 0, 0, PM_NOREMOVE ); /* make sure we have a message queue */
+
+ count = 0;
+ ret = EnumThreadWindows( GetCurrentThreadId(), enum_proc, (LPARAM)&count );
+ ok( ret, "EnumThreadWindows should have returned TRUE\n" );
+ ok( count == 0, "count should be 0 got %d\n", count );
+
+ hwnd[0] = CreateWindowExA(0, "ToolWindowClass", "Tool window 1", WS_POPUP,
+ 0, 0, 100, 100, 0, 0, 0, NULL );
+ count = 0;
+ ret = EnumThreadWindows( GetCurrentThreadId(), enum_proc, (LPARAM)&count );
+ ok( ret, "EnumThreadWindows should have returned TRUE\n" );
+ if (count != 2) /* Vista gives us two windows for the price of one */
+ {
+ ok( count == 1, "count should be 1 got %d\n", count );
+ hwnd[2] = CreateWindowExA(0, "ToolWindowClass", "Tool window 2", WS_POPUP,
+ 0, 0, 100, 100, 0, 0, 0, NULL );
+ }
+ else hwnd[2] = 0;
+
+ hwnd[1] = CreateWindowExA(0, "ToolWindowClass", "Tool window 3", WS_POPUP,
+ 0, 0, 100, 100, 0, 0, 0, NULL );
+ count = 0;
+ ret = EnumThreadWindows( GetCurrentThreadId(), enum_proc, (LPARAM)&count );
+ ok( !ret, "EnumThreadWindows should have returned FALSE\n" );
+ ok( count == 3, "count should be 3 got %d\n", count );
+
+ if (hwnd[2]) DestroyWindow(hwnd[2]);
+ DestroyWindow(hwnd[1]);
+ DestroyWindow(hwnd[0]);
+ return 0;
+}
+
+/* test EnumThreadWindows in a separate thread */
+static void test_enum_thread_windows(void)
+{
+ DWORD id;
+ HANDLE handle = CreateThread( NULL, 0, enum_thread, 0, 0, &id );
+ ok( !WaitForSingleObject( handle, 10000 ), "wait failed\n" );
+ CloseHandle( handle );
+}
static LRESULT WINAPI main_window_procA(HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam)
{
test_CreateWindow();
test_parent_owner();
test_SetParent();
+ test_enum_thread_windows();
test_mdi();
test_icons();