Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
30f2c661
Commit
30f2c661
authored
Aug 05, 2011
by
Francois Gouget
Committed by
Alexandre Julliard
Aug 23, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
user32/tests: Test what happens to a WM_QUIT posted to a window that gets destroyed.
parent
4505b4b0
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
49 additions
and
0 deletions
+49
-0
msg.c
dlls/user32/tests/msg.c
+49
-0
No files found.
dlls/user32/tests/msg.c
View file @
30f2c661
...
...
@@ -7608,6 +7608,21 @@ static LRESULT WINAPI ParentMsgCheckProcA(HWND hwnd, UINT message, WPARAM wParam
return
ret
;
}
static
INT_PTR
CALLBACK
StopQuitMsgCheckProcA
(
HWND
hwnd
,
UINT
message
,
WPARAM
wp
,
LPARAM
lp
)
{
if
(
message
==
WM_CREATE
)
PostMessage
(
hwnd
,
WM_CLOSE
,
0
,
0
);
else
if
(
message
==
WM_CLOSE
)
{
/* Only the first WM_QUIT will survive the window destruction */
PostMessage
(
hwnd
,
WM_USER
,
0x1234
,
0x5678
);
PostMessage
(
hwnd
,
WM_QUIT
,
0x1234
,
0x5678
);
PostMessage
(
hwnd
,
WM_QUIT
,
0x4321
,
0x8765
);
}
return
DefWindowProcA
(
hwnd
,
message
,
wp
,
lp
);
}
static
LRESULT
WINAPI
TestDlgProcA
(
HWND
hwnd
,
UINT
message
,
WPARAM
wParam
,
LPARAM
lParam
)
{
static
LONG
defwndproc_counter
=
0
;
...
...
@@ -7790,6 +7805,10 @@ static BOOL RegisterWindowClasses(void)
cls
.
lpszClassName
=
"TestParentClass"
;
if
(
!
RegisterClassA
(
&
cls
))
return
FALSE
;
cls
.
lpfnWndProc
=
StopQuitMsgCheckProcA
;
cls
.
lpszClassName
=
"StopQuitClass"
;
if
(
!
RegisterClassA
(
&
cls
))
return
FALSE
;
cls
.
lpfnWndProc
=
DefWindowProcA
;
cls
.
lpszClassName
=
"SimpleWindowClass"
;
if
(
!
RegisterClassA
(
&
cls
))
return
FALSE
;
...
...
@@ -10131,6 +10150,13 @@ static const struct message WmQuitDialogSeq[] = {
{
0
}
};
static
const
struct
message
WmStopQuitSeq
[]
=
{
{
WM_DWMNCRENDERINGCHANGED
,
posted
|
optional
},
{
WM_CLOSE
,
posted
},
{
WM_QUIT
,
posted
|
wparam
|
lparam
,
0x1234
,
0
},
{
0
}
};
static
void
test_quit_message
(
void
)
{
MSG
msg
;
...
...
@@ -10193,6 +10219,29 @@ static void test_quit_message(void)
ok
(
msg
.
message
==
WM_QUIT
,
"Received message 0x%04x instead of WM_QUIT
\n
"
,
msg
.
message
);
ok
(
msg
.
wParam
==
0x1234
,
"wParam was 0x%lx instead of 0x1234
\n
"
,
msg
.
wParam
);
ok
(
msg
.
lParam
==
0
,
"lParam was 0x%lx instead of 0
\n
"
,
msg
.
lParam
);
/* Check what happens to a WM_QUIT message posted to a window that gets
* destroyed.
*/
CreateWindowExA
(
0
,
"StopQuitClass"
,
"Stop Quit Test"
,
WS_OVERLAPPEDWINDOW
,
0
,
0
,
100
,
100
,
NULL
,
NULL
,
NULL
,
NULL
);
flush_sequence
();
while
(
PeekMessage
(
&
msg
,
0
,
0
,
0
,
PM_REMOVE
))
{
struct
recvd_message
rmsg
;
rmsg
.
hwnd
=
msg
.
hwnd
;
rmsg
.
message
=
msg
.
message
;
rmsg
.
flags
=
posted
|
wparam
|
lparam
;
rmsg
.
wParam
=
msg
.
wParam
;
rmsg
.
lParam
=
msg
.
lParam
;
rmsg
.
descr
=
"stop/quit"
;
if
(
msg
.
message
==
WM_QUIT
)
/* The hwnd can only be checked here */
ok
(
!
msg
.
hwnd
,
"The WM_QUIT hwnd was %p instead of NULL
\n
"
,
msg
.
hwnd
);
add_message
(
&
rmsg
);
DispatchMessage
(
&
msg
);
}
ok_sequence
(
WmStopQuitSeq
,
"WmStopQuitSeq"
,
TRUE
);
}
static
const
struct
message
WmMouseHoverSeq
[]
=
{
...
...
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