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
ed954e54
Commit
ed954e54
authored
Dec 04, 2006
by
Dmitry Timoshkov
Committed by
Alexandre Julliard
Dec 04, 2006
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
user32: Add ShowWindow test, make it pass under Wine.
parent
c05bcabe
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
126 additions
and
1 deletion
+126
-1
nonclient.c
dlls/user32/nonclient.c
+3
-1
win.c
dlls/user32/tests/win.c
+123
-0
No files found.
dlls/user32/nonclient.c
View file @
ed954e54
...
@@ -1541,7 +1541,9 @@ LRESULT NC_HandleNCLButtonDblClk( HWND hwnd, WPARAM wParam, LPARAM lParam )
...
@@ -1541,7 +1541,9 @@ LRESULT NC_HandleNCLButtonDblClk( HWND hwnd, WPARAM wParam, LPARAM lParam )
*/
*/
LRESULT
NC_HandleSysCommand
(
HWND
hwnd
,
WPARAM
wParam
,
LPARAM
lParam
)
LRESULT
NC_HandleSysCommand
(
HWND
hwnd
,
WPARAM
wParam
,
LPARAM
lParam
)
{
{
TRACE
(
"Handling WM_SYSCOMMAND %x %lx
\n
"
,
wParam
,
lParam
);
TRACE
(
"hwnd %p WM_SYSCOMMAND %x %lx
\n
"
,
hwnd
,
wParam
,
lParam
);
if
(
!
IsWindowEnabled
(
hwnd
))
return
0
;
if
(
HOOK_CallHooks
(
WH_CBT
,
HCBT_SYSCOMMAND
,
wParam
,
lParam
,
TRUE
))
if
(
HOOK_CallHooks
(
WH_CBT
,
HCBT_SYSCOMMAND
,
wParam
,
lParam
,
TRUE
))
return
0
;
return
0
;
...
...
dlls/user32/tests/win.c
View file @
ed954e54
...
@@ -3943,6 +3943,128 @@ static void test_SetWindowLong(void)
...
@@ -3943,6 +3943,128 @@ static void test_SetWindowLong(void)
}
}
}
}
static
void
test_ShowWindow
(
void
)
{
HWND
hwnd
;
DWORD
style
;
RECT
rcMain
,
rc
;
LPARAM
ret
;
SetRect
(
&
rcMain
,
120
,
120
,
210
,
210
);
hwnd
=
CreateWindowEx
(
0
,
"MainWindowClass"
,
NULL
,
WS_CAPTION
|
WS_SYSMENU
|
WS_MINIMIZEBOX
|
WS_MAXIMIZEBOX
|
WS_POPUP
,
rcMain
.
left
,
rcMain
.
top
,
rcMain
.
right
-
rcMain
.
left
,
rcMain
.
bottom
-
rcMain
.
top
,
0
,
0
,
0
,
NULL
);
assert
(
hwnd
);
style
=
GetWindowLong
(
hwnd
,
GWL_STYLE
);
ok
(
!
(
style
&
WS_DISABLED
),
"window should not be disabled
\n
"
);
ok
(
!
(
style
&
WS_VISIBLE
),
"window should not be visible
\n
"
);
ok
(
!
(
style
&
WS_MINIMIZE
),
"window should not be minimized
\n
"
);
ok
(
!
(
style
&
WS_MAXIMIZE
),
"window should not be maximized
\n
"
);
GetWindowRect
(
hwnd
,
&
rc
);
ok
(
EqualRect
(
&
rcMain
,
&
rc
),
"rects should match
\n
"
);
ret
=
ShowWindow
(
hwnd
,
SW_SHOW
);
ok
(
!
ret
,
"not expected ret: %lu
\n
"
,
ret
);
style
=
GetWindowLong
(
hwnd
,
GWL_STYLE
);
ok
(
!
(
style
&
WS_DISABLED
),
"window should not be disabled
\n
"
);
ok
(
style
&
WS_VISIBLE
,
"window should be visible
\n
"
);
ok
(
!
(
style
&
WS_MINIMIZE
),
"window should not be minimized
\n
"
);
ok
(
!
(
style
&
WS_MAXIMIZE
),
"window should not be maximized
\n
"
);
GetWindowRect
(
hwnd
,
&
rc
);
ok
(
EqualRect
(
&
rcMain
,
&
rc
),
"rects should match
\n
"
);
ret
=
ShowWindow
(
hwnd
,
SW_MINIMIZE
);
ok
(
ret
,
"not expected ret: %lu
\n
"
,
ret
);
style
=
GetWindowLong
(
hwnd
,
GWL_STYLE
);
ok
(
!
(
style
&
WS_DISABLED
),
"window should not be disabled
\n
"
);
ok
(
style
&
WS_VISIBLE
,
"window should be visible
\n
"
);
ok
(
style
&
WS_MINIMIZE
,
"window should be minimized
\n
"
);
ok
(
!
(
style
&
WS_MAXIMIZE
),
"window should not be maximized
\n
"
);
GetWindowRect
(
hwnd
,
&
rc
);
ok
(
!
EqualRect
(
&
rcMain
,
&
rc
),
"rects shouldn't match
\n
"
);
ShowWindow
(
hwnd
,
SW_RESTORE
);
ok
(
ret
,
"not expected ret: %lu
\n
"
,
ret
);
style
=
GetWindowLong
(
hwnd
,
GWL_STYLE
);
ok
(
!
(
style
&
WS_DISABLED
),
"window should not be disabled
\n
"
);
ok
(
style
&
WS_VISIBLE
,
"window should be visible
\n
"
);
ok
(
!
(
style
&
WS_MINIMIZE
),
"window should not be minimized
\n
"
);
ok
(
!
(
style
&
WS_MAXIMIZE
),
"window should not be maximized
\n
"
);
GetWindowRect
(
hwnd
,
&
rc
);
ok
(
EqualRect
(
&
rcMain
,
&
rc
),
"rects should match
\n
"
);
ret
=
EnableWindow
(
hwnd
,
FALSE
);
ok
(
!
ret
,
"not expected ret: %lu
\n
"
,
ret
);
style
=
GetWindowLong
(
hwnd
,
GWL_STYLE
);
ok
(
style
&
WS_DISABLED
,
"window should be disabled
\n
"
);
ret
=
DefWindowProc
(
hwnd
,
WM_SYSCOMMAND
,
SC_MINIMIZE
,
0
);
ok
(
!
ret
,
"not expected ret: %lu
\n
"
,
ret
);
style
=
GetWindowLong
(
hwnd
,
GWL_STYLE
);
ok
(
style
&
WS_DISABLED
,
"window should be disabled
\n
"
);
ok
(
style
&
WS_VISIBLE
,
"window should be visible
\n
"
);
ok
(
!
(
style
&
WS_MINIMIZE
),
"window should not be minimized
\n
"
);
ok
(
!
(
style
&
WS_MAXIMIZE
),
"window should not be maximized
\n
"
);
GetWindowRect
(
hwnd
,
&
rc
);
ok
(
EqualRect
(
&
rcMain
,
&
rc
),
"rects should match
\n
"
);
ret
=
DefWindowProc
(
hwnd
,
WM_SYSCOMMAND
,
SC_MAXIMIZE
,
0
);
ok
(
!
ret
,
"not expected ret: %lu
\n
"
,
ret
);
style
=
GetWindowLong
(
hwnd
,
GWL_STYLE
);
ok
(
style
&
WS_DISABLED
,
"window should be disabled
\n
"
);
ok
(
style
&
WS_VISIBLE
,
"window should be visible
\n
"
);
ok
(
!
(
style
&
WS_MINIMIZE
),
"window should not be minimized
\n
"
);
ok
(
!
(
style
&
WS_MAXIMIZE
),
"window should not be maximized
\n
"
);
GetWindowRect
(
hwnd
,
&
rc
);
ok
(
EqualRect
(
&
rcMain
,
&
rc
),
"rects should match
\n
"
);
ret
=
ShowWindow
(
hwnd
,
SW_MINIMIZE
);
ok
(
ret
,
"not expected ret: %lu
\n
"
,
ret
);
style
=
GetWindowLong
(
hwnd
,
GWL_STYLE
);
ok
(
style
&
WS_DISABLED
,
"window should be disabled
\n
"
);
ok
(
style
&
WS_VISIBLE
,
"window should be visible
\n
"
);
ok
(
style
&
WS_MINIMIZE
,
"window should be minimized
\n
"
);
ok
(
!
(
style
&
WS_MAXIMIZE
),
"window should not be maximized
\n
"
);
GetWindowRect
(
hwnd
,
&
rc
);
ok
(
!
EqualRect
(
&
rcMain
,
&
rc
),
"rects shouldn't match
\n
"
);
ret
=
DefWindowProc
(
hwnd
,
WM_SYSCOMMAND
,
SC_RESTORE
,
0
);
ok
(
!
ret
,
"not expected ret: %lu
\n
"
,
ret
);
style
=
GetWindowLong
(
hwnd
,
GWL_STYLE
);
ok
(
style
&
WS_DISABLED
,
"window should be disabled
\n
"
);
ok
(
style
&
WS_VISIBLE
,
"window should be visible
\n
"
);
ok
(
style
&
WS_MINIMIZE
,
"window should be minimized
\n
"
);
ok
(
!
(
style
&
WS_MAXIMIZE
),
"window should not be maximized
\n
"
);
GetWindowRect
(
hwnd
,
&
rc
);
ok
(
!
EqualRect
(
&
rcMain
,
&
rc
),
"rects shouldn't match
\n
"
);
ret
=
ShowWindow
(
hwnd
,
SW_RESTORE
);
ok
(
ret
,
"not expected ret: %lu
\n
"
,
ret
);
style
=
GetWindowLong
(
hwnd
,
GWL_STYLE
);
ok
(
style
&
WS_DISABLED
,
"window should be disabled
\n
"
);
ok
(
style
&
WS_VISIBLE
,
"window should be visible
\n
"
);
ok
(
!
(
style
&
WS_MINIMIZE
),
"window should not be minimized
\n
"
);
ok
(
!
(
style
&
WS_MAXIMIZE
),
"window should not be maximized
\n
"
);
GetWindowRect
(
hwnd
,
&
rc
);
ok
(
EqualRect
(
&
rcMain
,
&
rc
),
"rects should match
\n
"
);
ret
=
DefWindowProc
(
hwnd
,
WM_SYSCOMMAND
,
SC_CLOSE
,
0
);
ok
(
!
ret
,
"not expected ret: %lu
\n
"
,
ret
);
ok
(
IsWindow
(
hwnd
),
"window should exist
\n
"
);
ret
=
EnableWindow
(
hwnd
,
TRUE
);
ok
(
ret
,
"not expected ret: %lu
\n
"
,
ret
);
ret
=
DefWindowProc
(
hwnd
,
WM_SYSCOMMAND
,
SC_CLOSE
,
0
);
ok
(
!
ret
,
"not expected ret: %lu
\n
"
,
ret
);
ok
(
!
IsWindow
(
hwnd
),
"window should not exist
\n
"
);
}
START_TEST
(
win
)
START_TEST
(
win
)
{
{
pGetAncestor
=
(
void
*
)
GetProcAddress
(
GetModuleHandleA
(
"user32.dll"
),
"GetAncestor"
);
pGetAncestor
=
(
void
*
)
GetProcAddress
(
GetModuleHandleA
(
"user32.dll"
),
"GetAncestor"
);
...
@@ -4019,6 +4141,7 @@ START_TEST(win)
...
@@ -4019,6 +4141,7 @@ START_TEST(win)
test_redrawnow
();
test_redrawnow
();
test_csparentdc
();
test_csparentdc
();
test_SetWindowLong
();
test_SetWindowLong
();
test_ShowWindow
();
/* add the tests above this line */
/* add the tests above this line */
UnhookWindowsHookEx
(
hhook
);
UnhookWindowsHookEx
(
hhook
);
...
...
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