2003-10-02 04:32:56 +00:00
|
|
|
/*
|
|
|
|
* Unit tests for window message handling
|
|
|
|
*
|
|
|
|
* Copyright 1999 Ove Kaaven
|
|
|
|
* Copyright 2003 Dimitrie O. Paun
|
2004-03-25 23:35:52 +00:00
|
|
|
* Copyright 2004 Dmitry Timoshkov
|
2003-10-02 04:32:56 +00:00
|
|
|
*
|
|
|
|
* This library is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU Lesser General Public
|
|
|
|
* License as published by the Free Software Foundation; either
|
|
|
|
* version 2.1 of the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This library is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
* Lesser General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU Lesser General Public
|
|
|
|
* License along with this library; if not, write to the Free Software
|
|
|
|
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include <assert.h>
|
|
|
|
#include <stdarg.h>
|
2004-08-26 00:49:06 +00:00
|
|
|
#include <stdio.h>
|
2003-10-02 04:32:56 +00:00
|
|
|
|
2004-08-11 18:50:40 +00:00
|
|
|
#define _WIN32_WINNT 0x0500 /* For WM_CHANGEUISTATE */
|
|
|
|
|
2003-10-02 04:32:56 +00:00
|
|
|
#include "windef.h"
|
|
|
|
#include "winbase.h"
|
|
|
|
#include "wingdi.h"
|
|
|
|
#include "winuser.h"
|
|
|
|
|
|
|
|
#include "wine/test.h"
|
|
|
|
|
2004-06-30 18:16:08 +00:00
|
|
|
#define MDI_FIRST_CHILD_ID 2004
|
2003-10-02 04:32:56 +00:00
|
|
|
|
2004-09-13 18:03:09 +00:00
|
|
|
/* undocumented SWP flags - from SDK 3.1 */
|
|
|
|
#define SWP_NOCLIENTSIZE 0x0800
|
|
|
|
#define SWP_NOCLIENTMOVE 0x1000
|
|
|
|
|
2003-10-02 04:32:56 +00:00
|
|
|
/*
|
|
|
|
FIXME: add tests for these
|
|
|
|
Window Edge Styles (Win31/Win95/98 look), in order of precedence:
|
|
|
|
WS_EX_DLGMODALFRAME: double border, WS_CAPTION allowed
|
|
|
|
WS_THICKFRAME: thick border
|
|
|
|
WS_DLGFRAME: double border, WS_CAPTION not allowed (but possibly shown anyway)
|
|
|
|
WS_BORDER (default for overlapped windows): single black border
|
|
|
|
none (default for child (and popup?) windows): no border
|
|
|
|
*/
|
|
|
|
|
2004-08-26 00:49:06 +00:00
|
|
|
typedef enum {
|
|
|
|
sent=0x1,
|
|
|
|
posted=0x2,
|
|
|
|
parent=0x4,
|
|
|
|
wparam=0x8,
|
|
|
|
lparam=0x10,
|
|
|
|
defwinproc=0x20,
|
|
|
|
beginpaint=0x40,
|
|
|
|
optional=0x80,
|
|
|
|
hook=0x100
|
2003-10-02 04:32:56 +00:00
|
|
|
} msg_flags_t;
|
|
|
|
|
|
|
|
struct message {
|
|
|
|
UINT message; /* the WM_* code */
|
|
|
|
msg_flags_t flags; /* message props */
|
2004-03-25 23:35:52 +00:00
|
|
|
WPARAM wParam; /* expected value of wParam */
|
|
|
|
LPARAM lParam; /* expected value of lParam */
|
2003-10-02 04:32:56 +00:00
|
|
|
};
|
|
|
|
|
2004-07-09 19:25:26 +00:00
|
|
|
/* Empty message sequence */
|
|
|
|
static const struct message WmEmptySeq[] =
|
|
|
|
{
|
|
|
|
{ 0 }
|
|
|
|
};
|
2003-10-02 04:32:56 +00:00
|
|
|
/* CreateWindow (for overlapped window, not initially visible) (16/32) */
|
2004-03-25 23:35:52 +00:00
|
|
|
static const struct message WmCreateOverlappedSeq[] = {
|
2004-03-26 00:18:20 +00:00
|
|
|
{ HCBT_CREATEWND, hook },
|
2003-10-02 04:32:56 +00:00
|
|
|
{ WM_GETMINMAXINFO, sent },
|
|
|
|
{ WM_NCCREATE, sent },
|
|
|
|
{ WM_NCCALCSIZE, sent|wparam, 0 },
|
|
|
|
{ WM_CREATE, sent },
|
|
|
|
{ 0 }
|
|
|
|
};
|
2004-05-10 19:59:20 +00:00
|
|
|
/* SetWindowPos(SWP_SHOWWINDOW|SWP_NOSIZE|SWP_NOMOVE)
|
|
|
|
* for a not visible overlapped window.
|
|
|
|
*/
|
|
|
|
static const struct message WmSWP_ShowOverlappedSeq[] = {
|
2004-09-13 18:03:09 +00:00
|
|
|
{ WM_WINDOWPOSCHANGING, sent|wparam, SWP_SHOWWINDOW|SWP_NOSIZE|SWP_NOMOVE },
|
2004-05-10 19:59:20 +00:00
|
|
|
{ WM_NCPAINT, sent|wparam|optional, 1 },
|
|
|
|
{ WM_GETTEXT, sent|defwinproc|optional },
|
|
|
|
{ WM_ERASEBKGND, sent|optional },
|
|
|
|
{ HCBT_ACTIVATE, hook },
|
|
|
|
{ WM_QUERYNEWPALETTE, sent|wparam|lparam|optional, 0, 0 },
|
2004-09-13 18:03:09 +00:00
|
|
|
{ WM_WINDOWPOSCHANGING, sent|wparam|optional, SWP_NOSIZE|SWP_NOMOVE }, /* Win9x: SWP_NOSENDCHANGING */
|
2004-05-10 19:59:20 +00:00
|
|
|
{ WM_ACTIVATEAPP, sent|wparam, 1 },
|
|
|
|
{ WM_NCACTIVATE, sent|wparam, 1 },
|
2004-05-18 20:44:23 +00:00
|
|
|
{ WM_GETTEXT, sent|defwinproc|optional },
|
2004-05-10 19:59:20 +00:00
|
|
|
{ WM_ACTIVATE, sent|wparam, 1 },
|
|
|
|
{ HCBT_SETFOCUS, hook },
|
2004-05-20 01:17:28 +00:00
|
|
|
{ WM_IME_SETCONTEXT, sent|wparam|defwinproc|optional, 1 },
|
2004-09-08 22:02:23 +00:00
|
|
|
{ WM_IME_NOTIFY, sent|defwinproc|optional },
|
2004-05-10 19:59:20 +00:00
|
|
|
{ WM_SETFOCUS, sent|wparam|defwinproc, 0 },
|
|
|
|
{ WM_NCPAINT, sent|wparam|optional, 1 },
|
|
|
|
{ WM_GETTEXT, sent|defwinproc|optional },
|
|
|
|
{ WM_ERASEBKGND, sent|optional },
|
2004-09-13 18:03:09 +00:00
|
|
|
/* Win9x adds SWP_NOZORDER below */
|
|
|
|
{ WM_WINDOWPOSCHANGED, sent, /*|wparam, SWP_SHOWWINDOW|SWP_NOSIZE|SWP_NOMOVE|SWP_NOCLIENTSIZE|SWP_NOCLIENTMOVE*/ },
|
2004-05-18 20:44:23 +00:00
|
|
|
{ WM_NCCALCSIZE, sent|wparam|optional, 1 },
|
|
|
|
{ WM_NCPAINT, sent|wparam|optional, 1 },
|
|
|
|
{ WM_ERASEBKGND, sent|optional },
|
2004-05-10 19:59:20 +00:00
|
|
|
{ 0 }
|
|
|
|
};
|
|
|
|
/* SetWindowPos(SWP_HIDEWINDOW|SWP_NOSIZE|SWP_NOMOVE)
|
|
|
|
* for a visible overlapped window.
|
|
|
|
*/
|
|
|
|
static const struct message WmSWP_HideOverlappedSeq[] = {
|
2004-09-13 18:03:09 +00:00
|
|
|
{ WM_WINDOWPOSCHANGING, sent|wparam, SWP_HIDEWINDOW|SWP_NOSIZE|SWP_NOMOVE },
|
|
|
|
{ WM_WINDOWPOSCHANGED, sent|wparam, SWP_HIDEWINDOW|SWP_NOSIZE|SWP_NOMOVE|SWP_NOZORDER|SWP_NOCLIENTSIZE|SWP_NOCLIENTMOVE },
|
2004-05-10 19:59:20 +00:00
|
|
|
{ 0 }
|
|
|
|
};
|
|
|
|
/* ShowWindow(SW_SHOW) for a not visible overlapped window */
|
2004-03-25 23:35:52 +00:00
|
|
|
static const struct message WmShowOverlappedSeq[] = {
|
2003-10-02 04:32:56 +00:00
|
|
|
{ WM_SHOWWINDOW, sent|wparam, 1 },
|
2004-03-25 23:35:52 +00:00
|
|
|
{ WM_NCPAINT, sent|wparam|optional, 1 },
|
2004-09-13 18:03:09 +00:00
|
|
|
{ WM_WINDOWPOSCHANGING, sent|wparam, SWP_SHOWWINDOW|SWP_NOSIZE|SWP_NOMOVE },
|
2004-03-25 23:35:52 +00:00
|
|
|
{ WM_NCPAINT, sent|wparam|optional, 1 },
|
|
|
|
{ WM_GETTEXT, sent|defwinproc|optional },
|
|
|
|
{ WM_ERASEBKGND, sent|optional },
|
2004-03-26 00:18:20 +00:00
|
|
|
{ HCBT_ACTIVATE, hook },
|
2004-04-12 23:13:14 +00:00
|
|
|
{ WM_QUERYNEWPALETTE, sent|wparam|lparam|optional, 0, 0 },
|
2004-09-13 18:03:09 +00:00
|
|
|
{ WM_WINDOWPOSCHANGING, sent|wparam, SWP_NOSIZE|SWP_NOMOVE },
|
2003-10-02 04:32:56 +00:00
|
|
|
{ WM_ACTIVATEAPP, sent|wparam, 1 },
|
|
|
|
{ WM_NCACTIVATE, sent|wparam, 1 },
|
2004-05-05 22:01:49 +00:00
|
|
|
{ WM_GETTEXT, sent|defwinproc|optional },
|
2003-10-02 04:32:56 +00:00
|
|
|
{ WM_ACTIVATE, sent|wparam, 1 },
|
2004-03-26 00:18:20 +00:00
|
|
|
{ HCBT_SETFOCUS, hook },
|
2004-05-20 01:17:28 +00:00
|
|
|
{ WM_IME_SETCONTEXT, sent|wparam|defwinproc|optional, 1 },
|
2004-09-08 22:02:23 +00:00
|
|
|
{ WM_IME_NOTIFY, sent|defwinproc|optional },
|
2003-10-02 04:32:56 +00:00
|
|
|
{ WM_SETFOCUS, sent|wparam|defwinproc, 0 },
|
2004-03-25 23:35:52 +00:00
|
|
|
{ WM_NCPAINT, sent|wparam|optional, 1 },
|
|
|
|
{ WM_GETTEXT, sent|defwinproc|optional },
|
|
|
|
{ WM_ERASEBKGND, sent|optional },
|
2004-09-13 18:03:09 +00:00
|
|
|
/* Win9x adds SWP_NOZORDER below */
|
|
|
|
{ WM_WINDOWPOSCHANGED, sent, /*|wparam, SWP_SHOWWINDOW|SWP_NOSIZE|SWP_NOMOVE|SWP_NOCLIENTSIZE|SWP_NOCLIENTMOVE*/ },
|
2004-05-05 22:01:49 +00:00
|
|
|
{ WM_NCCALCSIZE, sent|optional },
|
|
|
|
{ WM_NCPAINT, sent|optional },
|
|
|
|
{ WM_ERASEBKGND, sent|optional },
|
2004-05-10 19:59:20 +00:00
|
|
|
#if 0 /* CreateWindow/ShowWindow(SW_SHOW) also generates WM_SIZE/WM_MOVE
|
|
|
|
* messages. Does that mean that CreateWindow doesn't set initial
|
|
|
|
* window dimensions for overlapped windows?
|
|
|
|
*/
|
|
|
|
{ WM_SIZE, sent },
|
|
|
|
{ WM_MOVE, sent },
|
|
|
|
#endif
|
|
|
|
{ 0 }
|
|
|
|
};
|
|
|
|
/* ShowWindow(SW_HIDE) for a visible overlapped window */
|
|
|
|
static const struct message WmHideOverlappedSeq[] = {
|
|
|
|
{ WM_SHOWWINDOW, sent|wparam, 0 },
|
2004-09-13 18:03:09 +00:00
|
|
|
{ WM_WINDOWPOSCHANGING, sent|wparam, SWP_HIDEWINDOW|SWP_NOSIZE|SWP_NOMOVE },
|
|
|
|
{ WM_WINDOWPOSCHANGED, sent|wparam, SWP_HIDEWINDOW|SWP_NOSIZE|SWP_NOMOVE|SWP_NOZORDER|SWP_NOCLIENTSIZE|SWP_NOCLIENTMOVE },
|
2003-10-02 04:32:56 +00:00
|
|
|
{ WM_SIZE, sent },
|
|
|
|
{ WM_MOVE, sent },
|
2004-05-10 19:59:20 +00:00
|
|
|
{ WM_NCACTIVATE, sent|wparam, 0 },
|
|
|
|
{ WM_ACTIVATE, sent|wparam, 0 },
|
|
|
|
{ WM_ACTIVATEAPP, sent|wparam, 0 },
|
|
|
|
{ WM_KILLFOCUS, sent|wparam, 0 },
|
2004-05-20 01:17:28 +00:00
|
|
|
{ WM_IME_SETCONTEXT, sent|wparam|optional, 0 },
|
2004-09-08 22:02:23 +00:00
|
|
|
{ WM_IME_NOTIFY, sent|optional|defwinproc },
|
2003-10-02 04:32:56 +00:00
|
|
|
{ 0 }
|
|
|
|
};
|
2004-06-03 23:26:35 +00:00
|
|
|
/* ShowWindow(SW_HIDE) for an invisible overlapped window */
|
|
|
|
static const struct message WmHideInvisibleOverlappedSeq[] = {
|
|
|
|
{ 0 }
|
|
|
|
};
|
2004-05-10 19:59:20 +00:00
|
|
|
/* DestroyWindow for a visible overlapped window */
|
2004-03-25 23:35:52 +00:00
|
|
|
static const struct message WmDestroyOverlappedSeq[] = {
|
2004-03-26 00:18:20 +00:00
|
|
|
{ HCBT_DESTROYWND, hook },
|
2004-09-13 18:03:09 +00:00
|
|
|
{ WM_WINDOWPOSCHANGING, sent|wparam, SWP_HIDEWINDOW|SWP_NOACTIVATE|SWP_NOSIZE|SWP_NOMOVE|SWP_NOZORDER },
|
|
|
|
{ WM_WINDOWPOSCHANGED, sent|wparam, SWP_HIDEWINDOW|SWP_NOACTIVATE|SWP_NOSIZE|SWP_NOMOVE|SWP_NOZORDER|SWP_NOCLIENTSIZE|SWP_NOCLIENTMOVE },
|
2003-10-02 04:32:56 +00:00
|
|
|
{ WM_NCACTIVATE, sent|wparam, 0 },
|
|
|
|
{ WM_ACTIVATE, sent|wparam, 0 },
|
|
|
|
{ WM_ACTIVATEAPP, sent|wparam, 0 },
|
|
|
|
{ WM_KILLFOCUS, sent|wparam, 0 },
|
2004-05-20 01:17:28 +00:00
|
|
|
{ WM_IME_SETCONTEXT, sent|wparam|optional, 0 },
|
2004-09-08 22:02:23 +00:00
|
|
|
{ WM_IME_NOTIFY, sent|optional|defwinproc },
|
2003-10-02 04:32:56 +00:00
|
|
|
{ WM_DESTROY, sent },
|
|
|
|
{ WM_NCDESTROY, sent },
|
|
|
|
{ 0 }
|
|
|
|
};
|
2004-04-02 20:22:53 +00:00
|
|
|
/* CreateWindow (for a child popup window, not initially visible) */
|
|
|
|
static const struct message WmCreateChildPopupSeq[] = {
|
|
|
|
{ HCBT_CREATEWND, hook },
|
|
|
|
{ WM_NCCREATE, sent },
|
|
|
|
{ WM_NCCALCSIZE, sent|wparam, 0 },
|
|
|
|
{ WM_CREATE, sent },
|
|
|
|
{ WM_SIZE, sent },
|
|
|
|
{ WM_MOVE, sent },
|
|
|
|
{ 0 }
|
|
|
|
};
|
|
|
|
/* CreateWindow (for a popup window, not initially visible,
|
|
|
|
* which sets WS_VISIBLE in WM_CREATE handler)
|
|
|
|
*/
|
|
|
|
static const struct message WmCreateInvisiblePopupSeq[] = {
|
|
|
|
{ HCBT_CREATEWND, hook },
|
|
|
|
{ WM_NCCREATE, sent },
|
|
|
|
{ WM_NCCALCSIZE, sent|wparam, 0 },
|
|
|
|
{ WM_CREATE, sent },
|
|
|
|
{ WM_STYLECHANGING, sent },
|
|
|
|
{ WM_STYLECHANGED, sent },
|
|
|
|
{ WM_SIZE, sent },
|
|
|
|
{ WM_MOVE, sent },
|
|
|
|
{ 0 }
|
|
|
|
};
|
|
|
|
/* SetWindowPos(SWP_SHOWWINDOW|SWP_NOSIZE|SWP_NOMOVE|SWP_NOACTIVATE|SWP_NOZORDER)
|
|
|
|
* for a popup window with WS_VISIBLE style set
|
|
|
|
*/
|
|
|
|
static const struct message WmShowVisiblePopupSeq_2[] = {
|
|
|
|
{ WM_WINDOWPOSCHANGING, sent|wparam, 0 },
|
|
|
|
{ 0 }
|
|
|
|
};
|
|
|
|
/* SetWindowPos(SWP_SHOWWINDOW|SWP_NOSIZE|SWP_NOMOVE)
|
|
|
|
* for a popup window with WS_VISIBLE style set
|
|
|
|
*/
|
|
|
|
static const struct message WmShowVisiblePopupSeq_3[] = {
|
|
|
|
{ WM_WINDOWPOSCHANGING, sent|wparam, 0 },
|
|
|
|
{ HCBT_ACTIVATE, hook },
|
2004-04-12 23:13:14 +00:00
|
|
|
{ WM_QUERYNEWPALETTE, sent|wparam|lparam|optional, 0, 0 },
|
2004-04-02 20:22:53 +00:00
|
|
|
{ WM_WINDOWPOSCHANGING, sent|wparam, 0 },
|
|
|
|
{ WM_NCACTIVATE, sent|wparam, 1 },
|
|
|
|
{ WM_ACTIVATE, sent|wparam, 1 },
|
|
|
|
{ HCBT_SETFOCUS, hook },
|
2004-04-20 04:02:50 +00:00
|
|
|
{ WM_KILLFOCUS, sent|parent },
|
2004-05-20 01:17:28 +00:00
|
|
|
{ WM_IME_SETCONTEXT, sent|parent|wparam|optional, 0 },
|
|
|
|
{ WM_IME_SETCONTEXT, sent|wparam|defwinproc|optional, 1 },
|
2004-09-08 22:02:23 +00:00
|
|
|
{ WM_IME_NOTIFY, sent|defwinproc|optional },
|
2004-04-02 20:22:53 +00:00
|
|
|
{ WM_SETFOCUS, sent|defwinproc },
|
|
|
|
{ 0 }
|
|
|
|
};
|
2003-10-02 04:32:56 +00:00
|
|
|
/* CreateWindow (for child window, not initially visible) */
|
2004-03-25 23:35:52 +00:00
|
|
|
static const struct message WmCreateChildSeq[] = {
|
2004-03-26 00:18:20 +00:00
|
|
|
{ HCBT_CREATEWND, hook },
|
2003-10-02 04:32:56 +00:00
|
|
|
{ WM_NCCREATE, sent },
|
|
|
|
/* child is inserted into parent's child list after WM_NCCREATE returns */
|
|
|
|
{ WM_NCCALCSIZE, sent|wparam, 0 },
|
|
|
|
{ WM_CREATE, sent },
|
|
|
|
{ WM_SIZE, sent },
|
|
|
|
{ WM_MOVE, sent },
|
2004-04-30 04:15:13 +00:00
|
|
|
{ WM_PARENTNOTIFY, sent|parent|wparam, WM_CREATE },
|
2003-10-02 04:32:56 +00:00
|
|
|
{ 0 }
|
|
|
|
};
|
2004-04-29 20:00:40 +00:00
|
|
|
/* CreateWindow (for maximized child window, not initially visible) */
|
|
|
|
static const struct message WmCreateMaximizedChildSeq[] = {
|
|
|
|
{ HCBT_CREATEWND, hook },
|
|
|
|
{ WM_NCCREATE, sent },
|
|
|
|
{ WM_NCCALCSIZE, sent|wparam, 0 },
|
|
|
|
{ WM_CREATE, sent },
|
|
|
|
{ WM_SIZE, sent },
|
|
|
|
{ WM_MOVE, sent },
|
|
|
|
{ HCBT_MINMAX, hook|lparam, 0, SW_MAXIMIZE },
|
|
|
|
{ WM_GETMINMAXINFO, sent },
|
2004-09-13 18:03:09 +00:00
|
|
|
{ WM_WINDOWPOSCHANGING, sent|wparam, SWP_FRAMECHANGED|SWP_NOACTIVATE|0x8000 },
|
2004-06-30 18:16:08 +00:00
|
|
|
{ WM_NCCALCSIZE, sent|wparam, 1 },
|
2004-09-13 18:03:09 +00:00
|
|
|
{ WM_WINDOWPOSCHANGED, sent|wparam, SWP_FRAMECHANGED|SWP_NOACTIVATE|SWP_NOMOVE|SWP_NOZORDER|SWP_NOREDRAW|SWP_NOCLIENTMOVE|0x8000 },
|
2004-04-29 20:00:40 +00:00
|
|
|
{ WM_SIZE, sent|defwinproc },
|
2004-04-30 04:15:13 +00:00
|
|
|
{ WM_PARENTNOTIFY, sent|parent|wparam, WM_CREATE },
|
2004-04-29 20:00:40 +00:00
|
|
|
{ 0 }
|
|
|
|
};
|
2004-06-18 19:33:55 +00:00
|
|
|
/* CreateWindow (for a child window, initially visible) */
|
|
|
|
static const struct message WmCreateVisibleChildSeq[] = {
|
|
|
|
{ HCBT_CREATEWND, hook },
|
|
|
|
{ WM_NCCREATE, sent },
|
|
|
|
/* child is inserted into parent's child list after WM_NCCREATE returns */
|
|
|
|
{ WM_NCCALCSIZE, sent|wparam, 0 },
|
|
|
|
{ WM_CREATE, sent },
|
|
|
|
{ WM_SIZE, sent },
|
|
|
|
{ WM_MOVE, sent },
|
|
|
|
{ WM_PARENTNOTIFY, sent|parent|wparam, WM_CREATE },
|
|
|
|
{ WM_SHOWWINDOW, sent|wparam, 1 },
|
2004-09-13 18:03:09 +00:00
|
|
|
{ WM_WINDOWPOSCHANGING, sent|wparam, SWP_SHOWWINDOW|SWP_NOSIZE|SWP_NOMOVE|SWP_NOACTIVATE|SWP_NOZORDER },
|
2004-06-18 19:33:55 +00:00
|
|
|
{ WM_ERASEBKGND, sent|parent|optional },
|
2004-09-13 18:03:09 +00:00
|
|
|
{ WM_WINDOWPOSCHANGED, sent|wparam, SWP_SHOWWINDOW|SWP_NOSIZE|SWP_NOMOVE|SWP_NOACTIVATE|SWP_NOZORDER|SWP_NOCLIENTSIZE|SWP_NOCLIENTMOVE },
|
2004-06-18 19:33:55 +00:00
|
|
|
{ 0 }
|
|
|
|
};
|
2004-05-10 19:59:20 +00:00
|
|
|
/* ShowWindow(SW_SHOW) for a not visible child window */
|
2004-03-25 23:35:52 +00:00
|
|
|
static const struct message WmShowChildSeq[] = {
|
2003-10-02 04:32:56 +00:00
|
|
|
{ WM_SHOWWINDOW, sent|wparam, 1 },
|
2004-09-13 18:03:09 +00:00
|
|
|
{ WM_WINDOWPOSCHANGING, sent|wparam, SWP_SHOWWINDOW|SWP_NOACTIVATE|SWP_NOSIZE|SWP_NOMOVE|SWP_NOZORDER },
|
2004-03-25 23:35:52 +00:00
|
|
|
{ WM_ERASEBKGND, sent|parent|optional },
|
2004-09-13 18:03:09 +00:00
|
|
|
{ WM_WINDOWPOSCHANGED, sent|wparam, SWP_SHOWWINDOW|SWP_NOACTIVATE|SWP_NOSIZE|SWP_NOMOVE|SWP_NOZORDER|SWP_NOCLIENTSIZE|SWP_NOCLIENTMOVE },
|
|
|
|
{ 0 }
|
|
|
|
};
|
|
|
|
/* ShowWindow(SW_HIDE) for a visible child window */
|
|
|
|
static const struct message WmHideChildSeq[] = {
|
|
|
|
{ WM_SHOWWINDOW, sent|wparam, 0 },
|
|
|
|
{ WM_WINDOWPOSCHANGING, sent|wparam, SWP_HIDEWINDOW|SWP_NOACTIVATE|SWP_NOSIZE|SWP_NOMOVE|SWP_NOZORDER },
|
|
|
|
{ WM_ERASEBKGND, sent|parent|optional },
|
|
|
|
{ WM_WINDOWPOSCHANGED, sent|wparam, SWP_HIDEWINDOW|SWP_NOACTIVATE|SWP_NOSIZE|SWP_NOMOVE|SWP_NOZORDER|SWP_NOCLIENTSIZE|SWP_NOCLIENTMOVE },
|
2003-10-02 04:32:56 +00:00
|
|
|
{ 0 }
|
|
|
|
};
|
2004-06-18 19:33:55 +00:00
|
|
|
/* SetWindowPos(SWP_SHOWWINDOW|SWP_NOSIZE|SWP_NOMOVE)
|
|
|
|
* for a not visible child window
|
|
|
|
*/
|
|
|
|
static const struct message WmShowChildSeq_2[] = {
|
2004-09-13 18:03:09 +00:00
|
|
|
{ WM_WINDOWPOSCHANGING, sent|wparam, SWP_SHOWWINDOW|SWP_NOSIZE|SWP_NOMOVE },
|
2004-06-18 19:33:55 +00:00
|
|
|
{ WM_CHILDACTIVATE, sent },
|
2004-09-13 18:03:09 +00:00
|
|
|
{ WM_WINDOWPOSCHANGED, sent|wparam, SWP_SHOWWINDOW|SWP_NOSIZE|SWP_NOMOVE|SWP_NOZORDER|SWP_NOCLIENTSIZE|SWP_NOCLIENTMOVE },
|
2004-06-18 19:33:55 +00:00
|
|
|
{ 0 }
|
|
|
|
};
|
|
|
|
/* SetWindowPos(SWP_SHOWWINDOW|SWP_NOSIZE|SWP_NOMOVE|SWP_NOACTIVATE)
|
|
|
|
* for a not visible child window
|
|
|
|
*/
|
|
|
|
static const struct message WmShowChildSeq_3[] = {
|
2004-09-13 18:03:09 +00:00
|
|
|
{ WM_WINDOWPOSCHANGING, sent|wparam, SWP_SHOWWINDOW|SWP_NOSIZE|SWP_NOMOVE|SWP_NOACTIVATE },
|
|
|
|
{ WM_WINDOWPOSCHANGED, sent|wparam, SWP_SHOWWINDOW|SWP_NOSIZE|SWP_NOMOVE|SWP_NOACTIVATE|SWP_NOZORDER|SWP_NOCLIENTSIZE|SWP_NOCLIENTMOVE },
|
2004-06-18 19:33:55 +00:00
|
|
|
{ 0 }
|
|
|
|
};
|
2004-09-21 00:24:22 +00:00
|
|
|
/* SetWindowPos(SWP_SHOWWINDOW|SWP_NOSIZE|SWP_NOMOVE)
|
|
|
|
* for a visible child window with a caption
|
|
|
|
*/
|
|
|
|
static const struct message WmShowChildSeq_4[] = {
|
|
|
|
{ WM_WINDOWPOSCHANGING, sent|wparam, SWP_SHOWWINDOW|SWP_NOSIZE|SWP_NOMOVE },
|
|
|
|
{ WM_CHILDACTIVATE, sent },
|
|
|
|
{ 0 }
|
|
|
|
};
|
2004-09-08 22:02:23 +00:00
|
|
|
/* ShowWindow(SW_SHOW) for child with invisible parent */
|
|
|
|
static const struct message WmShowChildInvisibleParentSeq[] = {
|
|
|
|
{ WM_SHOWWINDOW, sent|wparam, 1 },
|
|
|
|
{ 0 }
|
|
|
|
};
|
|
|
|
/* ShowWindow(SW_HIDE) for child with invisible parent */
|
|
|
|
static const struct message WmHideChildInvisibleParentSeq[] = {
|
|
|
|
{ WM_SHOWWINDOW, sent|wparam, 0 },
|
|
|
|
{ 0 }
|
|
|
|
};
|
|
|
|
/* SetWindowPos(SWP_SHOWWINDOW) for child with invisible parent */
|
|
|
|
static const struct message WmShowChildInvisibleParentSeq_2[] = {
|
2004-09-13 18:03:09 +00:00
|
|
|
{ WM_WINDOWPOSCHANGING, sent|wparam, SWP_SHOWWINDOW|SWP_NOSIZE|SWP_NOMOVE|SWP_NOACTIVATE|SWP_NOZORDER },
|
|
|
|
{ WM_WINDOWPOSCHANGED, sent|wparam, SWP_SHOWWINDOW|SWP_NOSIZE|SWP_NOMOVE|SWP_NOACTIVATE|SWP_NOZORDER|SWP_NOREDRAW|SWP_NOCLIENTSIZE|SWP_NOCLIENTMOVE },
|
2004-09-08 22:02:23 +00:00
|
|
|
{ 0 }
|
|
|
|
};
|
|
|
|
/* SetWindowPos(SWP_HIDEWINDOW) for child with invisible parent */
|
|
|
|
static const struct message WmHideChildInvisibleParentSeq_2[] = {
|
2004-09-13 18:03:09 +00:00
|
|
|
{ WM_WINDOWPOSCHANGING, sent|wparam, SWP_HIDEWINDOW|SWP_NOACTIVATE|SWP_NOSIZE|SWP_NOMOVE|SWP_NOZORDER },
|
|
|
|
{ WM_WINDOWPOSCHANGED, sent|wparam, SWP_HIDEWINDOW|SWP_NOACTIVATE|SWP_NOSIZE|SWP_NOMOVE|SWP_NOZORDER|SWP_NOREDRAW|SWP_NOCLIENTSIZE|SWP_NOCLIENTMOVE },
|
2004-09-08 22:02:23 +00:00
|
|
|
{ 0 }
|
|
|
|
};
|
2004-05-10 19:59:20 +00:00
|
|
|
/* DestroyWindow for a visible child window */
|
2004-03-25 23:35:52 +00:00
|
|
|
static const struct message WmDestroyChildSeq[] = {
|
2004-03-26 00:18:20 +00:00
|
|
|
{ HCBT_DESTROYWND, hook },
|
2004-04-30 04:15:13 +00:00
|
|
|
{ WM_PARENTNOTIFY, sent|parent|wparam, WM_DESTROY },
|
2003-10-02 04:32:56 +00:00
|
|
|
{ WM_SHOWWINDOW, sent|wparam, 0 },
|
2004-09-13 18:03:09 +00:00
|
|
|
{ WM_WINDOWPOSCHANGING, sent|wparam, SWP_HIDEWINDOW|SWP_NOACTIVATE|SWP_NOSIZE|SWP_NOMOVE|SWP_NOZORDER },
|
2004-03-25 23:35:52 +00:00
|
|
|
{ WM_ERASEBKGND, sent|parent|optional },
|
2004-09-13 18:03:09 +00:00
|
|
|
{ WM_WINDOWPOSCHANGED, sent|wparam, SWP_HIDEWINDOW|SWP_NOACTIVATE|SWP_NOSIZE|SWP_NOMOVE|SWP_NOZORDER|SWP_NOCLIENTSIZE|SWP_NOCLIENTMOVE },
|
2004-03-26 01:06:15 +00:00
|
|
|
{ HCBT_SETFOCUS, hook }, /* set focus to a parent */
|
|
|
|
{ WM_KILLFOCUS, sent },
|
2004-05-20 01:17:28 +00:00
|
|
|
{ WM_IME_SETCONTEXT, sent|wparam|optional, 0 },
|
|
|
|
{ WM_IME_SETCONTEXT, sent|wparam|parent|optional, 1 },
|
|
|
|
{ WM_SETFOCUS, sent|parent },
|
2003-10-02 04:32:56 +00:00
|
|
|
{ WM_DESTROY, sent },
|
2004-03-25 23:35:52 +00:00
|
|
|
{ WM_DESTROY, sent|optional }, /* a bug in win2k sp4 ? */
|
2003-10-02 04:32:56 +00:00
|
|
|
{ WM_NCDESTROY, sent },
|
2004-03-25 23:35:52 +00:00
|
|
|
{ WM_NCDESTROY, sent|optional }, /* a bug in win2k sp4 ? */
|
2003-10-02 04:32:56 +00:00
|
|
|
{ 0 }
|
|
|
|
};
|
|
|
|
/* Moving the mouse in nonclient area */
|
2004-03-25 23:35:52 +00:00
|
|
|
static const struct message WmMouseMoveInNonClientAreaSeq[] = { /* FIXME: add */
|
2003-10-02 04:32:56 +00:00
|
|
|
{ WM_NCHITTEST, sent },
|
|
|
|
{ WM_SETCURSOR, sent },
|
|
|
|
{ WM_NCMOUSEMOVE, posted },
|
|
|
|
{ 0 }
|
|
|
|
};
|
|
|
|
/* Moving the mouse in client area */
|
2004-03-25 23:35:52 +00:00
|
|
|
static const struct message WmMouseMoveInClientAreaSeq[] = { /* FIXME: add */
|
2003-10-02 04:32:56 +00:00
|
|
|
{ WM_NCHITTEST, sent },
|
|
|
|
{ WM_SETCURSOR, sent },
|
|
|
|
{ WM_MOUSEMOVE, posted },
|
|
|
|
{ 0 }
|
|
|
|
};
|
|
|
|
/* Moving by dragging the title bar (after WM_NCHITTEST and WM_SETCURSOR) (outline move) */
|
2004-03-25 23:35:52 +00:00
|
|
|
static const struct message WmDragTitleBarSeq[] = { /* FIXME: add */
|
2003-10-02 04:32:56 +00:00
|
|
|
{ WM_NCLBUTTONDOWN, sent|wparam, HTCAPTION },
|
|
|
|
{ WM_SYSCOMMAND, sent|defwinproc|wparam, SC_MOVE+2 },
|
|
|
|
{ WM_GETMINMAXINFO, sent|defwinproc },
|
|
|
|
{ WM_ENTERSIZEMOVE, sent|defwinproc },
|
2004-09-13 18:03:09 +00:00
|
|
|
{ WM_WINDOWPOSCHANGING, sent|wparam|defwinproc, 0 },
|
|
|
|
{ WM_WINDOWPOSCHANGED, sent|wparam|defwinproc, 0 },
|
2003-10-02 04:32:56 +00:00
|
|
|
{ WM_MOVE, sent|defwinproc },
|
|
|
|
{ WM_EXITSIZEMOVE, sent|defwinproc },
|
|
|
|
{ 0 }
|
|
|
|
};
|
|
|
|
/* Sizing by dragging the thick borders (after WM_NCHITTEST and WM_SETCURSOR) (outline move) */
|
2004-03-26 01:06:15 +00:00
|
|
|
static const struct message WmDragThickBordersBarSeq[] = { /* FIXME: add */
|
2003-10-02 04:32:56 +00:00
|
|
|
{ WM_NCLBUTTONDOWN, sent|wparam, 0xd },
|
|
|
|
{ WM_SYSCOMMAND, sent|defwinproc|wparam, 0xf004 },
|
|
|
|
{ WM_GETMINMAXINFO, sent|defwinproc },
|
|
|
|
{ WM_ENTERSIZEMOVE, sent|defwinproc },
|
|
|
|
{ WM_SIZING, sent|defwinproc|wparam, 4}, /* one for each mouse movement */
|
2004-09-13 18:03:09 +00:00
|
|
|
{ WM_WINDOWPOSCHANGING, sent|wparam|defwinproc, 0 },
|
2003-10-02 04:32:56 +00:00
|
|
|
{ WM_GETMINMAXINFO, sent|defwinproc },
|
|
|
|
{ WM_NCCALCSIZE, sent|defwinproc|wparam, 1 },
|
|
|
|
{ WM_NCPAINT, sent|defwinproc|wparam, 1 },
|
|
|
|
{ WM_GETTEXT, sent|defwinproc },
|
|
|
|
{ WM_ERASEBKGND, sent|defwinproc },
|
2004-09-13 18:03:09 +00:00
|
|
|
{ WM_WINDOWPOSCHANGED, sent|wparam|defwinproc, 0 },
|
2003-10-02 04:32:56 +00:00
|
|
|
{ WM_MOVE, sent|defwinproc },
|
|
|
|
{ WM_SIZE, sent|defwinproc },
|
|
|
|
{ WM_EXITSIZEMOVE, sent|defwinproc },
|
|
|
|
{ 0 }
|
|
|
|
};
|
|
|
|
/* Resizing child window with MoveWindow (32) */
|
2004-03-25 23:35:52 +00:00
|
|
|
static const struct message WmResizingChildWithMoveWindowSeq[] = {
|
2004-09-13 18:03:09 +00:00
|
|
|
{ WM_WINDOWPOSCHANGING, sent|wparam, SWP_NOACTIVATE|SWP_NOZORDER },
|
2003-10-02 04:32:56 +00:00
|
|
|
{ WM_NCCALCSIZE, sent|wparam, 1 },
|
2004-03-25 23:35:52 +00:00
|
|
|
{ WM_ERASEBKGND, sent|optional },
|
2004-09-13 18:03:09 +00:00
|
|
|
{ WM_WINDOWPOSCHANGED, sent|wparam, SWP_NOACTIVATE|SWP_NOZORDER },
|
2003-10-02 04:32:56 +00:00
|
|
|
{ WM_MOVE, sent|defwinproc },
|
|
|
|
{ WM_SIZE, sent|defwinproc },
|
|
|
|
{ 0 }
|
|
|
|
};
|
|
|
|
/* Clicking on inactive button */
|
2004-03-25 23:35:52 +00:00
|
|
|
static const struct message WmClickInactiveButtonSeq[] = { /* FIXME: add */
|
2003-10-02 04:32:56 +00:00
|
|
|
{ WM_NCHITTEST, sent },
|
|
|
|
{ WM_PARENTNOTIFY, sent|parent|wparam, WM_LBUTTONDOWN },
|
|
|
|
{ WM_MOUSEACTIVATE, sent },
|
|
|
|
{ WM_MOUSEACTIVATE, sent|parent|defwinproc },
|
|
|
|
{ WM_SETCURSOR, sent },
|
|
|
|
{ WM_SETCURSOR, sent|parent|defwinproc },
|
|
|
|
{ WM_LBUTTONDOWN, posted },
|
|
|
|
{ WM_KILLFOCUS, posted|parent },
|
|
|
|
{ WM_SETFOCUS, posted },
|
|
|
|
{ WM_CTLCOLORBTN, posted|parent },
|
|
|
|
{ BM_SETSTATE, posted },
|
|
|
|
{ WM_CTLCOLORBTN, posted|parent },
|
|
|
|
{ WM_LBUTTONUP, posted },
|
|
|
|
{ BM_SETSTATE, posted },
|
|
|
|
{ WM_CTLCOLORBTN, posted|parent },
|
|
|
|
{ WM_COMMAND, posted|parent },
|
|
|
|
{ 0 }
|
|
|
|
};
|
|
|
|
/* Reparenting a button (16/32) */
|
|
|
|
/* The last child (button) reparented gets topmost for its new parent. */
|
2004-03-25 23:35:52 +00:00
|
|
|
static const struct message WmReparentButtonSeq[] = { /* FIXME: add */
|
2003-10-02 04:32:56 +00:00
|
|
|
{ WM_SHOWWINDOW, sent|wparam, 0 },
|
|
|
|
{ WM_WINDOWPOSCHANGING, sent|wparam, SWP_HIDEWINDOW|SWP_NOACTIVATE|SWP_NOMOVE|SWP_NOSIZE|SWP_NOZORDER },
|
|
|
|
{ WM_ERASEBKGND, sent|parent },
|
|
|
|
{ WM_WINDOWPOSCHANGED, sent|wparam, SWP_HIDEWINDOW|SWP_NOACTIVATE|SWP_NOMOVE|SWP_NOSIZE|SWP_NOZORDER },
|
|
|
|
{ WM_WINDOWPOSCHANGING, sent|wparam, SWP_NOSIZE|SWP_NOZORDER },
|
|
|
|
{ WM_CHILDACTIVATE, sent },
|
|
|
|
{ WM_WINDOWPOSCHANGED, sent|wparam, SWP_NOSIZE|SWP_NOREDRAW|SWP_NOZORDER },
|
|
|
|
{ WM_MOVE, sent|defwinproc },
|
|
|
|
{ WM_SHOWWINDOW, sent|wparam, 1 },
|
|
|
|
{ 0 }
|
|
|
|
};
|
2004-04-20 04:02:50 +00:00
|
|
|
/* Creation of a custom dialog (32) */
|
|
|
|
static const struct message WmCreateCustomDialogSeq[] = {
|
|
|
|
{ HCBT_CREATEWND, hook },
|
|
|
|
{ WM_GETMINMAXINFO, sent },
|
|
|
|
{ WM_NCCREATE, sent },
|
|
|
|
{ WM_NCCALCSIZE, sent|wparam, 0 },
|
|
|
|
{ WM_CREATE, sent },
|
|
|
|
{ WM_SHOWWINDOW, sent|wparam, 1 },
|
|
|
|
{ HCBT_ACTIVATE, hook },
|
|
|
|
{ WM_QUERYNEWPALETTE, sent|wparam|lparam|optional, 0, 0 },
|
|
|
|
{ WM_WINDOWPOSCHANGING, sent|wparam, 0 },
|
|
|
|
{ WM_NCACTIVATE, sent|wparam, 1 },
|
2004-05-18 20:44:23 +00:00
|
|
|
{ WM_GETTEXT, sent|optional|defwinproc },
|
|
|
|
{ WM_GETICON, sent|optional|defwinproc },
|
|
|
|
{ WM_GETICON, sent|optional|defwinproc },
|
|
|
|
{ WM_GETICON, sent|optional|defwinproc },
|
|
|
|
{ WM_GETTEXT, sent|optional|defwinproc },
|
2004-04-20 04:02:50 +00:00
|
|
|
{ WM_ACTIVATE, sent|wparam, 1 },
|
|
|
|
{ WM_KILLFOCUS, sent|parent },
|
2004-05-20 01:17:28 +00:00
|
|
|
{ WM_IME_SETCONTEXT, sent|parent|wparam|optional, 0 },
|
|
|
|
{ WM_IME_SETCONTEXT, sent|wparam|optional, 1 },
|
2004-09-08 22:02:23 +00:00
|
|
|
{ WM_IME_NOTIFY, sent|optional|defwinproc },
|
2004-04-20 04:02:50 +00:00
|
|
|
{ WM_SETFOCUS, sent },
|
|
|
|
{ WM_GETDLGCODE, sent|defwinproc|wparam, 0 },
|
|
|
|
{ WM_WINDOWPOSCHANGING, sent|wparam, 0 },
|
|
|
|
{ WM_NCPAINT, sent|wparam, 1 },
|
2004-05-18 20:44:23 +00:00
|
|
|
{ WM_GETTEXT, sent|optional|defwinproc },
|
|
|
|
{ WM_GETICON, sent|optional|defwinproc },
|
|
|
|
{ WM_GETICON, sent|optional|defwinproc },
|
|
|
|
{ WM_GETICON, sent|optional|defwinproc },
|
|
|
|
{ WM_GETTEXT, sent|optional|defwinproc },
|
2004-04-20 04:02:50 +00:00
|
|
|
{ WM_ERASEBKGND, sent },
|
|
|
|
{ WM_CTLCOLORDLG, sent|defwinproc },
|
|
|
|
{ WM_WINDOWPOSCHANGED, sent|wparam, 0 },
|
2004-05-18 20:44:23 +00:00
|
|
|
{ WM_GETTEXT, sent|optional },
|
|
|
|
{ WM_GETICON, sent|optional },
|
|
|
|
{ WM_GETICON, sent|optional },
|
|
|
|
{ WM_GETICON, sent|optional },
|
|
|
|
{ WM_GETTEXT, sent|optional },
|
|
|
|
{ WM_NCCALCSIZE, sent|optional },
|
|
|
|
{ WM_NCPAINT, sent|optional },
|
|
|
|
{ WM_GETTEXT, sent|optional|defwinproc },
|
|
|
|
{ WM_GETICON, sent|optional|defwinproc },
|
|
|
|
{ WM_GETICON, sent|optional|defwinproc },
|
|
|
|
{ WM_GETICON, sent|optional|defwinproc },
|
|
|
|
{ WM_GETTEXT, sent|optional|defwinproc },
|
|
|
|
{ WM_ERASEBKGND, sent|optional },
|
|
|
|
{ WM_CTLCOLORDLG, sent|optional|defwinproc },
|
2004-04-20 04:02:50 +00:00
|
|
|
{ WM_SIZE, sent },
|
|
|
|
{ WM_MOVE, sent },
|
|
|
|
{ 0 }
|
|
|
|
};
|
2004-05-18 20:44:23 +00:00
|
|
|
/* Calling EndDialog for a custom dialog (32) */
|
|
|
|
static const struct message WmEndCustomDialogSeq[] = {
|
2004-09-13 18:03:09 +00:00
|
|
|
{ WM_WINDOWPOSCHANGING, sent|wparam, 0 },
|
|
|
|
{ WM_WINDOWPOSCHANGED, sent|wparam, 0 },
|
2004-05-18 20:44:23 +00:00
|
|
|
{ WM_GETTEXT, sent|optional },
|
|
|
|
{ WM_GETICON, sent|optional },
|
|
|
|
{ WM_GETICON, sent|optional },
|
|
|
|
{ WM_GETICON, sent|optional },
|
|
|
|
{ HCBT_ACTIVATE, hook },
|
|
|
|
{ WM_NCACTIVATE, sent|wparam, 0 },
|
|
|
|
{ WM_GETTEXT, sent|optional|defwinproc },
|
|
|
|
{ WM_GETICON, sent|optional|defwinproc },
|
|
|
|
{ WM_GETICON, sent|optional|defwinproc },
|
|
|
|
{ WM_GETICON, sent|optional|defwinproc },
|
|
|
|
{ WM_GETTEXT, sent|optional|defwinproc },
|
|
|
|
{ WM_ACTIVATE, sent|wparam, 0 },
|
2004-09-13 18:03:09 +00:00
|
|
|
{ WM_WINDOWPOSCHANGING, sent|wparam|optional, 0 },
|
2004-05-18 20:44:23 +00:00
|
|
|
{ HCBT_SETFOCUS, hook },
|
|
|
|
{ WM_KILLFOCUS, sent },
|
2004-05-20 01:17:28 +00:00
|
|
|
{ WM_IME_SETCONTEXT, sent|wparam|optional, 0 },
|
|
|
|
{ WM_IME_SETCONTEXT, sent|parent|wparam|defwinproc|optional, 1 },
|
2004-09-08 22:02:23 +00:00
|
|
|
{ WM_IME_NOTIFY, sent|optional },
|
2004-05-20 01:17:28 +00:00
|
|
|
{ WM_SETFOCUS, sent|parent|defwinproc },
|
2004-05-18 20:44:23 +00:00
|
|
|
{ 0 }
|
|
|
|
};
|
|
|
|
/* Creation and destruction of a modal dialog (32) */
|
|
|
|
static const struct message WmModalDialogSeq[] = {
|
2003-10-02 04:32:56 +00:00
|
|
|
{ WM_CANCELMODE, sent|parent },
|
2004-08-09 23:38:40 +00:00
|
|
|
{ HCBT_SETFOCUS, hook },
|
2003-10-02 04:32:56 +00:00
|
|
|
{ WM_KILLFOCUS, sent|parent },
|
2004-05-20 01:17:28 +00:00
|
|
|
{ WM_IME_SETCONTEXT, sent|parent|wparam|optional, 0 },
|
2003-10-02 04:32:56 +00:00
|
|
|
{ WM_ENABLE, sent|parent|wparam, 0 },
|
2004-06-01 19:39:26 +00:00
|
|
|
{ HCBT_CREATEWND, hook },
|
2003-10-02 04:32:56 +00:00
|
|
|
{ WM_SETFONT, sent },
|
|
|
|
{ WM_INITDIALOG, sent },
|
2004-05-18 20:44:23 +00:00
|
|
|
{ WM_CHANGEUISTATE, sent|optional },
|
|
|
|
{ WM_SHOWWINDOW, sent },
|
2004-06-01 19:39:26 +00:00
|
|
|
{ HCBT_ACTIVATE, hook },
|
2004-09-13 18:03:09 +00:00
|
|
|
{ WM_WINDOWPOSCHANGING, sent|wparam, 0 },
|
2003-10-02 04:32:56 +00:00
|
|
|
{ WM_NCACTIVATE, sent|wparam, 1 },
|
2004-05-18 20:44:23 +00:00
|
|
|
{ WM_GETICON, sent|optional },
|
|
|
|
{ WM_GETICON, sent|optional },
|
|
|
|
{ WM_GETICON, sent|optional },
|
|
|
|
{ WM_GETTEXT, sent|optional },
|
2003-10-02 04:32:56 +00:00
|
|
|
{ WM_ACTIVATE, sent|wparam, 1 },
|
2004-09-13 18:03:09 +00:00
|
|
|
{ WM_WINDOWPOSCHANGING, sent|wparam, 0 },
|
2003-10-02 04:32:56 +00:00
|
|
|
{ WM_NCPAINT, sent },
|
2004-05-18 20:44:23 +00:00
|
|
|
{ WM_GETICON, sent|optional },
|
|
|
|
{ WM_GETICON, sent|optional },
|
|
|
|
{ WM_GETICON, sent|optional },
|
|
|
|
{ WM_GETTEXT, sent|optional },
|
2003-10-02 04:32:56 +00:00
|
|
|
{ WM_ERASEBKGND, sent },
|
2004-05-18 20:44:23 +00:00
|
|
|
{ WM_CTLCOLORDLG, sent },
|
2004-09-13 18:03:09 +00:00
|
|
|
{ WM_WINDOWPOSCHANGED, sent|wparam, 0 },
|
2004-05-18 20:44:23 +00:00
|
|
|
{ WM_GETICON, sent|optional },
|
|
|
|
{ WM_GETICON, sent|optional },
|
|
|
|
{ WM_GETICON, sent|optional },
|
|
|
|
{ WM_GETTEXT, sent|optional },
|
2004-05-20 01:17:28 +00:00
|
|
|
{ WM_NCCALCSIZE, sent|optional },
|
|
|
|
{ WM_NCPAINT, sent|optional },
|
2004-05-18 20:44:23 +00:00
|
|
|
{ WM_GETICON, sent|optional },
|
|
|
|
{ WM_GETICON, sent|optional },
|
|
|
|
{ WM_GETICON, sent|optional },
|
|
|
|
{ WM_GETTEXT, sent|optional },
|
2004-05-20 01:17:28 +00:00
|
|
|
{ WM_ERASEBKGND, sent|optional },
|
|
|
|
{ WM_CTLCOLORDLG, sent|optional },
|
|
|
|
{ WM_PAINT, sent|optional },
|
2004-05-18 20:44:23 +00:00
|
|
|
{ WM_CTLCOLORBTN, sent },
|
2004-09-08 22:02:23 +00:00
|
|
|
{ WM_ENTERIDLE, sent|parent|optional },
|
2004-05-18 20:44:23 +00:00
|
|
|
{ WM_TIMER, sent },
|
2003-10-02 04:32:56 +00:00
|
|
|
{ WM_ENABLE, sent|parent|wparam, 1 },
|
2004-09-13 18:03:09 +00:00
|
|
|
{ WM_WINDOWPOSCHANGING, sent|wparam, 0 },
|
|
|
|
{ WM_WINDOWPOSCHANGED, sent|wparam, 0 },
|
2004-05-18 20:44:23 +00:00
|
|
|
{ WM_GETICON, sent|optional },
|
|
|
|
{ WM_GETICON, sent|optional },
|
|
|
|
{ WM_GETICON, sent|optional },
|
|
|
|
{ WM_GETTEXT, sent|optional },
|
|
|
|
{ HCBT_ACTIVATE, hook },
|
2003-10-02 04:32:56 +00:00
|
|
|
{ WM_NCACTIVATE, sent|wparam, 0 },
|
2004-05-18 20:44:23 +00:00
|
|
|
{ WM_GETICON, sent|optional },
|
|
|
|
{ WM_GETICON, sent|optional },
|
|
|
|
{ WM_GETICON, sent|optional },
|
|
|
|
{ WM_GETTEXT, sent|optional },
|
2003-10-02 04:32:56 +00:00
|
|
|
{ WM_ACTIVATE, sent|wparam, 0 },
|
2004-05-18 20:44:23 +00:00
|
|
|
{ WM_WINDOWPOSCHANGING, sent|optional },
|
|
|
|
{ HCBT_SETFOCUS, hook },
|
2004-05-20 01:17:28 +00:00
|
|
|
{ WM_IME_SETCONTEXT, sent|parent|wparam|defwinproc|optional, 1 },
|
|
|
|
{ WM_SETFOCUS, sent|parent|defwinproc },
|
2004-06-01 19:39:26 +00:00
|
|
|
{ HCBT_DESTROYWND, hook },
|
2003-10-02 04:32:56 +00:00
|
|
|
{ WM_DESTROY, sent },
|
|
|
|
{ WM_NCDESTROY, sent },
|
|
|
|
{ 0 }
|
|
|
|
};
|
|
|
|
/* Creation of a modal dialog that is resized inside WM_INITDIALOG (32) */
|
2004-03-25 23:35:52 +00:00
|
|
|
static const struct message WmCreateModalDialogResizeSeq[] = { /* FIXME: add */
|
2003-10-02 04:32:56 +00:00
|
|
|
/* (inside dialog proc, handling WM_INITDIALOG) */
|
2004-09-13 18:03:09 +00:00
|
|
|
{ WM_WINDOWPOSCHANGING, sent|wparam, 0 },
|
2003-10-02 04:32:56 +00:00
|
|
|
{ WM_NCCALCSIZE, sent },
|
|
|
|
{ WM_NCACTIVATE, sent|parent|wparam, 0 },
|
|
|
|
{ WM_GETTEXT, sent|defwinproc },
|
|
|
|
{ WM_ACTIVATE, sent|parent|wparam, 0 },
|
2004-09-13 18:03:09 +00:00
|
|
|
{ WM_WINDOWPOSCHANGING, sent|wparam, 0 },
|
2003-10-02 04:32:56 +00:00
|
|
|
{ WM_WINDOWPOSCHANGING, sent|parent },
|
|
|
|
{ WM_NCACTIVATE, sent|wparam, 1 },
|
|
|
|
{ WM_ACTIVATE, sent|wparam, 1 },
|
2004-09-13 18:03:09 +00:00
|
|
|
{ WM_WINDOWPOSCHANGED, sent|wparam, 0 },
|
2003-10-02 04:32:56 +00:00
|
|
|
{ WM_SIZE, sent|defwinproc },
|
|
|
|
/* (setting focus) */
|
|
|
|
{ WM_SHOWWINDOW, sent|wparam, 1 },
|
2004-09-13 18:03:09 +00:00
|
|
|
{ WM_WINDOWPOSCHANGING, sent|wparam, 0 },
|
2003-10-02 04:32:56 +00:00
|
|
|
{ WM_NCPAINT, sent },
|
|
|
|
{ WM_GETTEXT, sent|defwinproc },
|
|
|
|
{ WM_ERASEBKGND, sent },
|
|
|
|
{ WM_CTLCOLORDLG, sent|defwinproc },
|
2004-09-13 18:03:09 +00:00
|
|
|
{ WM_WINDOWPOSCHANGED, sent|wparam, 0 },
|
2003-10-02 04:32:56 +00:00
|
|
|
{ WM_PAINT, sent },
|
|
|
|
/* (bunch of WM_CTLCOLOR* for each control) */
|
|
|
|
{ WM_PAINT, sent|parent },
|
|
|
|
{ WM_ENTERIDLE, sent|parent|wparam, 0 },
|
|
|
|
{ WM_SETCURSOR, sent|parent },
|
|
|
|
{ 0 }
|
|
|
|
};
|
2004-02-17 20:29:05 +00:00
|
|
|
/* SetMenu for NonVisible windows with size change*/
|
2004-03-25 23:35:52 +00:00
|
|
|
static const struct message WmSetMenuNonVisibleSizeChangeSeq[] = {
|
2004-09-13 18:03:09 +00:00
|
|
|
{ WM_WINDOWPOSCHANGING, sent|wparam, SWP_FRAMECHANGED|SWP_NOACTIVATE|SWP_NOSIZE|SWP_NOMOVE|SWP_NOZORDER },
|
2004-02-17 20:29:05 +00:00
|
|
|
{ WM_NCCALCSIZE, sent|wparam, 1 },
|
2004-09-13 18:03:09 +00:00
|
|
|
{ WM_WINDOWPOSCHANGED, sent|wparam, SWP_FRAMECHANGED|SWP_NOACTIVATE|SWP_NOSIZE|SWP_NOMOVE|SWP_NOZORDER|SWP_NOREDRAW },
|
2004-04-06 20:09:59 +00:00
|
|
|
{ WM_MOVE, sent|defwinproc },
|
|
|
|
{ WM_SIZE, sent|defwinproc },
|
2004-05-18 20:44:23 +00:00
|
|
|
{ WM_GETICON, sent|optional },
|
|
|
|
{ WM_GETICON, sent|optional },
|
|
|
|
{ WM_GETICON, sent|optional },
|
|
|
|
{ WM_GETTEXT, sent|optional },
|
|
|
|
{ WM_NCCALCSIZE, sent|wparam|optional, 1 },
|
2004-02-17 20:29:05 +00:00
|
|
|
{ 0 }
|
|
|
|
};
|
|
|
|
/* SetMenu for NonVisible windows with no size change */
|
2004-03-25 23:35:52 +00:00
|
|
|
static const struct message WmSetMenuNonVisibleNoSizeChangeSeq[] = {
|
2004-09-13 18:03:09 +00:00
|
|
|
{ WM_WINDOWPOSCHANGING, sent|wparam, SWP_FRAMECHANGED|SWP_NOACTIVATE|SWP_NOSIZE|SWP_NOMOVE|SWP_NOZORDER },
|
2004-02-17 20:29:05 +00:00
|
|
|
{ WM_NCCALCSIZE, sent|wparam, 1 },
|
2004-09-13 18:03:09 +00:00
|
|
|
{ WM_WINDOWPOSCHANGED, sent|wparam, SWP_FRAMECHANGED|SWP_NOACTIVATE|SWP_NOSIZE|SWP_NOMOVE|SWP_NOZORDER|SWP_NOREDRAW|SWP_NOCLIENTSIZE|SWP_NOCLIENTMOVE },
|
2004-02-17 20:29:05 +00:00
|
|
|
{ 0 }
|
|
|
|
};
|
|
|
|
/* SetMenu for Visible windows with size change */
|
2004-03-25 23:35:52 +00:00
|
|
|
static const struct message WmSetMenuVisibleSizeChangeSeq[] = {
|
2004-09-13 18:03:09 +00:00
|
|
|
{ WM_WINDOWPOSCHANGING, sent|wparam, SWP_FRAMECHANGED|SWP_NOACTIVATE|SWP_NOSIZE|SWP_NOMOVE|SWP_NOZORDER },
|
2004-02-17 20:29:05 +00:00
|
|
|
{ WM_NCCALCSIZE, sent|wparam, 1 },
|
|
|
|
{ WM_NCPAINT, sent|wparam, 1 },
|
2004-05-18 20:44:23 +00:00
|
|
|
{ WM_GETTEXT, sent|defwinproc|optional },
|
2004-03-25 23:35:52 +00:00
|
|
|
{ WM_ERASEBKGND, sent|optional },
|
|
|
|
{ WM_ACTIVATE, sent|optional },
|
2004-09-13 18:03:09 +00:00
|
|
|
{ WM_WINDOWPOSCHANGED, sent|wparam, SWP_FRAMECHANGED|SWP_NOACTIVATE|SWP_NOSIZE|SWP_NOMOVE|SWP_NOZORDER },
|
2004-04-06 20:09:59 +00:00
|
|
|
{ WM_MOVE, sent|defwinproc },
|
|
|
|
{ WM_SIZE, sent|defwinproc },
|
2004-05-18 20:44:23 +00:00
|
|
|
{ WM_NCCALCSIZE, sent|wparam|optional, 1 },
|
|
|
|
{ WM_NCPAINT, sent|wparam|optional, 1 },
|
|
|
|
{ WM_ERASEBKGND, sent|optional },
|
2004-02-17 20:29:05 +00:00
|
|
|
{ 0 }
|
|
|
|
};
|
|
|
|
/* SetMenu for Visible windows with no size change */
|
2004-03-25 23:35:52 +00:00
|
|
|
static const struct message WmSetMenuVisibleNoSizeChangeSeq[] = {
|
2004-09-13 18:03:09 +00:00
|
|
|
{ WM_WINDOWPOSCHANGING, sent|wparam, SWP_FRAMECHANGED|SWP_NOACTIVATE|SWP_NOSIZE|SWP_NOMOVE|SWP_NOZORDER },
|
2004-02-17 20:29:05 +00:00
|
|
|
{ WM_NCCALCSIZE, sent|wparam, 1 },
|
|
|
|
{ WM_NCPAINT, sent|wparam, 1 },
|
2004-05-18 20:44:23 +00:00
|
|
|
{ WM_GETTEXT, sent|defwinproc|optional },
|
2004-03-25 23:35:52 +00:00
|
|
|
{ WM_ERASEBKGND, sent|optional },
|
|
|
|
{ WM_ACTIVATE, sent|optional },
|
2004-09-13 18:03:09 +00:00
|
|
|
{ WM_WINDOWPOSCHANGED, sent|wparam, SWP_FRAMECHANGED|SWP_NOACTIVATE|SWP_NOSIZE|SWP_NOMOVE|SWP_NOZORDER|SWP_NOCLIENTSIZE|SWP_NOCLIENTMOVE },
|
2004-02-17 20:29:05 +00:00
|
|
|
{ 0 }
|
|
|
|
};
|
2004-05-24 19:08:54 +00:00
|
|
|
/* DrawMenuBar for a visible window */
|
|
|
|
static const struct message WmDrawMenuBarSeq[] =
|
|
|
|
{
|
2004-09-13 18:03:09 +00:00
|
|
|
{ WM_WINDOWPOSCHANGING, sent|wparam, SWP_FRAMECHANGED|SWP_NOACTIVATE|SWP_NOSIZE|SWP_NOMOVE|SWP_NOZORDER },
|
2004-05-24 19:08:54 +00:00
|
|
|
{ WM_NCCALCSIZE, sent|wparam, 1 },
|
|
|
|
{ WM_NCPAINT, sent|wparam, 1 },
|
|
|
|
{ WM_GETTEXT, sent|defwinproc|optional },
|
|
|
|
{ WM_ERASEBKGND, sent|optional },
|
2004-09-13 18:03:09 +00:00
|
|
|
{ WM_WINDOWPOSCHANGED, sent|wparam, SWP_FRAMECHANGED|SWP_NOACTIVATE|SWP_NOSIZE|SWP_NOMOVE|SWP_NOZORDER|SWP_NOCLIENTSIZE|SWP_NOCLIENTMOVE },
|
2004-05-24 19:08:54 +00:00
|
|
|
{ 0 }
|
|
|
|
};
|
2003-10-02 04:32:56 +00:00
|
|
|
|
2004-04-08 19:07:06 +00:00
|
|
|
static const struct message WmSetRedrawFalseSeq[] =
|
|
|
|
{
|
|
|
|
{ WM_SETREDRAW, sent|wparam, 0 },
|
|
|
|
{ 0 }
|
|
|
|
};
|
|
|
|
|
|
|
|
static const struct message WmSetRedrawTrueSeq[] =
|
|
|
|
{
|
|
|
|
{ WM_SETREDRAW, sent|wparam, 1 },
|
|
|
|
{ 0 }
|
|
|
|
};
|
|
|
|
|
2004-06-03 00:08:55 +00:00
|
|
|
static const struct message WmEnableWindowSeq[] =
|
|
|
|
{
|
|
|
|
{ WM_CANCELMODE, sent },
|
|
|
|
{ WM_ENABLE, sent },
|
|
|
|
{ 0 }
|
|
|
|
};
|
|
|
|
|
2004-07-09 19:25:26 +00:00
|
|
|
static const struct message WmGetScrollRangeSeq[] =
|
|
|
|
{
|
|
|
|
{ SBM_GETRANGE, sent },
|
|
|
|
{ 0 }
|
|
|
|
};
|
|
|
|
static const struct message WmGetScrollInfoSeq[] =
|
|
|
|
{
|
|
|
|
{ SBM_GETSCROLLINFO, sent },
|
|
|
|
{ 0 }
|
|
|
|
};
|
|
|
|
static const struct message WmSetScrollRangeSeq[] =
|
|
|
|
{
|
|
|
|
/* MSDN claims that Windows sends SBM_SETRANGE message, but win2k SP4
|
|
|
|
sends SBM_SETSCROLLINFO.
|
|
|
|
*/
|
|
|
|
{ SBM_SETSCROLLINFO, sent },
|
|
|
|
{ 0 }
|
|
|
|
};
|
|
|
|
/* SetScrollRange for a window without a non-client area */
|
|
|
|
static const struct message WmSetScrollRangeHVSeq[] =
|
|
|
|
{
|
2004-09-13 18:03:09 +00:00
|
|
|
{ WM_WINDOWPOSCHANGING, sent|wparam, SWP_FRAMECHANGED|SWP_NOACTIVATE|SWP_NOMOVE|SWP_NOSIZE|SWP_NOZORDER },
|
2004-07-09 19:25:26 +00:00
|
|
|
{ WM_NCCALCSIZE, sent|wparam, 1 },
|
|
|
|
{ WM_GETTEXT, sent|defwinproc|optional },
|
|
|
|
{ WM_ERASEBKGND, sent|optional },
|
2004-09-13 18:03:09 +00:00
|
|
|
{ WM_WINDOWPOSCHANGED, sent|wparam, SWP_FRAMECHANGED|SWP_NOACTIVATE|SWP_NOMOVE|SWP_NOSIZE|SWP_NOZORDER|SWP_NOCLIENTSIZE|SWP_NOCLIENTMOVE },
|
2004-07-09 19:25:26 +00:00
|
|
|
{ 0 }
|
|
|
|
};
|
|
|
|
/* SetScrollRange for a window with a non-client area */
|
|
|
|
static const struct message WmSetScrollRangeHV_NC_Seq[] =
|
|
|
|
{
|
2004-09-13 18:03:09 +00:00
|
|
|
{ WM_WINDOWPOSCHANGING, sent, /*|wparam, SWP_FRAMECHANGED|SWP_NOACTIVATE|SWP_NOMOVE|SWP_NOSIZE|SWP_NOZORDER*/ },
|
2004-07-09 19:25:26 +00:00
|
|
|
{ WM_NCCALCSIZE, sent|wparam, 1 },
|
|
|
|
{ WM_NCPAINT, sent|optional },
|
|
|
|
{ WM_GETTEXT, sent|defwinproc|optional },
|
2004-09-08 22:02:23 +00:00
|
|
|
{ WM_GETICON, sent|optional|defwinproc },
|
|
|
|
{ WM_GETICON, sent|optional|defwinproc },
|
|
|
|
{ WM_GETICON, sent|optional|defwinproc },
|
|
|
|
{ WM_GETTEXT, sent|defwinproc|optional },
|
2004-07-09 19:25:26 +00:00
|
|
|
{ WM_ERASEBKGND, sent|optional },
|
|
|
|
{ WM_CTLCOLORDLG, sent|defwinproc|optional }, /* sent to a parent of the dialog */
|
2004-09-13 18:03:09 +00:00
|
|
|
{ WM_WINDOWPOSCHANGED, sent, /*|wparam, SWP_FRAMECHANGED|SWP_NOACTIVATE|SWP_NOMOVE|SWP_NOSIZE|SWP_NOZORDER|0x1000*/ },
|
2004-07-09 19:25:26 +00:00
|
|
|
{ WM_SIZE, sent|defwinproc },
|
2004-09-08 22:02:23 +00:00
|
|
|
{ WM_GETTEXT, sent|optional },
|
|
|
|
{ WM_GETICON, sent|optional },
|
|
|
|
{ WM_GETICON, sent|optional },
|
|
|
|
{ WM_GETICON, sent|optional },
|
|
|
|
{ WM_GETTEXT, sent|optional },
|
|
|
|
{ WM_GETICON, sent|optional },
|
|
|
|
{ WM_GETICON, sent|optional },
|
|
|
|
{ WM_GETICON, sent|optional },
|
|
|
|
{ WM_GETTEXT, sent|optional },
|
|
|
|
{ WM_GETICON, sent|optional },
|
|
|
|
{ WM_GETICON, sent|optional },
|
|
|
|
{ WM_GETICON, sent|optional },
|
|
|
|
{ WM_GETTEXT, sent|optional },
|
2004-07-09 19:25:26 +00:00
|
|
|
{ 0 }
|
|
|
|
};
|
|
|
|
|
2004-05-18 20:44:23 +00:00
|
|
|
static int after_end_dialog;
|
2003-10-02 04:32:56 +00:00
|
|
|
static int sequence_cnt, sequence_size;
|
|
|
|
static struct message* sequence;
|
|
|
|
|
2004-03-25 23:35:52 +00:00
|
|
|
static void add_message(const struct message *msg)
|
2003-10-02 04:32:56 +00:00
|
|
|
{
|
|
|
|
if (!sequence)
|
2004-03-25 23:35:52 +00:00
|
|
|
{
|
|
|
|
sequence_size = 10;
|
2004-03-27 20:41:43 +00:00
|
|
|
sequence = HeapAlloc( GetProcessHeap(), 0, sequence_size * sizeof (struct message) );
|
2004-03-25 23:35:52 +00:00
|
|
|
}
|
2003-10-02 04:32:56 +00:00
|
|
|
if (sequence_cnt == sequence_size)
|
2004-03-25 23:35:52 +00:00
|
|
|
{
|
|
|
|
sequence_size *= 2;
|
2004-03-27 20:41:43 +00:00
|
|
|
sequence = HeapReAlloc( GetProcessHeap(), 0, sequence, sequence_size * sizeof (struct message) );
|
2004-03-25 23:35:52 +00:00
|
|
|
}
|
2003-10-02 04:32:56 +00:00
|
|
|
assert(sequence);
|
2004-03-25 23:35:52 +00:00
|
|
|
|
|
|
|
sequence[sequence_cnt].message = msg->message;
|
|
|
|
sequence[sequence_cnt].flags = msg->flags;
|
|
|
|
sequence[sequence_cnt].wParam = msg->wParam;
|
|
|
|
sequence[sequence_cnt].lParam = msg->lParam;
|
|
|
|
|
|
|
|
sequence_cnt++;
|
2003-10-02 04:32:56 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static void flush_sequence()
|
|
|
|
{
|
2004-03-27 20:41:43 +00:00
|
|
|
HeapFree(GetProcessHeap(), 0, sequence);
|
2003-10-02 04:32:56 +00:00
|
|
|
sequence = 0;
|
|
|
|
sequence_cnt = sequence_size = 0;
|
|
|
|
}
|
|
|
|
|
2004-08-25 17:35:06 +00:00
|
|
|
static void ok_sequence(const struct message *expected, const char *context, int todo)
|
2003-10-02 04:32:56 +00:00
|
|
|
{
|
2004-03-25 23:35:52 +00:00
|
|
|
static const struct message end_of_sequence = { 0, 0, 0, 0 };
|
2004-03-27 20:41:43 +00:00
|
|
|
const struct message *actual;
|
2003-10-02 04:32:56 +00:00
|
|
|
|
2004-03-25 23:35:52 +00:00
|
|
|
add_message(&end_of_sequence);
|
2003-10-02 04:32:56 +00:00
|
|
|
|
2004-03-27 20:41:43 +00:00
|
|
|
actual = sequence;
|
|
|
|
|
2004-03-25 23:35:52 +00:00
|
|
|
while (expected->message && actual->message)
|
2003-10-02 04:32:56 +00:00
|
|
|
{
|
2004-03-25 23:35:52 +00:00
|
|
|
trace("expected %04x - actual %04x\n", expected->message, actual->message);
|
|
|
|
|
2003-10-02 04:32:56 +00:00
|
|
|
if (expected->message == actual->message)
|
|
|
|
{
|
|
|
|
if (expected->flags & wparam)
|
2004-09-13 18:03:09 +00:00
|
|
|
{
|
|
|
|
if (expected->wParam != actual->wParam && todo)
|
|
|
|
{
|
|
|
|
todo_wine {
|
|
|
|
ok (FALSE,
|
|
|
|
"%s: in msg 0x%04x expecting wParam 0x%x got 0x%x\n",
|
|
|
|
context, expected->message, expected->wParam, actual->wParam);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
ok (expected->wParam == actual->wParam,
|
2003-10-02 04:32:56 +00:00
|
|
|
"%s: in msg 0x%04x expecting wParam 0x%x got 0x%x\n",
|
|
|
|
context, expected->message, expected->wParam, actual->wParam);
|
2004-09-13 18:03:09 +00:00
|
|
|
}
|
2003-10-02 04:32:56 +00:00
|
|
|
if (expected->flags & lparam)
|
|
|
|
ok (expected->lParam == actual->lParam,
|
|
|
|
"%s: in msg 0x%04x expecting lParam 0x%lx got 0x%lx\n",
|
|
|
|
context, expected->message, expected->lParam, actual->lParam);
|
2004-04-06 20:09:59 +00:00
|
|
|
ok ((expected->flags & defwinproc) == (actual->flags & defwinproc),
|
|
|
|
"%s: the msg 0x%04x should %shave been sent by DefWindowProc\n",
|
|
|
|
context, expected->message, (expected->flags & defwinproc) ? "" : "NOT ");
|
2004-08-26 00:49:06 +00:00
|
|
|
ok ((expected->flags & beginpaint) == (actual->flags & beginpaint),
|
|
|
|
"%s: the msg 0x%04x should %shave been sent by BeginPaint\n",
|
|
|
|
context, expected->message, (expected->flags & beginpaint) ? "" : "NOT ");
|
2003-10-02 04:32:56 +00:00
|
|
|
ok ((expected->flags & (sent|posted)) == (actual->flags & (sent|posted)),
|
|
|
|
"%s: the msg 0x%04x should have been %s\n",
|
|
|
|
context, expected->message, (expected->flags & posted) ? "posted" : "sent");
|
|
|
|
ok ((expected->flags & parent) == (actual->flags & parent),
|
|
|
|
"%s: the msg 0x%04x was expected in %s\n",
|
|
|
|
context, expected->message, (expected->flags & parent) ? "parent" : "child");
|
2004-03-26 00:18:20 +00:00
|
|
|
ok ((expected->flags & hook) == (actual->flags & hook),
|
2004-03-27 20:41:43 +00:00
|
|
|
"%s: the msg 0x%04x should have been sent by a hook\n",
|
2004-03-26 00:18:20 +00:00
|
|
|
context, expected->message);
|
2003-10-02 04:32:56 +00:00
|
|
|
expected++;
|
|
|
|
actual++;
|
|
|
|
}
|
2004-03-25 23:35:52 +00:00
|
|
|
else if (expected->flags & optional)
|
2003-10-02 04:32:56 +00:00
|
|
|
expected++;
|
2004-08-25 17:35:06 +00:00
|
|
|
else if (todo)
|
2003-10-02 04:32:56 +00:00
|
|
|
{
|
2004-08-25 17:35:06 +00:00
|
|
|
todo_wine {
|
|
|
|
ok (FALSE, "%s: the msg 0x%04x was expected, but got msg 0x%04x instead\n",
|
|
|
|
context, expected->message, actual->message);
|
|
|
|
}
|
2004-09-14 00:46:03 +00:00
|
|
|
flush_sequence();
|
|
|
|
return;
|
2004-08-25 17:35:06 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
ok (FALSE, "%s: the msg 0x%04x was expected, but got msg 0x%04x instead\n",
|
|
|
|
context, expected->message, actual->message);
|
|
|
|
expected++;
|
|
|
|
actual++;
|
|
|
|
}
|
2003-10-02 04:32:56 +00:00
|
|
|
}
|
|
|
|
|
2004-05-10 19:59:20 +00:00
|
|
|
/* skip all optional trailing messages */
|
|
|
|
while (expected->message && (expected->flags & optional))
|
|
|
|
expected++;
|
|
|
|
|
2004-08-25 17:35:06 +00:00
|
|
|
if (todo)
|
|
|
|
{
|
|
|
|
todo_wine {
|
|
|
|
if (expected->message || actual->message)
|
|
|
|
ok (FALSE, "%s: the msg sequence is not complete: expected %04x - actual %04x\n",
|
|
|
|
context, expected->message, actual->message);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
if (expected->message || actual->message)
|
|
|
|
ok (FALSE, "%s: the msg sequence is not complete: expected %04x - actual %04x\n",
|
|
|
|
context, expected->message, actual->message);
|
|
|
|
}
|
2004-03-25 23:35:52 +00:00
|
|
|
|
2003-10-02 04:32:56 +00:00
|
|
|
flush_sequence();
|
|
|
|
}
|
|
|
|
|
2004-06-23 20:51:21 +00:00
|
|
|
/******************************** MDI test **********************************/
|
|
|
|
|
|
|
|
/* CreateWindow for MDI frame window, initially visible */
|
|
|
|
static const struct message WmCreateMDIframeSeq[] = {
|
|
|
|
{ HCBT_CREATEWND, hook },
|
|
|
|
{ WM_GETMINMAXINFO, sent },
|
|
|
|
{ WM_NCCREATE, sent },
|
|
|
|
{ WM_NCCALCSIZE, sent|wparam, 0 },
|
|
|
|
{ WM_CREATE, sent },
|
|
|
|
{ WM_SHOWWINDOW, sent|wparam, 1 },
|
2004-09-13 18:03:09 +00:00
|
|
|
{ WM_WINDOWPOSCHANGING, sent|wparam, SWP_SHOWWINDOW|SWP_NOSIZE|SWP_NOMOVE },
|
2004-06-23 20:51:21 +00:00
|
|
|
{ HCBT_ACTIVATE, hook },
|
|
|
|
{ WM_QUERYNEWPALETTE, sent|wparam|lparam|optional, 0, 0 },
|
2004-09-13 18:03:09 +00:00
|
|
|
{ WM_WINDOWPOSCHANGING, sent|wparam, SWP_NOSIZE|SWP_NOMOVE },
|
|
|
|
{ WM_WINDOWPOSCHANGED, sent|wparam|optional, SWP_NOSIZE|SWP_NOMOVE|SWP_NOCLIENTSIZE|SWP_NOCLIENTMOVE }, /* Win9x */
|
2004-06-23 20:51:21 +00:00
|
|
|
{ WM_ACTIVATEAPP, sent|wparam, 1 },
|
|
|
|
{ WM_NCACTIVATE, sent|wparam, 1 },
|
|
|
|
{ WM_ACTIVATE, sent|wparam, 1 },
|
|
|
|
{ HCBT_SETFOCUS, hook },
|
|
|
|
{ WM_IME_SETCONTEXT, sent|wparam|defwinproc|optional, 1 },
|
|
|
|
{ WM_SETFOCUS, sent|wparam|defwinproc, 0 },
|
2004-09-13 18:03:09 +00:00
|
|
|
/* Win9x adds SWP_NOZORDER below */
|
|
|
|
{ WM_WINDOWPOSCHANGED, sent, /*|wparam, SWP_SHOWWINDOW|SWP_NOSIZE|SWP_NOMOVE|SWP_NOCLIENTSIZE|SWP_NOCLIENTMOVE*/ },
|
2004-06-23 20:51:21 +00:00
|
|
|
{ WM_SIZE, sent },
|
|
|
|
{ WM_MOVE, sent },
|
|
|
|
{ 0 }
|
|
|
|
};
|
2004-06-30 18:16:08 +00:00
|
|
|
/* DestroyWindow for MDI frame window, initially visible */
|
|
|
|
static const struct message WmDestroyMDIframeSeq[] = {
|
|
|
|
{ HCBT_DESTROYWND, hook },
|
2004-09-13 18:03:09 +00:00
|
|
|
{ WM_WINDOWPOSCHANGING, sent|wparam, SWP_HIDEWINDOW|SWP_NOACTIVATE|SWP_NOSIZE|SWP_NOMOVE|SWP_NOZORDER },
|
|
|
|
{ WM_WINDOWPOSCHANGED, sent|wparam, SWP_HIDEWINDOW|SWP_NOACTIVATE|SWP_NOSIZE|SWP_NOMOVE|SWP_NOZORDER|SWP_NOCLIENTSIZE|SWP_NOCLIENTMOVE },
|
2004-06-30 18:16:08 +00:00
|
|
|
{ WM_NCACTIVATE, sent|wparam, 0 },
|
|
|
|
{ WM_ACTIVATE, sent|wparam|optional, 0 }, /* Win9x */
|
|
|
|
{ WM_ACTIVATEAPP, sent|wparam|optional, 0 }, /* Win9x */
|
|
|
|
{ WM_DESTROY, sent },
|
|
|
|
{ WM_NCDESTROY, sent },
|
|
|
|
{ 0 }
|
|
|
|
};
|
2004-06-23 20:51:21 +00:00
|
|
|
/* CreateWindow for MDI client window, initially visible */
|
|
|
|
static const struct message WmCreateMDIclientSeq[] = {
|
|
|
|
{ HCBT_CREATEWND, hook },
|
|
|
|
{ WM_NCCREATE, sent },
|
2004-06-30 18:16:08 +00:00
|
|
|
{ WM_NCCALCSIZE, sent|wparam, 0 },
|
2004-06-23 20:51:21 +00:00
|
|
|
{ WM_CREATE, sent },
|
|
|
|
{ WM_SIZE, sent },
|
|
|
|
{ WM_MOVE, sent },
|
|
|
|
{ WM_PARENTNOTIFY, sent|wparam, WM_CREATE }, /* in MDI frame */
|
2004-06-30 18:16:08 +00:00
|
|
|
{ WM_SHOWWINDOW, sent|wparam, 1 },
|
2004-09-13 18:03:09 +00:00
|
|
|
{ WM_WINDOWPOSCHANGING, sent|wparam, SWP_SHOWWINDOW|SWP_NOACTIVATE|SWP_NOZORDER|SWP_NOSIZE|SWP_NOMOVE },
|
|
|
|
{ WM_WINDOWPOSCHANGED, sent|wparam, SWP_SHOWWINDOW|SWP_NOACTIVATE|SWP_NOZORDER|SWP_NOSIZE|SWP_NOMOVE|SWP_NOCLIENTSIZE|SWP_NOCLIENTMOVE },
|
2004-06-30 18:16:08 +00:00
|
|
|
{ 0 }
|
|
|
|
};
|
|
|
|
/* DestroyWindow for MDI client window, initially visible */
|
|
|
|
static const struct message WmDestroyMDIclientSeq[] = {
|
|
|
|
{ HCBT_DESTROYWND, hook },
|
|
|
|
{ WM_PARENTNOTIFY, sent|wparam, WM_DESTROY }, /* in MDI frame */
|
|
|
|
{ WM_SHOWWINDOW, sent|wparam, 0 },
|
2004-09-13 18:03:09 +00:00
|
|
|
{ WM_WINDOWPOSCHANGING, sent|wparam, SWP_HIDEWINDOW|SWP_NOACTIVATE|SWP_NOSIZE|SWP_NOMOVE|SWP_NOZORDER },
|
|
|
|
{ WM_WINDOWPOSCHANGED, sent|wparam, SWP_HIDEWINDOW|SWP_NOACTIVATE|SWP_NOSIZE|SWP_NOMOVE|SWP_NOZORDER|SWP_NOCLIENTSIZE|SWP_NOCLIENTMOVE },
|
2004-06-30 18:16:08 +00:00
|
|
|
{ WM_DESTROY, sent },
|
|
|
|
{ WM_NCDESTROY, sent },
|
2004-06-23 20:51:21 +00:00
|
|
|
{ 0 }
|
|
|
|
};
|
|
|
|
/* CreateWindow for MDI child window, initially visible */
|
2004-06-30 18:16:08 +00:00
|
|
|
static const struct message WmCreateMDIchildVisibleSeq[] = {
|
2004-06-23 20:51:21 +00:00
|
|
|
{ HCBT_CREATEWND, hook },
|
|
|
|
{ WM_NCCREATE, sent },
|
|
|
|
{ WM_NCCALCSIZE, sent|wparam, 0 },
|
|
|
|
{ WM_CREATE, sent },
|
|
|
|
{ WM_SIZE, sent },
|
|
|
|
{ WM_MOVE, sent },
|
2004-06-30 18:16:08 +00:00
|
|
|
/* Win2k sends wparam set to
|
|
|
|
* MAKEWPARAM(WM_CREATE, MDI_FIRST_CHILD_ID + nTotalCreated),
|
|
|
|
* while Win9x doesn't bother to set child window id according to
|
|
|
|
* CLIENTCREATESTRUCT.idFirstChild
|
|
|
|
*/
|
|
|
|
{ WM_PARENTNOTIFY, sent /*|wparam, WM_CREATE*/ }, /* in MDI client */
|
2004-06-23 20:51:21 +00:00
|
|
|
{ WM_SHOWWINDOW, sent|wparam, 1 },
|
2004-09-13 18:03:09 +00:00
|
|
|
{ WM_WINDOWPOSCHANGING, sent|wparam, SWP_SHOWWINDOW|SWP_NOACTIVATE|SWP_NOSIZE|SWP_NOMOVE|SWP_NOZORDER },
|
|
|
|
{ WM_WINDOWPOSCHANGED, sent|wparam, SWP_SHOWWINDOW|SWP_NOACTIVATE|SWP_NOSIZE|SWP_NOMOVE|SWP_NOZORDER|SWP_NOCLIENTSIZE|SWP_NOCLIENTMOVE },
|
2004-06-23 20:51:21 +00:00
|
|
|
{ WM_MDIREFRESHMENU, sent/*|wparam|lparam, 0, 0*/ },
|
2004-09-13 18:03:09 +00:00
|
|
|
{ WM_WINDOWPOSCHANGING, sent|wparam, SWP_SHOWWINDOW|SWP_NOSIZE|SWP_NOMOVE },
|
2004-06-23 20:51:21 +00:00
|
|
|
{ WM_CHILDACTIVATE, sent|wparam|lparam, 0, 0 },
|
2004-09-13 18:03:09 +00:00
|
|
|
{ WM_WINDOWPOSCHANGING, sent|wparam|defwinproc, SWP_NOACTIVATE|SWP_NOSIZE|SWP_NOMOVE },
|
2004-06-30 18:16:08 +00:00
|
|
|
|
|
|
|
/* Win9x: message sequence terminates here. */
|
|
|
|
|
2004-06-23 20:51:21 +00:00
|
|
|
{ WM_NCACTIVATE, sent|wparam|defwinproc, 1 },
|
|
|
|
{ HCBT_SETFOCUS, hook }, /* in MDI client */
|
2004-06-30 18:16:08 +00:00
|
|
|
{ WM_IME_SETCONTEXT, sent|wparam|optional, 1 }, /* in MDI client */
|
2004-06-23 20:51:21 +00:00
|
|
|
{ WM_SETFOCUS, sent }, /* in MDI client */
|
|
|
|
{ HCBT_SETFOCUS, hook },
|
|
|
|
{ WM_KILLFOCUS, sent }, /* in MDI client */
|
2004-06-30 18:16:08 +00:00
|
|
|
{ WM_IME_SETCONTEXT, sent|wparam|optional, 0 }, /* in MDI client */
|
2004-06-23 20:51:21 +00:00
|
|
|
{ WM_IME_SETCONTEXT, sent|wparam|defwinproc|optional, 1 },
|
|
|
|
{ WM_SETFOCUS, sent|defwinproc },
|
|
|
|
{ WM_MDIACTIVATE, sent|defwinproc },
|
|
|
|
{ 0 }
|
|
|
|
};
|
2004-06-30 18:16:08 +00:00
|
|
|
/* DestroyWindow for MDI child window, initially visible */
|
|
|
|
static const struct message WmDestroyMDIchildVisibleSeq[] = {
|
|
|
|
{ HCBT_DESTROYWND, hook },
|
|
|
|
/* Win2k sends wparam set to
|
|
|
|
* MAKEWPARAM(WM_DESTROY, MDI_FIRST_CHILD_ID + nTotalCreated),
|
|
|
|
* while Win9x doesn't bother to set child window id according to
|
|
|
|
* CLIENTCREATESTRUCT.idFirstChild
|
|
|
|
*/
|
|
|
|
{ WM_PARENTNOTIFY, sent /*|wparam, WM_DESTROY*/ }, /* in MDI client */
|
|
|
|
{ WM_SHOWWINDOW, sent|wparam, 0 },
|
2004-09-13 18:03:09 +00:00
|
|
|
{ WM_WINDOWPOSCHANGING, sent|wparam, SWP_HIDEWINDOW|SWP_NOACTIVATE|SWP_NOSIZE|SWP_NOMOVE|SWP_NOZORDER },
|
2004-06-30 18:16:08 +00:00
|
|
|
{ WM_ERASEBKGND, sent|parent|optional },
|
2004-09-13 18:03:09 +00:00
|
|
|
{ WM_WINDOWPOSCHANGED, sent|wparam, SWP_HIDEWINDOW|SWP_NOACTIVATE|SWP_NOSIZE|SWP_NOMOVE|SWP_NOZORDER|SWP_NOCLIENTSIZE|SWP_NOCLIENTMOVE },
|
2004-06-30 18:16:08 +00:00
|
|
|
|
|
|
|
/* { WM_DESTROY, sent }
|
|
|
|
* Win9x: message sequence terminates here.
|
|
|
|
*/
|
|
|
|
|
|
|
|
{ HCBT_SETFOCUS, hook }, /* set focus to MDI client */
|
|
|
|
{ WM_KILLFOCUS, sent },
|
|
|
|
{ WM_IME_SETCONTEXT, sent|wparam|optional, 0 },
|
|
|
|
{ WM_IME_SETCONTEXT, sent|wparam|optional, 1 }, /* in MDI client */
|
|
|
|
{ WM_SETFOCUS, sent }, /* in MDI client */
|
|
|
|
|
|
|
|
{ HCBT_SETFOCUS, hook }, /* MDI client sets focus back to MDI child */
|
|
|
|
{ WM_KILLFOCUS, sent }, /* in MDI client */
|
|
|
|
{ WM_IME_SETCONTEXT, sent|wparam|optional, 0 }, /* in MDI client */
|
|
|
|
{ WM_IME_SETCONTEXT, sent|wparam|optional, 1 },
|
|
|
|
{ WM_SETFOCUS, sent }, /* in MDI client */
|
|
|
|
|
|
|
|
{ HCBT_SETFOCUS, hook }, /* set focus to MDI client */
|
|
|
|
{ WM_KILLFOCUS, sent },
|
|
|
|
{ WM_IME_SETCONTEXT, sent|wparam|optional, 0 },
|
|
|
|
{ WM_IME_SETCONTEXT, sent|wparam|optional, 1 }, /* in MDI client */
|
|
|
|
{ WM_SETFOCUS, sent }, /* in MDI client */
|
|
|
|
|
|
|
|
{ HCBT_SETFOCUS, hook }, /* MDI client sets focus back to MDI child */
|
|
|
|
{ WM_KILLFOCUS, sent }, /* in MDI client */
|
|
|
|
{ WM_IME_SETCONTEXT, sent|wparam|optional, 0 }, /* in MDI client */
|
|
|
|
{ WM_IME_SETCONTEXT, sent|wparam|optional, 1 },
|
|
|
|
{ WM_SETFOCUS, sent }, /* in MDI client */
|
|
|
|
|
|
|
|
{ WM_DESTROY, sent },
|
|
|
|
|
|
|
|
{ HCBT_SETFOCUS, hook }, /* set focus to MDI client */
|
|
|
|
{ WM_KILLFOCUS, sent },
|
|
|
|
{ WM_IME_SETCONTEXT, sent|wparam|optional, 0 },
|
|
|
|
{ WM_IME_SETCONTEXT, sent|wparam|optional, 1 }, /* in MDI client */
|
|
|
|
{ WM_SETFOCUS, sent }, /* in MDI client */
|
|
|
|
|
|
|
|
{ HCBT_SETFOCUS, hook }, /* MDI client sets focus back to MDI child */
|
|
|
|
{ WM_KILLFOCUS, sent }, /* in MDI client */
|
|
|
|
{ WM_IME_SETCONTEXT, sent|wparam|optional, 0 }, /* in MDI client */
|
|
|
|
{ WM_IME_SETCONTEXT, sent|wparam|optional, 1 },
|
|
|
|
{ WM_SETFOCUS, sent }, /* in MDI client */
|
|
|
|
|
|
|
|
{ WM_NCDESTROY, sent },
|
|
|
|
{ 0 }
|
|
|
|
};
|
|
|
|
/* CreateWindow for MDI child window, initially invisible */
|
|
|
|
static const struct message WmCreateMDIchildInvisibleSeq[] = {
|
|
|
|
{ HCBT_CREATEWND, hook },
|
|
|
|
{ WM_NCCREATE, sent },
|
|
|
|
{ WM_NCCALCSIZE, sent|wparam, 0 },
|
|
|
|
{ WM_CREATE, sent },
|
|
|
|
{ WM_SIZE, sent },
|
|
|
|
{ WM_MOVE, sent },
|
|
|
|
/* Win2k sends wparam set to
|
|
|
|
* MAKEWPARAM(WM_CREATE, MDI_FIRST_CHILD_ID + nTotalCreated),
|
|
|
|
* while Win9x doesn't bother to set child window id according to
|
|
|
|
* CLIENTCREATESTRUCT.idFirstChild
|
|
|
|
*/
|
|
|
|
{ WM_PARENTNOTIFY, sent /*|wparam, WM_CREATE*/ }, /* in MDI client */
|
|
|
|
{ 0 }
|
|
|
|
};
|
|
|
|
/* DestroyWindow for MDI child window, initially invisible */
|
|
|
|
static const struct message WmDestroyMDIchildInvisibleSeq[] = {
|
|
|
|
{ HCBT_DESTROYWND, hook },
|
|
|
|
/* Win2k sends wparam set to
|
|
|
|
* MAKEWPARAM(WM_DESTROY, MDI_FIRST_CHILD_ID + nTotalCreated),
|
|
|
|
* while Win9x doesn't bother to set child window id according to
|
|
|
|
* CLIENTCREATESTRUCT.idFirstChild
|
|
|
|
*/
|
|
|
|
{ WM_PARENTNOTIFY, sent /*|wparam, WM_DESTROY*/ }, /* in MDI client */
|
|
|
|
{ WM_DESTROY, sent },
|
|
|
|
{ WM_NCDESTROY, sent },
|
|
|
|
{ 0 }
|
|
|
|
};
|
2004-09-13 19:16:31 +00:00
|
|
|
/* CreateWindow for the 1st MDI child window, initially visible and maximized */
|
|
|
|
static const struct message WmCreateMDIchildVisibleMaxSeq1[] = {
|
|
|
|
{ HCBT_CREATEWND, hook },
|
|
|
|
{ WM_NCCREATE, sent },
|
|
|
|
{ WM_NCCALCSIZE, sent|wparam, 0 },
|
|
|
|
{ WM_CREATE, sent },
|
|
|
|
{ WM_SIZE, sent },
|
|
|
|
{ WM_MOVE, sent },
|
|
|
|
{ HCBT_MINMAX, hook|lparam, 0, SW_MAXIMIZE },
|
|
|
|
{ WM_GETMINMAXINFO, sent },
|
|
|
|
{ WM_WINDOWPOSCHANGING, sent|wparam, SWP_FRAMECHANGED|SWP_NOACTIVATE|0x8000 },
|
|
|
|
{ WM_NCCALCSIZE, sent|wparam, 1 },
|
|
|
|
{ WM_WINDOWPOSCHANGED, sent|wparam, SWP_FRAMECHANGED|SWP_NOACTIVATE|SWP_NOSIZE|SWP_NOMOVE|SWP_NOZORDER|SWP_NOREDRAW|SWP_NOCLIENTSIZE|SWP_NOCLIENTMOVE|0x8000 },
|
|
|
|
{ WM_SIZE, sent|defwinproc },
|
|
|
|
/* in MDI frame */
|
|
|
|
{ WM_WINDOWPOSCHANGING, sent|wparam, SWP_FRAMECHANGED|SWP_NOACTIVATE|SWP_NOSIZE|SWP_NOMOVE|SWP_NOZORDER },
|
|
|
|
{ WM_NCCALCSIZE, sent|wparam, 1 },
|
|
|
|
{ WM_WINDOWPOSCHANGED, sent|wparam, SWP_FRAMECHANGED|SWP_NOACTIVATE|SWP_NOSIZE|SWP_NOMOVE|SWP_NOZORDER|SWP_NOCLIENTSIZE|SWP_NOCLIENTMOVE },
|
|
|
|
/* Win2k sends wparam set to
|
|
|
|
* MAKEWPARAM(WM_CREATE, MDI_FIRST_CHILD_ID + nTotalCreated),
|
|
|
|
* while Win9x doesn't bother to set child window id according to
|
|
|
|
* CLIENTCREATESTRUCT.idFirstChild
|
|
|
|
*/
|
|
|
|
{ WM_PARENTNOTIFY, sent /*|wparam, WM_CREATE*/ }, /* in MDI client */
|
|
|
|
{ WM_SHOWWINDOW, sent|wparam, 1 },
|
|
|
|
{ WM_WINDOWPOSCHANGING, sent|wparam, SWP_SHOWWINDOW|SWP_NOACTIVATE|SWP_NOSIZE|SWP_NOMOVE|SWP_NOZORDER },
|
|
|
|
{ WM_WINDOWPOSCHANGED, sent|wparam, SWP_SHOWWINDOW|SWP_NOACTIVATE|SWP_NOSIZE|SWP_NOMOVE|SWP_NOZORDER|SWP_NOCLIENTSIZE|SWP_NOCLIENTMOVE },
|
|
|
|
{ WM_MDIREFRESHMENU, sent/*|wparam|lparam, 0, 0*/ },
|
|
|
|
{ WM_WINDOWPOSCHANGING, sent|wparam, SWP_SHOWWINDOW|SWP_NOSIZE|SWP_NOMOVE },
|
|
|
|
{ WM_CHILDACTIVATE, sent|wparam|lparam, 0, 0 },
|
|
|
|
{ WM_WINDOWPOSCHANGING, sent|wparam|defwinproc, SWP_NOACTIVATE|SWP_NOSIZE|SWP_NOMOVE },
|
|
|
|
|
|
|
|
/* Win9x: message sequence terminates here. */
|
|
|
|
|
|
|
|
{ WM_NCACTIVATE, sent|wparam|defwinproc, 1 },
|
|
|
|
{ HCBT_SETFOCUS, hook }, /* in MDI client */
|
|
|
|
{ WM_IME_SETCONTEXT, sent|wparam|optional, 1 }, /* in MDI client */
|
|
|
|
{ WM_SETFOCUS, sent }, /* in MDI client */
|
|
|
|
{ HCBT_SETFOCUS, hook },
|
|
|
|
{ WM_KILLFOCUS, sent }, /* in MDI client */
|
|
|
|
{ WM_IME_SETCONTEXT, sent|wparam|optional, 0 }, /* in MDI client */
|
|
|
|
{ WM_IME_SETCONTEXT, sent|wparam|defwinproc|optional, 1 },
|
|
|
|
{ WM_SETFOCUS, sent|defwinproc },
|
|
|
|
{ WM_MDIACTIVATE, sent|defwinproc },
|
|
|
|
/* in MDI frame */
|
|
|
|
{ WM_WINDOWPOSCHANGING, sent|wparam, SWP_FRAMECHANGED|SWP_NOACTIVATE|SWP_NOSIZE|SWP_NOMOVE|SWP_NOZORDER },
|
|
|
|
{ WM_NCCALCSIZE, sent|wparam, 1 },
|
|
|
|
{ WM_WINDOWPOSCHANGED, sent|wparam, SWP_FRAMECHANGED|SWP_NOACTIVATE|SWP_NOSIZE|SWP_NOMOVE|SWP_NOZORDER|SWP_NOCLIENTSIZE|SWP_NOCLIENTMOVE },
|
|
|
|
{ 0 }
|
|
|
|
};
|
|
|
|
/* CreateWindow for the 2nd MDI child window, initially visible and maximized */
|
|
|
|
static const struct message WmCreateMDIchildVisibleMaxSeq2[] = {
|
|
|
|
/* restore the 1st MDI child */
|
|
|
|
{ WM_SETREDRAW, sent|wparam, 0 },
|
|
|
|
{ HCBT_MINMAX, hook },
|
|
|
|
{ WM_WINDOWPOSCHANGING, sent|wparam, SWP_FRAMECHANGED|0x8000 },
|
|
|
|
{ WM_NCCALCSIZE, sent|wparam, 1 },
|
|
|
|
{ WM_CHILDACTIVATE, sent|wparam|lparam, 0, 0 },
|
|
|
|
{ WM_WINDOWPOSCHANGED, sent|wparam, SWP_FRAMECHANGED|SWP_NOSIZE|SWP_NOMOVE|SWP_NOZORDER|SWP_NOREDRAW|SWP_NOCLIENTSIZE|SWP_NOCLIENTMOVE|0x8000 },
|
|
|
|
{ WM_SIZE, sent|defwinproc },
|
|
|
|
/* in MDI frame */
|
|
|
|
{ WM_WINDOWPOSCHANGING, sent|wparam, SWP_FRAMECHANGED|SWP_NOACTIVATE|SWP_NOSIZE|SWP_NOMOVE|SWP_NOZORDER },
|
|
|
|
{ WM_NCCALCSIZE, sent|wparam, 1 },
|
|
|
|
{ WM_WINDOWPOSCHANGED, sent|wparam, SWP_FRAMECHANGED|SWP_NOACTIVATE|SWP_NOSIZE|SWP_NOMOVE|SWP_NOZORDER|SWP_NOCLIENTSIZE|SWP_NOCLIENTMOVE },
|
|
|
|
{ WM_SETREDRAW, sent|wparam, 1 }, /* in the 1st MDI child */
|
|
|
|
/* create the 2nd MDI child */
|
|
|
|
{ HCBT_CREATEWND, hook },
|
|
|
|
{ WM_NCCREATE, sent },
|
|
|
|
{ WM_NCCALCSIZE, sent|wparam, 0 },
|
|
|
|
{ WM_CREATE, sent },
|
|
|
|
{ WM_SIZE, sent },
|
|
|
|
{ WM_MOVE, sent },
|
|
|
|
{ HCBT_MINMAX, hook|lparam, 0, SW_MAXIMIZE },
|
|
|
|
{ WM_GETMINMAXINFO, sent },
|
|
|
|
{ WM_WINDOWPOSCHANGING, sent|wparam, SWP_FRAMECHANGED|SWP_NOACTIVATE|0x8000 },
|
|
|
|
{ WM_NCCALCSIZE, sent|wparam, 1 },
|
|
|
|
{ WM_WINDOWPOSCHANGED, sent|wparam, SWP_FRAMECHANGED|SWP_NOACTIVATE|SWP_NOSIZE|SWP_NOMOVE|SWP_NOREDRAW|SWP_NOCLIENTSIZE|SWP_NOCLIENTMOVE|0x8000 },
|
|
|
|
{ WM_SIZE, sent|defwinproc },
|
|
|
|
/* in MDI frame */
|
|
|
|
{ WM_WINDOWPOSCHANGING, sent|wparam, SWP_FRAMECHANGED|SWP_NOACTIVATE|SWP_NOSIZE|SWP_NOMOVE|SWP_NOZORDER },
|
|
|
|
{ WM_NCCALCSIZE, sent|wparam, 1 },
|
|
|
|
{ WM_WINDOWPOSCHANGED, sent|wparam, SWP_FRAMECHANGED|SWP_NOACTIVATE|SWP_NOSIZE|SWP_NOMOVE|SWP_NOZORDER|SWP_NOCLIENTSIZE|SWP_NOCLIENTMOVE },
|
|
|
|
/* Win2k sends wparam set to
|
|
|
|
* MAKEWPARAM(WM_CREATE, MDI_FIRST_CHILD_ID + nTotalCreated),
|
|
|
|
* while Win9x doesn't bother to set child window id according to
|
|
|
|
* CLIENTCREATESTRUCT.idFirstChild
|
|
|
|
*/
|
|
|
|
{ WM_PARENTNOTIFY, sent /*|wparam, WM_CREATE*/ }, /* in MDI client */
|
|
|
|
{ WM_SHOWWINDOW, sent|wparam, 1 },
|
|
|
|
{ WM_WINDOWPOSCHANGING, sent|wparam, SWP_SHOWWINDOW|SWP_NOACTIVATE|SWP_NOSIZE|SWP_NOMOVE|SWP_NOZORDER },
|
|
|
|
{ WM_WINDOWPOSCHANGED, sent|wparam, SWP_SHOWWINDOW|SWP_NOACTIVATE|SWP_NOSIZE|SWP_NOMOVE|SWP_NOZORDER|SWP_NOCLIENTSIZE|SWP_NOCLIENTMOVE },
|
|
|
|
{ WM_MDIREFRESHMENU, sent/*|wparam|lparam, 0, 0*/ },
|
|
|
|
{ WM_WINDOWPOSCHANGING, sent|wparam, SWP_SHOWWINDOW|SWP_NOSIZE|SWP_NOMOVE },
|
|
|
|
{ WM_CHILDACTIVATE, sent|wparam|lparam, 0, 0 },
|
|
|
|
|
|
|
|
{ WM_NCACTIVATE, sent|wparam|defwinproc, 0 }, /* in the 1st MDI child */
|
|
|
|
{ WM_MDIACTIVATE, sent|defwinproc }, /* in the 1st MDI child */
|
|
|
|
|
|
|
|
{ WM_WINDOWPOSCHANGING, sent|wparam|defwinproc, SWP_NOACTIVATE|SWP_NOSIZE|SWP_NOMOVE },
|
|
|
|
|
|
|
|
/* Win9x: message sequence terminates here. */
|
|
|
|
|
|
|
|
{ WM_NCACTIVATE, sent|wparam|defwinproc, 1 },
|
|
|
|
{ HCBT_SETFOCUS, hook },
|
|
|
|
{ WM_KILLFOCUS, sent|defwinproc }, /* in the 1st MDI child */
|
|
|
|
{ WM_IME_SETCONTEXT, sent|wparam|defwinproc|optional, 0 }, /* in the 1st MDI child */
|
|
|
|
{ WM_IME_SETCONTEXT, sent|wparam|optional, 1 }, /* in MDI client */
|
|
|
|
{ WM_SETFOCUS, sent }, /* in MDI client */
|
|
|
|
{ HCBT_SETFOCUS, hook },
|
|
|
|
{ WM_KILLFOCUS, sent }, /* in MDI client */
|
|
|
|
{ WM_IME_SETCONTEXT, sent|wparam|optional, 0 }, /* in MDI client */
|
|
|
|
{ WM_IME_SETCONTEXT, sent|wparam|defwinproc|optional, 1 },
|
|
|
|
{ WM_SETFOCUS, sent|defwinproc },
|
|
|
|
|
|
|
|
{ WM_MDIACTIVATE, sent|defwinproc },
|
|
|
|
/* in MDI frame */
|
|
|
|
{ WM_WINDOWPOSCHANGING, sent|wparam, SWP_FRAMECHANGED|SWP_NOACTIVATE|SWP_NOSIZE|SWP_NOMOVE|SWP_NOZORDER },
|
|
|
|
{ WM_NCCALCSIZE, sent|wparam, 1 },
|
|
|
|
{ WM_WINDOWPOSCHANGED, sent|wparam, SWP_FRAMECHANGED|SWP_NOACTIVATE|SWP_NOSIZE|SWP_NOMOVE|SWP_NOZORDER|SWP_NOCLIENTSIZE|SWP_NOCLIENTMOVE },
|
|
|
|
{ 0 }
|
|
|
|
};
|
2004-10-08 23:36:18 +00:00
|
|
|
/* WM_MDICREATE MDI child window, initially visible and maximized */
|
|
|
|
static const struct message WmCreateMDIchildVisibleMaxSeq3[] = {
|
|
|
|
{ WM_MDICREATE, sent },
|
|
|
|
{ HCBT_CREATEWND, hook },
|
|
|
|
{ WM_NCCREATE, sent },
|
|
|
|
{ WM_NCCALCSIZE, sent|wparam, 0 },
|
|
|
|
{ WM_CREATE, sent },
|
|
|
|
{ WM_SIZE, sent },
|
|
|
|
{ WM_MOVE, sent },
|
|
|
|
{ HCBT_MINMAX, hook|lparam, 0, SW_MAXIMIZE },
|
|
|
|
{ WM_GETMINMAXINFO, sent },
|
|
|
|
{ WM_WINDOWPOSCHANGING, sent|wparam, SWP_FRAMECHANGED|SWP_NOACTIVATE|0x8000 },
|
|
|
|
{ WM_NCCALCSIZE, sent|wparam, 1 },
|
|
|
|
{ WM_WINDOWPOSCHANGED, sent|wparam, SWP_FRAMECHANGED|SWP_NOACTIVATE|SWP_NOSIZE|SWP_NOMOVE|SWP_NOZORDER|SWP_NOREDRAW|SWP_NOCLIENTSIZE|SWP_NOCLIENTMOVE|0x8000 },
|
|
|
|
{ WM_SIZE, sent|defwinproc },
|
|
|
|
/* in MDI frame */
|
|
|
|
{ WM_WINDOWPOSCHANGING, sent|wparam, SWP_FRAMECHANGED|SWP_NOACTIVATE|SWP_NOSIZE|SWP_NOMOVE|SWP_NOZORDER },
|
|
|
|
{ WM_NCCALCSIZE, sent|wparam, 1 },
|
|
|
|
{ WM_WINDOWPOSCHANGED, sent|wparam, SWP_FRAMECHANGED|SWP_NOACTIVATE|SWP_NOSIZE|SWP_NOMOVE|SWP_NOZORDER|SWP_NOCLIENTSIZE|SWP_NOCLIENTMOVE },
|
|
|
|
/* Win2k sends wparam set to
|
|
|
|
* MAKEWPARAM(WM_CREATE, MDI_FIRST_CHILD_ID + nTotalCreated),
|
|
|
|
* while Win9x doesn't bother to set child window id according to
|
|
|
|
* CLIENTCREATESTRUCT.idFirstChild
|
|
|
|
*/
|
|
|
|
{ WM_PARENTNOTIFY, sent /*|wparam, WM_CREATE*/ }, /* in MDI client */
|
|
|
|
{ WM_SHOWWINDOW, sent|wparam, 1 },
|
|
|
|
{ WM_WINDOWPOSCHANGING, sent|wparam, SWP_SHOWWINDOW|SWP_NOACTIVATE|SWP_NOSIZE|SWP_NOMOVE|SWP_NOZORDER },
|
|
|
|
{ WM_WINDOWPOSCHANGED, sent|wparam, SWP_SHOWWINDOW|SWP_NOACTIVATE|SWP_NOSIZE|SWP_NOMOVE|SWP_NOZORDER|SWP_NOCLIENTSIZE|SWP_NOCLIENTMOVE },
|
|
|
|
{ WM_MDIREFRESHMENU, sent/*|wparam|lparam, 0, 0*/ },
|
|
|
|
{ WM_WINDOWPOSCHANGING, sent|wparam, SWP_SHOWWINDOW|SWP_NOSIZE|SWP_NOMOVE },
|
|
|
|
{ WM_CHILDACTIVATE, sent|wparam|lparam, 0, 0 },
|
|
|
|
{ WM_WINDOWPOSCHANGING, sent|wparam|defwinproc, SWP_NOACTIVATE|SWP_NOSIZE|SWP_NOMOVE },
|
|
|
|
|
|
|
|
/* Win9x: message sequence terminates here. */
|
|
|
|
|
|
|
|
{ WM_NCACTIVATE, sent|wparam|defwinproc, 1 },
|
|
|
|
{ HCBT_SETFOCUS, hook }, /* in MDI client */
|
|
|
|
{ WM_IME_SETCONTEXT, sent|wparam|optional, 1 }, /* in MDI client */
|
|
|
|
{ WM_SETFOCUS, sent }, /* in MDI client */
|
|
|
|
{ HCBT_SETFOCUS, hook },
|
|
|
|
{ WM_KILLFOCUS, sent }, /* in MDI client */
|
|
|
|
{ WM_IME_SETCONTEXT, sent|wparam|optional, 0 }, /* in MDI client */
|
|
|
|
{ WM_IME_SETCONTEXT, sent|wparam|defwinproc|optional, 1 },
|
|
|
|
{ WM_SETFOCUS, sent|defwinproc },
|
|
|
|
|
|
|
|
{ WM_MDIACTIVATE, sent|defwinproc },
|
|
|
|
|
|
|
|
/* in MDI child */
|
|
|
|
{ WM_WINDOWPOSCHANGING, sent|wparam, SWP_FRAMECHANGED|SWP_NOACTIVATE|SWP_NOSIZE|SWP_NOMOVE|SWP_NOZORDER },
|
|
|
|
{ WM_NCCALCSIZE, sent|wparam, 1 },
|
|
|
|
{ WM_WINDOWPOSCHANGED, sent|wparam, SWP_FRAMECHANGED|SWP_NOACTIVATE|SWP_NOSIZE|SWP_NOMOVE|SWP_NOZORDER|SWP_NOCLIENTSIZE|SWP_NOCLIENTMOVE },
|
|
|
|
|
|
|
|
/* in MDI frame */
|
|
|
|
{ WM_WINDOWPOSCHANGING, sent|wparam, SWP_FRAMECHANGED|SWP_NOACTIVATE|SWP_NOSIZE|SWP_NOMOVE|SWP_NOZORDER },
|
|
|
|
{ WM_NCCALCSIZE, sent|wparam, 1 },
|
|
|
|
{ WM_WINDOWPOSCHANGED, sent|wparam, SWP_FRAMECHANGED|SWP_NOACTIVATE|SWP_NOSIZE|SWP_NOMOVE|SWP_NOZORDER },
|
|
|
|
{ WM_MOVE, sent|defwinproc },
|
|
|
|
{ WM_SIZE, sent|defwinproc },
|
|
|
|
|
|
|
|
/* in MDI client */
|
|
|
|
{ WM_WINDOWPOSCHANGING, sent|wparam, SWP_NOACTIVATE|SWP_NOZORDER },
|
|
|
|
{ WM_NCCALCSIZE, sent|wparam, 1 },
|
|
|
|
{ WM_WINDOWPOSCHANGED, sent|wparam, SWP_NOACTIVATE|SWP_NOMOVE|SWP_NOZORDER|SWP_NOCLIENTMOVE },
|
|
|
|
{ WM_SIZE, sent },
|
|
|
|
|
|
|
|
/* in MDI child */
|
|
|
|
{ WM_WINDOWPOSCHANGING, sent|wparam, SWP_NOACTIVATE|SWP_NOZORDER },
|
|
|
|
{ WM_NCCALCSIZE, sent|wparam, 1 },
|
|
|
|
{ WM_WINDOWPOSCHANGED, sent|wparam, SWP_NOACTIVATE|SWP_NOMOVE|SWP_NOZORDER|SWP_NOCLIENTMOVE },
|
|
|
|
{ WM_SIZE, sent|defwinproc },
|
|
|
|
|
|
|
|
{ 0 }
|
|
|
|
};
|
2004-09-13 19:16:31 +00:00
|
|
|
/* WM_SYSCOMMAND/SC_CLOSE for the 2nd MDI child window, initially visible and maximized */
|
|
|
|
static const struct message WmDestroyMDIchildVisibleMaxSeq2[] = {
|
|
|
|
{ WM_SYSCOMMAND, sent|wparam, SC_CLOSE },
|
|
|
|
{ HCBT_SYSCOMMAND, hook },
|
|
|
|
{ WM_CLOSE, sent|defwinproc },
|
|
|
|
{ WM_MDIDESTROY, sent }, /* in MDI client */
|
|
|
|
|
|
|
|
/* bring the 1st MDI child to top */
|
|
|
|
{ WM_WINDOWPOSCHANGING, sent|wparam|defwinproc, SWP_NOSIZE|SWP_NOMOVE }, /* in the 1st MDI child */
|
|
|
|
{ WM_WINDOWPOSCHANGING, sent|wparam|defwinproc, SWP_NOACTIVATE|SWP_NOSIZE|SWP_NOMOVE }, /* in the 2nd MDI child */
|
|
|
|
{ WM_CHILDACTIVATE, sent|defwinproc|wparam|lparam, 0, 0 }, /* in the 1st MDI child */
|
|
|
|
{ WM_NCACTIVATE, sent|wparam|defwinproc, 0 }, /* in the 1st MDI child */
|
|
|
|
{ WM_MDIACTIVATE, sent|defwinproc }, /* in the 1st MDI child */
|
|
|
|
|
|
|
|
/* maximize the 1st MDI child */
|
|
|
|
{ HCBT_MINMAX, hook },
|
|
|
|
{ WM_GETMINMAXINFO, sent|defwinproc },
|
|
|
|
{ WM_WINDOWPOSCHANGING, sent|wparam|defwinproc, SWP_FRAMECHANGED|0x8000 },
|
|
|
|
{ WM_NCCALCSIZE, sent|defwinproc|wparam, 1 },
|
|
|
|
{ WM_CHILDACTIVATE, sent|defwinproc|wparam|lparam, 0, 0 },
|
|
|
|
{ WM_WINDOWPOSCHANGED, sent|wparam|defwinproc, SWP_FRAMECHANGED|SWP_NOSIZE|SWP_NOMOVE|SWP_NOZORDER|SWP_NOREDRAW|SWP_NOCLIENTSIZE|SWP_NOCLIENTMOVE|0x8000 },
|
|
|
|
{ WM_SIZE, sent|defwinproc },
|
|
|
|
|
|
|
|
/* restore the 2nd MDI child */
|
|
|
|
{ WM_SETREDRAW, sent|defwinproc|wparam, 0 },
|
|
|
|
{ HCBT_MINMAX, hook },
|
|
|
|
{ WM_WINDOWPOSCHANGING, sent|wparam|defwinproc, SWP_NOACTIVATE|SWP_FRAMECHANGED|SWP_SHOWWINDOW|SWP_NOZORDER|0x8000 },
|
|
|
|
{ WM_NCCALCSIZE, sent|defwinproc|wparam, 1 },
|
|
|
|
{ WM_WINDOWPOSCHANGED, sent|wparam|defwinproc, SWP_NOACTIVATE|SWP_FRAMECHANGED|SWP_SHOWWINDOW|SWP_NOSIZE|SWP_NOMOVE|SWP_NOZORDER|SWP_NOREDRAW|SWP_NOCLIENTSIZE|SWP_NOCLIENTMOVE|0x8000 },
|
|
|
|
{ WM_SIZE, sent|defwinproc },
|
|
|
|
{ WM_SETREDRAW, sent|defwinproc|wparam, 1 },
|
|
|
|
/* in MDI frame */
|
|
|
|
{ WM_WINDOWPOSCHANGING, sent|wparam, SWP_FRAMECHANGED|SWP_NOACTIVATE|SWP_NOSIZE|SWP_NOMOVE|SWP_NOZORDER },
|
|
|
|
{ WM_NCCALCSIZE, sent|wparam, 1 },
|
|
|
|
{ WM_WINDOWPOSCHANGED, sent|wparam, SWP_FRAMECHANGED|SWP_NOACTIVATE|SWP_NOSIZE|SWP_NOMOVE|SWP_NOZORDER|SWP_NOCLIENTSIZE|SWP_NOCLIENTMOVE },
|
|
|
|
|
|
|
|
/* bring the 1st MDI child to top */
|
|
|
|
{ WM_WINDOWPOSCHANGING, sent|wparam|defwinproc, SWP_NOACTIVATE|SWP_NOSIZE|SWP_NOMOVE },
|
|
|
|
{ WM_NCACTIVATE, sent|wparam|defwinproc, 1 },
|
|
|
|
{ HCBT_SETFOCUS, hook },
|
|
|
|
{ WM_KILLFOCUS, sent|defwinproc },
|
|
|
|
{ WM_IME_SETCONTEXT, sent|wparam|defwinproc|optional, 0 },
|
|
|
|
{ WM_IME_SETCONTEXT, sent|wparam|optional, 1 }, /* in MDI client */
|
|
|
|
{ WM_SETFOCUS, sent }, /* in MDI client */
|
|
|
|
{ HCBT_SETFOCUS, hook },
|
|
|
|
{ WM_KILLFOCUS, sent }, /* in MDI client */
|
|
|
|
{ WM_IME_SETCONTEXT, sent|wparam|optional, 0 }, /* in MDI client */
|
|
|
|
{ WM_IME_SETCONTEXT, sent|wparam|defwinproc|optional, 1 },
|
|
|
|
{ WM_SETFOCUS, sent|defwinproc },
|
|
|
|
{ WM_MDIACTIVATE, sent|defwinproc },
|
|
|
|
{ WM_WINDOWPOSCHANGED, sent|wparam|defwinproc, SWP_NOSIZE|SWP_NOMOVE|SWP_NOREDRAW|SWP_NOCLIENTSIZE|SWP_NOCLIENTMOVE },
|
|
|
|
|
|
|
|
/* apparently ShowWindow(SW_SHOW) on an MDI client */
|
|
|
|
{ WM_SHOWWINDOW, sent|wparam, 1 },
|
|
|
|
{ WM_WINDOWPOSCHANGING, sent|wparam, SWP_SHOWWINDOW|SWP_NOACTIVATE|SWP_NOSIZE|SWP_NOMOVE|SWP_NOZORDER },
|
|
|
|
{ WM_WINDOWPOSCHANGED, sent|wparam, SWP_SHOWWINDOW|SWP_NOACTIVATE|SWP_NOSIZE|SWP_NOMOVE|SWP_NOZORDER|SWP_NOCLIENTSIZE|SWP_NOCLIENTMOVE },
|
|
|
|
{ WM_MDIREFRESHMENU, sent },
|
|
|
|
|
|
|
|
{ HCBT_DESTROYWND, hook },
|
|
|
|
/* Win2k sends wparam set to
|
|
|
|
* MAKEWPARAM(WM_DESTROY, MDI_FIRST_CHILD_ID + nTotalCreated),
|
|
|
|
* while Win9x doesn't bother to set child window id according to
|
|
|
|
* CLIENTCREATESTRUCT.idFirstChild
|
|
|
|
*/
|
|
|
|
{ WM_PARENTNOTIFY, sent /*|wparam, WM_DESTROY*/ }, /* in MDI client */
|
|
|
|
{ WM_SHOWWINDOW, sent|defwinproc|wparam, 0 },
|
|
|
|
{ WM_WINDOWPOSCHANGING, sent|wparam|defwinproc, SWP_HIDEWINDOW|SWP_NOACTIVATE|SWP_NOSIZE|SWP_NOMOVE|SWP_NOZORDER },
|
|
|
|
{ WM_ERASEBKGND, sent|parent|optional },
|
|
|
|
{ WM_WINDOWPOSCHANGED, sent|wparam|defwinproc, SWP_HIDEWINDOW|SWP_NOACTIVATE|SWP_NOSIZE|SWP_NOMOVE|SWP_NOZORDER|SWP_NOCLIENTSIZE|SWP_NOCLIENTMOVE },
|
|
|
|
|
|
|
|
{ WM_DESTROY, sent|defwinproc },
|
|
|
|
{ WM_NCDESTROY, sent|defwinproc },
|
|
|
|
{ 0 }
|
|
|
|
};
|
2004-10-08 23:36:18 +00:00
|
|
|
/* WM_MDIDESTROY for the single MDI child window, initially visible and maximized */
|
|
|
|
static const struct message WmDestroyMDIchildVisibleMaxSeq1[] = {
|
|
|
|
{ WM_MDIDESTROY, sent }, /* in MDI client */
|
|
|
|
{ WM_SHOWWINDOW, sent|wparam, 0 },
|
|
|
|
{ WM_WINDOWPOSCHANGING, sent|wparam, SWP_HIDEWINDOW|SWP_NOACTIVATE|SWP_NOSIZE|SWP_NOMOVE|SWP_NOZORDER },
|
|
|
|
{ WM_ERASEBKGND, sent|parent|optional },
|
|
|
|
{ WM_WINDOWPOSCHANGED, sent|wparam, SWP_HIDEWINDOW|SWP_NOACTIVATE|SWP_NOSIZE|SWP_NOMOVE|SWP_NOZORDER|SWP_NOCLIENTSIZE|SWP_NOCLIENTMOVE },
|
|
|
|
|
|
|
|
{ HCBT_SETFOCUS, hook },
|
|
|
|
{ WM_KILLFOCUS, sent },
|
|
|
|
{ WM_IME_SETCONTEXT, sent|wparam|optional, 0 },
|
|
|
|
{ WM_IME_SETCONTEXT, sent|wparam|optional, 1 }, /* in MDI client */
|
|
|
|
{ WM_SETFOCUS, sent }, /* in MDI client */
|
|
|
|
{ HCBT_SETFOCUS, hook },
|
|
|
|
{ WM_KILLFOCUS, sent }, /* in MDI client */
|
|
|
|
{ WM_IME_SETCONTEXT, sent|wparam|optional, 0 }, /* in MDI client */
|
|
|
|
{ WM_IME_SETCONTEXT, sent|wparam|optional, 1 },
|
|
|
|
{ WM_SETFOCUS, sent },
|
|
|
|
|
|
|
|
/* in MDI child */
|
|
|
|
{ WM_WINDOWPOSCHANGING, sent|wparam, SWP_FRAMECHANGED|SWP_NOACTIVATE|SWP_NOSIZE|SWP_NOMOVE|SWP_NOZORDER },
|
|
|
|
{ WM_NCCALCSIZE, sent|wparam, 1 },
|
|
|
|
{ WM_WINDOWPOSCHANGED, sent|wparam, SWP_FRAMECHANGED|SWP_NOACTIVATE|SWP_NOSIZE|SWP_NOMOVE|SWP_NOZORDER|SWP_NOREDRAW|SWP_NOCLIENTSIZE|SWP_NOCLIENTMOVE },
|
|
|
|
|
|
|
|
/* in MDI frame */
|
|
|
|
{ WM_WINDOWPOSCHANGING, sent|wparam, SWP_FRAMECHANGED|SWP_NOACTIVATE|SWP_NOSIZE|SWP_NOMOVE|SWP_NOZORDER },
|
|
|
|
{ WM_NCCALCSIZE, sent|wparam, 1 },
|
|
|
|
{ WM_WINDOWPOSCHANGED, sent|wparam, SWP_FRAMECHANGED|SWP_NOACTIVATE|SWP_NOSIZE|SWP_NOMOVE|SWP_NOZORDER },
|
|
|
|
{ WM_MOVE, sent|defwinproc },
|
|
|
|
{ WM_SIZE, sent|defwinproc },
|
|
|
|
|
|
|
|
/* in MDI client */
|
|
|
|
{ WM_WINDOWPOSCHANGING, sent|wparam, SWP_NOACTIVATE|SWP_NOZORDER },
|
|
|
|
{ WM_NCCALCSIZE, sent|wparam, 1 },
|
|
|
|
{ WM_WINDOWPOSCHANGED, sent|wparam, SWP_NOACTIVATE|SWP_NOMOVE|SWP_NOZORDER|SWP_NOCLIENTMOVE },
|
|
|
|
{ WM_SIZE, sent },
|
|
|
|
|
|
|
|
/* in MDI child */
|
|
|
|
{ WM_WINDOWPOSCHANGING, sent|wparam, SWP_NOACTIVATE|SWP_NOZORDER },
|
|
|
|
{ WM_NCCALCSIZE, sent|wparam, 1 },
|
|
|
|
{ WM_WINDOWPOSCHANGED, sent|wparam, SWP_NOACTIVATE|SWP_NOMOVE|SWP_NOZORDER|SWP_NOREDRAW|SWP_NOCLIENTMOVE },
|
|
|
|
{ WM_SIZE, sent|defwinproc },
|
|
|
|
|
|
|
|
/* in MDI child */
|
|
|
|
{ WM_WINDOWPOSCHANGING, sent|wparam|defwinproc, SWP_FRAMECHANGED|SWP_NOACTIVATE|SWP_NOSIZE|SWP_NOMOVE|SWP_NOZORDER },
|
|
|
|
{ WM_NCCALCSIZE, sent|wparam|defwinproc, 1 },
|
|
|
|
{ WM_WINDOWPOSCHANGED, sent|wparam|defwinproc, SWP_FRAMECHANGED|SWP_NOACTIVATE|SWP_NOSIZE|SWP_NOMOVE|SWP_NOZORDER|SWP_NOREDRAW|SWP_NOCLIENTSIZE|SWP_NOCLIENTMOVE },
|
|
|
|
|
|
|
|
/* in MDI frame */
|
|
|
|
{ WM_WINDOWPOSCHANGING, sent|wparam|defwinproc, SWP_FRAMECHANGED|SWP_NOACTIVATE|SWP_NOSIZE|SWP_NOMOVE|SWP_NOZORDER },
|
|
|
|
{ WM_NCCALCSIZE, sent|wparam|defwinproc, 1 },
|
|
|
|
{ WM_WINDOWPOSCHANGED, sent|wparam|defwinproc, SWP_FRAMECHANGED|SWP_NOACTIVATE|SWP_NOSIZE|SWP_NOMOVE|SWP_NOZORDER },
|
|
|
|
{ WM_MOVE, sent|defwinproc },
|
|
|
|
{ WM_SIZE, sent|defwinproc },
|
|
|
|
|
|
|
|
/* in MDI client */
|
|
|
|
{ WM_WINDOWPOSCHANGING, sent|wparam, SWP_NOACTIVATE|SWP_NOZORDER },
|
|
|
|
{ WM_NCCALCSIZE, sent|wparam, 1 },
|
|
|
|
{ WM_WINDOWPOSCHANGED, sent|wparam, SWP_NOACTIVATE|SWP_NOMOVE|SWP_NOZORDER|SWP_NOCLIENTMOVE },
|
|
|
|
{ WM_SIZE, sent },
|
|
|
|
|
|
|
|
/* in MDI child */
|
|
|
|
{ WM_WINDOWPOSCHANGING, sent|wparam|defwinproc, SWP_NOACTIVATE|SWP_NOZORDER },
|
|
|
|
{ WM_NCCALCSIZE, sent|wparam|defwinproc, 1 },
|
|
|
|
{ WM_WINDOWPOSCHANGED, sent|wparam|defwinproc, SWP_NOACTIVATE|SWP_NOMOVE|SWP_NOZORDER|SWP_NOREDRAW|SWP_NOCLIENTMOVE },
|
|
|
|
{ WM_SIZE, sent|defwinproc },
|
|
|
|
|
|
|
|
/* in MDI frame */
|
|
|
|
{ WM_WINDOWPOSCHANGING, sent|wparam, SWP_FRAMECHANGED|SWP_NOACTIVATE|SWP_NOSIZE|SWP_NOMOVE|SWP_NOZORDER },
|
|
|
|
{ WM_NCCALCSIZE, sent|wparam, 1 },
|
|
|
|
{ WM_WINDOWPOSCHANGED, sent|wparam, SWP_FRAMECHANGED|SWP_NOACTIVATE|SWP_NOSIZE|SWP_NOMOVE|SWP_NOZORDER|SWP_NOCLIENTSIZE|SWP_NOCLIENTMOVE },
|
|
|
|
|
|
|
|
{ WM_NCACTIVATE, sent|wparam, 0 },
|
|
|
|
{ WM_MDIACTIVATE, sent },
|
|
|
|
|
|
|
|
{ HCBT_MINMAX, hook },
|
|
|
|
{ WM_WINDOWPOSCHANGING, sent|wparam, SWP_FRAMECHANGED|SWP_SHOWWINDOW|0x8000 },
|
|
|
|
{ WM_NCCALCSIZE, sent|wparam, 1 },
|
|
|
|
{ WM_CHILDACTIVATE, sent|wparam|lparam, 0, 0 },
|
|
|
|
{ WM_WINDOWPOSCHANGED, sent|wparam, SWP_FRAMECHANGED|SWP_SHOWWINDOW|SWP_NOMOVE|SWP_NOZORDER|SWP_NOCLIENTMOVE|0x8000 },
|
|
|
|
{ WM_SIZE, sent|defwinproc },
|
|
|
|
|
|
|
|
/* in MDI child */
|
|
|
|
{ WM_WINDOWPOSCHANGING, sent|wparam|defwinproc, SWP_FRAMECHANGED|SWP_NOACTIVATE|SWP_NOSIZE|SWP_NOMOVE|SWP_NOZORDER },
|
|
|
|
{ WM_NCCALCSIZE, sent|wparam|defwinproc, 1 },
|
|
|
|
{ WM_WINDOWPOSCHANGED, sent|wparam|defwinproc, SWP_FRAMECHANGED|SWP_NOACTIVATE|SWP_NOSIZE|SWP_NOMOVE|SWP_NOZORDER|SWP_NOCLIENTSIZE|SWP_NOCLIENTMOVE },
|
|
|
|
|
|
|
|
/* in MDI frame */
|
|
|
|
{ WM_WINDOWPOSCHANGING, sent|wparam, SWP_FRAMECHANGED|SWP_NOACTIVATE|SWP_NOSIZE|SWP_NOMOVE|SWP_NOZORDER },
|
|
|
|
{ WM_NCCALCSIZE, sent|wparam, 1 },
|
|
|
|
{ WM_WINDOWPOSCHANGED, sent|wparam, SWP_FRAMECHANGED|SWP_NOACTIVATE|SWP_NOSIZE|SWP_NOMOVE|SWP_NOZORDER },
|
|
|
|
{ WM_MOVE, sent|defwinproc },
|
|
|
|
{ WM_SIZE, sent|defwinproc },
|
|
|
|
|
|
|
|
/* in MDI client */
|
|
|
|
{ WM_WINDOWPOSCHANGING, sent|wparam, SWP_NOACTIVATE|SWP_NOZORDER },
|
|
|
|
{ WM_NCCALCSIZE, sent|wparam, 1 },
|
|
|
|
{ WM_WINDOWPOSCHANGED, sent|wparam, SWP_NOACTIVATE|SWP_NOMOVE|SWP_NOZORDER|SWP_NOCLIENTMOVE },
|
|
|
|
{ WM_SIZE, sent },
|
|
|
|
|
|
|
|
{ HCBT_SETFOCUS, hook },
|
|
|
|
{ WM_KILLFOCUS, sent },
|
|
|
|
{ WM_IME_SETCONTEXT, sent|wparam|optional, 0 },
|
|
|
|
{ WM_IME_SETCONTEXT, sent|wparam|optional, 1 }, /* in MDI client */
|
|
|
|
{ WM_SETFOCUS, sent }, /* in MDI client */
|
|
|
|
|
|
|
|
{ WM_MDIREFRESHMENU, sent }, /* in MDI client */
|
|
|
|
|
|
|
|
{ HCBT_DESTROYWND, hook },
|
|
|
|
/* Win2k sends wparam set to
|
|
|
|
* MAKEWPARAM(WM_DESTROY, MDI_FIRST_CHILD_ID + nTotalCreated),
|
|
|
|
* while Win9x doesn't bother to set child window id according to
|
|
|
|
* CLIENTCREATESTRUCT.idFirstChild
|
|
|
|
*/
|
|
|
|
{ WM_PARENTNOTIFY, sent /*|wparam, WM_DESTROY*/ }, /* in MDI client */
|
|
|
|
|
|
|
|
{ WM_SHOWWINDOW, sent|wparam, 0 },
|
|
|
|
{ WM_WINDOWPOSCHANGING, sent|wparam, SWP_HIDEWINDOW|SWP_NOACTIVATE|SWP_NOSIZE|SWP_NOMOVE|SWP_NOZORDER },
|
|
|
|
{ WM_ERASEBKGND, sent|parent|optional },
|
|
|
|
{ WM_WINDOWPOSCHANGED, sent|wparam, SWP_HIDEWINDOW|SWP_NOACTIVATE|SWP_NOSIZE|SWP_NOMOVE|SWP_NOZORDER|SWP_NOCLIENTSIZE|SWP_NOCLIENTMOVE },
|
|
|
|
|
|
|
|
{ WM_DESTROY, sent },
|
|
|
|
{ WM_NCDESTROY, sent },
|
|
|
|
{ 0 }
|
|
|
|
};
|
2004-09-21 00:24:22 +00:00
|
|
|
/* ShowWindow(SW_MAXIMIZE) for a not visible MDI child window */
|
|
|
|
static const struct message WmMaximizeMDIchildInvisibleSeq[] = {
|
|
|
|
{ HCBT_MINMAX, hook },
|
|
|
|
{ WM_GETMINMAXINFO, sent },
|
|
|
|
{ WM_WINDOWPOSCHANGING, sent|wparam, SWP_SHOWWINDOW|SWP_FRAMECHANGED|0x8000 },
|
|
|
|
{ WM_NCCALCSIZE, sent|wparam, 1 },
|
|
|
|
{ WM_CHILDACTIVATE, sent|wparam|lparam, 0, 0 },
|
|
|
|
|
|
|
|
{ WM_WINDOWPOSCHANGING, sent|wparam|defwinproc, SWP_NOACTIVATE|SWP_NOSIZE|SWP_NOMOVE },
|
|
|
|
{ WM_NCACTIVATE, sent|wparam|defwinproc, 1 },
|
|
|
|
{ HCBT_SETFOCUS, hook },
|
|
|
|
{ WM_IME_SETCONTEXT, sent|wparam|optional, 1 }, /* in MDI client */
|
|
|
|
{ WM_SETFOCUS, sent }, /* in MDI client */
|
|
|
|
{ HCBT_SETFOCUS, hook },
|
|
|
|
{ WM_KILLFOCUS, sent }, /* in MDI client */
|
|
|
|
{ WM_IME_SETCONTEXT, sent|wparam|optional, 0 }, /* in MDI client */
|
|
|
|
{ WM_IME_SETCONTEXT, sent|wparam|defwinproc|optional, 1 },
|
|
|
|
{ WM_SETFOCUS, sent|defwinproc },
|
|
|
|
{ WM_MDIACTIVATE, sent|defwinproc },
|
|
|
|
{ WM_WINDOWPOSCHANGED, sent|wparam, SWP_SHOWWINDOW|SWP_FRAMECHANGED|SWP_NOSIZE|SWP_NOMOVE|SWP_NOZORDER|SWP_NOCLIENTSIZE|SWP_NOCLIENTMOVE|0x8000 },
|
|
|
|
{ WM_SIZE, sent|defwinproc },
|
|
|
|
/* in MDI frame */
|
|
|
|
{ WM_WINDOWPOSCHANGING, sent|wparam, SWP_FRAMECHANGED|SWP_NOACTIVATE|SWP_NOSIZE|SWP_NOMOVE|SWP_NOZORDER },
|
|
|
|
{ WM_NCCALCSIZE, sent|wparam, 1 },
|
|
|
|
{ WM_WINDOWPOSCHANGED, sent|wparam, SWP_FRAMECHANGED|SWP_NOACTIVATE|SWP_NOSIZE|SWP_NOMOVE|SWP_NOZORDER|SWP_NOCLIENTSIZE|SWP_NOCLIENTMOVE },
|
|
|
|
{ 0 }
|
|
|
|
};
|
|
|
|
/* ShowWindow(SW_MAXIMIZE) for a visible MDI child window */
|
|
|
|
static const struct message WmMaximizeMDIchildVisibleSeq[] = {
|
|
|
|
{ HCBT_MINMAX, hook },
|
|
|
|
{ WM_GETMINMAXINFO, sent },
|
|
|
|
{ WM_WINDOWPOSCHANGING, sent|wparam, SWP_FRAMECHANGED|0x8000 },
|
|
|
|
{ WM_NCCALCSIZE, sent|wparam, 1 },
|
|
|
|
{ WM_CHILDACTIVATE, sent|wparam|lparam, 0, 0 },
|
|
|
|
{ WM_WINDOWPOSCHANGED, sent|wparam, SWP_FRAMECHANGED|SWP_NOSIZE|SWP_NOMOVE|SWP_NOZORDER|SWP_NOCLIENTSIZE|SWP_NOCLIENTMOVE|0x8000 },
|
|
|
|
{ WM_SIZE, sent|defwinproc },
|
|
|
|
/* in MDI frame */
|
|
|
|
{ WM_WINDOWPOSCHANGING, sent|wparam, SWP_FRAMECHANGED|SWP_NOACTIVATE|SWP_NOSIZE|SWP_NOMOVE|SWP_NOZORDER },
|
|
|
|
{ WM_NCCALCSIZE, sent|wparam, 1 },
|
|
|
|
{ WM_WINDOWPOSCHANGED, sent|wparam, SWP_FRAMECHANGED|SWP_NOACTIVATE|SWP_NOSIZE|SWP_NOMOVE|SWP_NOZORDER|SWP_NOCLIENTSIZE|SWP_NOCLIENTMOVE },
|
|
|
|
{ 0 }
|
|
|
|
};
|
|
|
|
/* ShowWindow(SW_RESTORE) for a visible MDI child window */
|
|
|
|
static const struct message WmRestoreMDIchildVisibleSeq[] = {
|
|
|
|
{ HCBT_MINMAX, hook },
|
|
|
|
{ WM_WINDOWPOSCHANGING, sent|wparam, SWP_FRAMECHANGED|0x8000 },
|
|
|
|
{ WM_NCCALCSIZE, sent|wparam, 1 },
|
|
|
|
{ WM_CHILDACTIVATE, sent|wparam|lparam, 0, 0 },
|
|
|
|
{ WM_WINDOWPOSCHANGED, sent|wparam, SWP_FRAMECHANGED|SWP_NOSIZE|SWP_NOMOVE|SWP_NOZORDER|SWP_NOCLIENTSIZE|SWP_NOCLIENTMOVE|0x8000 },
|
|
|
|
{ WM_SIZE, sent|defwinproc },
|
|
|
|
/* in MDI frame */
|
|
|
|
{ WM_WINDOWPOSCHANGING, sent|wparam, SWP_FRAMECHANGED|SWP_NOACTIVATE|SWP_NOSIZE|SWP_NOMOVE|SWP_NOZORDER },
|
|
|
|
{ WM_NCCALCSIZE, sent|wparam, 1 },
|
|
|
|
{ WM_WINDOWPOSCHANGED, sent|wparam, SWP_FRAMECHANGED|SWP_NOACTIVATE|SWP_NOSIZE|SWP_NOMOVE|SWP_NOZORDER|SWP_NOCLIENTSIZE|SWP_NOCLIENTMOVE },
|
|
|
|
{ 0 }
|
|
|
|
};
|
|
|
|
/* ShowWindow(SW_RESTORE) for a not visible MDI child window */
|
|
|
|
static const struct message WmRestoreMDIchildInisibleSeq[] = {
|
|
|
|
{ HCBT_MINMAX, hook },
|
|
|
|
{ WM_WINDOWPOSCHANGING, sent|wparam, SWP_SHOWWINDOW|SWP_FRAMECHANGED|0x8000 },
|
|
|
|
{ WM_NCCALCSIZE, sent|wparam, 1 },
|
|
|
|
{ WM_CHILDACTIVATE, sent|wparam|lparam, 0, 0 },
|
|
|
|
{ WM_WINDOWPOSCHANGED, sent|wparam, SWP_SHOWWINDOW|SWP_FRAMECHANGED|SWP_NOSIZE|SWP_NOMOVE|SWP_NOZORDER|SWP_NOCLIENTSIZE|SWP_NOCLIENTMOVE|0x8000 },
|
|
|
|
{ WM_SIZE, sent|defwinproc },
|
|
|
|
/* in MDI frame */
|
|
|
|
{ WM_WINDOWPOSCHANGING, sent|wparam, SWP_FRAMECHANGED|SWP_NOACTIVATE|SWP_NOSIZE|SWP_NOMOVE|SWP_NOZORDER },
|
|
|
|
{ WM_NCCALCSIZE, sent|wparam, 1 },
|
|
|
|
{ WM_WINDOWPOSCHANGED, sent|wparam, SWP_FRAMECHANGED|SWP_NOACTIVATE|SWP_NOSIZE|SWP_NOMOVE|SWP_NOZORDER|SWP_NOCLIENTSIZE|SWP_NOCLIENTMOVE },
|
|
|
|
{ 0 }
|
|
|
|
};
|
2004-06-23 20:51:21 +00:00
|
|
|
|
|
|
|
static HWND mdi_client;
|
|
|
|
static WNDPROC old_mdi_client_proc;
|
|
|
|
|
|
|
|
static LRESULT WINAPI mdi_client_hook_proc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
|
|
|
|
{
|
|
|
|
struct message msg;
|
|
|
|
|
|
|
|
/* do not log painting messages */
|
|
|
|
if (message != WM_PAINT &&
|
|
|
|
message != WM_ERASEBKGND &&
|
|
|
|
message != WM_NCPAINT &&
|
2004-10-11 19:55:28 +00:00
|
|
|
message != WM_GETTEXT &&
|
|
|
|
message != WM_MDIGETACTIVE)
|
2004-06-23 20:51:21 +00:00
|
|
|
{
|
|
|
|
trace("mdi client: %p, %04x, %08x, %08lx\n", hwnd, message, wParam, lParam);
|
|
|
|
|
2004-09-13 18:03:09 +00:00
|
|
|
switch (message)
|
|
|
|
{
|
|
|
|
case WM_WINDOWPOSCHANGING:
|
|
|
|
case WM_WINDOWPOSCHANGED:
|
|
|
|
{
|
|
|
|
WINDOWPOS *winpos = (WINDOWPOS *)lParam;
|
|
|
|
|
|
|
|
trace("%s\n", (message == WM_WINDOWPOSCHANGING) ? "WM_WINDOWPOSCHANGING" : "WM_WINDOWPOSCHANGED");
|
|
|
|
trace("%p after %p, x %d, y %d, cx %d, cy %d flags %08x\n",
|
|
|
|
winpos->hwnd, winpos->hwndInsertAfter,
|
|
|
|
winpos->x, winpos->y, winpos->cx, winpos->cy, winpos->flags);
|
|
|
|
|
|
|
|
/* Log only documented flags, win2k uses 0x1000 and 0x2000
|
|
|
|
* in the high word for internal purposes
|
|
|
|
*/
|
|
|
|
wParam = winpos->flags & 0xffff;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2004-06-23 20:51:21 +00:00
|
|
|
msg.message = message;
|
|
|
|
msg.flags = sent|wparam|lparam;
|
2004-06-30 18:16:08 +00:00
|
|
|
msg.wParam = wParam;
|
|
|
|
msg.lParam = lParam;
|
2004-06-23 20:51:21 +00:00
|
|
|
add_message(&msg);
|
|
|
|
}
|
|
|
|
|
|
|
|
return CallWindowProcA(old_mdi_client_proc, hwnd, message, wParam, lParam);
|
|
|
|
}
|
|
|
|
|
|
|
|
static LRESULT WINAPI mdi_child_wnd_proc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
|
|
|
|
{
|
|
|
|
static long defwndproc_counter = 0;
|
|
|
|
LRESULT ret;
|
|
|
|
struct message msg;
|
|
|
|
|
|
|
|
/* do not log painting messages */
|
|
|
|
if (message != WM_PAINT &&
|
|
|
|
message != WM_ERASEBKGND &&
|
|
|
|
message != WM_NCPAINT &&
|
|
|
|
message != WM_GETTEXT)
|
|
|
|
{
|
|
|
|
trace("mdi child: %p, %04x, %08x, %08lx\n", hwnd, message, wParam, lParam);
|
|
|
|
|
2004-06-30 18:16:08 +00:00
|
|
|
switch (message)
|
|
|
|
{
|
|
|
|
case WM_WINDOWPOSCHANGING:
|
|
|
|
case WM_WINDOWPOSCHANGED:
|
|
|
|
{
|
|
|
|
WINDOWPOS *winpos = (WINDOWPOS *)lParam;
|
|
|
|
|
|
|
|
trace("%s\n", (message == WM_WINDOWPOSCHANGING) ? "WM_WINDOWPOSCHANGING" : "WM_WINDOWPOSCHANGED");
|
|
|
|
trace("%p after %p, x %d, y %d, cx %d, cy %d flags %08x\n",
|
|
|
|
winpos->hwnd, winpos->hwndInsertAfter,
|
|
|
|
winpos->x, winpos->y, winpos->cx, winpos->cy, winpos->flags);
|
2004-09-13 18:03:09 +00:00
|
|
|
|
|
|
|
/* Log only documented flags, win2k uses 0x1000 and 0x2000
|
|
|
|
* in the high word for internal purposes
|
|
|
|
*/
|
|
|
|
wParam = winpos->flags & 0xffff;
|
2004-06-30 18:16:08 +00:00
|
|
|
break;
|
|
|
|
}
|
2004-10-11 19:55:28 +00:00
|
|
|
|
|
|
|
case WM_MDIACTIVATE:
|
|
|
|
{
|
|
|
|
HWND active, client = GetParent(hwnd);
|
|
|
|
|
|
|
|
active = (HWND)SendMessageA(client, WM_MDIGETACTIVE, 0, 0);
|
|
|
|
|
|
|
|
if (hwnd == (HWND)lParam) /* if we are being activated */
|
|
|
|
ok (active == (HWND)lParam, "new active %p != active %p\n", (HWND)lParam, active);
|
|
|
|
else
|
|
|
|
ok (active == (HWND)wParam, "old active %p != active %p\n", (HWND)wParam, active);
|
|
|
|
break;
|
|
|
|
}
|
2004-06-30 18:16:08 +00:00
|
|
|
}
|
|
|
|
|
2004-06-23 20:51:21 +00:00
|
|
|
msg.message = message;
|
|
|
|
msg.flags = sent|wparam|lparam;
|
|
|
|
if (defwndproc_counter) msg.flags |= defwinproc;
|
|
|
|
msg.wParam = wParam;
|
|
|
|
msg.lParam = lParam;
|
|
|
|
add_message(&msg);
|
|
|
|
}
|
|
|
|
|
|
|
|
defwndproc_counter++;
|
|
|
|
ret = DefMDIChildProcA(hwnd, message, wParam, lParam);
|
|
|
|
defwndproc_counter--;
|
|
|
|
|
|
|
|
return ret;
|
|
|
|
}
|
|
|
|
|
|
|
|
static LRESULT WINAPI mdi_frame_wnd_proc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
|
|
|
|
{
|
|
|
|
static long defwndproc_counter = 0;
|
|
|
|
LRESULT ret;
|
|
|
|
struct message msg;
|
|
|
|
|
|
|
|
/* do not log painting messages */
|
|
|
|
if (message != WM_PAINT &&
|
|
|
|
message != WM_ERASEBKGND &&
|
|
|
|
message != WM_NCPAINT &&
|
|
|
|
message != WM_GETTEXT)
|
|
|
|
{
|
|
|
|
trace("mdi frame: %p, %04x, %08x, %08lx\n", hwnd, message, wParam, lParam);
|
|
|
|
|
2004-09-13 18:03:09 +00:00
|
|
|
switch (message)
|
|
|
|
{
|
|
|
|
case WM_WINDOWPOSCHANGING:
|
|
|
|
case WM_WINDOWPOSCHANGED:
|
|
|
|
{
|
|
|
|
WINDOWPOS *winpos = (WINDOWPOS *)lParam;
|
|
|
|
|
|
|
|
trace("%s\n", (message == WM_WINDOWPOSCHANGING) ? "WM_WINDOWPOSCHANGING" : "WM_WINDOWPOSCHANGED");
|
|
|
|
trace("%p after %p, x %d, y %d, cx %d, cy %d flags %08x\n",
|
|
|
|
winpos->hwnd, winpos->hwndInsertAfter,
|
|
|
|
winpos->x, winpos->y, winpos->cx, winpos->cy, winpos->flags);
|
|
|
|
|
|
|
|
/* Log only documented flags, win2k uses 0x1000 and 0x2000
|
|
|
|
* in the high word for internal purposes
|
|
|
|
*/
|
|
|
|
wParam = winpos->flags & 0xffff;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2004-06-23 20:51:21 +00:00
|
|
|
msg.message = message;
|
|
|
|
msg.flags = sent|wparam|lparam;
|
|
|
|
if (defwndproc_counter) msg.flags |= defwinproc;
|
|
|
|
msg.wParam = wParam;
|
|
|
|
msg.lParam = lParam;
|
|
|
|
add_message(&msg);
|
|
|
|
}
|
|
|
|
|
|
|
|
defwndproc_counter++;
|
|
|
|
ret = DefFrameProcA(hwnd, mdi_client, message, wParam, lParam);
|
|
|
|
defwndproc_counter--;
|
|
|
|
|
|
|
|
return ret;
|
|
|
|
}
|
|
|
|
|
|
|
|
static BOOL mdi_RegisterWindowClasses(void)
|
|
|
|
{
|
|
|
|
WNDCLASSA cls;
|
|
|
|
|
|
|
|
cls.style = 0;
|
|
|
|
cls.lpfnWndProc = mdi_frame_wnd_proc;
|
|
|
|
cls.cbClsExtra = 0;
|
|
|
|
cls.cbWndExtra = 0;
|
|
|
|
cls.hInstance = GetModuleHandleA(0);
|
|
|
|
cls.hIcon = 0;
|
|
|
|
cls.hCursor = LoadCursorA(0, (LPSTR)IDC_ARROW);
|
|
|
|
cls.hbrBackground = GetStockObject(WHITE_BRUSH);
|
|
|
|
cls.lpszMenuName = NULL;
|
|
|
|
cls.lpszClassName = "MDI_frame_class";
|
|
|
|
if (!RegisterClassA(&cls)) return FALSE;
|
|
|
|
|
|
|
|
cls.lpfnWndProc = mdi_child_wnd_proc;
|
|
|
|
cls.lpszClassName = "MDI_child_class";
|
|
|
|
if (!RegisterClassA(&cls)) return FALSE;
|
|
|
|
|
|
|
|
if (!GetClassInfoA(0, "MDIClient", &cls)) assert(0);
|
|
|
|
old_mdi_client_proc = cls.lpfnWndProc;
|
|
|
|
cls.hInstance = GetModuleHandleA(0);
|
|
|
|
cls.lpfnWndProc = mdi_client_hook_proc;
|
|
|
|
cls.lpszClassName = "MDI_client_class";
|
|
|
|
if (!RegisterClassA(&cls)) assert(0);
|
|
|
|
|
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void test_mdi_messages(void)
|
|
|
|
{
|
2004-10-05 02:10:04 +00:00
|
|
|
MDICREATESTRUCTA mdi_cs;
|
2004-06-23 20:51:21 +00:00
|
|
|
CLIENTCREATESTRUCT client_cs;
|
2004-09-13 19:16:31 +00:00
|
|
|
HWND mdi_frame, mdi_child, mdi_child2, active_child;
|
|
|
|
BOOL zoomed;
|
2004-10-08 23:36:18 +00:00
|
|
|
HMENU hMenu = CreateMenu();
|
2004-06-23 20:51:21 +00:00
|
|
|
|
|
|
|
assert(mdi_RegisterWindowClasses());
|
|
|
|
|
|
|
|
flush_sequence();
|
|
|
|
|
|
|
|
trace("creating MDI frame window\n");
|
|
|
|
mdi_frame = CreateWindowExA(0, "MDI_frame_class", "MDI frame window",
|
|
|
|
WS_CAPTION | WS_SYSMENU | WS_MINIMIZEBOX |
|
|
|
|
WS_MAXIMIZEBOX | WS_VISIBLE,
|
|
|
|
100, 100, CW_USEDEFAULT, CW_USEDEFAULT,
|
2004-10-08 23:36:18 +00:00
|
|
|
GetDesktopWindow(), hMenu,
|
2004-06-23 20:51:21 +00:00
|
|
|
GetModuleHandleA(0), NULL);
|
|
|
|
assert(mdi_frame);
|
2004-08-25 17:35:06 +00:00
|
|
|
ok_sequence(WmCreateMDIframeSeq, "Create MDI frame window", TRUE);
|
2004-06-23 20:51:21 +00:00
|
|
|
|
2004-09-21 00:24:22 +00:00
|
|
|
ok(GetActiveWindow() == mdi_frame, "wrong active window %p\n", GetActiveWindow());
|
|
|
|
ok(GetFocus() == mdi_frame, "wrong focus window %p\n", GetFocus());
|
|
|
|
|
2004-06-23 20:51:21 +00:00
|
|
|
trace("creating MDI client window\n");
|
|
|
|
client_cs.hWindowMenu = 0;
|
2004-06-30 18:16:08 +00:00
|
|
|
client_cs.idFirstChild = MDI_FIRST_CHILD_ID;
|
2004-06-23 20:51:21 +00:00
|
|
|
mdi_client = CreateWindowExA(0, "MDI_client_class",
|
|
|
|
NULL,
|
2004-06-30 18:16:08 +00:00
|
|
|
WS_CHILD | WS_VISIBLE | MDIS_ALLCHILDSTYLES,
|
2004-06-23 20:51:21 +00:00
|
|
|
0, 0, 0, 0,
|
|
|
|
mdi_frame, 0, GetModuleHandleA(0), &client_cs);
|
|
|
|
assert(mdi_client);
|
2004-09-13 18:03:09 +00:00
|
|
|
ok_sequence(WmCreateMDIclientSeq, "Create visible MDI client window", FALSE);
|
2004-06-30 18:16:08 +00:00
|
|
|
|
2004-09-21 00:24:22 +00:00
|
|
|
ok(GetActiveWindow() == mdi_frame, "wrong active window %p\n", GetActiveWindow());
|
2004-06-30 18:16:08 +00:00
|
|
|
ok(GetFocus() == mdi_frame, "input focus should be on MDI frame not on %p\n", GetFocus());
|
|
|
|
|
2004-09-13 19:16:31 +00:00
|
|
|
active_child = (HWND)SendMessageA(mdi_client, WM_MDIGETACTIVE, 0, (LPARAM)&zoomed);
|
|
|
|
ok(!active_child, "wrong active MDI child %p\n", active_child);
|
|
|
|
ok(!zoomed, "wrong zoomed state %d\n", zoomed);
|
|
|
|
|
2004-06-30 18:16:08 +00:00
|
|
|
SetFocus(0);
|
|
|
|
flush_sequence();
|
2004-06-23 20:51:21 +00:00
|
|
|
|
2004-12-06 16:38:19 +00:00
|
|
|
trace("creating invisible MDI child window\n");
|
|
|
|
mdi_child = CreateWindowExA(WS_EX_MDICHILD, "MDI_child_class", "MDI child",
|
|
|
|
WS_CHILD,
|
|
|
|
0, 0, CW_USEDEFAULT, CW_USEDEFAULT,
|
|
|
|
mdi_client, 0, GetModuleHandleA(0), NULL);
|
|
|
|
assert(mdi_child);
|
|
|
|
|
|
|
|
flush_sequence();
|
|
|
|
ShowWindow(mdi_child, SW_SHOWNORMAL);
|
|
|
|
ok_sequence(WmShowChildSeq, "ShowWindow(SW_SHOWNORMAL) MDI child window", FALSE);
|
|
|
|
|
|
|
|
ok(GetWindowLongA(mdi_child, GWL_STYLE) & WS_VISIBLE, "MDI child should be visible\n");
|
|
|
|
ok(IsWindowVisible(mdi_child), "MDI child should be visible\n");
|
|
|
|
|
|
|
|
ok(GetActiveWindow() == mdi_frame, "wrong active window %p\n", GetActiveWindow());
|
|
|
|
ok(GetFocus() == 0, "wrong focus window %p\n", GetFocus());
|
|
|
|
|
|
|
|
active_child = (HWND)SendMessageA(mdi_client, WM_MDIGETACTIVE, 0, (LPARAM)&zoomed);
|
|
|
|
ok(!active_child, "wrong active MDI child %p\n", active_child);
|
|
|
|
ok(!zoomed, "wrong zoomed state %d\n", zoomed);
|
|
|
|
|
|
|
|
ShowWindow(mdi_child, SW_HIDE);
|
|
|
|
ok_sequence(WmHideChildSeq, "ShowWindow(SW_HIDE) MDI child window", FALSE);
|
|
|
|
flush_sequence();
|
|
|
|
|
|
|
|
ShowWindow(mdi_child, SW_SHOW);
|
|
|
|
ok_sequence(WmShowChildSeq, "ShowWindow(SW_SHOW) MDI child window", FALSE);
|
|
|
|
|
|
|
|
ok(GetWindowLongA(mdi_child, GWL_STYLE) & WS_VISIBLE, "MDI child should be visible\n");
|
|
|
|
ok(IsWindowVisible(mdi_child), "MDI child should be visible\n");
|
|
|
|
|
|
|
|
ok(GetActiveWindow() == mdi_frame, "wrong active window %p\n", GetActiveWindow());
|
|
|
|
ok(GetFocus() == 0, "wrong focus window %p\n", GetFocus());
|
|
|
|
|
|
|
|
active_child = (HWND)SendMessageA(mdi_client, WM_MDIGETACTIVE, 0, (LPARAM)&zoomed);
|
|
|
|
ok(!active_child, "wrong active MDI child %p\n", active_child);
|
|
|
|
ok(!zoomed, "wrong zoomed state %d\n", zoomed);
|
|
|
|
|
|
|
|
DestroyWindow(mdi_child);
|
|
|
|
flush_sequence();
|
|
|
|
|
2004-06-30 18:16:08 +00:00
|
|
|
trace("creating visible MDI child window\n");
|
2004-06-23 20:51:21 +00:00
|
|
|
mdi_child = CreateWindowExA(WS_EX_MDICHILD, "MDI_child_class", "MDI child",
|
|
|
|
WS_CHILD | WS_VISIBLE,
|
|
|
|
0, 0, CW_USEDEFAULT, CW_USEDEFAULT,
|
|
|
|
mdi_client, 0, GetModuleHandleA(0), NULL);
|
|
|
|
assert(mdi_child);
|
2004-08-25 17:35:06 +00:00
|
|
|
ok_sequence(WmCreateMDIchildVisibleSeq, "Create visible MDI child window", TRUE);
|
2004-06-30 18:16:08 +00:00
|
|
|
|
|
|
|
ok(GetWindowLongA(mdi_child, GWL_STYLE) & WS_VISIBLE, "MDI child should be visible\n");
|
|
|
|
ok(IsWindowVisible(mdi_child), "MDI child should be visible\n");
|
2004-06-23 20:51:21 +00:00
|
|
|
|
2004-09-21 00:24:22 +00:00
|
|
|
ok(GetActiveWindow() == mdi_frame, "wrong active window %p\n", GetActiveWindow());
|
|
|
|
ok(GetFocus() == mdi_child, "wrong focus window %p\n", GetFocus());
|
|
|
|
|
2004-09-13 19:16:31 +00:00
|
|
|
active_child = (HWND)SendMessageA(mdi_client, WM_MDIGETACTIVE, 0, (LPARAM)&zoomed);
|
|
|
|
ok(active_child == mdi_child, "wrong active MDI child %p\n", active_child);
|
|
|
|
ok(!zoomed, "wrong zoomed state %d\n", zoomed);
|
|
|
|
flush_sequence();
|
|
|
|
|
2004-06-23 20:51:21 +00:00
|
|
|
DestroyWindow(mdi_child);
|
2004-08-25 17:35:06 +00:00
|
|
|
ok_sequence(WmDestroyMDIchildVisibleSeq, "Destroy visible MDI child window", TRUE);
|
2004-06-30 18:16:08 +00:00
|
|
|
|
2004-09-21 00:24:22 +00:00
|
|
|
ok(GetActiveWindow() == mdi_frame, "wrong active window %p\n", GetActiveWindow());
|
|
|
|
ok(GetFocus() == 0, "wrong focus window %p\n", GetFocus());
|
|
|
|
|
2004-09-13 19:16:31 +00:00
|
|
|
/* Win2k: MDI client still returns a just destroyed child as active
|
|
|
|
* Win9x: MDI client returns 0
|
|
|
|
*/
|
|
|
|
active_child = (HWND)SendMessageA(mdi_client, WM_MDIGETACTIVE, 0, (LPARAM)&zoomed);
|
|
|
|
ok(active_child == mdi_child || /* win2k */
|
|
|
|
!active_child, /* win9x */
|
|
|
|
"wrong active MDI child %p\n", active_child);
|
|
|
|
ok(!zoomed, "wrong zoomed state %d\n", zoomed);
|
|
|
|
|
2004-06-30 18:16:08 +00:00
|
|
|
flush_sequence();
|
|
|
|
|
|
|
|
trace("creating invisible MDI child window\n");
|
2004-09-13 19:16:31 +00:00
|
|
|
mdi_child2 = CreateWindowExA(WS_EX_MDICHILD, "MDI_child_class", "MDI child",
|
2004-06-30 18:16:08 +00:00
|
|
|
WS_CHILD,
|
|
|
|
0, 0, CW_USEDEFAULT, CW_USEDEFAULT,
|
|
|
|
mdi_client, 0, GetModuleHandleA(0), NULL);
|
2004-09-13 19:16:31 +00:00
|
|
|
assert(mdi_child2);
|
2004-09-21 00:24:22 +00:00
|
|
|
ok_sequence(WmCreateMDIchildInvisibleSeq, "Create invisible MDI child window", FALSE);
|
2004-06-30 18:16:08 +00:00
|
|
|
|
2004-09-13 19:16:31 +00:00
|
|
|
ok(!(GetWindowLongA(mdi_child2, GWL_STYLE) & WS_VISIBLE), "MDI child should not be visible\n");
|
|
|
|
ok(!IsWindowVisible(mdi_child2), "MDI child should not be visible\n");
|
2004-06-30 18:16:08 +00:00
|
|
|
|
2004-09-21 00:24:22 +00:00
|
|
|
ok(GetActiveWindow() == mdi_frame, "wrong active window %p\n", GetActiveWindow());
|
|
|
|
ok(GetFocus() == 0, "wrong focus window %p\n", GetFocus());
|
|
|
|
|
2004-09-13 19:16:31 +00:00
|
|
|
/* Win2k: MDI client still returns a just destroyed child as active
|
|
|
|
* Win9x: MDI client returns mdi_child2
|
|
|
|
*/
|
|
|
|
active_child = (HWND)SendMessageA(mdi_client, WM_MDIGETACTIVE, 0, (LPARAM)&zoomed);
|
|
|
|
ok(active_child == mdi_child || /* win2k */
|
|
|
|
active_child == mdi_child2, /* win9x */
|
|
|
|
"wrong active MDI child %p\n", active_child);
|
|
|
|
ok(!zoomed, "wrong zoomed state %d\n", zoomed);
|
|
|
|
flush_sequence();
|
|
|
|
|
2004-09-21 00:24:22 +00:00
|
|
|
ShowWindow(mdi_child2, SW_MAXIMIZE);
|
|
|
|
ok_sequence(WmMaximizeMDIchildInvisibleSeq, "ShowWindow(SW_MAXIMIZE):invisible MDI child", TRUE);
|
|
|
|
|
|
|
|
ok(GetWindowLongA(mdi_child2, GWL_STYLE) & WS_VISIBLE, "MDI child should be visible\n");
|
|
|
|
ok(IsWindowVisible(mdi_child2), "MDI child should be visible\n");
|
|
|
|
|
|
|
|
active_child = (HWND)SendMessageA(mdi_client, WM_MDIGETACTIVE, 0, (LPARAM)&zoomed);
|
|
|
|
ok(active_child == mdi_child2, "wrong active MDI child %p\n", active_child);
|
|
|
|
ok(zoomed, "wrong zoomed state %d\n", zoomed);
|
|
|
|
flush_sequence();
|
|
|
|
|
|
|
|
ok(GetActiveWindow() == mdi_frame, "wrong active window %p\n", GetActiveWindow());
|
|
|
|
ok(GetFocus() == mdi_child2 || /* win2k */
|
|
|
|
GetFocus() == 0, /* win9x */
|
|
|
|
"wrong focus window %p\n", GetFocus());
|
|
|
|
|
|
|
|
SetFocus(0);
|
|
|
|
flush_sequence();
|
|
|
|
|
|
|
|
ShowWindow(mdi_child2, SW_HIDE);
|
|
|
|
ok_sequence(WmHideChildSeq, "ShowWindow(SW_HIDE):MDI child", FALSE);
|
|
|
|
|
|
|
|
ShowWindow(mdi_child2, SW_RESTORE);
|
|
|
|
ok_sequence(WmRestoreMDIchildInisibleSeq, "ShowWindow(SW_RESTORE):invisible MDI child", TRUE);
|
|
|
|
flush_sequence();
|
|
|
|
|
|
|
|
ok(GetWindowLongA(mdi_child2, GWL_STYLE) & WS_VISIBLE, "MDI child should be visible\n");
|
|
|
|
ok(IsWindowVisible(mdi_child2), "MDI child should be visible\n");
|
|
|
|
|
|
|
|
active_child = (HWND)SendMessageA(mdi_client, WM_MDIGETACTIVE, 0, (LPARAM)&zoomed);
|
|
|
|
ok(active_child == mdi_child2, "wrong active MDI child %p\n", active_child);
|
|
|
|
ok(!zoomed, "wrong zoomed state %d\n", zoomed);
|
|
|
|
flush_sequence();
|
|
|
|
|
|
|
|
SetFocus(0);
|
|
|
|
flush_sequence();
|
|
|
|
|
|
|
|
ShowWindow(mdi_child2, SW_HIDE);
|
|
|
|
ok_sequence(WmHideChildSeq, "ShowWindow(SW_HIDE):MDI child", FALSE);
|
|
|
|
|
2004-09-13 19:16:31 +00:00
|
|
|
ShowWindow(mdi_child2, SW_SHOW);
|
|
|
|
ok_sequence(WmShowChildSeq, "ShowWindow(SW_SHOW):MDI child", TRUE);
|
|
|
|
|
2004-09-21 00:24:22 +00:00
|
|
|
ok(GetActiveWindow() == mdi_frame, "wrong active window %p\n", GetActiveWindow());
|
|
|
|
ok(GetFocus() == 0, "wrong focus window %p\n", GetFocus());
|
|
|
|
|
|
|
|
ShowWindow(mdi_child2, SW_MAXIMIZE);
|
|
|
|
ok_sequence(WmMaximizeMDIchildVisibleSeq, "ShowWindow(SW_MAXIMIZE):MDI child", TRUE);
|
|
|
|
|
|
|
|
ok(GetActiveWindow() == mdi_frame, "wrong active window %p\n", GetActiveWindow());
|
|
|
|
ok(GetFocus() == 0, "wrong focus window %p\n", GetFocus());
|
|
|
|
|
|
|
|
ShowWindow(mdi_child2, SW_RESTORE);
|
|
|
|
ok_sequence(WmRestoreMDIchildVisibleSeq, "ShowWindow(SW_RESTORE):MDI child", TRUE);
|
|
|
|
|
|
|
|
ok(GetActiveWindow() == mdi_frame, "wrong active window %p\n", GetActiveWindow());
|
|
|
|
ok(GetFocus() == 0, "wrong focus window %p\n", GetFocus());
|
|
|
|
|
|
|
|
SetFocus(0);
|
|
|
|
flush_sequence();
|
|
|
|
|
2004-09-13 19:16:31 +00:00
|
|
|
ShowWindow(mdi_child2, SW_HIDE);
|
|
|
|
ok_sequence(WmHideChildSeq, "ShowWindow(SW_HIDE):MDI child", FALSE);
|
|
|
|
|
2004-09-21 00:24:22 +00:00
|
|
|
ok(GetActiveWindow() == mdi_frame, "wrong active window %p\n", GetActiveWindow());
|
|
|
|
ok(GetFocus() == 0, "wrong focus window %p\n", GetFocus());
|
|
|
|
|
2004-09-13 19:16:31 +00:00
|
|
|
DestroyWindow(mdi_child2);
|
2004-08-25 17:35:06 +00:00
|
|
|
ok_sequence(WmDestroyMDIchildInvisibleSeq, "Destroy invisible MDI child window", TRUE);
|
2004-06-30 18:16:08 +00:00
|
|
|
|
2004-09-21 00:24:22 +00:00
|
|
|
ok(GetActiveWindow() == mdi_frame, "wrong active window %p\n", GetActiveWindow());
|
|
|
|
ok(GetFocus() == 0, "wrong focus window %p\n", GetFocus());
|
|
|
|
|
2004-09-13 19:16:31 +00:00
|
|
|
/* test for maximized MDI children */
|
|
|
|
trace("creating maximized visible MDI child window 1\n");
|
|
|
|
mdi_child = CreateWindowExA(WS_EX_MDICHILD, "MDI_child_class", "MDI child",
|
|
|
|
WS_CHILD | WS_VISIBLE | WS_MAXIMIZEBOX | WS_MAXIMIZE,
|
|
|
|
0, 0, CW_USEDEFAULT, CW_USEDEFAULT,
|
|
|
|
mdi_client, 0, GetModuleHandleA(0), NULL);
|
|
|
|
assert(mdi_child);
|
|
|
|
ok_sequence(WmCreateMDIchildVisibleMaxSeq1, "Create maximized visible 1st MDI child window", TRUE);
|
|
|
|
ok(IsZoomed(mdi_child), "1st MDI child should be maximized\n");
|
|
|
|
|
2004-09-21 00:24:22 +00:00
|
|
|
ok(GetActiveWindow() == mdi_frame, "wrong active window %p\n", GetActiveWindow());
|
|
|
|
ok(GetFocus() == mdi_child || /* win2k */
|
|
|
|
GetFocus() == 0, /* win9x */
|
|
|
|
"wrong focus window %p\n", GetFocus());
|
|
|
|
|
2004-09-13 19:16:31 +00:00
|
|
|
active_child = (HWND)SendMessageA(mdi_client, WM_MDIGETACTIVE, 0, (LPARAM)&zoomed);
|
|
|
|
ok(active_child == mdi_child, "wrong active MDI child %p\n", active_child);
|
|
|
|
ok(zoomed, "wrong zoomed state %d\n", zoomed);
|
|
|
|
flush_sequence();
|
|
|
|
|
|
|
|
trace("creating maximized visible MDI child window 2\n");
|
|
|
|
mdi_child2 = CreateWindowExA(WS_EX_MDICHILD, "MDI_child_class", "MDI child",
|
|
|
|
WS_CHILD | WS_VISIBLE | WS_MAXIMIZEBOX | WS_MAXIMIZE,
|
|
|
|
0, 0, CW_USEDEFAULT, CW_USEDEFAULT,
|
|
|
|
mdi_client, 0, GetModuleHandleA(0), NULL);
|
|
|
|
assert(mdi_child2);
|
|
|
|
ok_sequence(WmCreateMDIchildVisibleMaxSeq2, "Create maximized visible 2nd MDI child 2 window", TRUE);
|
|
|
|
ok(IsZoomed(mdi_child2), "2nd MDI child should be maximized\n");
|
|
|
|
ok(!IsZoomed(mdi_child), "1st MDI child should NOT be maximized\n");
|
|
|
|
|
2004-09-21 00:24:22 +00:00
|
|
|
ok(GetActiveWindow() == mdi_frame, "wrong active window %p\n", GetActiveWindow());
|
|
|
|
ok(GetFocus() == mdi_child2, "wrong focus window %p\n", GetFocus());
|
|
|
|
|
2004-09-13 19:16:31 +00:00
|
|
|
active_child = (HWND)SendMessageA(mdi_client, WM_MDIGETACTIVE, 0, (LPARAM)&zoomed);
|
|
|
|
ok(active_child == mdi_child2, "wrong active MDI child %p\n", active_child);
|
|
|
|
ok(zoomed, "wrong zoomed state %d\n", zoomed);
|
|
|
|
flush_sequence();
|
|
|
|
|
2004-09-21 00:24:22 +00:00
|
|
|
trace("destroying maximized visible MDI child window 2\n");
|
2004-09-13 19:16:31 +00:00
|
|
|
DestroyWindow(mdi_child2);
|
|
|
|
ok_sequence(WmDestroyMDIchildVisibleSeq, "Destroy visible MDI child window", TRUE);
|
|
|
|
|
|
|
|
ok(!IsZoomed(mdi_child), "1st MDI child should NOT be maximized\n");
|
2004-09-21 00:24:22 +00:00
|
|
|
|
|
|
|
ok(GetActiveWindow() == mdi_frame, "wrong active window %p\n", GetActiveWindow());
|
|
|
|
ok(GetFocus() == 0, "wrong focus window %p\n", GetFocus());
|
2004-09-13 19:16:31 +00:00
|
|
|
|
|
|
|
/* Win2k: MDI client still returns a just destroyed child as active
|
|
|
|
* Win9x: MDI client returns 0
|
|
|
|
*/
|
|
|
|
active_child = (HWND)SendMessageA(mdi_client, WM_MDIGETACTIVE, 0, (LPARAM)&zoomed);
|
|
|
|
ok(active_child == mdi_child2 || /* win2k */
|
|
|
|
!active_child, /* win9x */
|
|
|
|
"wrong active MDI child %p\n", active_child);
|
|
|
|
flush_sequence();
|
|
|
|
|
|
|
|
ShowWindow(mdi_child, SW_MAXIMIZE);
|
|
|
|
ok(IsZoomed(mdi_child), "1st MDI child should be maximized\n");
|
|
|
|
flush_sequence();
|
|
|
|
|
2004-09-21 00:24:22 +00:00
|
|
|
ok(GetActiveWindow() == mdi_frame, "wrong active window %p\n", GetActiveWindow());
|
|
|
|
ok(GetFocus() == mdi_child, "wrong focus window %p\n", GetFocus());
|
|
|
|
|
2004-09-13 19:16:31 +00:00
|
|
|
trace("re-creating maximized visible MDI child window 2\n");
|
|
|
|
mdi_child2 = CreateWindowExA(WS_EX_MDICHILD, "MDI_child_class", "MDI child",
|
|
|
|
WS_CHILD | WS_VISIBLE | WS_MAXIMIZEBOX | WS_MAXIMIZE,
|
|
|
|
0, 0, CW_USEDEFAULT, CW_USEDEFAULT,
|
|
|
|
mdi_client, 0, GetModuleHandleA(0), NULL);
|
|
|
|
assert(mdi_child2);
|
|
|
|
ok_sequence(WmCreateMDIchildVisibleMaxSeq2, "Create maximized visible 2nd MDI child 2 window", TRUE);
|
|
|
|
ok(IsZoomed(mdi_child2), "2nd MDI child should be maximized\n");
|
|
|
|
ok(!IsZoomed(mdi_child), "1st MDI child should NOT be maximized\n");
|
|
|
|
|
2004-09-21 00:24:22 +00:00
|
|
|
ok(GetActiveWindow() == mdi_frame, "wrong active window %p\n", GetActiveWindow());
|
|
|
|
ok(GetFocus() == mdi_child2, "wrong focus window %p\n", GetFocus());
|
|
|
|
|
2004-09-13 19:16:31 +00:00
|
|
|
active_child = (HWND)SendMessageA(mdi_client, WM_MDIGETACTIVE, 0, (LPARAM)&zoomed);
|
|
|
|
ok(active_child == mdi_child2, "wrong active MDI child %p\n", active_child);
|
|
|
|
ok(zoomed, "wrong zoomed state %d\n", zoomed);
|
|
|
|
flush_sequence();
|
|
|
|
|
|
|
|
SendMessageA(mdi_child2, WM_SYSCOMMAND, SC_CLOSE, 0);
|
|
|
|
ok_sequence(WmDestroyMDIchildVisibleMaxSeq2, "WM_SYSCOMMAND/SC_CLOSE on a visible maximized MDI child window", TRUE);
|
|
|
|
ok(!IsWindow(mdi_child2), "MDI child 2 should be destroyed\n");
|
|
|
|
|
|
|
|
ok(IsZoomed(mdi_child), "1st MDI child should be maximized\n");
|
2004-09-21 00:24:22 +00:00
|
|
|
ok(GetActiveWindow() == mdi_frame, "wrong active window %p\n", GetActiveWindow());
|
|
|
|
ok(GetFocus() == mdi_child, "wrong focus window %p\n", GetFocus());
|
2004-09-13 19:16:31 +00:00
|
|
|
|
|
|
|
active_child = (HWND)SendMessageA(mdi_client, WM_MDIGETACTIVE, 0, (LPARAM)&zoomed);
|
|
|
|
ok(active_child == mdi_child, "wrong active MDI child %p\n", active_child);
|
|
|
|
ok(zoomed, "wrong zoomed state %d\n", zoomed);
|
|
|
|
flush_sequence();
|
|
|
|
|
|
|
|
DestroyWindow(mdi_child);
|
|
|
|
ok_sequence(WmDestroyMDIchildVisibleSeq, "Destroy visible MDI child window", TRUE);
|
|
|
|
|
2004-09-21 00:24:22 +00:00
|
|
|
ok(GetActiveWindow() == mdi_frame, "wrong active window %p\n", GetActiveWindow());
|
|
|
|
ok(GetFocus() == 0, "wrong focus window %p\n", GetFocus());
|
|
|
|
|
2004-09-13 19:16:31 +00:00
|
|
|
/* Win2k: MDI client still returns a just destroyed child as active
|
|
|
|
* Win9x: MDI client returns 0
|
|
|
|
*/
|
|
|
|
active_child = (HWND)SendMessageA(mdi_client, WM_MDIGETACTIVE, 0, (LPARAM)&zoomed);
|
|
|
|
ok(active_child == mdi_child || /* win2k */
|
|
|
|
!active_child, /* win9x */
|
|
|
|
"wrong active MDI child %p\n", active_child);
|
|
|
|
flush_sequence();
|
|
|
|
/* end of test for maximized MDI children */
|
|
|
|
|
2004-10-05 02:10:04 +00:00
|
|
|
mdi_cs.szClass = "MDI_child_Class";
|
|
|
|
mdi_cs.szTitle = "MDI child";
|
|
|
|
mdi_cs.hOwner = GetModuleHandleA(0);
|
2004-10-08 23:36:18 +00:00
|
|
|
mdi_cs.x = 0;
|
|
|
|
mdi_cs.y = 0;
|
2004-10-05 02:10:04 +00:00
|
|
|
mdi_cs.cx = CW_USEDEFAULT;
|
|
|
|
mdi_cs.cy = CW_USEDEFAULT;
|
2004-10-08 23:36:18 +00:00
|
|
|
mdi_cs.style = WS_CHILD | WS_SYSMENU | WS_VISIBLE | WS_MAXIMIZEBOX | WS_MAXIMIZE;
|
2004-10-05 02:10:04 +00:00
|
|
|
mdi_cs.lParam = 0;
|
|
|
|
mdi_child = (HWND)SendMessageA(mdi_client, WM_MDICREATE, 0, (LPARAM)&mdi_cs);
|
|
|
|
ok(mdi_child != 0, "MDI child creation failed\n");
|
2004-10-08 23:36:18 +00:00
|
|
|
ok_sequence(WmCreateMDIchildVisibleMaxSeq3, "WM_MDICREATE for maximized visible MDI child window", TRUE);
|
|
|
|
|
|
|
|
ok(GetMenuItemID(hMenu, GetMenuItemCount(hMenu) - 1) == SC_CLOSE, "SC_CLOSE menu item not found\n");
|
2004-10-05 02:10:04 +00:00
|
|
|
|
|
|
|
active_child = (HWND)SendMessageA(mdi_client, WM_MDIGETACTIVE, 0, (LPARAM)&zoomed);
|
|
|
|
ok(active_child == mdi_child, "wrong active MDI child %p\n", active_child);
|
|
|
|
|
2004-10-08 23:36:18 +00:00
|
|
|
ok(IsZoomed(mdi_child), "MDI child should be maximized\n");
|
|
|
|
ok(GetActiveWindow() == mdi_frame, "wrong active window %p\n", GetActiveWindow());
|
|
|
|
ok(GetFocus() == mdi_child, "wrong focus window %p\n", GetFocus());
|
|
|
|
|
|
|
|
active_child = (HWND)SendMessageA(mdi_client, WM_MDIGETACTIVE, 0, (LPARAM)&zoomed);
|
|
|
|
ok(active_child == mdi_child, "wrong active MDI child %p\n", active_child);
|
|
|
|
ok(zoomed, "wrong zoomed state %d\n", zoomed);
|
|
|
|
flush_sequence();
|
|
|
|
|
2004-10-05 02:10:04 +00:00
|
|
|
SendMessageA(mdi_client, WM_MDIDESTROY, (WPARAM)mdi_child, 0);
|
2004-10-08 23:36:18 +00:00
|
|
|
ok_sequence(WmDestroyMDIchildVisibleMaxSeq1, "Destroy visible maximized MDI child window", TRUE);
|
|
|
|
|
2004-10-05 02:10:04 +00:00
|
|
|
ok(!IsWindow(mdi_child), "MDI child should be destroyed\n");
|
|
|
|
active_child = (HWND)SendMessageA(mdi_client, WM_MDIGETACTIVE, 0, (LPARAM)&zoomed);
|
|
|
|
ok(!active_child, "wrong active MDI child %p\n", active_child);
|
|
|
|
|
|
|
|
SetFocus(0);
|
|
|
|
flush_sequence();
|
|
|
|
|
2004-06-30 18:16:08 +00:00
|
|
|
DestroyWindow(mdi_client);
|
2004-08-25 17:35:06 +00:00
|
|
|
ok_sequence(WmDestroyMDIclientSeq, "Destroy MDI client window", FALSE);
|
2004-06-30 18:16:08 +00:00
|
|
|
|
2004-06-23 20:51:21 +00:00
|
|
|
DestroyWindow(mdi_frame);
|
2004-08-25 17:35:06 +00:00
|
|
|
ok_sequence(WmDestroyMDIframeSeq, "Destroy MDI frame window", FALSE);
|
2004-06-23 20:51:21 +00:00
|
|
|
}
|
|
|
|
/************************* End of MDI test **********************************/
|
|
|
|
|
2004-04-08 19:07:06 +00:00
|
|
|
static void test_WM_SETREDRAW(HWND hwnd)
|
|
|
|
{
|
|
|
|
DWORD style = GetWindowLongA(hwnd, GWL_STYLE);
|
|
|
|
|
|
|
|
flush_sequence();
|
|
|
|
|
|
|
|
SendMessageA(hwnd, WM_SETREDRAW, FALSE, 0);
|
2004-08-25 17:35:06 +00:00
|
|
|
ok_sequence(WmSetRedrawFalseSeq, "SetRedraw:FALSE", FALSE);
|
2004-04-08 19:07:06 +00:00
|
|
|
|
|
|
|
ok(!(GetWindowLongA(hwnd, GWL_STYLE) & WS_VISIBLE), "WS_VISIBLE should NOT be set\n");
|
|
|
|
ok(!IsWindowVisible(hwnd), "IsWindowVisible() should return FALSE\n");
|
|
|
|
|
|
|
|
flush_sequence();
|
|
|
|
SendMessageA(hwnd, WM_SETREDRAW, TRUE, 0);
|
2004-08-25 17:35:06 +00:00
|
|
|
ok_sequence(WmSetRedrawTrueSeq, "SetRedraw:TRUE", FALSE);
|
2004-04-08 19:07:06 +00:00
|
|
|
|
|
|
|
ok(GetWindowLongA(hwnd, GWL_STYLE) & WS_VISIBLE, "WS_VISIBLE should be set\n");
|
2004-05-05 01:35:37 +00:00
|
|
|
ok(IsWindowVisible(hwnd), "IsWindowVisible() should return TRUE\n");
|
2004-04-08 19:07:06 +00:00
|
|
|
|
|
|
|
/* restore original WS_VISIBLE state */
|
|
|
|
SetWindowLongA(hwnd, GWL_STYLE, style);
|
|
|
|
|
|
|
|
flush_sequence();
|
|
|
|
}
|
|
|
|
|
2004-05-18 20:44:23 +00:00
|
|
|
static INT_PTR CALLBACK TestModalDlgProcA(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
|
|
|
|
{
|
|
|
|
struct message msg;
|
|
|
|
|
|
|
|
trace("dialog: %p, %04x, %08x, %08lx\n", hwnd, message, wParam, lParam);
|
|
|
|
|
|
|
|
msg.message = message;
|
|
|
|
msg.flags = sent|wparam|lparam;
|
|
|
|
msg.wParam = wParam;
|
|
|
|
msg.lParam = lParam;
|
|
|
|
add_message(&msg);
|
|
|
|
|
|
|
|
if (message == WM_INITDIALOG) SetTimer( hwnd, 1, 100, NULL );
|
|
|
|
if (message == WM_TIMER) EndDialog( hwnd, 0 );
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2004-07-09 19:25:26 +00:00
|
|
|
static void test_hv_scroll_1(HWND hwnd, INT ctl, DWORD clear, DWORD set, INT min, INT max)
|
|
|
|
{
|
|
|
|
DWORD style, exstyle;
|
|
|
|
INT xmin, xmax;
|
|
|
|
|
|
|
|
exstyle = GetWindowLongA(hwnd, GWL_EXSTYLE);
|
|
|
|
style = GetWindowLongA(hwnd, GWL_STYLE);
|
|
|
|
/* do not be confused by WS_DLGFRAME set */
|
|
|
|
if ((style & WS_CAPTION) == WS_CAPTION) style &= ~WS_CAPTION;
|
|
|
|
|
|
|
|
if (clear) ok(style & clear, "style %08lx should be set\n", clear);
|
|
|
|
if (set) ok(!(style & set), "style %08lx should not be set\n", set);
|
|
|
|
|
|
|
|
ok(SetScrollRange(hwnd, ctl, min, max, FALSE), "SetScrollRange(%d) error %ld\n", ctl, GetLastError());
|
|
|
|
if ((style & (WS_DLGFRAME | WS_BORDER | WS_THICKFRAME)) || (exstyle & WS_EX_DLGMODALFRAME))
|
2004-08-25 17:35:06 +00:00
|
|
|
ok_sequence(WmSetScrollRangeHV_NC_Seq, "SetScrollRange(SB_HORZ/SB_VERT) NC", FALSE);
|
2004-07-09 19:25:26 +00:00
|
|
|
else
|
2004-08-25 17:35:06 +00:00
|
|
|
ok_sequence(WmSetScrollRangeHVSeq, "SetScrollRange(SB_HORZ/SB_VERT)", TRUE);
|
2004-07-09 19:25:26 +00:00
|
|
|
|
|
|
|
style = GetWindowLongA(hwnd, GWL_STYLE);
|
|
|
|
if (set) ok(style & set, "style %08lx should be set\n", set);
|
|
|
|
if (clear) ok(!(style & clear), "style %08lx should not be set\n", clear);
|
|
|
|
|
|
|
|
/* a subsequent call should do nothing */
|
|
|
|
ok(SetScrollRange(hwnd, ctl, min, max, FALSE), "SetScrollRange(%d) error %ld\n", ctl, GetLastError());
|
2004-08-25 17:35:06 +00:00
|
|
|
ok_sequence(WmEmptySeq, "SetScrollRange(SB_HORZ/SB_VERT)", FALSE);
|
2004-07-09 19:25:26 +00:00
|
|
|
|
|
|
|
xmin = 0xdeadbeef;
|
|
|
|
xmax = 0xdeadbeef;
|
|
|
|
trace("Ignore GetScrollRange error below if you are on Win9x\n");
|
|
|
|
ok(GetScrollRange(hwnd, ctl, &xmin, &xmax), "GetScrollRange(%d) error %ld\n", ctl, GetLastError());
|
2004-08-25 17:35:06 +00:00
|
|
|
ok_sequence(WmEmptySeq, "GetScrollRange(SB_HORZ/SB_VERT)", FALSE);
|
2004-07-09 19:25:26 +00:00
|
|
|
ok(xmin == min, "unexpected min scroll value %d\n", xmin);
|
|
|
|
ok(xmax == max, "unexpected max scroll value %d\n", xmax);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void test_hv_scroll_2(HWND hwnd, INT ctl, DWORD clear, DWORD set, INT min, INT max)
|
|
|
|
{
|
|
|
|
DWORD style, exstyle;
|
|
|
|
SCROLLINFO si;
|
|
|
|
|
|
|
|
exstyle = GetWindowLongA(hwnd, GWL_EXSTYLE);
|
|
|
|
style = GetWindowLongA(hwnd, GWL_STYLE);
|
|
|
|
/* do not be confused by WS_DLGFRAME set */
|
|
|
|
if ((style & WS_CAPTION) == WS_CAPTION) style &= ~WS_CAPTION;
|
|
|
|
|
|
|
|
if (clear) ok(style & clear, "style %08lx should be set\n", clear);
|
|
|
|
if (set) ok(!(style & set), "style %08lx should not be set\n", set);
|
|
|
|
|
|
|
|
si.cbSize = sizeof(si);
|
|
|
|
si.fMask = SIF_RANGE;
|
|
|
|
si.nMin = min;
|
|
|
|
si.nMax = max;
|
|
|
|
SetScrollInfo(hwnd, ctl, &si, TRUE);
|
|
|
|
if ((style & (WS_DLGFRAME | WS_BORDER | WS_THICKFRAME)) || (exstyle & WS_EX_DLGMODALFRAME))
|
2004-08-25 17:35:06 +00:00
|
|
|
ok_sequence(WmSetScrollRangeHV_NC_Seq, "SetScrollInfo(SB_HORZ/SB_VERT) NC", FALSE);
|
2004-07-09 19:25:26 +00:00
|
|
|
else
|
2004-08-25 17:35:06 +00:00
|
|
|
ok_sequence(WmSetScrollRangeHVSeq, "SetScrollInfo(SB_HORZ/SB_VERT)", TRUE);
|
2004-07-09 19:25:26 +00:00
|
|
|
|
|
|
|
style = GetWindowLongA(hwnd, GWL_STYLE);
|
|
|
|
if (set) ok(style & set, "style %08lx should be set\n", set);
|
|
|
|
if (clear) ok(!(style & clear), "style %08lx should not be set\n", clear);
|
|
|
|
|
|
|
|
/* a subsequent call should do nothing */
|
|
|
|
SetScrollInfo(hwnd, ctl, &si, TRUE);
|
2004-08-25 17:35:06 +00:00
|
|
|
ok_sequence(WmEmptySeq, "SetScrollInfo(SB_HORZ/SB_VERT)", FALSE);
|
2004-07-09 19:25:26 +00:00
|
|
|
|
|
|
|
si.fMask = SIF_PAGE;
|
|
|
|
si.nPage = 5;
|
|
|
|
SetScrollInfo(hwnd, ctl, &si, FALSE);
|
2004-08-25 17:35:06 +00:00
|
|
|
ok_sequence(WmEmptySeq, "SetScrollInfo(SB_HORZ/SB_VERT)", FALSE);
|
2004-07-09 19:25:26 +00:00
|
|
|
|
|
|
|
si.fMask = SIF_POS;
|
|
|
|
si.nPos = max - 1;
|
|
|
|
SetScrollInfo(hwnd, ctl, &si, FALSE);
|
2004-08-25 17:35:06 +00:00
|
|
|
ok_sequence(WmEmptySeq, "SetScrollInfo(SB_HORZ/SB_VERT)", FALSE);
|
2004-07-09 19:25:26 +00:00
|
|
|
|
|
|
|
si.fMask = SIF_RANGE;
|
|
|
|
si.nMin = 0xdeadbeef;
|
|
|
|
si.nMax = 0xdeadbeef;
|
|
|
|
ok(GetScrollInfo(hwnd, ctl, &si), "GetScrollInfo error %ld\n", GetLastError());
|
2004-08-25 17:35:06 +00:00
|
|
|
ok_sequence(WmEmptySeq, "GetScrollRange(SB_HORZ/SB_VERT)", FALSE);
|
2004-07-09 19:25:26 +00:00
|
|
|
ok(si.nMin == min, "unexpected min scroll value %d\n", si.nMin);
|
|
|
|
ok(si.nMax == max, "unexpected max scroll value %d\n", si.nMax);
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Win9x sends WM_USER+xxx while and NT versions send SBM_xxx messages */
|
|
|
|
static void test_scroll_messages(HWND hwnd)
|
|
|
|
{
|
|
|
|
SCROLLINFO si;
|
|
|
|
INT min, max;
|
|
|
|
|
|
|
|
min = 0xdeadbeef;
|
|
|
|
max = 0xdeadbeef;
|
|
|
|
ok(GetScrollRange(hwnd, SB_CTL, &min, &max), "GetScrollRange error %ld\n", GetLastError());
|
|
|
|
if (sequence->message != WmGetScrollRangeSeq[0].message)
|
|
|
|
trace("GetScrollRange(SB_CTL) generated unknown message %04x\n", sequence->message);
|
|
|
|
/* values of min and max are undefined */
|
|
|
|
flush_sequence();
|
|
|
|
|
|
|
|
ok(SetScrollRange(hwnd, SB_CTL, 10, 150, FALSE), "SetScrollRange error %ld\n", GetLastError());
|
|
|
|
if (sequence->message != WmSetScrollRangeSeq[0].message)
|
|
|
|
trace("SetScrollRange(SB_CTL) generated unknown message %04x\n", sequence->message);
|
|
|
|
flush_sequence();
|
|
|
|
|
|
|
|
min = 0xdeadbeef;
|
|
|
|
max = 0xdeadbeef;
|
|
|
|
ok(GetScrollRange(hwnd, SB_CTL, &min, &max), "GetScrollRange error %ld\n", GetLastError());
|
|
|
|
if (sequence->message != WmGetScrollRangeSeq[0].message)
|
|
|
|
trace("GetScrollRange(SB_CTL) generated unknown message %04x\n", sequence->message);
|
|
|
|
/* values of min and max are undefined */
|
|
|
|
flush_sequence();
|
|
|
|
|
|
|
|
si.cbSize = sizeof(si);
|
|
|
|
si.fMask = SIF_RANGE;
|
|
|
|
si.nMin = 20;
|
|
|
|
si.nMax = 160;
|
|
|
|
SetScrollInfo(hwnd, SB_CTL, &si, FALSE);
|
|
|
|
if (sequence->message != WmSetScrollRangeSeq[0].message)
|
|
|
|
trace("SetScrollInfo(SB_CTL) generated unknown message %04x\n", sequence->message);
|
|
|
|
flush_sequence();
|
|
|
|
|
|
|
|
si.fMask = SIF_PAGE;
|
|
|
|
si.nPage = 10;
|
|
|
|
SetScrollInfo(hwnd, SB_CTL, &si, FALSE);
|
|
|
|
if (sequence->message != WmSetScrollRangeSeq[0].message)
|
|
|
|
trace("SetScrollInfo(SB_CTL) generated unknown message %04x\n", sequence->message);
|
|
|
|
flush_sequence();
|
|
|
|
|
|
|
|
si.fMask = SIF_POS;
|
|
|
|
si.nPos = 20;
|
|
|
|
SetScrollInfo(hwnd, SB_CTL, &si, FALSE);
|
|
|
|
if (sequence->message != WmSetScrollRangeSeq[0].message)
|
|
|
|
trace("SetScrollInfo(SB_CTL) generated unknown message %04x\n", sequence->message);
|
|
|
|
flush_sequence();
|
|
|
|
|
|
|
|
si.fMask = SIF_RANGE;
|
|
|
|
si.nMin = 0xdeadbeef;
|
|
|
|
si.nMax = 0xdeadbeef;
|
|
|
|
ok(GetScrollInfo(hwnd, SB_CTL, &si), "GetScrollInfo error %ld\n", GetLastError());
|
|
|
|
if (sequence->message != WmGetScrollInfoSeq[0].message)
|
|
|
|
trace("GetScrollInfo(SB_CTL) generated unknown message %04x\n", sequence->message);
|
|
|
|
/* values of min and max are undefined */
|
|
|
|
flush_sequence();
|
|
|
|
|
|
|
|
/* set WS_HSCROLL */
|
|
|
|
test_hv_scroll_1(hwnd, SB_HORZ, 0, WS_HSCROLL, 10, 150);
|
|
|
|
/* clear WS_HSCROLL */
|
|
|
|
test_hv_scroll_1(hwnd, SB_HORZ, WS_HSCROLL, 0, 0, 0);
|
|
|
|
|
|
|
|
/* set WS_HSCROLL */
|
|
|
|
test_hv_scroll_2(hwnd, SB_HORZ, 0, WS_HSCROLL, 10, 150);
|
|
|
|
/* clear WS_HSCROLL */
|
|
|
|
test_hv_scroll_2(hwnd, SB_HORZ, WS_HSCROLL, 0, 0, 0);
|
|
|
|
|
|
|
|
/* set WS_VSCROLL */
|
|
|
|
test_hv_scroll_1(hwnd, SB_VERT, 0, WS_VSCROLL, 10, 150);
|
|
|
|
/* clear WS_VSCROLL */
|
|
|
|
test_hv_scroll_1(hwnd, SB_VERT, WS_VSCROLL, 0, 0, 0);
|
|
|
|
|
|
|
|
/* set WS_VSCROLL */
|
|
|
|
test_hv_scroll_2(hwnd, SB_VERT, 0, WS_VSCROLL, 10, 150);
|
|
|
|
/* clear WS_VSCROLL */
|
|
|
|
test_hv_scroll_2(hwnd, SB_VERT, WS_VSCROLL, 0, 0, 0);
|
|
|
|
}
|
|
|
|
|
2003-10-02 04:32:56 +00:00
|
|
|
/* test if we receive the right sequence of messages */
|
|
|
|
static void test_messages(void)
|
|
|
|
{
|
|
|
|
HWND hwnd, hparent, hchild;
|
|
|
|
HWND hchild2, hbutton;
|
2004-02-17 20:29:05 +00:00
|
|
|
HMENU hmenu;
|
2004-11-23 17:39:13 +00:00
|
|
|
MSG msg;
|
2003-10-02 04:32:56 +00:00
|
|
|
|
|
|
|
hwnd = CreateWindowExA(0, "TestWindowClass", "Test overlapped", WS_OVERLAPPEDWINDOW,
|
|
|
|
100, 100, 200, 200, 0, 0, 0, NULL);
|
|
|
|
ok (hwnd != 0, "Failed to create overlapped window\n");
|
2004-08-25 17:35:06 +00:00
|
|
|
ok_sequence(WmCreateOverlappedSeq, "CreateWindow:overlapped", FALSE);
|
2004-04-08 19:07:06 +00:00
|
|
|
|
2004-06-03 23:26:35 +00:00
|
|
|
/* test ShowWindow(SW_HIDE) on a newly created invisible window */
|
|
|
|
ok( ShowWindow(hwnd, SW_HIDE) == FALSE, "ShowWindow: window was visible\n" );
|
2004-08-25 17:35:06 +00:00
|
|
|
ok_sequence(WmHideInvisibleOverlappedSeq, "ShowWindow(SW_HIDE):overlapped, invisible", FALSE);
|
2004-06-03 23:26:35 +00:00
|
|
|
|
2004-04-08 19:07:06 +00:00
|
|
|
/* test WM_SETREDRAW on a not visible top level window */
|
|
|
|
test_WM_SETREDRAW(hwnd);
|
2004-05-10 19:59:20 +00:00
|
|
|
|
|
|
|
SetWindowPos(hwnd, 0,0,0,0,0, SWP_SHOWWINDOW|SWP_NOSIZE|SWP_NOMOVE);
|
2004-08-25 17:35:06 +00:00
|
|
|
ok_sequence(WmSWP_ShowOverlappedSeq, "SetWindowPos:SWP_SHOWWINDOW:overlapped", FALSE);
|
2004-05-10 19:59:20 +00:00
|
|
|
ok(IsWindowVisible(hwnd), "window should be visible at this point\n");
|
|
|
|
|
|
|
|
ok(GetActiveWindow() == hwnd, "window should be active\n");
|
|
|
|
ok(GetFocus() == hwnd, "window should have input focus\n");
|
|
|
|
ShowWindow(hwnd, SW_HIDE);
|
2004-08-25 17:35:06 +00:00
|
|
|
ok_sequence(WmHideOverlappedSeq, "ShowWindow(SW_HIDE):overlapped", TRUE);
|
2003-10-02 04:32:56 +00:00
|
|
|
|
2004-04-02 20:22:53 +00:00
|
|
|
ShowWindow(hwnd, SW_SHOW);
|
2004-08-25 17:35:06 +00:00
|
|
|
ok_sequence(WmShowOverlappedSeq, "ShowWindow(SW_SHOW):overlapped", TRUE);
|
2004-05-10 19:59:20 +00:00
|
|
|
|
|
|
|
ok(GetActiveWindow() == hwnd, "window should be active\n");
|
|
|
|
ok(GetFocus() == hwnd, "window should have input focus\n");
|
|
|
|
SetWindowPos(hwnd, 0,0,0,0,0, SWP_HIDEWINDOW|SWP_NOSIZE|SWP_NOMOVE);
|
2004-09-21 00:24:22 +00:00
|
|
|
ok_sequence(WmSWP_HideOverlappedSeq, "SetWindowPos:SWP_HIDEWINDOW:overlapped", TRUE);
|
2004-05-10 19:59:20 +00:00
|
|
|
ok(!IsWindowVisible(hwnd), "window should not be visible at this point\n");
|
2003-10-02 04:32:56 +00:00
|
|
|
|
2004-04-08 19:07:06 +00:00
|
|
|
/* test WM_SETREDRAW on a visible top level window */
|
2004-05-10 19:59:20 +00:00
|
|
|
ShowWindow(hwnd, SW_SHOW);
|
2004-04-08 19:07:06 +00:00
|
|
|
test_WM_SETREDRAW(hwnd);
|
|
|
|
|
2004-07-09 19:25:26 +00:00
|
|
|
trace("testing scroll APIs on a visible top level window %p\n", hwnd);
|
|
|
|
test_scroll_messages(hwnd);
|
|
|
|
|
2003-10-02 04:32:56 +00:00
|
|
|
DestroyWindow(hwnd);
|
2004-08-25 17:35:06 +00:00
|
|
|
ok_sequence(WmDestroyOverlappedSeq, "DestroyWindow:overlapped", FALSE);
|
2003-10-02 04:32:56 +00:00
|
|
|
|
2004-03-25 23:35:52 +00:00
|
|
|
hparent = CreateWindowExA(0, "TestParentClass", "Test parent", WS_OVERLAPPEDWINDOW | WS_VISIBLE,
|
2003-10-02 04:32:56 +00:00
|
|
|
100, 100, 200, 200, 0, 0, 0, NULL);
|
|
|
|
ok (hparent != 0, "Failed to create parent window\n");
|
|
|
|
flush_sequence();
|
|
|
|
|
2004-04-29 20:00:40 +00:00
|
|
|
hchild = CreateWindowExA(0, "TestWindowClass", "Test child", WS_CHILD | WS_MAXIMIZE,
|
|
|
|
0, 0, 10, 10, hparent, 0, 0, NULL);
|
|
|
|
ok (hchild != 0, "Failed to create child window\n");
|
2004-09-13 18:03:09 +00:00
|
|
|
ok_sequence(WmCreateMaximizedChildSeq, "CreateWindow:maximized child", TRUE);
|
2004-04-29 20:00:40 +00:00
|
|
|
DestroyWindow(hchild);
|
|
|
|
flush_sequence();
|
|
|
|
|
2004-09-21 00:24:22 +00:00
|
|
|
/* visible child window with a caption */
|
|
|
|
hchild = CreateWindowExA(0, "TestWindowClass", "Test child",
|
|
|
|
WS_CHILD | WS_VISIBLE | WS_CAPTION,
|
2004-06-18 19:33:55 +00:00
|
|
|
0, 0, 10, 10, hparent, 0, 0, NULL);
|
|
|
|
ok (hchild != 0, "Failed to create child window\n");
|
2004-08-25 17:35:06 +00:00
|
|
|
ok_sequence(WmCreateVisibleChildSeq, "CreateWindow:visible child", FALSE);
|
2004-07-09 19:25:26 +00:00
|
|
|
|
|
|
|
trace("testing scroll APIs on a visible child window %p\n", hchild);
|
|
|
|
test_scroll_messages(hchild);
|
|
|
|
|
2004-09-21 00:24:22 +00:00
|
|
|
SetWindowPos(hchild, 0,0,0,0,0, SWP_SHOWWINDOW|SWP_NOSIZE|SWP_NOMOVE);
|
|
|
|
ok_sequence(WmShowChildSeq_4, "SetWindowPos(SWP_SHOWWINDOW):child with a caption", FALSE);
|
|
|
|
|
2004-06-18 19:33:55 +00:00
|
|
|
DestroyWindow(hchild);
|
|
|
|
flush_sequence();
|
|
|
|
|
|
|
|
hchild = CreateWindowExA(0, "TestWindowClass", "Test child", WS_CHILD,
|
2003-10-02 04:32:56 +00:00
|
|
|
0, 0, 10, 10, hparent, 0, 0, NULL);
|
|
|
|
ok (hchild != 0, "Failed to create child window\n");
|
2004-08-25 17:35:06 +00:00
|
|
|
ok_sequence(WmCreateChildSeq, "CreateWindow:child", FALSE);
|
2003-10-02 04:32:56 +00:00
|
|
|
|
2004-06-18 19:33:55 +00:00
|
|
|
hchild2 = CreateWindowExA(0, "SimpleWindowClass", "Test child2", WS_CHILD,
|
2003-10-02 04:32:56 +00:00
|
|
|
100, 100, 50, 50, hparent, 0, 0, NULL);
|
|
|
|
ok (hchild2 != 0, "Failed to create child2 window\n");
|
|
|
|
flush_sequence();
|
|
|
|
|
2004-06-18 19:33:55 +00:00
|
|
|
hbutton = CreateWindowExA(0, "TestWindowClass", "Test button", WS_CHILD,
|
2003-10-02 04:32:56 +00:00
|
|
|
0, 100, 50, 50, hchild, 0, 0, NULL);
|
|
|
|
ok (hbutton != 0, "Failed to create button window\n");
|
2004-04-08 19:07:06 +00:00
|
|
|
|
|
|
|
/* test WM_SETREDRAW on a not visible child window */
|
|
|
|
test_WM_SETREDRAW(hchild);
|
2003-10-02 04:32:56 +00:00
|
|
|
|
2004-04-02 20:22:53 +00:00
|
|
|
ShowWindow(hchild, SW_SHOW);
|
2004-09-13 18:03:09 +00:00
|
|
|
ok_sequence(WmShowChildSeq, "ShowWindow(SW_SHOW):child", FALSE);
|
|
|
|
|
|
|
|
ShowWindow(hchild, SW_HIDE);
|
|
|
|
ok_sequence(WmHideChildSeq, "ShowWindow(SW_HIDE):child", FALSE);
|
|
|
|
|
|
|
|
ShowWindow(hchild, SW_SHOW);
|
|
|
|
ok_sequence(WmShowChildSeq, "ShowWindow(SW_SHOW):child", FALSE);
|
2003-10-02 04:32:56 +00:00
|
|
|
|
2004-04-08 19:07:06 +00:00
|
|
|
/* test WM_SETREDRAW on a visible child window */
|
|
|
|
test_WM_SETREDRAW(hchild);
|
|
|
|
|
2003-10-02 04:32:56 +00:00
|
|
|
MoveWindow(hchild, 10, 10, 20, 20, TRUE);
|
2004-08-25 17:35:06 +00:00
|
|
|
ok_sequence(WmResizingChildWithMoveWindowSeq, "MoveWindow:child", FALSE);
|
2003-10-02 04:32:56 +00:00
|
|
|
|
2004-06-18 19:33:55 +00:00
|
|
|
ShowWindow(hchild, SW_HIDE);
|
|
|
|
flush_sequence();
|
|
|
|
SetWindowPos(hchild, 0,0,0,0,0, SWP_SHOWWINDOW|SWP_NOSIZE|SWP_NOMOVE);
|
2004-08-25 17:35:06 +00:00
|
|
|
ok_sequence(WmShowChildSeq_2, "SetWindowPos:show_child_2", FALSE);
|
2004-06-18 19:33:55 +00:00
|
|
|
|
|
|
|
ShowWindow(hchild, SW_HIDE);
|
|
|
|
flush_sequence();
|
|
|
|
SetWindowPos(hchild, 0,0,0,0,0, SWP_SHOWWINDOW|SWP_NOSIZE|SWP_NOMOVE|SWP_NOACTIVATE);
|
2004-08-25 17:35:06 +00:00
|
|
|
ok_sequence(WmShowChildSeq_3, "SetWindowPos:show_child_3", FALSE);
|
2004-06-18 19:33:55 +00:00
|
|
|
|
|
|
|
/* DestroyWindow sequence below expects that a child has focus */
|
|
|
|
SetFocus(hchild);
|
|
|
|
flush_sequence();
|
|
|
|
|
2003-10-02 04:32:56 +00:00
|
|
|
DestroyWindow(hchild);
|
2004-08-25 17:35:06 +00:00
|
|
|
ok_sequence(WmDestroyChildSeq, "DestroyWindow:child", FALSE);
|
2004-02-17 20:29:05 +00:00
|
|
|
DestroyWindow(hchild2);
|
|
|
|
DestroyWindow(hbutton);
|
2004-04-02 20:22:53 +00:00
|
|
|
|
|
|
|
flush_sequence();
|
|
|
|
hchild = CreateWindowExA(0, "TestWindowClass", "Test Child Popup", WS_CHILD | WS_POPUP,
|
|
|
|
0, 0, 100, 100, hparent, 0, 0, NULL);
|
|
|
|
ok (hchild != 0, "Failed to create child popup window\n");
|
2004-08-25 17:35:06 +00:00
|
|
|
ok_sequence(WmCreateChildPopupSeq, "CreateWindow:child_popup", FALSE);
|
2004-04-02 20:22:53 +00:00
|
|
|
DestroyWindow(hchild);
|
|
|
|
|
|
|
|
/* test what happens to a window which sets WS_VISIBLE in WM_CREATE */
|
|
|
|
flush_sequence();
|
|
|
|
hchild = CreateWindowExA(0, "TestPopupClass", "Test Popup", WS_POPUP,
|
|
|
|
0, 0, 100, 100, hparent, 0, 0, NULL);
|
|
|
|
ok (hchild != 0, "Failed to create popup window\n");
|
2004-08-25 17:35:06 +00:00
|
|
|
ok_sequence(WmCreateInvisiblePopupSeq, "CreateWindow:invisible_popup", FALSE);
|
2004-04-02 20:22:53 +00:00
|
|
|
ok(GetWindowLongA(hchild, GWL_STYLE) & WS_VISIBLE, "WS_VISIBLE should be set\n");
|
|
|
|
ok(IsWindowVisible(hchild), "IsWindowVisible() should return TRUE\n");
|
|
|
|
flush_sequence();
|
|
|
|
ShowWindow(hchild, SW_SHOW);
|
2004-08-25 17:35:06 +00:00
|
|
|
ok_sequence(WmEmptySeq, "ShowWindow:show_visible_popup", FALSE);
|
2004-04-02 20:22:53 +00:00
|
|
|
flush_sequence();
|
|
|
|
SetWindowPos(hchild, 0,0,0,0,0, SWP_SHOWWINDOW|SWP_NOSIZE|SWP_NOMOVE|SWP_NOACTIVATE|SWP_NOZORDER);
|
2004-08-25 17:35:06 +00:00
|
|
|
ok_sequence(WmShowVisiblePopupSeq_2, "SetWindowPos:show_visible_popup_2", FALSE);
|
2004-04-02 20:22:53 +00:00
|
|
|
flush_sequence();
|
|
|
|
SetWindowPos(hchild, 0,0,0,0,0, SWP_SHOWWINDOW|SWP_NOSIZE|SWP_NOMOVE);
|
2004-08-25 17:35:06 +00:00
|
|
|
ok_sequence(WmShowVisiblePopupSeq_3, "SetWindowPos:show_visible_popup_3", FALSE);
|
2004-04-02 20:22:53 +00:00
|
|
|
DestroyWindow(hchild);
|
|
|
|
|
|
|
|
/* this time add WS_VISIBLE for CreateWindowEx, but this fact actually
|
|
|
|
* changes nothing in message sequences.
|
|
|
|
*/
|
|
|
|
flush_sequence();
|
|
|
|
hchild = CreateWindowExA(0, "TestPopupClass", "Test Popup", WS_POPUP | WS_VISIBLE,
|
|
|
|
0, 0, 100, 100, hparent, 0, 0, NULL);
|
|
|
|
ok (hchild != 0, "Failed to create popup window\n");
|
2004-08-25 17:35:06 +00:00
|
|
|
ok_sequence(WmCreateInvisiblePopupSeq, "CreateWindow:invisible_popup", FALSE);
|
2004-04-02 20:22:53 +00:00
|
|
|
ok(GetWindowLongA(hchild, GWL_STYLE) & WS_VISIBLE, "WS_VISIBLE should be set\n");
|
|
|
|
ok(IsWindowVisible(hchild), "IsWindowVisible() should return TRUE\n");
|
|
|
|
flush_sequence();
|
|
|
|
ShowWindow(hchild, SW_SHOW);
|
2004-08-25 17:35:06 +00:00
|
|
|
ok_sequence(WmEmptySeq, "ShowWindow:show_visible_popup", FALSE);
|
2004-04-02 20:22:53 +00:00
|
|
|
flush_sequence();
|
|
|
|
SetWindowPos(hchild, 0,0,0,0,0, SWP_SHOWWINDOW|SWP_NOSIZE|SWP_NOMOVE|SWP_NOACTIVATE|SWP_NOZORDER);
|
2004-08-25 17:35:06 +00:00
|
|
|
ok_sequence(WmShowVisiblePopupSeq_2, "SetWindowPos:show_visible_popup_2", FALSE);
|
2004-04-02 20:22:53 +00:00
|
|
|
DestroyWindow(hchild);
|
|
|
|
|
2004-04-20 04:02:50 +00:00
|
|
|
flush_sequence();
|
|
|
|
hwnd = CreateWindowExA(WS_EX_DLGMODALFRAME, "TestDialogClass", NULL, WS_VISIBLE|WS_CAPTION|WS_SYSMENU|WS_DLGFRAME,
|
|
|
|
0, 0, 100, 100, hparent, 0, 0, NULL);
|
|
|
|
ok(hwnd != 0, "Failed to create custom dialog window\n");
|
2004-08-25 17:35:06 +00:00
|
|
|
ok_sequence(WmCreateCustomDialogSeq, "CreateCustomDialog", TRUE);
|
2004-05-18 20:44:23 +00:00
|
|
|
|
2004-07-09 19:25:26 +00:00
|
|
|
trace("testing scroll APIs on a visible dialog %p\n", hwnd);
|
|
|
|
test_scroll_messages(hwnd);
|
|
|
|
|
2004-05-18 20:44:23 +00:00
|
|
|
flush_sequence();
|
|
|
|
after_end_dialog = 1;
|
|
|
|
EndDialog( hwnd, 0 );
|
2004-08-25 17:35:06 +00:00
|
|
|
ok_sequence(WmEndCustomDialogSeq, "EndCustomDialog", FALSE);
|
2004-05-18 20:44:23 +00:00
|
|
|
|
2004-04-20 04:02:50 +00:00
|
|
|
DestroyWindow(hwnd);
|
2004-05-18 20:44:23 +00:00
|
|
|
after_end_dialog = 0;
|
|
|
|
|
|
|
|
flush_sequence();
|
|
|
|
DialogBoxA( 0, "TEST_DIALOG", hparent, TestModalDlgProcA );
|
2004-08-25 17:35:06 +00:00
|
|
|
ok_sequence(WmModalDialogSeq, "ModalDialog", TRUE);
|
2004-04-20 04:02:50 +00:00
|
|
|
|
2004-09-08 22:02:23 +00:00
|
|
|
/* test showing child with hidden parent */
|
|
|
|
ShowWindow( hparent, SW_HIDE );
|
|
|
|
flush_sequence();
|
|
|
|
|
|
|
|
hchild = CreateWindowExA(0, "TestWindowClass", "Test child", WS_CHILD,
|
|
|
|
0, 0, 10, 10, hparent, 0, 0, NULL);
|
|
|
|
ok (hchild != 0, "Failed to create child window\n");
|
|
|
|
ok_sequence(WmCreateChildSeq, "CreateWindow:child", FALSE);
|
|
|
|
|
|
|
|
ShowWindow( hchild, SW_SHOW );
|
|
|
|
ok_sequence(WmShowChildInvisibleParentSeq, "ShowWindow:show child with invisible parent", TRUE);
|
|
|
|
ok(GetWindowLongA(hchild, GWL_STYLE) & WS_VISIBLE, "WS_VISIBLE should be set\n");
|
|
|
|
ok(!IsWindowVisible(hchild), "IsWindowVisible() should return FALSE\n");
|
|
|
|
|
|
|
|
ShowWindow( hchild, SW_HIDE );
|
|
|
|
ok_sequence(WmHideChildInvisibleParentSeq, "ShowWindow:hide child with invisible parent", TRUE);
|
|
|
|
ok(!(GetWindowLongA(hchild, GWL_STYLE) & WS_VISIBLE), "WS_VISIBLE should be not set\n");
|
|
|
|
ok(!IsWindowVisible(hchild), "IsWindowVisible() should return FALSE\n");
|
|
|
|
|
|
|
|
SetWindowPos(hchild, 0,0,0,0,0, SWP_SHOWWINDOW|SWP_NOSIZE|SWP_NOMOVE|SWP_NOACTIVATE|SWP_NOZORDER);
|
2004-09-13 18:03:09 +00:00
|
|
|
ok_sequence(WmShowChildInvisibleParentSeq_2, "SetWindowPos:show child with invisible parent", TRUE);
|
2004-09-08 22:02:23 +00:00
|
|
|
ok(GetWindowLongA(hchild, GWL_STYLE) & WS_VISIBLE, "WS_VISIBLE should be set\n");
|
|
|
|
ok(!IsWindowVisible(hchild), "IsWindowVisible() should return FALSE\n");
|
|
|
|
|
|
|
|
SetWindowPos(hchild, 0,0,0,0,0, SWP_HIDEWINDOW|SWP_NOSIZE|SWP_NOMOVE|SWP_NOACTIVATE|SWP_NOZORDER);
|
2004-09-13 18:03:09 +00:00
|
|
|
ok_sequence(WmHideChildInvisibleParentSeq_2, "SetWindowPos:hide child with invisible parent", TRUE);
|
2004-09-08 22:02:23 +00:00
|
|
|
ok(!(GetWindowLongA(hchild, GWL_STYLE) & WS_VISIBLE), "WS_VISIBLE should not be set\n");
|
|
|
|
ok(!IsWindowVisible(hchild), "IsWindowVisible() should return FALSE\n");
|
|
|
|
|
2004-10-05 23:45:35 +00:00
|
|
|
DestroyWindow(hchild);
|
2004-02-17 20:29:05 +00:00
|
|
|
DestroyWindow(hparent);
|
|
|
|
flush_sequence();
|
|
|
|
|
|
|
|
/* Message sequence for SetMenu */
|
2004-10-08 23:36:18 +00:00
|
|
|
ok(!DrawMenuBar(hwnd), "DrawMenuBar should return FALSE for a window without a menu\n");
|
|
|
|
ok_sequence(WmEmptySeq, "DrawMenuBar for a window without a menu", FALSE);
|
|
|
|
|
2004-02-17 20:29:05 +00:00
|
|
|
hmenu = CreateMenu();
|
|
|
|
ok (hmenu != 0, "Failed to create menu\n");
|
|
|
|
ok (InsertMenuA(hmenu, -1, MF_BYPOSITION, 0x1000, "foo"), "InsertMenu failed\n");
|
|
|
|
hwnd = CreateWindowExA(0, "TestWindowClass", "Test overlapped", WS_OVERLAPPEDWINDOW,
|
|
|
|
100, 100, 200, 200, 0, hmenu, 0, NULL);
|
2004-08-25 17:35:06 +00:00
|
|
|
ok_sequence(WmCreateOverlappedSeq, "CreateWindow:overlapped", FALSE);
|
2004-05-05 01:35:37 +00:00
|
|
|
ok (SetMenu(hwnd, 0), "SetMenu\n");
|
2004-08-25 17:35:06 +00:00
|
|
|
ok_sequence(WmSetMenuNonVisibleSizeChangeSeq, "SetMenu:NonVisibleSizeChange", FALSE);
|
2004-05-05 01:35:37 +00:00
|
|
|
ok (SetMenu(hwnd, 0), "SetMenu\n");
|
2004-08-25 17:35:06 +00:00
|
|
|
ok_sequence(WmSetMenuNonVisibleNoSizeChangeSeq, "SetMenu:NonVisibleNoSizeChange", FALSE);
|
2004-04-02 20:22:53 +00:00
|
|
|
ShowWindow(hwnd, SW_SHOW);
|
2004-02-17 20:29:05 +00:00
|
|
|
flush_sequence();
|
2004-05-05 01:35:37 +00:00
|
|
|
ok (SetMenu(hwnd, 0), "SetMenu\n");
|
2004-08-25 17:35:06 +00:00
|
|
|
ok_sequence(WmSetMenuVisibleNoSizeChangeSeq, "SetMenu:VisibleNoSizeChange", TRUE);
|
2004-05-05 01:35:37 +00:00
|
|
|
ok (SetMenu(hwnd, hmenu), "SetMenu\n");
|
2004-08-25 17:35:06 +00:00
|
|
|
ok_sequence(WmSetMenuVisibleSizeChangeSeq, "SetMenu:VisibleSizeChange", TRUE);
|
2004-02-17 20:29:05 +00:00
|
|
|
|
2004-05-24 19:08:54 +00:00
|
|
|
ok(DrawMenuBar(hwnd), "DrawMenuBar\n");
|
2004-08-25 17:35:06 +00:00
|
|
|
ok_sequence(WmDrawMenuBarSeq, "DrawMenuBar", TRUE);
|
2004-05-24 19:08:54 +00:00
|
|
|
|
2004-04-20 04:02:50 +00:00
|
|
|
DestroyWindow(hwnd);
|
2004-06-03 00:08:55 +00:00
|
|
|
flush_sequence();
|
|
|
|
|
|
|
|
/* Message sequence for EnableWindow */
|
|
|
|
hparent = CreateWindowExA(0, "TestWindowClass", "Test parent", WS_OVERLAPPEDWINDOW | WS_VISIBLE,
|
|
|
|
100, 100, 200, 200, 0, 0, 0, NULL);
|
|
|
|
ok (hparent != 0, "Failed to create parent window\n");
|
2004-06-18 19:33:55 +00:00
|
|
|
hchild = CreateWindowExA(0, "TestWindowClass", "Test child", WS_CHILD | WS_VISIBLE,
|
2004-06-03 00:08:55 +00:00
|
|
|
0, 0, 10, 10, hparent, 0, 0, NULL);
|
|
|
|
ok (hchild != 0, "Failed to create child window\n");
|
|
|
|
|
|
|
|
SetFocus(hchild);
|
|
|
|
flush_sequence();
|
|
|
|
|
|
|
|
EnableWindow(hparent, FALSE);
|
2004-08-25 17:35:06 +00:00
|
|
|
ok_sequence(WmEnableWindowSeq, "EnableWindow", FALSE);
|
2004-06-03 00:08:55 +00:00
|
|
|
|
2004-11-23 17:39:13 +00:00
|
|
|
while (PeekMessage( &msg, 0, 0, 0, PM_REMOVE )) DispatchMessage( &msg );
|
|
|
|
flush_sequence();
|
|
|
|
PostMessage( hparent, WM_USER, 0, 0 );
|
|
|
|
PostMessage( hparent, WM_USER+1, 0, 0 );
|
|
|
|
/* PeekMessage(NULL) fails, but still removes the message */
|
|
|
|
SetLastError(0xdeadbeef);
|
|
|
|
ok( !PeekMessage( NULL, 0, 0, 0, PM_REMOVE ), "PeekMessage(NULL) should fail\n" );
|
|
|
|
ok( GetLastError() == ERROR_NOACCESS, "last error is %ld\n", GetLastError() );
|
|
|
|
ok( PeekMessage( &msg, 0, 0, 0, PM_REMOVE ), "PeekMessage should succeed\n" );
|
|
|
|
ok( msg.message == WM_USER+1, "got %x instead of WM_USER+1\n", msg.message );
|
|
|
|
|
2004-10-05 23:45:35 +00:00
|
|
|
DestroyWindow(hchild);
|
2004-06-03 00:08:55 +00:00
|
|
|
DestroyWindow(hparent);
|
|
|
|
flush_sequence();
|
2003-10-02 04:32:56 +00:00
|
|
|
}
|
|
|
|
|
2004-08-09 23:38:40 +00:00
|
|
|
/****************** button message test *************************/
|
|
|
|
static const struct message WmSetFocusButtonSeq[] =
|
|
|
|
{
|
|
|
|
{ HCBT_SETFOCUS, hook },
|
|
|
|
{ WM_IME_SETCONTEXT, sent|wparam|optional, 1 },
|
|
|
|
{ WM_SETFOCUS, sent|wparam, 0 },
|
|
|
|
{ WM_CTLCOLORBTN, sent|defwinproc },
|
|
|
|
{ 0 }
|
|
|
|
};
|
|
|
|
static const struct message WmKillFocusButtonSeq[] =
|
|
|
|
{
|
|
|
|
{ HCBT_SETFOCUS, hook },
|
|
|
|
{ WM_KILLFOCUS, sent|wparam, 0 },
|
|
|
|
{ WM_CTLCOLORBTN, sent|defwinproc },
|
|
|
|
{ WM_IME_SETCONTEXT, sent|wparam|optional, 0 },
|
|
|
|
{ 0 }
|
|
|
|
};
|
|
|
|
static const struct message WmSetFocusStaticSeq[] =
|
|
|
|
{
|
|
|
|
{ HCBT_SETFOCUS, hook },
|
|
|
|
{ WM_IME_SETCONTEXT, sent|wparam|optional, 1 },
|
|
|
|
{ WM_SETFOCUS, sent|wparam, 0 },
|
|
|
|
{ WM_CTLCOLORSTATIC, sent|defwinproc },
|
|
|
|
{ 0 }
|
|
|
|
};
|
|
|
|
static const struct message WmKillFocusStaticSeq[] =
|
|
|
|
{
|
|
|
|
{ HCBT_SETFOCUS, hook },
|
|
|
|
{ WM_KILLFOCUS, sent|wparam, 0 },
|
|
|
|
{ WM_CTLCOLORSTATIC, sent|defwinproc },
|
|
|
|
{ WM_IME_SETCONTEXT, sent|wparam|optional, 0 },
|
|
|
|
{ 0 }
|
|
|
|
};
|
2004-08-26 18:31:56 +00:00
|
|
|
static const struct message WmLButtonDownSeq[] =
|
|
|
|
{
|
|
|
|
{ WM_LBUTTONDOWN, sent|wparam|lparam, 0, 0 },
|
|
|
|
{ HCBT_SETFOCUS, hook },
|
|
|
|
{ WM_IME_SETCONTEXT, sent|wparam|defwinproc|optional, 1 },
|
|
|
|
{ WM_SETFOCUS, sent|wparam|defwinproc, 0 },
|
|
|
|
{ WM_CTLCOLORBTN, sent|defwinproc },
|
|
|
|
{ BM_SETSTATE, sent|wparam|defwinproc, TRUE },
|
|
|
|
{ WM_CTLCOLORBTN, sent|defwinproc },
|
|
|
|
{ 0 }
|
|
|
|
};
|
|
|
|
static const struct message WmLButtonUpSeq[] =
|
|
|
|
{
|
|
|
|
{ WM_LBUTTONUP, sent|wparam|lparam, 0, 0 },
|
|
|
|
{ BM_SETSTATE, sent|wparam|defwinproc, FALSE },
|
|
|
|
{ WM_CTLCOLORBTN, sent|defwinproc },
|
|
|
|
{ WM_CAPTURECHANGED, sent|wparam|defwinproc, 0 },
|
|
|
|
{ 0 }
|
|
|
|
};
|
2004-08-09 23:38:40 +00:00
|
|
|
|
|
|
|
static WNDPROC old_button_proc;
|
|
|
|
|
|
|
|
static LRESULT CALLBACK button_hook_proc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
|
|
|
|
{
|
|
|
|
static long defwndproc_counter = 0;
|
|
|
|
LRESULT ret;
|
|
|
|
struct message msg;
|
|
|
|
|
2004-08-26 18:31:56 +00:00
|
|
|
trace("button: %p, %04x, %08x, %08lx\n", hwnd, message, wParam, lParam);
|
2004-08-09 23:38:40 +00:00
|
|
|
|
|
|
|
msg.message = message;
|
|
|
|
msg.flags = sent|wparam|lparam;
|
|
|
|
if (defwndproc_counter) msg.flags |= defwinproc;
|
|
|
|
msg.wParam = wParam;
|
|
|
|
msg.lParam = lParam;
|
|
|
|
add_message(&msg);
|
|
|
|
|
2004-08-26 18:31:56 +00:00
|
|
|
if (message == BM_SETSTATE)
|
|
|
|
ok(GetCapture() == hwnd, "GetCapture() = %p\n", GetCapture());
|
|
|
|
|
2004-08-09 23:38:40 +00:00
|
|
|
defwndproc_counter++;
|
|
|
|
ret = CallWindowProcA(old_button_proc, hwnd, message, wParam, lParam);
|
|
|
|
defwndproc_counter--;
|
|
|
|
|
|
|
|
return ret;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void subclass_button(void)
|
|
|
|
{
|
|
|
|
WNDCLASSA cls;
|
|
|
|
|
|
|
|
if (!GetClassInfoA(0, "button", &cls)) assert(0);
|
|
|
|
|
|
|
|
old_button_proc = cls.lpfnWndProc;
|
|
|
|
|
|
|
|
cls.hInstance = GetModuleHandle(0);
|
|
|
|
cls.lpfnWndProc = button_hook_proc;
|
|
|
|
cls.lpszClassName = "my_button_class";
|
|
|
|
if (!RegisterClassA(&cls)) assert(0);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void test_button_messages(void)
|
|
|
|
{
|
|
|
|
static const struct
|
|
|
|
{
|
|
|
|
DWORD style;
|
2004-10-26 21:18:10 +00:00
|
|
|
DWORD dlg_code;
|
2004-08-09 23:38:40 +00:00
|
|
|
const struct message *setfocus;
|
|
|
|
const struct message *killfocus;
|
|
|
|
} button[] = {
|
2004-10-26 21:18:10 +00:00
|
|
|
{ BS_PUSHBUTTON, DLGC_BUTTON | DLGC_UNDEFPUSHBUTTON,
|
|
|
|
WmSetFocusButtonSeq, WmKillFocusButtonSeq },
|
|
|
|
{ BS_DEFPUSHBUTTON, DLGC_BUTTON | DLGC_DEFPUSHBUTTON,
|
|
|
|
WmSetFocusButtonSeq, WmKillFocusButtonSeq },
|
|
|
|
{ BS_CHECKBOX, DLGC_BUTTON,
|
|
|
|
WmSetFocusStaticSeq, WmKillFocusStaticSeq },
|
|
|
|
{ BS_AUTOCHECKBOX, DLGC_BUTTON,
|
|
|
|
WmSetFocusStaticSeq, WmKillFocusStaticSeq },
|
|
|
|
{ BS_RADIOBUTTON, DLGC_BUTTON | DLGC_RADIOBUTTON,
|
|
|
|
WmSetFocusStaticSeq, WmKillFocusStaticSeq },
|
|
|
|
{ BS_3STATE, DLGC_BUTTON,
|
|
|
|
WmSetFocusStaticSeq, WmKillFocusStaticSeq },
|
|
|
|
{ BS_AUTO3STATE, DLGC_BUTTON,
|
|
|
|
WmSetFocusStaticSeq, WmKillFocusStaticSeq },
|
|
|
|
{ BS_GROUPBOX, DLGC_STATIC,
|
|
|
|
WmSetFocusStaticSeq, WmKillFocusStaticSeq },
|
|
|
|
{ BS_USERBUTTON, DLGC_BUTTON | DLGC_UNDEFPUSHBUTTON,
|
|
|
|
WmSetFocusButtonSeq, WmKillFocusButtonSeq },
|
|
|
|
{ BS_AUTORADIOBUTTON, DLGC_BUTTON | DLGC_RADIOBUTTON,
|
|
|
|
WmSetFocusStaticSeq, WmKillFocusStaticSeq },
|
|
|
|
{ BS_OWNERDRAW, DLGC_BUTTON,
|
|
|
|
WmSetFocusButtonSeq, WmKillFocusButtonSeq }
|
2004-08-09 23:38:40 +00:00
|
|
|
};
|
2004-09-22 02:46:38 +00:00
|
|
|
unsigned int i;
|
2004-08-09 23:38:40 +00:00
|
|
|
HWND hwnd;
|
2004-10-26 21:18:10 +00:00
|
|
|
DWORD dlg_code;
|
2004-08-09 23:38:40 +00:00
|
|
|
|
|
|
|
subclass_button();
|
|
|
|
|
|
|
|
for (i = 0; i < sizeof(button)/sizeof(button[0]); i++)
|
|
|
|
{
|
|
|
|
hwnd = CreateWindowExA(0, "my_button_class", "test", button[i].style | WS_POPUP,
|
|
|
|
0, 0, 50, 14, 0, 0, 0, NULL);
|
|
|
|
ok(hwnd != 0, "Failed to create button window\n");
|
|
|
|
|
2004-10-26 21:18:10 +00:00
|
|
|
dlg_code = SendMessageA(hwnd, WM_GETDLGCODE, 0, 0);
|
|
|
|
ok(dlg_code == button[i].dlg_code, "%d: wrong dlg_code %08lx\n", i, dlg_code);
|
|
|
|
|
2004-08-09 23:38:40 +00:00
|
|
|
ShowWindow(hwnd, SW_SHOW);
|
|
|
|
UpdateWindow(hwnd);
|
|
|
|
SetFocus(0);
|
|
|
|
flush_sequence();
|
|
|
|
|
|
|
|
trace("button style %08lx\n", button[i].style);
|
|
|
|
SetFocus(hwnd);
|
2004-08-25 17:35:06 +00:00
|
|
|
ok_sequence(button[i].setfocus, "SetFocus(hwnd) on a button", FALSE);
|
2004-08-09 23:38:40 +00:00
|
|
|
|
|
|
|
SetFocus(0);
|
2004-08-25 17:35:06 +00:00
|
|
|
ok_sequence(button[i].killfocus, "SetFocus(0) on a button", FALSE);
|
2004-08-09 23:38:40 +00:00
|
|
|
|
|
|
|
DestroyWindow(hwnd);
|
|
|
|
}
|
2004-08-26 18:31:56 +00:00
|
|
|
|
2004-10-26 21:18:10 +00:00
|
|
|
hwnd = CreateWindowExA(0, "my_button_class", "test", BS_PUSHBUTTON | WS_POPUP | WS_VISIBLE,
|
2004-08-26 18:31:56 +00:00
|
|
|
0, 0, 50, 14, 0, 0, 0, NULL);
|
|
|
|
ok(hwnd != 0, "Failed to create button window\n");
|
|
|
|
|
|
|
|
SetFocus(0);
|
|
|
|
flush_sequence();
|
|
|
|
|
|
|
|
SendMessageA(hwnd, WM_LBUTTONDOWN, 0, 0);
|
|
|
|
ok_sequence(WmLButtonDownSeq, "WM_LBUTTONDOWN on a button", FALSE);
|
|
|
|
|
|
|
|
SendMessageA(hwnd, WM_LBUTTONUP, 0, 0);
|
|
|
|
ok_sequence(WmLButtonUpSeq, "WM_LBUTTONDOWN on a button", FALSE);
|
|
|
|
DestroyWindow(hwnd);
|
2004-08-09 23:38:40 +00:00
|
|
|
}
|
2004-08-26 00:49:06 +00:00
|
|
|
|
|
|
|
/************* painting message test ********************/
|
|
|
|
|
|
|
|
static void dump_region(HRGN hrgn)
|
|
|
|
{
|
|
|
|
DWORD i, size;
|
|
|
|
RGNDATA *data = NULL;
|
|
|
|
RECT *rect;
|
|
|
|
|
|
|
|
if (!hrgn)
|
|
|
|
{
|
|
|
|
printf( "null region\n" );
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
if (!(size = GetRegionData( hrgn, 0, NULL ))) return;
|
|
|
|
if (!(data = HeapAlloc( GetProcessHeap(), 0, size ))) return;
|
|
|
|
GetRegionData( hrgn, size, data );
|
|
|
|
printf("%ld rects:", data->rdh.nCount );
|
|
|
|
for (i = 0, rect = (RECT *)data->Buffer; i < data->rdh.nCount; i++, rect++)
|
|
|
|
printf( " (%ld,%ld)-(%ld,%ld)", rect->left, rect->top, rect->right, rect->bottom );
|
|
|
|
printf("\n");
|
|
|
|
HeapFree( GetProcessHeap(), 0, data );
|
|
|
|
}
|
|
|
|
|
|
|
|
static void check_update_rgn( HWND hwnd, HRGN hrgn )
|
|
|
|
{
|
|
|
|
INT ret;
|
|
|
|
RECT r1, r2;
|
|
|
|
HRGN tmp = CreateRectRgn( 0, 0, 0, 0 );
|
|
|
|
HRGN update = CreateRectRgn( 0, 0, 0, 0 );
|
|
|
|
|
|
|
|
ret = GetUpdateRgn( hwnd, update, FALSE );
|
|
|
|
ok( ret != ERROR, "GetUpdateRgn failed\n" );
|
|
|
|
if (ret == NULLREGION)
|
|
|
|
{
|
|
|
|
ok( !hrgn, "Update region shouldn't be empty\n" );
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
if (CombineRgn( tmp, hrgn, update, RGN_XOR ) != NULLREGION)
|
|
|
|
{
|
|
|
|
ok( 0, "Regions are different\n" );
|
|
|
|
if (winetest_debug > 0)
|
|
|
|
{
|
|
|
|
printf( "Update region: " );
|
|
|
|
dump_region( update );
|
|
|
|
printf( "Wanted region: " );
|
|
|
|
dump_region( hrgn );
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
GetRgnBox( update, &r1 );
|
|
|
|
GetUpdateRect( hwnd, &r2, FALSE );
|
|
|
|
ok( r1.left == r2.left && r1.top == r2.top && r1.right == r2.right && r1.bottom == r2.bottom,
|
|
|
|
"Rectangles are different: %ld,%ld-%ld,%ld / %ld,%ld-%ld,%ld\n",
|
|
|
|
r1.left, r1.top, r1.right, r1.bottom, r2.left, r2.top, r2.right, r2.bottom );
|
|
|
|
|
|
|
|
DeleteObject( tmp );
|
|
|
|
DeleteObject( update );
|
|
|
|
}
|
|
|
|
|
|
|
|
static const struct message WmInvalidateRgn[] = {
|
|
|
|
{ WM_NCPAINT, sent },
|
2004-08-26 18:21:56 +00:00
|
|
|
{ WM_GETTEXT, sent|defwinproc|optional },
|
2004-08-26 00:49:06 +00:00
|
|
|
{ 0 }
|
|
|
|
};
|
|
|
|
|
|
|
|
static const struct message WmInvalidateFull[] = {
|
|
|
|
{ WM_NCPAINT, sent|wparam, 1 },
|
2004-08-26 18:21:56 +00:00
|
|
|
{ WM_GETTEXT, sent|defwinproc|optional },
|
2004-08-26 00:49:06 +00:00
|
|
|
{ 0 }
|
|
|
|
};
|
|
|
|
|
|
|
|
static const struct message WmInvalidateErase[] = {
|
|
|
|
{ WM_NCPAINT, sent|wparam, 1 },
|
2004-08-26 18:21:56 +00:00
|
|
|
{ WM_GETTEXT, sent|defwinproc|optional },
|
2004-08-26 00:49:06 +00:00
|
|
|
{ WM_ERASEBKGND, sent },
|
|
|
|
{ 0 }
|
|
|
|
};
|
|
|
|
|
|
|
|
static const struct message WmInvalidatePaint[] = {
|
|
|
|
{ WM_PAINT, sent },
|
|
|
|
{ WM_NCPAINT, sent|wparam|beginpaint, 1 },
|
2004-08-26 18:21:56 +00:00
|
|
|
{ WM_GETTEXT, sent|beginpaint|defwinproc|optional },
|
2004-08-26 00:49:06 +00:00
|
|
|
{ 0 }
|
|
|
|
};
|
|
|
|
|
|
|
|
static const struct message WmInvalidateErasePaint[] = {
|
|
|
|
{ WM_PAINT, sent },
|
|
|
|
{ WM_NCPAINT, sent|wparam|beginpaint, 1 },
|
2004-08-26 18:21:56 +00:00
|
|
|
{ WM_GETTEXT, sent|beginpaint|defwinproc|optional },
|
2004-08-26 00:49:06 +00:00
|
|
|
{ WM_ERASEBKGND, sent|beginpaint },
|
|
|
|
{ 0 }
|
|
|
|
};
|
|
|
|
|
|
|
|
static const struct message WmErase[] = {
|
|
|
|
{ WM_ERASEBKGND, sent },
|
|
|
|
{ 0 }
|
|
|
|
};
|
|
|
|
|
|
|
|
static const struct message WmPaint[] = {
|
|
|
|
{ WM_PAINT, sent },
|
|
|
|
{ 0 }
|
|
|
|
};
|
|
|
|
|
|
|
|
static void test_paint_messages(void)
|
|
|
|
{
|
|
|
|
RECT rect;
|
2004-09-02 20:13:19 +00:00
|
|
|
MSG msg;
|
2004-08-26 00:49:06 +00:00
|
|
|
HRGN hrgn = CreateRectRgn( 0, 0, 0, 0 );
|
|
|
|
HRGN hrgn2 = CreateRectRgn( 0, 0, 0, 0 );
|
|
|
|
HWND hwnd = CreateWindowExA(0, "TestWindowClass", "Test overlapped", WS_OVERLAPPEDWINDOW,
|
|
|
|
100, 100, 200, 200, 0, 0, 0, NULL);
|
|
|
|
ok (hwnd != 0, "Failed to create overlapped window\n");
|
|
|
|
|
|
|
|
ShowWindow( hwnd, SW_SHOW );
|
|
|
|
UpdateWindow( hwnd );
|
|
|
|
check_update_rgn( hwnd, 0 );
|
|
|
|
SetRectRgn( hrgn, 10, 10, 20, 20 );
|
|
|
|
RedrawWindow( hwnd, NULL, hrgn, RDW_INVALIDATE );
|
|
|
|
check_update_rgn( hwnd, hrgn );
|
|
|
|
SetRectRgn( hrgn2, 20, 20, 30, 30 );
|
|
|
|
RedrawWindow( hwnd, NULL, hrgn2, RDW_INVALIDATE );
|
|
|
|
CombineRgn( hrgn, hrgn, hrgn2, RGN_OR );
|
|
|
|
check_update_rgn( hwnd, hrgn );
|
|
|
|
/* validate everything */
|
|
|
|
RedrawWindow( hwnd, NULL, NULL, RDW_VALIDATE );
|
|
|
|
check_update_rgn( hwnd, 0 );
|
|
|
|
/* now with frame */
|
|
|
|
SetRectRgn( hrgn, -5, -5, 20, 20 );
|
|
|
|
|
2004-10-27 21:18:01 +00:00
|
|
|
/* flush pending messages */
|
|
|
|
while (PeekMessage( &msg, 0, 0, 0, PM_REMOVE )) DispatchMessage( &msg );
|
|
|
|
|
2004-08-26 00:49:06 +00:00
|
|
|
flush_sequence();
|
|
|
|
RedrawWindow( hwnd, NULL, hrgn, RDW_INVALIDATE | RDW_FRAME );
|
|
|
|
ok_sequence( WmEmptySeq, "EmptySeq", FALSE );
|
|
|
|
|
|
|
|
SetRectRgn( hrgn, 0, 0, 20, 20 ); /* GetUpdateRgn clips to client area */
|
|
|
|
check_update_rgn( hwnd, hrgn );
|
|
|
|
|
|
|
|
flush_sequence();
|
|
|
|
RedrawWindow( hwnd, NULL, hrgn, RDW_INVALIDATE | RDW_FRAME | RDW_ERASENOW );
|
|
|
|
ok_sequence( WmInvalidateRgn, "InvalidateRgn", FALSE );
|
|
|
|
|
|
|
|
flush_sequence();
|
|
|
|
RedrawWindow( hwnd, NULL, NULL, RDW_INVALIDATE | RDW_FRAME | RDW_ERASENOW );
|
|
|
|
ok_sequence( WmInvalidateFull, "InvalidateFull", FALSE );
|
|
|
|
|
|
|
|
GetClientRect( hwnd, &rect );
|
|
|
|
SetRectRgn( hrgn, rect.left, rect.top, rect.right, rect.bottom );
|
|
|
|
check_update_rgn( hwnd, hrgn );
|
|
|
|
|
|
|
|
flush_sequence();
|
|
|
|
RedrawWindow( hwnd, NULL, NULL, RDW_INVALIDATE | RDW_FRAME | RDW_ERASE | RDW_ERASENOW );
|
|
|
|
ok_sequence( WmInvalidateErase, "InvalidateErase", FALSE );
|
|
|
|
|
|
|
|
flush_sequence();
|
|
|
|
RedrawWindow( hwnd, NULL, NULL, RDW_INVALIDATE | RDW_FRAME | RDW_ERASENOW | RDW_UPDATENOW );
|
|
|
|
ok_sequence( WmInvalidatePaint, "InvalidatePaint", TRUE );
|
|
|
|
check_update_rgn( hwnd, 0 );
|
|
|
|
|
|
|
|
flush_sequence();
|
|
|
|
RedrawWindow( hwnd, NULL, NULL, RDW_INVALIDATE | RDW_FRAME | RDW_ERASE | RDW_UPDATENOW );
|
|
|
|
ok_sequence( WmInvalidateErasePaint, "InvalidateErasePaint", FALSE );
|
|
|
|
check_update_rgn( hwnd, 0 );
|
|
|
|
|
|
|
|
flush_sequence();
|
|
|
|
SetRectRgn( hrgn, 0, 0, 100, 100 );
|
|
|
|
RedrawWindow( hwnd, NULL, hrgn, RDW_INVALIDATE );
|
|
|
|
SetRectRgn( hrgn, 0, 0, 50, 100 );
|
|
|
|
RedrawWindow( hwnd, NULL, hrgn, RDW_VALIDATE );
|
|
|
|
SetRectRgn( hrgn, 50, 0, 100, 100 );
|
|
|
|
check_update_rgn( hwnd, hrgn );
|
|
|
|
RedrawWindow( hwnd, NULL, hrgn, RDW_VALIDATE | RDW_ERASENOW );
|
|
|
|
ok_sequence( WmEmptySeq, "EmptySeq", FALSE ); /* must not generate messages, everything is valid */
|
|
|
|
check_update_rgn( hwnd, 0 );
|
|
|
|
|
|
|
|
flush_sequence();
|
|
|
|
SetRectRgn( hrgn, 0, 0, 100, 100 );
|
|
|
|
RedrawWindow( hwnd, NULL, hrgn, RDW_INVALIDATE | RDW_ERASE );
|
|
|
|
SetRectRgn( hrgn, 0, 0, 100, 50 );
|
|
|
|
RedrawWindow( hwnd, NULL, hrgn, RDW_VALIDATE | RDW_ERASENOW );
|
|
|
|
ok_sequence( WmErase, "Erase", FALSE );
|
|
|
|
SetRectRgn( hrgn, 0, 50, 100, 100 );
|
|
|
|
check_update_rgn( hwnd, hrgn );
|
|
|
|
|
|
|
|
flush_sequence();
|
|
|
|
SetRectRgn( hrgn, 0, 0, 100, 100 );
|
|
|
|
RedrawWindow( hwnd, NULL, hrgn, RDW_INVALIDATE | RDW_ERASE );
|
|
|
|
SetRectRgn( hrgn, 0, 0, 50, 50 );
|
|
|
|
RedrawWindow( hwnd, NULL, hrgn, RDW_VALIDATE | RDW_NOERASE | RDW_UPDATENOW );
|
|
|
|
ok_sequence( WmPaint, "Paint", FALSE );
|
|
|
|
|
2004-09-02 20:13:19 +00:00
|
|
|
flush_sequence();
|
|
|
|
SetRectRgn( hrgn, -4, -4, -2, -2 );
|
|
|
|
RedrawWindow( hwnd, NULL, hrgn, RDW_INVALIDATE | RDW_FRAME );
|
|
|
|
SetRectRgn( hrgn, -4, -4, -3, -3 );
|
|
|
|
RedrawWindow( hwnd, NULL, hrgn, RDW_VALIDATE | RDW_NOFRAME | RDW_ERASENOW );
|
|
|
|
ok_sequence( WmEmptySeq, "EmptySeq", FALSE );
|
|
|
|
|
|
|
|
flush_sequence();
|
|
|
|
SetRectRgn( hrgn, -4, -4, -2, -2 );
|
|
|
|
RedrawWindow( hwnd, NULL, hrgn, RDW_INVALIDATE | RDW_FRAME );
|
|
|
|
SetRectRgn( hrgn, -4, -4, -3, -3 );
|
|
|
|
RedrawWindow( hwnd, NULL, hrgn, RDW_VALIDATE | RDW_NOFRAME );
|
|
|
|
SetRectRgn( hrgn, 0, 0, 1, 1 );
|
|
|
|
RedrawWindow( hwnd, NULL, hrgn, RDW_INVALIDATE | RDW_UPDATENOW );
|
|
|
|
ok_sequence( WmPaint, "Paint", TRUE );
|
|
|
|
|
|
|
|
flush_sequence();
|
|
|
|
SetRectRgn( hrgn, -4, -4, -1, -1 );
|
|
|
|
RedrawWindow( hwnd, NULL, hrgn, RDW_INVALIDATE | RDW_FRAME );
|
|
|
|
RedrawWindow( hwnd, NULL, 0, RDW_ERASENOW );
|
|
|
|
/* make sure no WM_PAINT was generated */
|
|
|
|
while (PeekMessage( &msg, 0, 0, 0, PM_REMOVE )) DispatchMessage( &msg );
|
|
|
|
ok_sequence( WmInvalidateRgn, "InvalidateRgn", FALSE );
|
|
|
|
|
|
|
|
flush_sequence();
|
|
|
|
SetRectRgn( hrgn, -4, -4, -1, -1 );
|
|
|
|
RedrawWindow( hwnd, NULL, hrgn, RDW_INVALIDATE | RDW_FRAME );
|
|
|
|
while (PeekMessage( &msg, 0, 0, 0, PM_REMOVE ))
|
|
|
|
{
|
|
|
|
if (msg.hwnd == hwnd && msg.message == WM_PAINT)
|
|
|
|
{
|
|
|
|
/* GetUpdateRgn must return empty region since only nonclient area is invalidated */
|
|
|
|
INT ret = GetUpdateRgn( hwnd, hrgn, FALSE );
|
|
|
|
ok( ret == NULLREGION, "Invalid GetUpdateRgn result %d\n", ret );
|
|
|
|
ret = GetUpdateRect( hwnd, &rect, FALSE );
|
|
|
|
ok( ret, "Invalid GetUpdateRect result %d\n", ret );
|
|
|
|
/* this will send WM_NCPAINT and validate the non client area */
|
|
|
|
ret = GetUpdateRect( hwnd, &rect, TRUE );
|
|
|
|
ok( !ret, "Invalid GetUpdateRect result %d\n", ret );
|
|
|
|
}
|
|
|
|
else DispatchMessage( &msg );
|
|
|
|
}
|
|
|
|
ok_sequence( WmInvalidateRgn, "InvalidateRgn", FALSE );
|
|
|
|
|
2004-08-26 00:49:06 +00:00
|
|
|
DeleteObject( hrgn );
|
|
|
|
DeleteObject( hrgn2 );
|
|
|
|
DestroyWindow( hwnd );
|
|
|
|
}
|
|
|
|
|
2004-10-05 22:35:00 +00:00
|
|
|
struct wnd_event
|
|
|
|
{
|
|
|
|
HWND hwnd;
|
|
|
|
HANDLE event;
|
|
|
|
};
|
|
|
|
|
|
|
|
static DWORD WINAPI thread_proc(void *param)
|
|
|
|
{
|
|
|
|
MSG msg;
|
|
|
|
struct wnd_event *wnd_event = (struct wnd_event *)param;
|
|
|
|
|
|
|
|
wnd_event->hwnd = CreateWindowExA(0, "TestWindowClass", "window caption text", WS_OVERLAPPEDWINDOW,
|
|
|
|
100, 100, 200, 200, 0, 0, 0, NULL);
|
|
|
|
ok(wnd_event->hwnd != 0, "Failed to create overlapped window\n");
|
|
|
|
|
|
|
|
SetEvent(wnd_event->event);
|
|
|
|
|
|
|
|
while (GetMessage(&msg, 0, 0, 0))
|
|
|
|
{
|
|
|
|
TranslateMessage(&msg);
|
|
|
|
DispatchMessage(&msg);
|
|
|
|
}
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void test_interthread_messages(void)
|
|
|
|
{
|
|
|
|
HANDLE hThread;
|
|
|
|
DWORD tid;
|
|
|
|
WNDPROC proc;
|
|
|
|
MSG msg;
|
|
|
|
char buf[256];
|
|
|
|
int len, expected_len;
|
|
|
|
struct wnd_event wnd_event;
|
|
|
|
|
2004-10-06 18:51:27 +00:00
|
|
|
wnd_event.event = CreateEventW(NULL, 0, 0, NULL);
|
|
|
|
if (!wnd_event.event)
|
|
|
|
{
|
|
|
|
trace("skipping interthread message test under win9x\n");
|
|
|
|
return;
|
|
|
|
}
|
2004-10-05 22:35:00 +00:00
|
|
|
|
|
|
|
hThread = CreateThread(NULL, 0, thread_proc, &wnd_event, 0, &tid);
|
|
|
|
ok(hThread != NULL, "CreateThread failed, error %ld\n", GetLastError());
|
|
|
|
|
|
|
|
ok(WaitForSingleObject(wnd_event.event, INFINITE) == WAIT_OBJECT_0, "WaitForSingleObject failed\n");
|
|
|
|
|
|
|
|
CloseHandle(wnd_event.event);
|
|
|
|
|
|
|
|
SetLastError(0xdeadbeef);
|
|
|
|
ok(!DestroyWindow(wnd_event.hwnd), "DestroyWindow succeded\n");
|
|
|
|
ok(GetLastError() == ERROR_ACCESS_DENIED, "wrong error code %ld\n", GetLastError());
|
|
|
|
|
|
|
|
proc = (WNDPROC)GetWindowLongPtrA(wnd_event.hwnd, GWLP_WNDPROC);
|
|
|
|
ok(proc != NULL, "GetWindowLongPtrA(GWLP_WNDPROC) error %ld\n", GetLastError());
|
|
|
|
|
|
|
|
expected_len = lstrlenA("window caption text");
|
|
|
|
memset(buf, 0, sizeof(buf));
|
|
|
|
SetLastError(0xdeadbeef);
|
|
|
|
len = CallWindowProcA(proc, wnd_event.hwnd, WM_GETTEXT, sizeof(buf), (LPARAM)buf);
|
|
|
|
ok(len == expected_len, "CallWindowProcA(WM_GETTEXT) error %ld, len %d, expected len %d\n", GetLastError(), len, expected_len);
|
|
|
|
ok(!lstrcmpA(buf, "window caption text"), "window text mismatch\n");
|
|
|
|
|
|
|
|
msg.hwnd = wnd_event.hwnd;
|
|
|
|
msg.message = WM_GETTEXT;
|
|
|
|
msg.wParam = sizeof(buf);
|
|
|
|
msg.lParam = (LPARAM)buf;
|
|
|
|
memset(buf, 0, sizeof(buf));
|
|
|
|
SetLastError(0xdeadbeef);
|
|
|
|
len = DispatchMessageA(&msg);
|
|
|
|
ok(!len && GetLastError() == ERROR_MESSAGE_SYNC_ONLY,
|
|
|
|
"DispatchMessageA(WM_GETTEXT) succeded on another thread window: ret %d, error %ld\n", len, GetLastError());
|
|
|
|
|
2004-10-06 18:51:27 +00:00
|
|
|
/* the following test causes an exception in user.exe under win9x */
|
2004-10-05 22:35:00 +00:00
|
|
|
msg.hwnd = wnd_event.hwnd;
|
|
|
|
msg.message = WM_TIMER;
|
|
|
|
msg.wParam = 0;
|
2004-10-06 18:51:27 +00:00
|
|
|
msg.lParam = GetWindowLongPtrA(wnd_event.hwnd, GWLP_WNDPROC);
|
2004-10-05 22:35:00 +00:00
|
|
|
SetLastError(0xdeadbeef);
|
|
|
|
len = DispatchMessageA(&msg);
|
|
|
|
ok(!len && GetLastError() == 0xdeadbeef,
|
|
|
|
"DispatchMessageA(WM_TIMER) failed on another thread window: ret %d, error %ld\n", len, GetLastError());
|
|
|
|
|
|
|
|
ok(PostMessageA(wnd_event.hwnd, WM_QUIT, 0, 0), "PostMessageA(WM_QUIT) error %ld\n", GetLastError());
|
|
|
|
|
|
|
|
ok(WaitForSingleObject(hThread, INFINITE) == WAIT_OBJECT_0, "WaitForSingleObject failed\n");
|
|
|
|
CloseHandle(hThread);
|
|
|
|
}
|
2004-08-26 00:49:06 +00:00
|
|
|
|
2004-10-05 23:45:35 +00:00
|
|
|
|
|
|
|
static const struct message WmVkN[] = {
|
2004-10-22 20:29:10 +00:00
|
|
|
{ WM_KEYDOWN, wparam|lparam, 'N', 1 },
|
|
|
|
{ WM_KEYDOWN, sent|wparam|lparam, 'N', 1 },
|
2004-10-05 23:45:35 +00:00
|
|
|
{ WM_CHAR, wparam|lparam, 'n', 1 },
|
|
|
|
{ WM_COMMAND, sent|wparam|lparam, MAKEWPARAM(1002,1), 0 },
|
2004-10-22 20:29:10 +00:00
|
|
|
{ WM_KEYUP, wparam|lparam, 'N', 0xc0000001 },
|
|
|
|
{ WM_KEYUP, sent|wparam|lparam, 'N', 0xc0000001 },
|
2004-10-05 23:45:35 +00:00
|
|
|
{ 0 }
|
|
|
|
};
|
|
|
|
static const struct message WmShiftVkN[] = {
|
|
|
|
{ WM_KEYDOWN, wparam|lparam, VK_SHIFT, 1 },
|
|
|
|
{ WM_KEYDOWN, sent|wparam|lparam, VK_SHIFT, 1 },
|
2004-10-22 20:29:10 +00:00
|
|
|
{ WM_KEYDOWN, wparam|lparam, 'N', 1 },
|
|
|
|
{ WM_KEYDOWN, sent|wparam|lparam, 'N', 1 },
|
2004-10-05 23:45:35 +00:00
|
|
|
{ WM_CHAR, wparam|lparam, 'N', 1 },
|
|
|
|
{ WM_COMMAND, sent|wparam|lparam, MAKEWPARAM(1001,1), 0 },
|
2004-10-22 20:29:10 +00:00
|
|
|
{ WM_KEYUP, wparam|lparam, 'N', 0xc0000001 },
|
|
|
|
{ WM_KEYUP, sent|wparam|lparam, 'N', 0xc0000001 },
|
2004-10-05 23:45:35 +00:00
|
|
|
{ WM_KEYUP, wparam|lparam, VK_SHIFT, 0xc0000001 },
|
|
|
|
{ WM_KEYUP, sent|wparam|lparam, VK_SHIFT, 0xc0000001 },
|
|
|
|
{ 0 }
|
|
|
|
};
|
|
|
|
static const struct message WmCtrlVkN[] = {
|
|
|
|
{ WM_KEYDOWN, wparam|lparam, VK_CONTROL, 1 },
|
|
|
|
{ WM_KEYDOWN, sent|wparam|lparam, VK_CONTROL, 1 },
|
2004-10-22 20:29:10 +00:00
|
|
|
{ WM_KEYDOWN, wparam|lparam, 'N', 1 },
|
|
|
|
{ WM_KEYDOWN, sent|wparam|lparam, 'N', 1 },
|
2004-10-05 23:45:35 +00:00
|
|
|
{ WM_CHAR, wparam|lparam, 0x000e, 1 },
|
|
|
|
{ WM_COMMAND, sent|wparam|lparam, MAKEWPARAM(1000,1), 0 },
|
2004-10-22 20:29:10 +00:00
|
|
|
{ WM_KEYUP, wparam|lparam, 'N', 0xc0000001 },
|
|
|
|
{ WM_KEYUP, sent|wparam|lparam, 'N', 0xc0000001 },
|
2004-10-05 23:45:35 +00:00
|
|
|
{ WM_KEYUP, wparam|lparam, VK_CONTROL, 0xc0000001 },
|
|
|
|
{ WM_KEYUP, sent|wparam|lparam, VK_CONTROL, 0xc0000001 },
|
|
|
|
{ 0 }
|
|
|
|
};
|
|
|
|
static const struct message WmCtrlVkN_2[] = {
|
|
|
|
{ WM_KEYDOWN, wparam|lparam, VK_CONTROL, 1 },
|
|
|
|
{ WM_KEYDOWN, sent|wparam|lparam, VK_CONTROL, 1 },
|
2004-10-22 20:29:10 +00:00
|
|
|
{ WM_KEYDOWN, wparam|lparam, 'N', 1 },
|
2004-10-05 23:45:35 +00:00
|
|
|
{ WM_COMMAND, sent|wparam|lparam, MAKEWPARAM(1000,1), 0 },
|
2004-10-22 20:29:10 +00:00
|
|
|
{ WM_KEYUP, wparam|lparam, 'N', 0xc0000001 },
|
|
|
|
{ WM_KEYUP, sent|wparam|lparam, 'N', 0xc0000001 },
|
2004-10-05 23:45:35 +00:00
|
|
|
{ WM_KEYUP, wparam|lparam, VK_CONTROL, 0xc0000001 },
|
|
|
|
{ WM_KEYUP, sent|wparam|lparam, VK_CONTROL, 0xc0000001 },
|
|
|
|
{ 0 }
|
|
|
|
};
|
|
|
|
static const struct message WmAltVkN[] = {
|
|
|
|
{ WM_SYSKEYDOWN, wparam|lparam, VK_MENU, 0x20000001 },
|
|
|
|
{ WM_SYSKEYDOWN, sent|wparam|lparam, VK_MENU, 0x20000001 },
|
2004-10-22 20:29:10 +00:00
|
|
|
{ WM_SYSKEYDOWN, wparam|lparam, 'N', 0x20000001 },
|
|
|
|
{ WM_SYSKEYDOWN, sent|wparam|lparam, 'N', 0x20000001 },
|
2004-10-05 23:45:35 +00:00
|
|
|
{ WM_SYSCHAR, wparam|lparam, 'n', 0x20000001 },
|
|
|
|
{ WM_SYSCHAR, sent|wparam|lparam, 'n', 0x20000001 },
|
|
|
|
{ WM_SYSCOMMAND, sent|defwinproc|wparam|lparam, SC_KEYMENU, 'n' },
|
|
|
|
{ HCBT_SYSCOMMAND, hook },
|
|
|
|
{ WM_ENTERMENULOOP, sent|defwinproc|wparam|lparam, 0, 0 },
|
|
|
|
{ WM_SETCURSOR, sent|defwinproc },
|
|
|
|
{ WM_INITMENU, sent|defwinproc },
|
|
|
|
{ WM_MENUCHAR, sent|defwinproc|wparam, MAKEWPARAM('n',MF_SYSMENU) },
|
|
|
|
{ WM_CAPTURECHANGED, sent|defwinproc },
|
|
|
|
{ WM_MENUSELECT, sent|defwinproc|wparam, MAKEWPARAM(0,0xffff) },
|
|
|
|
{ WM_EXITMENULOOP, sent|defwinproc },
|
|
|
|
{ WM_MENUSELECT, sent|defwinproc|wparam|optional, MAKEWPARAM(0,0xffff) }, /* Win95 bug */
|
|
|
|
{ WM_EXITMENULOOP, sent|defwinproc|optional }, /* Win95 bug */
|
2004-10-22 20:29:10 +00:00
|
|
|
{ WM_SYSKEYUP, wparam|lparam, 'N', 0xe0000001 },
|
|
|
|
{ WM_SYSKEYUP, sent|wparam|lparam, 'N', 0xe0000001 },
|
2004-10-05 23:45:35 +00:00
|
|
|
{ WM_KEYUP, wparam|lparam, VK_MENU, 0xc0000001 },
|
|
|
|
{ WM_KEYUP, sent|wparam|lparam, VK_MENU, 0xc0000001 },
|
|
|
|
{ 0 }
|
|
|
|
};
|
|
|
|
static const struct message WmAltVkN_2[] = {
|
|
|
|
{ WM_SYSKEYDOWN, wparam|lparam, VK_MENU, 0x20000001 },
|
|
|
|
{ WM_SYSKEYDOWN, sent|wparam|lparam, VK_MENU, 0x20000001 },
|
2004-10-22 20:29:10 +00:00
|
|
|
{ WM_SYSKEYDOWN, wparam|lparam, 'N', 0x20000001 },
|
2004-10-05 23:45:35 +00:00
|
|
|
{ WM_COMMAND, sent|wparam|lparam, MAKEWPARAM(1003,1), 0 },
|
2004-10-22 20:29:10 +00:00
|
|
|
{ WM_SYSKEYUP, wparam|lparam, 'N', 0xe0000001 },
|
|
|
|
{ WM_SYSKEYUP, sent|wparam|lparam, 'N', 0xe0000001 },
|
2004-10-05 23:45:35 +00:00
|
|
|
{ WM_KEYUP, wparam|lparam, VK_MENU, 0xc0000001 },
|
|
|
|
{ WM_KEYUP, sent|wparam|lparam, VK_MENU, 0xc0000001 },
|
|
|
|
{ 0 }
|
|
|
|
};
|
|
|
|
static const struct message WmCtrlAltVkN[] = {
|
|
|
|
{ WM_KEYDOWN, wparam|lparam, VK_CONTROL, 1 },
|
|
|
|
{ WM_KEYDOWN, sent|wparam|lparam, VK_CONTROL, 1 },
|
|
|
|
{ WM_KEYDOWN, wparam|lparam, VK_MENU, 0x20000001 },
|
|
|
|
{ WM_KEYDOWN, sent|wparam|lparam, VK_MENU, 0x20000001 },
|
2004-10-22 20:29:10 +00:00
|
|
|
{ WM_KEYDOWN, wparam|lparam, 'N', 0x20000001 },
|
|
|
|
{ WM_KEYDOWN, sent|wparam|lparam, 'N', 0x20000001 },
|
|
|
|
{ WM_KEYUP, wparam|lparam, 'N', 0xe0000001 },
|
|
|
|
{ WM_KEYUP, sent|wparam|lparam, 'N', 0xe0000001 },
|
2004-10-05 23:45:35 +00:00
|
|
|
{ WM_KEYUP, wparam|lparam, VK_MENU, 0xc0000001 },
|
|
|
|
{ WM_KEYUP, sent|wparam|lparam, VK_MENU, 0xc0000001 },
|
|
|
|
{ WM_KEYUP, wparam|lparam, VK_CONTROL, 0xc0000001 },
|
|
|
|
{ WM_KEYUP, sent|wparam|lparam, VK_CONTROL, 0xc0000001 },
|
|
|
|
{ 0 }
|
|
|
|
};
|
|
|
|
|
|
|
|
static void pump_msg_loop(HWND hwnd, HACCEL hAccel)
|
|
|
|
{
|
|
|
|
MSG msg;
|
|
|
|
|
|
|
|
while (PeekMessageA(&msg, 0, 0, 0, PM_REMOVE))
|
|
|
|
{
|
|
|
|
struct message log_msg;
|
|
|
|
|
|
|
|
trace("accel: %p, %04x, %08x, %08lx\n", msg.hwnd, msg.message, msg.wParam, msg.lParam);
|
|
|
|
|
|
|
|
log_msg.message = msg.message;
|
|
|
|
log_msg.flags = wparam|lparam;
|
|
|
|
log_msg.wParam = msg.wParam;
|
|
|
|
log_msg.lParam = msg.lParam;
|
|
|
|
add_message(&log_msg);
|
|
|
|
|
|
|
|
if (!TranslateAccelerator(hwnd, hAccel, &msg))
|
|
|
|
{
|
|
|
|
TranslateMessage(&msg);
|
|
|
|
DispatchMessage(&msg);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static void test_accelerators(void)
|
|
|
|
{
|
|
|
|
SHORT state;
|
|
|
|
HACCEL hAccel;
|
|
|
|
HWND hwnd = CreateWindowExA(0, "TestWindowClass", NULL, WS_OVERLAPPEDWINDOW,
|
|
|
|
100, 100, 200, 200, 0, 0, 0, NULL);
|
|
|
|
assert(hwnd != 0);
|
|
|
|
|
|
|
|
SetFocus(hwnd);
|
|
|
|
ok(GetFocus() == hwnd, "wrong focus window %p\n", GetFocus());
|
|
|
|
|
|
|
|
state = GetKeyState(VK_SHIFT);
|
|
|
|
ok(!(state & 0x8000), "wrong Shift state %04x\n", state);
|
|
|
|
state = GetKeyState(VK_CAPITAL);
|
|
|
|
ok(state == 0, "wrong CapsLock state %04x\n", state);
|
|
|
|
|
|
|
|
hAccel = LoadAccelerators(GetModuleHandleA(0), MAKEINTRESOURCE(1));
|
|
|
|
assert(hAccel != 0);
|
|
|
|
|
|
|
|
trace("testing VK_N press/release\n");
|
|
|
|
flush_sequence();
|
2004-10-22 20:29:10 +00:00
|
|
|
keybd_event('N', 0, 0, 0);
|
|
|
|
keybd_event('N', 0, KEYEVENTF_KEYUP, 0);
|
2004-10-05 23:45:35 +00:00
|
|
|
pump_msg_loop(hwnd, hAccel);
|
|
|
|
ok_sequence(WmVkN, "VK_N press/release", FALSE);
|
|
|
|
|
|
|
|
trace("testing Shift+VK_N press/release\n");
|
|
|
|
flush_sequence();
|
|
|
|
keybd_event(VK_SHIFT, 0, 0, 0);
|
2004-10-22 20:29:10 +00:00
|
|
|
keybd_event('N', 0, 0, 0);
|
|
|
|
keybd_event('N', 0, KEYEVENTF_KEYUP, 0);
|
2004-10-05 23:45:35 +00:00
|
|
|
keybd_event(VK_SHIFT, 0, KEYEVENTF_KEYUP, 0);
|
|
|
|
pump_msg_loop(hwnd, hAccel);
|
|
|
|
ok_sequence(WmShiftVkN, "Shift+VK_N press/release", FALSE);
|
|
|
|
|
|
|
|
trace("testing Ctrl+VK_N press/release\n");
|
|
|
|
flush_sequence();
|
|
|
|
keybd_event(VK_CONTROL, 0, 0, 0);
|
2004-10-22 20:29:10 +00:00
|
|
|
keybd_event('N', 0, 0, 0);
|
|
|
|
keybd_event('N', 0, KEYEVENTF_KEYUP, 0);
|
2004-10-05 23:45:35 +00:00
|
|
|
keybd_event(VK_CONTROL, 0, KEYEVENTF_KEYUP, 0);
|
|
|
|
pump_msg_loop(hwnd, hAccel);
|
|
|
|
ok_sequence(WmCtrlVkN, "Ctrl+VK_N press/release", FALSE);
|
|
|
|
|
|
|
|
trace("testing Alt+VK_N press/release\n");
|
|
|
|
flush_sequence();
|
|
|
|
keybd_event(VK_MENU, 0, 0, 0);
|
2004-10-22 20:29:10 +00:00
|
|
|
keybd_event('N', 0, 0, 0);
|
|
|
|
keybd_event('N', 0, KEYEVENTF_KEYUP, 0);
|
2004-10-05 23:45:35 +00:00
|
|
|
keybd_event(VK_MENU, 0, KEYEVENTF_KEYUP, 0);
|
|
|
|
pump_msg_loop(hwnd, hAccel);
|
|
|
|
ok_sequence(WmAltVkN, "Alt+VK_N press/release", FALSE);
|
|
|
|
|
|
|
|
trace("testing Ctrl+Alt+VK_N press/release\n");
|
|
|
|
flush_sequence();
|
|
|
|
keybd_event(VK_CONTROL, 0, 0, 0);
|
|
|
|
keybd_event(VK_MENU, 0, 0, 0);
|
2004-10-22 20:29:10 +00:00
|
|
|
keybd_event('N', 0, 0, 0);
|
|
|
|
keybd_event('N', 0, KEYEVENTF_KEYUP, 0);
|
2004-10-05 23:45:35 +00:00
|
|
|
keybd_event(VK_MENU, 0, KEYEVENTF_KEYUP, 0);
|
|
|
|
keybd_event(VK_CONTROL, 0, KEYEVENTF_KEYUP, 0);
|
|
|
|
pump_msg_loop(hwnd, hAccel);
|
|
|
|
ok_sequence(WmCtrlAltVkN, "Ctrl+Alt+VK_N press/release 1", FALSE);
|
|
|
|
|
|
|
|
ok(DestroyAcceleratorTable(hAccel), "DestroyAcceleratorTable error %ld\n", GetLastError());
|
|
|
|
|
|
|
|
hAccel = LoadAccelerators(GetModuleHandleA(0), MAKEINTRESOURCE(2));
|
|
|
|
assert(hAccel != 0);
|
|
|
|
|
|
|
|
trace("testing VK_N press/release\n");
|
|
|
|
flush_sequence();
|
2004-10-22 20:29:10 +00:00
|
|
|
keybd_event('N', 0, 0, 0);
|
|
|
|
keybd_event('N', 0, KEYEVENTF_KEYUP, 0);
|
2004-10-05 23:45:35 +00:00
|
|
|
pump_msg_loop(hwnd, hAccel);
|
|
|
|
ok_sequence(WmVkN, "VK_N press/release", FALSE);
|
|
|
|
|
|
|
|
trace("testing Shift+VK_N press/release\n");
|
|
|
|
flush_sequence();
|
|
|
|
keybd_event(VK_SHIFT, 0, 0, 0);
|
2004-10-22 20:29:10 +00:00
|
|
|
keybd_event('N', 0, 0, 0);
|
|
|
|
keybd_event('N', 0, KEYEVENTF_KEYUP, 0);
|
2004-10-05 23:45:35 +00:00
|
|
|
keybd_event(VK_SHIFT, 0, KEYEVENTF_KEYUP, 0);
|
|
|
|
pump_msg_loop(hwnd, hAccel);
|
|
|
|
ok_sequence(WmShiftVkN, "Shift+VK_N press/release", FALSE);
|
|
|
|
|
|
|
|
trace("testing Ctrl+VK_N press/release 2\n");
|
|
|
|
flush_sequence();
|
|
|
|
keybd_event(VK_CONTROL, 0, 0, 0);
|
2004-10-22 20:29:10 +00:00
|
|
|
keybd_event('N', 0, 0, 0);
|
|
|
|
keybd_event('N', 0, KEYEVENTF_KEYUP, 0);
|
2004-10-05 23:45:35 +00:00
|
|
|
keybd_event(VK_CONTROL, 0, KEYEVENTF_KEYUP, 0);
|
|
|
|
pump_msg_loop(hwnd, hAccel);
|
|
|
|
ok_sequence(WmCtrlVkN_2, "Ctrl+VK_N press/release 2", FALSE);
|
|
|
|
|
|
|
|
trace("testing Alt+VK_N press/release 2\n");
|
|
|
|
flush_sequence();
|
|
|
|
keybd_event(VK_MENU, 0, 0, 0);
|
2004-10-22 20:29:10 +00:00
|
|
|
keybd_event('N', 0, 0, 0);
|
|
|
|
keybd_event('N', 0, KEYEVENTF_KEYUP, 0);
|
2004-10-05 23:45:35 +00:00
|
|
|
keybd_event(VK_MENU, 0, KEYEVENTF_KEYUP, 0);
|
|
|
|
pump_msg_loop(hwnd, hAccel);
|
|
|
|
ok_sequence(WmAltVkN_2, "Alt+VK_N press/release 2", FALSE);
|
|
|
|
|
|
|
|
trace("testing Ctrl+Alt+VK_N press/release\n");
|
|
|
|
flush_sequence();
|
|
|
|
keybd_event(VK_CONTROL, 0, 0, 0);
|
|
|
|
keybd_event(VK_MENU, 0, 0, 0);
|
2004-10-22 20:29:10 +00:00
|
|
|
keybd_event('N', 0, 0, 0);
|
|
|
|
keybd_event('N', 0, KEYEVENTF_KEYUP, 0);
|
2004-10-05 23:45:35 +00:00
|
|
|
keybd_event(VK_MENU, 0, KEYEVENTF_KEYUP, 0);
|
|
|
|
keybd_event(VK_CONTROL, 0, KEYEVENTF_KEYUP, 0);
|
|
|
|
pump_msg_loop(hwnd, hAccel);
|
|
|
|
ok_sequence(WmCtrlAltVkN, "Ctrl+Alt+VK_N press/release 2", FALSE);
|
|
|
|
|
|
|
|
ok(DestroyAcceleratorTable(hAccel), "DestroyAcceleratorTable error %ld\n", GetLastError());
|
|
|
|
|
|
|
|
DestroyWindow(hwnd);
|
|
|
|
}
|
|
|
|
|
2004-08-26 00:49:06 +00:00
|
|
|
/************* window procedures ********************/
|
2004-08-09 23:38:40 +00:00
|
|
|
|
2003-10-02 04:32:56 +00:00
|
|
|
static LRESULT WINAPI MsgCheckProcA(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
|
|
|
|
{
|
2004-04-06 20:09:59 +00:00
|
|
|
static long defwndproc_counter = 0;
|
2004-08-26 00:49:06 +00:00
|
|
|
static long beginpaint_counter = 0;
|
2004-04-06 20:09:59 +00:00
|
|
|
LRESULT ret;
|
2004-03-25 23:35:52 +00:00
|
|
|
struct message msg;
|
|
|
|
|
|
|
|
trace("%p, %04x, %08x, %08lx\n", hwnd, message, wParam, lParam);
|
|
|
|
|
2004-09-13 18:03:09 +00:00
|
|
|
switch (message)
|
|
|
|
{
|
|
|
|
case WM_WINDOWPOSCHANGING:
|
|
|
|
case WM_WINDOWPOSCHANGED:
|
|
|
|
{
|
|
|
|
WINDOWPOS *winpos = (WINDOWPOS *)lParam;
|
|
|
|
|
|
|
|
trace("%s\n", (message == WM_WINDOWPOSCHANGING) ? "WM_WINDOWPOSCHANGING" : "WM_WINDOWPOSCHANGED");
|
|
|
|
trace("%p after %p, x %d, y %d, cx %d, cy %d flags %08x\n",
|
|
|
|
winpos->hwnd, winpos->hwndInsertAfter,
|
|
|
|
winpos->x, winpos->y, winpos->cx, winpos->cy, winpos->flags);
|
|
|
|
|
|
|
|
/* Log only documented flags, win2k uses 0x1000 and 0x2000
|
|
|
|
* in the high word for internal purposes
|
|
|
|
*/
|
|
|
|
wParam = winpos->flags & 0xffff;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2004-03-25 23:35:52 +00:00
|
|
|
msg.message = message;
|
|
|
|
msg.flags = sent|wparam|lparam;
|
2004-04-06 20:09:59 +00:00
|
|
|
if (defwndproc_counter) msg.flags |= defwinproc;
|
2004-08-26 00:49:06 +00:00
|
|
|
if (beginpaint_counter) msg.flags |= beginpaint;
|
2004-03-25 23:35:52 +00:00
|
|
|
msg.wParam = wParam;
|
|
|
|
msg.lParam = lParam;
|
|
|
|
add_message(&msg);
|
2003-10-02 04:32:56 +00:00
|
|
|
|
2004-04-29 20:00:40 +00:00
|
|
|
if (message == WM_GETMINMAXINFO && (GetWindowLongA(hwnd, GWL_STYLE) & WS_CHILD))
|
|
|
|
{
|
|
|
|
HWND parent = GetParent(hwnd);
|
|
|
|
RECT rc;
|
|
|
|
MINMAXINFO *minmax = (MINMAXINFO *)lParam;
|
|
|
|
|
|
|
|
GetClientRect(parent, &rc);
|
|
|
|
trace("parent %p client size = (%ld x %ld)\n", parent, rc.right, rc.bottom);
|
|
|
|
|
|
|
|
trace("ptReserved = (%ld,%ld)\n"
|
|
|
|
"ptMaxSize = (%ld,%ld)\n"
|
|
|
|
"ptMaxPosition = (%ld,%ld)\n"
|
|
|
|
"ptMinTrackSize = (%ld,%ld)\n"
|
|
|
|
"ptMaxTrackSize = (%ld,%ld)\n",
|
|
|
|
minmax->ptReserved.x, minmax->ptReserved.y,
|
|
|
|
minmax->ptMaxSize.x, minmax->ptMaxSize.y,
|
|
|
|
minmax->ptMaxPosition.x, minmax->ptMaxPosition.y,
|
|
|
|
minmax->ptMinTrackSize.x, minmax->ptMinTrackSize.y,
|
|
|
|
minmax->ptMaxTrackSize.x, minmax->ptMaxTrackSize.y);
|
|
|
|
|
|
|
|
ok(minmax->ptMaxSize.x == rc.right, "default width of maximized child %ld != %ld\n",
|
|
|
|
minmax->ptMaxSize.x, rc.right);
|
|
|
|
ok(minmax->ptMaxSize.y == rc.bottom, "default height of maximized child %ld != %ld\n",
|
|
|
|
minmax->ptMaxSize.y, rc.bottom);
|
|
|
|
}
|
|
|
|
|
2004-08-26 00:49:06 +00:00
|
|
|
if (message == WM_PAINT)
|
|
|
|
{
|
|
|
|
PAINTSTRUCT ps;
|
|
|
|
beginpaint_counter++;
|
|
|
|
BeginPaint( hwnd, &ps );
|
|
|
|
beginpaint_counter--;
|
|
|
|
EndPaint( hwnd, &ps );
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2004-04-06 20:09:59 +00:00
|
|
|
defwndproc_counter++;
|
|
|
|
ret = DefWindowProcA(hwnd, message, wParam, lParam);
|
|
|
|
defwndproc_counter--;
|
|
|
|
|
|
|
|
return ret;
|
2003-10-02 04:32:56 +00:00
|
|
|
}
|
|
|
|
|
2004-04-02 20:22:53 +00:00
|
|
|
static LRESULT WINAPI PopupMsgCheckProcA(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
|
|
|
|
{
|
2004-04-06 20:09:59 +00:00
|
|
|
static long defwndproc_counter = 0;
|
|
|
|
LRESULT ret;
|
2004-04-02 20:22:53 +00:00
|
|
|
struct message msg;
|
|
|
|
|
|
|
|
trace("popup: %p, %04x, %08x, %08lx\n", hwnd, message, wParam, lParam);
|
|
|
|
|
|
|
|
msg.message = message;
|
|
|
|
msg.flags = sent|wparam|lparam;
|
2004-04-06 20:09:59 +00:00
|
|
|
if (defwndproc_counter) msg.flags |= defwinproc;
|
2004-04-02 20:22:53 +00:00
|
|
|
msg.wParam = wParam;
|
|
|
|
msg.lParam = lParam;
|
|
|
|
add_message(&msg);
|
|
|
|
|
|
|
|
if (message == WM_CREATE)
|
|
|
|
{
|
|
|
|
DWORD style = GetWindowLongA(hwnd, GWL_STYLE) | WS_VISIBLE;
|
|
|
|
SetWindowLongA(hwnd, GWL_STYLE, style);
|
|
|
|
}
|
|
|
|
|
2004-04-06 20:09:59 +00:00
|
|
|
defwndproc_counter++;
|
|
|
|
ret = DefWindowProcA(hwnd, message, wParam, lParam);
|
|
|
|
defwndproc_counter--;
|
|
|
|
|
|
|
|
return ret;
|
2004-04-02 20:22:53 +00:00
|
|
|
}
|
|
|
|
|
2004-03-26 02:28:28 +00:00
|
|
|
static LRESULT WINAPI ParentMsgCheckProcA(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
|
|
|
|
{
|
2004-04-06 20:09:59 +00:00
|
|
|
static long defwndproc_counter = 0;
|
|
|
|
LRESULT ret;
|
2004-03-26 02:28:28 +00:00
|
|
|
struct message msg;
|
|
|
|
|
2004-04-02 20:22:53 +00:00
|
|
|
trace("parent: %p, %04x, %08x, %08lx\n", hwnd, message, wParam, lParam);
|
2004-03-26 02:28:28 +00:00
|
|
|
|
2004-04-20 04:02:50 +00:00
|
|
|
if (message == WM_PARENTNOTIFY || message == WM_CANCELMODE ||
|
2004-05-20 01:17:28 +00:00
|
|
|
message == WM_SETFOCUS || message == WM_KILLFOCUS ||
|
|
|
|
message == WM_ENABLE || message == WM_ENTERIDLE ||
|
|
|
|
message == WM_IME_SETCONTEXT)
|
2004-03-26 02:28:28 +00:00
|
|
|
{
|
|
|
|
msg.message = message;
|
|
|
|
msg.flags = sent|parent|wparam|lparam;
|
2004-04-06 20:09:59 +00:00
|
|
|
if (defwndproc_counter) msg.flags |= defwinproc;
|
2004-03-26 02:28:28 +00:00
|
|
|
msg.wParam = wParam;
|
|
|
|
msg.lParam = lParam;
|
|
|
|
add_message(&msg);
|
|
|
|
}
|
|
|
|
|
2004-04-06 20:09:59 +00:00
|
|
|
defwndproc_counter++;
|
|
|
|
ret = DefWindowProcA(hwnd, message, wParam, lParam);
|
|
|
|
defwndproc_counter--;
|
|
|
|
|
|
|
|
return ret;
|
2004-03-26 02:28:28 +00:00
|
|
|
}
|
|
|
|
|
2004-04-20 04:02:50 +00:00
|
|
|
static LRESULT WINAPI TestDlgProcA(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
|
|
|
|
{
|
|
|
|
static long defwndproc_counter = 0;
|
|
|
|
LRESULT ret;
|
|
|
|
struct message msg;
|
|
|
|
|
|
|
|
trace("dialog: %p, %04x, %08x, %08lx\n", hwnd, message, wParam, lParam);
|
|
|
|
|
|
|
|
DefDlgProcA(hwnd, DM_SETDEFID, 1, 0);
|
|
|
|
ret = DefDlgProcA(hwnd, DM_GETDEFID, 0, 0);
|
2004-05-18 20:44:23 +00:00
|
|
|
if (after_end_dialog)
|
|
|
|
ok( ret == 0, "DM_GETDEFID should return 0 after EndDialog, got %lx\n", ret );
|
|
|
|
else
|
|
|
|
ok(HIWORD(ret) == DC_HASDEFID, "DM_GETDEFID should return DC_HASDEFID, got %lx\n", ret);
|
2004-04-20 04:02:50 +00:00
|
|
|
|
|
|
|
msg.message = message;
|
|
|
|
msg.flags = sent|wparam|lparam;
|
|
|
|
if (defwndproc_counter) msg.flags |= defwinproc;
|
|
|
|
msg.wParam = wParam;
|
|
|
|
msg.lParam = lParam;
|
|
|
|
add_message(&msg);
|
|
|
|
|
|
|
|
defwndproc_counter++;
|
|
|
|
ret = DefDlgProcA(hwnd, message, wParam, lParam);
|
|
|
|
defwndproc_counter--;
|
|
|
|
|
|
|
|
return ret;
|
|
|
|
}
|
|
|
|
|
2003-10-02 04:32:56 +00:00
|
|
|
static BOOL RegisterWindowClasses(void)
|
|
|
|
{
|
|
|
|
WNDCLASSA cls;
|
|
|
|
|
|
|
|
cls.style = 0;
|
|
|
|
cls.lpfnWndProc = MsgCheckProcA;
|
|
|
|
cls.cbClsExtra = 0;
|
|
|
|
cls.cbWndExtra = 0;
|
|
|
|
cls.hInstance = GetModuleHandleA(0);
|
|
|
|
cls.hIcon = 0;
|
|
|
|
cls.hCursor = LoadCursorA(0, (LPSTR)IDC_ARROW);
|
|
|
|
cls.hbrBackground = GetStockObject(WHITE_BRUSH);
|
|
|
|
cls.lpszMenuName = NULL;
|
|
|
|
cls.lpszClassName = "TestWindowClass";
|
2004-04-02 20:22:53 +00:00
|
|
|
if(!RegisterClassA(&cls)) return FALSE;
|
2003-10-02 04:32:56 +00:00
|
|
|
|
2004-04-02 20:22:53 +00:00
|
|
|
cls.lpfnWndProc = PopupMsgCheckProcA;
|
|
|
|
cls.lpszClassName = "TestPopupClass";
|
2003-10-02 04:32:56 +00:00
|
|
|
if(!RegisterClassA(&cls)) return FALSE;
|
|
|
|
|
2004-03-26 02:28:28 +00:00
|
|
|
cls.lpfnWndProc = ParentMsgCheckProcA;
|
2003-10-02 04:32:56 +00:00
|
|
|
cls.lpszClassName = "TestParentClass";
|
|
|
|
if(!RegisterClassA(&cls)) return FALSE;
|
|
|
|
|
|
|
|
cls.lpfnWndProc = DefWindowProcA;
|
|
|
|
cls.lpszClassName = "SimpleWindowClass";
|
|
|
|
if(!RegisterClassA(&cls)) return FALSE;
|
|
|
|
|
2004-04-20 04:02:50 +00:00
|
|
|
ok(GetClassInfoA(0, "#32770", &cls), "GetClassInfo failed\n");
|
|
|
|
cls.lpfnWndProc = TestDlgProcA;
|
|
|
|
cls.lpszClassName = "TestDialogClass";
|
|
|
|
if(!RegisterClassA(&cls)) return FALSE;
|
|
|
|
|
2003-10-02 04:32:56 +00:00
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
|
2004-03-26 00:18:20 +00:00
|
|
|
static HHOOK hCBT_hook;
|
|
|
|
|
|
|
|
static LRESULT CALLBACK cbt_hook_proc(int nCode, WPARAM wParam, LPARAM lParam)
|
|
|
|
{
|
|
|
|
char buf[256];
|
|
|
|
|
|
|
|
trace("CBT: %d, %08x, %08lx\n", nCode, wParam, lParam);
|
|
|
|
|
2004-09-13 19:32:59 +00:00
|
|
|
if (nCode == HCBT_SYSCOMMAND)
|
|
|
|
{
|
|
|
|
struct message msg;
|
|
|
|
|
|
|
|
msg.message = nCode;
|
|
|
|
msg.flags = hook;
|
|
|
|
msg.wParam = wParam;
|
|
|
|
msg.lParam = lParam;
|
|
|
|
add_message(&msg);
|
|
|
|
|
|
|
|
return CallNextHookEx(hCBT_hook, nCode, wParam, lParam);
|
|
|
|
}
|
|
|
|
|
2004-08-09 23:38:40 +00:00
|
|
|
/* Log also SetFocus(0) calls */
|
|
|
|
if (!wParam) wParam = lParam;
|
|
|
|
|
2004-03-26 00:18:20 +00:00
|
|
|
if (GetClassNameA((HWND)wParam, buf, sizeof(buf)))
|
|
|
|
{
|
|
|
|
if (!strcmp(buf, "TestWindowClass") ||
|
|
|
|
!strcmp(buf, "TestParentClass") ||
|
2004-04-02 20:22:53 +00:00
|
|
|
!strcmp(buf, "TestPopupClass") ||
|
2004-04-20 04:02:50 +00:00
|
|
|
!strcmp(buf, "SimpleWindowClass") ||
|
2004-06-01 19:39:26 +00:00
|
|
|
!strcmp(buf, "TestDialogClass") ||
|
2004-06-23 20:51:21 +00:00
|
|
|
!strcmp(buf, "MDI_frame_class") ||
|
|
|
|
!strcmp(buf, "MDI_client_class") ||
|
|
|
|
!strcmp(buf, "MDI_child_class") ||
|
2004-08-09 23:38:40 +00:00
|
|
|
!strcmp(buf, "my_button_class") ||
|
2004-06-01 19:39:26 +00:00
|
|
|
!strcmp(buf, "#32770"))
|
2004-03-26 00:18:20 +00:00
|
|
|
{
|
|
|
|
struct message msg;
|
|
|
|
|
|
|
|
msg.message = nCode;
|
|
|
|
msg.flags = hook;
|
|
|
|
msg.wParam = wParam;
|
|
|
|
msg.lParam = lParam;
|
|
|
|
add_message(&msg);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return CallNextHookEx(hCBT_hook, nCode, wParam, lParam);
|
|
|
|
}
|
|
|
|
|
2004-10-04 19:10:37 +00:00
|
|
|
static const WCHAR wszUnicode[] = {'U','n','i','c','o','d','e',0};
|
|
|
|
static const WCHAR wszAnsi[] = {'U',0};
|
|
|
|
|
|
|
|
static LRESULT CALLBACK MsgConversionProcW(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
|
|
|
|
{
|
|
|
|
switch (uMsg)
|
|
|
|
{
|
|
|
|
case CB_FINDSTRINGEXACT:
|
|
|
|
trace("String: %p\n", (LPCWSTR)lParam);
|
2004-10-04 20:39:00 +00:00
|
|
|
if (!lstrcmpW((LPCWSTR)lParam, wszUnicode))
|
2004-10-04 19:10:37 +00:00
|
|
|
return 1;
|
2004-10-04 20:39:00 +00:00
|
|
|
if (!lstrcmpW((LPCWSTR)lParam, wszAnsi))
|
2004-10-04 19:10:37 +00:00
|
|
|
return 0;
|
|
|
|
return -1;
|
|
|
|
}
|
|
|
|
return DefWindowProcW(hwnd, uMsg, wParam, lParam);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void test_message_conversion(void)
|
|
|
|
{
|
|
|
|
static const WCHAR wszMsgConversionClass[] =
|
|
|
|
{'M','s','g','C','o','n','v','e','r','s','i','o','n','C','l','a','s','s',0};
|
|
|
|
WNDCLASSW cls;
|
|
|
|
LRESULT lRes;
|
|
|
|
HWND hwnd;
|
|
|
|
WNDPROC wndproc;
|
|
|
|
|
|
|
|
cls.style = 0;
|
|
|
|
cls.lpfnWndProc = MsgConversionProcW;
|
|
|
|
cls.cbClsExtra = 0;
|
|
|
|
cls.cbWndExtra = 0;
|
|
|
|
cls.hInstance = GetModuleHandleW(NULL);
|
|
|
|
cls.hIcon = NULL;
|
|
|
|
cls.hCursor = LoadCursorW(NULL, (LPWSTR)IDC_ARROW);
|
|
|
|
cls.hbrBackground = (HBRUSH)(COLOR_BTNFACE+1);
|
|
|
|
cls.lpszMenuName = NULL;
|
|
|
|
cls.lpszClassName = wszMsgConversionClass;
|
|
|
|
/* this call will fail on Win9x, but that doesn't matter as this test is
|
|
|
|
* meaningless on those platforms */
|
|
|
|
if(!RegisterClassW(&cls)) return;
|
|
|
|
|
|
|
|
hwnd = CreateWindowExW(0, wszMsgConversionClass, NULL, WS_OVERLAPPED,
|
|
|
|
100, 100, 200, 200, 0, 0, 0, NULL);
|
|
|
|
ok(hwnd != NULL, "Window creation failed\n");
|
|
|
|
|
|
|
|
/* {W, A} -> A */
|
|
|
|
|
|
|
|
wndproc = (WNDPROC)GetWindowLongPtrA(hwnd, GWLP_WNDPROC);
|
|
|
|
lRes = CallWindowProcA(wndproc, hwnd, CB_FINDSTRINGEXACT, 0, (LPARAM)wszUnicode);
|
|
|
|
ok(lRes == 0, "String should have been converted\n");
|
|
|
|
lRes = CallWindowProcW(wndproc, hwnd, CB_FINDSTRINGEXACT, 0, (LPARAM)wszUnicode);
|
|
|
|
ok(lRes == 1, "String shouldn't have been converted\n");
|
|
|
|
|
|
|
|
/* {W, A} -> W */
|
|
|
|
|
|
|
|
wndproc = (WNDPROC)GetWindowLongPtrW(hwnd, GWLP_WNDPROC);
|
|
|
|
lRes = CallWindowProcA(wndproc, hwnd, CB_FINDSTRINGEXACT, 0, (LPARAM)wszUnicode);
|
|
|
|
ok(lRes == 1, "String shouldn't have been converted\n");
|
|
|
|
lRes = CallWindowProcW(wndproc, hwnd, CB_FINDSTRINGEXACT, 0, (LPARAM)wszUnicode);
|
|
|
|
ok(lRes == 1, "String shouldn't have been converted\n");
|
|
|
|
|
|
|
|
/* Synchronous messages */
|
|
|
|
|
|
|
|
lRes = SendMessageA(hwnd, CB_FINDSTRINGEXACT, 0, (LPARAM)wszUnicode);
|
|
|
|
ok(lRes == 0, "String should have been converted\n");
|
|
|
|
lRes = SendMessageW(hwnd, CB_FINDSTRINGEXACT, 0, (LPARAM)wszUnicode);
|
|
|
|
ok(lRes == 1, "String shouldn't have been converted\n");
|
|
|
|
|
|
|
|
/* Asynchronous messages */
|
|
|
|
|
|
|
|
SetLastError(0);
|
|
|
|
lRes = PostMessageA(hwnd, CB_FINDSTRINGEXACT, 0, (LPARAM)wszUnicode);
|
|
|
|
ok(lRes == 0 && GetLastError() == ERROR_MESSAGE_SYNC_ONLY,
|
|
|
|
"PostMessage on sync only message returned %ld, last error %ld\n", lRes, GetLastError());
|
|
|
|
SetLastError(0);
|
|
|
|
lRes = PostMessageW(hwnd, CB_FINDSTRINGEXACT, 0, (LPARAM)wszUnicode);
|
|
|
|
ok(lRes == 0 && GetLastError() == ERROR_MESSAGE_SYNC_ONLY,
|
|
|
|
"PostMessage on sync only message returned %ld, last error %ld\n", lRes, GetLastError());
|
2004-10-04 20:39:00 +00:00
|
|
|
SetLastError(0);
|
|
|
|
lRes = PostThreadMessageA(GetCurrentThreadId(), CB_FINDSTRINGEXACT, 0, (LPARAM)wszUnicode);
|
|
|
|
ok(lRes == 0 && GetLastError() == ERROR_MESSAGE_SYNC_ONLY,
|
|
|
|
"PosThreadtMessage on sync only message returned %ld, last error %ld\n", lRes, GetLastError());
|
|
|
|
SetLastError(0);
|
|
|
|
lRes = PostThreadMessageW(GetCurrentThreadId(), CB_FINDSTRINGEXACT, 0, (LPARAM)wszUnicode);
|
|
|
|
ok(lRes == 0 && GetLastError() == ERROR_MESSAGE_SYNC_ONLY,
|
|
|
|
"PosThreadtMessage on sync only message returned %ld, last error %ld\n", lRes, GetLastError());
|
|
|
|
SetLastError(0);
|
|
|
|
lRes = SendNotifyMessageA(hwnd, CB_FINDSTRINGEXACT, 0, (LPARAM)wszUnicode);
|
|
|
|
ok(lRes == 0 && GetLastError() == ERROR_MESSAGE_SYNC_ONLY,
|
|
|
|
"SendNotifyMessage on sync only message returned %ld, last error %ld\n", lRes, GetLastError());
|
|
|
|
SetLastError(0);
|
|
|
|
lRes = SendNotifyMessageW(hwnd, CB_FINDSTRINGEXACT, 0, (LPARAM)wszUnicode);
|
|
|
|
ok(lRes == 0 && GetLastError() == ERROR_MESSAGE_SYNC_ONLY,
|
|
|
|
"SendNotifyMessage on sync only message returned %ld, last error %ld\n", lRes, GetLastError());
|
|
|
|
SetLastError(0);
|
|
|
|
lRes = SendMessageCallbackA(hwnd, CB_FINDSTRINGEXACT, 0, (LPARAM)wszUnicode, NULL, 0);
|
|
|
|
ok(lRes == 0 && GetLastError() == ERROR_MESSAGE_SYNC_ONLY,
|
|
|
|
"SendMessageCallback on sync only message returned %ld, last error %ld\n", lRes, GetLastError());
|
|
|
|
SetLastError(0);
|
|
|
|
lRes = SendMessageCallbackW(hwnd, CB_FINDSTRINGEXACT, 0, (LPARAM)wszUnicode, NULL, 0);
|
|
|
|
ok(lRes == 0 && GetLastError() == ERROR_MESSAGE_SYNC_ONLY,
|
|
|
|
"SendMessageCallback on sync only message returned %ld, last error %ld\n", lRes, GetLastError());
|
2004-10-04 19:10:37 +00:00
|
|
|
}
|
|
|
|
|
2004-11-29 18:21:14 +00:00
|
|
|
typedef struct _thread_info
|
|
|
|
{
|
|
|
|
HWND hWnd;
|
|
|
|
HANDLE handles[2];
|
|
|
|
DWORD id;
|
|
|
|
} thread_info;
|
|
|
|
|
|
|
|
static VOID CALLBACK tfunc(HWND hwnd, UINT uMsg, UINT id, DWORD dwTime)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
#define TIMER_ID 0x19
|
|
|
|
|
|
|
|
static DWORD WINAPI timer_thread_proc(LPVOID x)
|
|
|
|
{
|
|
|
|
thread_info *info = x;
|
|
|
|
DWORD r;
|
|
|
|
|
|
|
|
r = KillTimer(info->hWnd, 0x19);
|
|
|
|
ok(r,"KillTimer failed in thread\n");
|
|
|
|
r = SetTimer(info->hWnd,TIMER_ID,10000,tfunc);
|
|
|
|
ok(r,"SetTimer failed in thread\n");
|
|
|
|
ok(r==TIMER_ID,"SetTimer id different\n");
|
|
|
|
r = SetEvent(info->handles[0]);
|
|
|
|
ok(r,"SetEvent failed in thread\n");
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void test_timers(void)
|
|
|
|
{
|
|
|
|
thread_info info;
|
|
|
|
DWORD id;
|
|
|
|
|
|
|
|
info.hWnd = CreateWindow ("TestWindowClass", NULL,
|
|
|
|
WS_OVERLAPPEDWINDOW ,
|
|
|
|
CW_USEDEFAULT, CW_USEDEFAULT, 300, 300, 0,
|
|
|
|
NULL, NULL, 0);
|
|
|
|
|
|
|
|
info.id = SetTimer(info.hWnd,TIMER_ID,10000,tfunc);
|
|
|
|
ok(info.id, "SetTimer failed");
|
|
|
|
ok(info.id==TIMER_ID, "SetTimer timer ID different");
|
|
|
|
info.handles[0] = CreateEvent(NULL,0,0,NULL);
|
|
|
|
info.handles[1] = CreateThread(NULL,0,timer_thread_proc,&info,0,&id);
|
|
|
|
|
|
|
|
WaitForMultipleObjects(2, info.handles, FALSE, INFINITE);
|
|
|
|
|
|
|
|
WaitForSingleObject(info.handles[1], INFINITE);
|
|
|
|
|
|
|
|
ok( KillTimer(info.hWnd, TIMER_ID), "KillTimer failed\n");
|
|
|
|
|
|
|
|
ok(DestroyWindow(info.hWnd), "failed to destroy window\n");
|
|
|
|
}
|
|
|
|
|
2003-10-02 04:32:56 +00:00
|
|
|
START_TEST(msg)
|
|
|
|
{
|
|
|
|
if (!RegisterWindowClasses()) assert(0);
|
|
|
|
|
2004-03-26 00:18:20 +00:00
|
|
|
hCBT_hook = SetWindowsHookExA(WH_CBT, cbt_hook_proc, 0, GetCurrentThreadId());
|
|
|
|
assert(hCBT_hook);
|
|
|
|
|
2003-10-02 04:32:56 +00:00
|
|
|
test_messages();
|
2004-06-23 20:51:21 +00:00
|
|
|
test_mdi_messages();
|
2004-08-09 23:38:40 +00:00
|
|
|
test_button_messages();
|
2004-08-26 00:49:06 +00:00
|
|
|
test_paint_messages();
|
2004-10-05 22:35:00 +00:00
|
|
|
test_interthread_messages();
|
2004-10-04 19:10:37 +00:00
|
|
|
test_message_conversion();
|
2004-10-05 23:45:35 +00:00
|
|
|
test_accelerators();
|
2004-11-29 18:21:14 +00:00
|
|
|
test_timers();
|
2004-03-26 00:18:20 +00:00
|
|
|
|
|
|
|
UnhookWindowsHookEx(hCBT_hook);
|
2003-10-02 04:32:56 +00:00
|
|
|
}
|