Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
d6c8a003
Commit
d6c8a003
authored
May 12, 2009
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
user32/tests: Add more systematic support for ignoring certain messages.
parent
2c882507
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
43 additions
and
46 deletions
+43
-46
msg.c
dlls/user32/tests/msg.c
+32
-45
win.c
dlls/user32/tests/win.c
+11
-1
No files found.
dlls/user32/tests/msg.c
View file @
d6c8a003
...
...
@@ -1557,6 +1557,8 @@ static const struct message WmEnableWindowSeq_1[] =
{
{
WM_CANCELMODE
,
sent
|
wparam
|
lparam
,
0
,
0
},
{
EVENT_OBJECT_STATECHANGE
,
winevent_hook
|
wparam
|
lparam
,
0
,
0
},
{
HCBT_SETFOCUS
,
hook
|
optional
},
{
WM_KILLFOCUS
,
sent
|
optional
},
{
WM_ENABLE
,
sent
|
wparam
|
lparam
,
FALSE
,
0
},
{
0
}
};
...
...
@@ -1759,6 +1761,16 @@ static const char *get_winpos_flags(UINT flags)
#undef DUMP
}
static
BOOL
ignore_message
(
UINT
message
)
{
/* these are always ignored */
return
(
message
>=
0xc000
||
message
==
WM_GETICON
||
message
==
WM_GETOBJECT
||
message
==
WM_TIMECHANGE
||
message
==
WM_DEVICECHANGE
);
}
#define add_message(msg) add_message_(__LINE__,msg);
static
void
add_message_
(
int
line
,
const
struct
recvd_message
*
msg
)
...
...
@@ -1863,6 +1875,8 @@ static void add_message_(int line, const struct recvd_message *msg)
sprintf
(
seq
->
output
,
"%s: %p %04x wp %08lx lp %08lx"
,
msg
->
descr
,
msg
->
hwnd
,
msg
->
message
,
msg
->
wParam
,
msg
->
lParam
);
}
if
(
msg
->
flags
&
(
sent
|
posted
|
parent
|
defwinproc
|
beginpaint
))
sprintf
(
seq
->
output
+
strlen
(
seq
->
output
),
" (flags %x)"
,
msg
->
flags
);
}
}
...
...
@@ -3202,9 +3216,7 @@ static LRESULT WINAPI mdi_client_hook_proc(HWND hwnd, UINT message, WPARAM wPara
message
!=
WM_NCHITTEST
&&
message
!=
WM_GETTEXT
&&
message
!=
WM_MDIGETACTIVE
&&
message
!=
WM_GETICON
&&
message
!=
WM_GETOBJECT
&&
message
!=
WM_DEVICECHANGE
)
!
ignore_message
(
message
))
{
msg
.
hwnd
=
hwnd
;
msg
.
message
=
message
;
...
...
@@ -3231,9 +3243,7 @@ static LRESULT WINAPI mdi_child_wnd_proc(HWND hwnd, UINT message, WPARAM wParam,
message
!=
WM_ERASEBKGND
&&
message
!=
WM_NCHITTEST
&&
message
!=
WM_GETTEXT
&&
message
!=
WM_GETICON
&&
message
!=
WM_GETOBJECT
&&
message
!=
WM_DEVICECHANGE
)
!
ignore_message
(
message
))
{
switch
(
message
)
{
...
...
@@ -3281,9 +3291,7 @@ static LRESULT WINAPI mdi_frame_wnd_proc(HWND hwnd, UINT message, WPARAM wParam,
message
!=
WM_ERASEBKGND
&&
message
!=
WM_NCHITTEST
&&
message
!=
WM_GETTEXT
&&
message
!=
WM_GETICON
&&
message
!=
WM_GETOBJECT
&&
message
!=
WM_DEVICECHANGE
)
!
ignore_message
(
message
))
{
msg
.
hwnd
=
hwnd
;
msg
.
message
=
message
;
...
...
@@ -3898,16 +3906,15 @@ static INT_PTR CALLBACK TestModalDlgProcA(HWND hwnd, UINT message, WPARAM wParam
{
struct
recvd_message
msg
;
if
(
ignore_message
(
message
))
return
0
;
switch
(
message
)
{
/* ignore */
case
WM_GETICON
:
case
WM_GETOBJECT
:
case
WM_MOUSEMOVE
:
case
WM_NCMOUSEMOVE
:
case
WM_NCMOUSELEAVE
:
case
WM_SETCURSOR
:
case
WM_DEVICECHANGE
:
return
0
;
case
WM_NCHITTEST
:
return
HTCLIENT
;
...
...
@@ -5157,11 +5164,10 @@ static LRESULT CALLBACK button_hook_proc(HWND hwnd, UINT message, WPARAM wParam,
LRESULT
ret
;
struct
recvd_message
msg
;
if
(
ignore_message
(
message
))
return
0
;
switch
(
message
)
{
case
WM_GETICON
:
case
WM_GETOBJECT
:
return
0
;
/* ignore them */
case
WM_SYNCPAINT
:
break
;
case
BM_SETSTATE
:
...
...
@@ -5318,7 +5324,7 @@ static LRESULT CALLBACK static_hook_proc(HWND hwnd, UINT message, WPARAM wParam,
LRESULT
ret
;
struct
recvd_message
msg
;
if
(
message
==
WM_GETICON
||
message
==
WM_GETOBJECT
)
return
0
;
/* ignore them */
if
(
ignore_message
(
message
))
return
0
;
msg
.
hwnd
=
hwnd
;
msg
.
message
=
message
;
...
...
@@ -5420,9 +5426,7 @@ static LRESULT CALLBACK combobox_hook_proc(HWND hwnd, UINT message, WPARAM wPara
message
!=
WM_ERASEBKGND
&&
message
!=
WM_NCHITTEST
&&
message
!=
WM_GETTEXT
&&
message
!=
WM_GETICON
&&
message
!=
WM_GETOBJECT
&&
message
!=
WM_DEVICECHANGE
)
!
ignore_message
(
message
))
{
msg
.
hwnd
=
hwnd
;
msg
.
message
=
message
;
...
...
@@ -6657,10 +6661,8 @@ static void pump_msg_loop(HWND hwnd, HACCEL hAccel)
/* ignore some unwanted messages */
if
(
msg
.
message
==
WM_MOUSEMOVE
||
msg
.
message
==
WM_GETICON
||
msg
.
message
==
WM_GETOBJECT
||
msg
.
message
==
WM_TIMER
||
msg
.
message
==
WM_DEVICECHANGE
)
ignore_message
(
msg
.
message
)
)
continue
;
log_msg
.
hwnd
=
msg
.
hwnd
;
...
...
@@ -6902,8 +6904,7 @@ static LRESULT MsgCheckProc (BOOL unicode, HWND hwnd, UINT message,
LRESULT
ret
;
struct
recvd_message
msg
;
/* ignore registered messages */
if
(
message
>=
0xc000
)
return
0
;
if
(
ignore_message
(
message
))
return
0
;
switch
(
message
)
{
...
...
@@ -6966,9 +6967,6 @@ static LRESULT MsgCheckProc (BOOL unicode, HWND hwnd, UINT message,
case
WM_MOUSEACTIVATE
:
case
WM_NCMOUSEMOVE
:
case
WM_SETCURSOR
:
case
WM_GETICON
:
case
WM_GETOBJECT
:
case
WM_DEVICECHANGE
:
case
WM_IME_SELECT
:
return
0
;
}
...
...
@@ -7038,11 +7036,10 @@ static LRESULT WINAPI PopupMsgCheckProcA(HWND hwnd, UINT message, WPARAM wParam,
LRESULT
ret
;
struct
recvd_message
msg
;
if
(
ignore_message
(
message
))
return
0
;
switch
(
message
)
{
case
WM_GETICON
:
case
WM_GETOBJECT
:
return
0
;
/* ignore them */
case
WM_QUERYENDSESSION
:
case
WM_ENDSESSION
:
lParam
&=
~
0x01
;
/* Vista adds a 0x01 flag */
...
...
@@ -7078,10 +7075,7 @@ static LRESULT WINAPI ParentMsgCheckProcA(HWND hwnd, UINT message, WPARAM wParam
LRESULT
ret
;
struct
recvd_message
msg
;
if
(
message
==
WM_GETICON
||
message
==
WM_GETOBJECT
)
return
0
;
/* ignore them */
/* ignore registered messages */
if
(
message
>=
0xc000
)
return
0
;
if
(
ignore_message
(
message
))
return
0
;
if
(
log_all_parent_messages
||
message
==
WM_PARENTNOTIFY
||
message
==
WM_CANCELMODE
||
...
...
@@ -7145,7 +7139,7 @@ static LRESULT WINAPI TestDlgProcA(HWND hwnd, UINT message, WPARAM wParam, LPARA
LRESULT
ret
;
struct
recvd_message
msg
;
if
(
message
==
WM_GETICON
||
message
==
WM_GETOBJECT
)
return
0
;
/* ignore them */
if
(
ignore_message
(
message
))
return
0
;
if
(
test_def_id
)
{
...
...
@@ -8773,7 +8767,7 @@ static LRESULT CALLBACK edit_hook_proc(HWND hwnd, UINT message, WPARAM wParam, L
LRESULT
ret
;
struct
recvd_message
msg
;
if
(
message
==
WM_GETICON
||
message
==
WM_GETOBJECT
)
return
0
;
/* ignore them */
if
(
ignore_message
(
message
))
return
0
;
msg
.
hwnd
=
hwnd
;
msg
.
message
=
message
;
...
...
@@ -10271,12 +10265,7 @@ static INT_PTR WINAPI test_dlg_proc(HWND hwnd, UINT message, WPARAM wParam, LPAR
{
struct
recvd_message
msg
;
switch
(
message
)
{
case
WM_GETICON
:
case
WM_GETOBJECT
:
return
0
;
/* ignore them */
}
if
(
ignore_message
(
message
))
return
0
;
msg
.
hwnd
=
hwnd
;
msg
.
message
=
message
;
...
...
@@ -11052,9 +11041,7 @@ static LRESULT WINAPI listbox_hook_proc(HWND hwnd, UINT message, WPARAM wp, LPAR
message
!=
WM_ERASEBKGND
&&
message
!=
WM_NCHITTEST
&&
message
!=
WM_GETTEXT
&&
message
!=
WM_GETOBJECT
&&
message
!=
WM_GETICON
&&
message
!=
WM_DEVICECHANGE
)
!
ignore_message
(
message
))
{
msg
.
hwnd
=
hwnd
;
msg
.
message
=
message
;
...
...
dlls/user32/tests/win.c
View file @
d6c8a003
...
...
@@ -118,6 +118,16 @@ static void check_parents( HWND hwnd, HWND ga_parent, HWND gwl_parent, HWND get_
}
}
static
BOOL
ignore_message
(
UINT
message
)
{
/* these are always ignored */
return
(
message
>=
0xc000
||
message
==
WM_GETICON
||
message
==
WM_GETOBJECT
||
message
==
WM_TIMECHANGE
||
message
==
WM_DEVICECHANGE
);
}
static
BOOL
CALLBACK
EnumChildProc
(
HWND
hwndChild
,
LPARAM
lParam
)
{
(
*
(
LPINT
)
lParam
)
++
;
...
...
@@ -2713,7 +2723,7 @@ static BOOL wait_for_message( MSG *msg )
if
(
ret
)
{
if
(
msg
->
message
==
WM_PAINT
)
DispatchMessage
(
msg
);
else
if
(
msg
->
message
<
0xc000
)
break
;
/* skip registered messages */
else
if
(
!
ignore_message
(
msg
->
message
))
break
;
}
else
if
(
MsgWaitForMultipleObjects
(
0
,
NULL
,
FALSE
,
100
,
QS_ALLINPUT
)
==
WAIT_TIMEOUT
)
break
;
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment