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
a2b7aafd
Commit
a2b7aafd
authored
Apr 02, 2009
by
Nikolay Sivov
Committed by
Alexandre Julliard
Apr 02, 2009
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
user32: Implemented GetWindowRgnBox with some tests.
parent
eb32e9ec
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
66 additions
and
1 deletion
+66
-1
win.c
dlls/user32/tests/win.c
+45
-0
user32.spec
dlls/user32/user32.spec
+1
-1
winpos.c
dlls/user32/winpos.c
+20
-0
No files found.
dlls/user32/tests/win.c
View file @
a2b7aafd
...
...
@@ -51,6 +51,7 @@ static BOOL (WINAPI *pGetLayeredWindowAttributes)(HWND,COLORREF*,BYTE*,DWORD*);
static
BOOL
(
WINAPI
*
pSetLayeredWindowAttributes
)(
HWND
,
COLORREF
,
BYTE
,
DWORD
);
static
BOOL
(
WINAPI
*
pGetMonitorInfoA
)(
HMONITOR
,
LPMONITORINFO
);
static
HMONITOR
(
WINAPI
*
pMonitorFromPoint
)(
POINT
,
DWORD
);
static
int
(
WINAPI
*
pGetWindowRgnBox
)(
HWND
,
LPRECT
);
static
BOOL
test_lbuttondown_flag
;
static
HWND
hwndMessage
;
...
...
@@ -5529,6 +5530,48 @@ static void test_handles( HWND full_hwnd )
#endif
}
static
void
test_winregion
(
void
)
{
HWND
hwnd
;
RECT
r
;
int
ret
;
HRGN
hrgn
;
if
(
!
pGetWindowRgnBox
)
{
win_skip
(
"GetWindowRgnBox not supported
\n
"
);
return
;
}
hwnd
=
CreateWindowExA
(
0
,
"static"
,
NULL
,
WS_VISIBLE
,
10
,
10
,
10
,
10
,
NULL
,
0
,
0
,
NULL
);
/* NULL prect */
SetLastError
(
0xdeadbeef
);
ret
=
pGetWindowRgnBox
(
hwnd
,
NULL
);
ok
(
ret
==
ERROR
,
"Expected ERROR, got %d
\n
"
,
ret
);
ok
(
GetLastError
()
==
0xdeadbeef
,
"Expected , got %d
\n
"
,
GetLastError
());
hrgn
=
CreateRectRgn
(
2
,
3
,
10
,
15
);
ok
(
hrgn
!=
NULL
,
"Region creation failed
\n
"
);
if
(
hrgn
)
{
SetWindowRgn
(
hwnd
,
hrgn
,
FALSE
);
SetLastError
(
0xdeadbeef
);
ret
=
pGetWindowRgnBox
(
hwnd
,
NULL
);
ok
(
ret
==
ERROR
,
"Expected ERROR, got %d
\n
"
,
ret
);
ok
(
GetLastError
()
==
0xdeadbeef
,
"Expected , got %d
\n
"
,
GetLastError
());
r
.
left
=
r
.
top
=
r
.
right
=
r
.
bottom
=
0
;
ret
=
pGetWindowRgnBox
(
hwnd
,
&
r
);
ok
(
ret
==
SIMPLEREGION
,
"Expected SIMPLEREGION, got %d
\n
"
,
ret
);
ok
(
r
.
left
==
2
&&
r
.
top
==
3
&&
r
.
right
==
10
&&
r
.
bottom
==
15
,
"Expected (2,3,10,15), got (%d,%d,%d,%d)
\n
"
,
r
.
left
,
r
.
top
,
r
.
right
,
r
.
bottom
);
DeleteObject
(
hrgn
);
}
DestroyWindow
(
hwnd
);
}
START_TEST
(
win
)
{
HMODULE
user32
=
GetModuleHandleA
(
"user32.dll"
);
...
...
@@ -5539,6 +5582,7 @@ START_TEST(win)
pSetLayeredWindowAttributes
=
(
void
*
)
GetProcAddress
(
user32
,
"SetLayeredWindowAttributes"
);
pGetMonitorInfoA
=
(
void
*
)
GetProcAddress
(
user32
,
"GetMonitorInfoA"
);
pMonitorFromPoint
=
(
void
*
)
GetProcAddress
(
user32
,
"MonitorFromPoint"
);
pGetWindowRgnBox
=
(
void
*
)
GetProcAddress
(
user32
,
"GetWindowRgnBox"
);
if
(
!
RegisterWindowClasses
())
assert
(
0
);
...
...
@@ -5608,6 +5652,7 @@ START_TEST(win)
test_SetForegroundWindow
(
hwndMain
);
test_shell_window
();
test_handles
(
hwndMain
);
test_winregion
();
/* add the tests above this line */
if
(
hhook
)
UnhookWindowsHookEx
(
hhook
);
...
...
dlls/user32/user32.spec
View file @
a2b7aafd
...
...
@@ -385,7 +385,7 @@
@ stdcall GetWindowPlacement(long ptr)
@ stdcall GetWindowRect(long ptr)
@ stdcall GetWindowRgn(long long)
# @ stub GetWindowRgnBox
@ stdcall GetWindowRgnBox(long ptr)
@ stdcall GetWindowTextA(long ptr long)
@ stdcall GetWindowTextLengthA(long)
@ stdcall GetWindowTextLengthW(long)
...
...
dlls/user32/winpos.c
View file @
a2b7aafd
...
...
@@ -155,6 +155,26 @@ int WINAPI GetWindowRgn ( HWND hwnd, HRGN hrgn )
return
nRet
;
}
/***********************************************************************
* GetWindowRgnBox (USER32.@)
*/
int
WINAPI
GetWindowRgnBox
(
HWND
hwnd
,
LPRECT
prect
)
{
int
ret
=
ERROR
;
HRGN
hrgn
;
if
(
!
prect
)
return
ERROR
;
if
((
hrgn
=
CreateRectRgn
(
0
,
0
,
0
,
0
)))
{
if
((
ret
=
GetWindowRgn
(
hwnd
,
hrgn
))
!=
ERROR
)
ret
=
GetRgnBox
(
hrgn
,
prect
);
DeleteObject
(
hrgn
);
}
return
ret
;
}
/***********************************************************************
* SetWindowRgn (USER32.@)
...
...
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