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
4bb95f4d
Commit
4bb95f4d
authored
Oct 12, 2009
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
user32: Use the generic handle functions for windows too.
parent
da3c4c99
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
25 additions
and
45 deletions
+25
-45
nonclient.c
dlls/user32/nonclient.c
+5
-5
win.c
dlls/user32/win.c
+17
-36
win.h
dlls/user32/win.h
+2
-3
winpos.c
dlls/user32/winpos.c
+1
-1
No files found.
dlls/user32/nonclient.c
View file @
4bb95f4d
...
...
@@ -533,17 +533,17 @@ static LRESULT NC_DoNCHitTest (WND *wndPtr, POINT pt )
RECT
rect
,
rcClient
;
POINT
ptClient
;
TRACE
(
"hwnd=%p pt=%d,%d
\n
"
,
wndPtr
->
hwndSelf
,
pt
.
x
,
pt
.
y
);
TRACE
(
"hwnd=%p pt=%d,%d
\n
"
,
wndPtr
->
obj
.
handle
,
pt
.
x
,
pt
.
y
);
GetWindowRect
(
wndPtr
->
hwndSelf
,
&
rect
);
GetWindowRect
(
wndPtr
->
obj
.
handle
,
&
rect
);
if
(
!
PtInRect
(
&
rect
,
pt
))
return
HTNOWHERE
;
if
(
wndPtr
->
dwStyle
&
WS_MINIMIZE
)
return
HTCAPTION
;
/* Check client area */
ptClient
=
pt
;
ScreenToClient
(
wndPtr
->
hwndSelf
,
&
ptClient
);
GetClientRect
(
wndPtr
->
hwndSelf
,
&
rcClient
);
ScreenToClient
(
wndPtr
->
obj
.
handle
,
&
ptClient
);
GetClientRect
(
wndPtr
->
obj
.
handle
,
&
rcClient
);
if
(
PtInRect
(
&
rcClient
,
ptClient
))
return
HTCLIENT
;
/* Check borders */
...
...
@@ -606,7 +606,7 @@ static LRESULT NC_DoNCHitTest (WND *wndPtr, POINT pt )
/* Check system menu */
if
((
wndPtr
->
dwStyle
&
WS_SYSMENU
)
&&
!
(
wndPtr
->
dwExStyle
&
WS_EX_TOOLWINDOW
))
{
if
(
NC_IconForWindow
(
wndPtr
->
hwndSelf
))
if
(
NC_IconForWindow
(
wndPtr
->
obj
.
handle
))
rect
.
left
+=
GetSystemMetrics
(
SM_CYCAPTION
)
-
1
;
}
if
(
pt
.
x
<
rect
.
left
)
return
HTSYSMENU
;
...
...
dlls/user32/win.c
View file @
4bb95f4d
...
...
@@ -250,12 +250,12 @@ static WND *create_window_handle( HWND parent, HWND owner, LPCWSTR name,
index
=
USER_HANDLE_TO_INDEX
(
handle
);
assert
(
index
<
NB_USER_HANDLES
);
user_handles
[
index
]
=
win
;
win
->
hwndSelf
=
handle
;
win
->
obj
.
handle
=
handle
;
win
->
obj
.
type
=
USER_WINDOW
;
win
->
parent
=
full_parent
;
win
->
owner
=
full_owner
;
win
->
class
=
class
;
win
->
winproc
=
get_class_winproc
(
class
);
win
->
dwMagic
=
WND_MAGIC
;
win
->
cbWndExtra
=
extra_bytes
;
if
(
WINPROC_IsUnicode
(
win
->
winproc
,
unicode
))
win
->
flags
|=
WIN_ISUNICODE
;
return
win
;
...
...
@@ -267,31 +267,23 @@ static WND *create_window_handle( HWND parent, HWND owner, LPCWSTR name,
*
* Free a window handle.
*/
static
WND
*
free_window_handle
(
HWND
hwnd
)
static
void
free_window_handle
(
HWND
hwnd
)
{
WND
*
ptr
;
struct
user_object
*
ptr
;
WORD
index
=
USER_HANDLE_TO_INDEX
(
hwnd
);
if
(
index
>=
NB_USER_HANDLES
)
return
NULL
;
USER_Lock
();
if
((
ptr
=
user_handles
[
index
]))
if
((
ptr
=
get_user_handle_ptr
(
hwnd
,
USER_WINDOW
))
&&
ptr
!=
OBJ_OTHER_PROCESS
)
{
SERVER_START_REQ
(
destroy_window
)
{
req
->
handle
=
wine_server_user_handle
(
hwnd
);
if
(
!
wine_server_call_err
(
req
))
{
user_handles
[
index
]
=
NULL
;
ptr
->
dwMagic
=
0
;
}
else
ptr
=
NULL
;
if
(
!
wine_server_call_err
(
req
))
user_handles
[
index
]
=
NULL
;
else
ptr
=
NULL
;
}
SERVER_END_REQ
;
}
USER_Unlock
();
release_user_handle_ptr
(
ptr
);
HeapFree
(
GetProcessHeap
(),
0
,
ptr
);
return
ptr
;
}
}
...
...
@@ -494,22 +486,12 @@ BOOL is_desktop_window( HWND hwnd )
*/
WND
*
WIN_GetPtr
(
HWND
hwnd
)
{
WND
*
ptr
;
WORD
index
=
USER_HANDLE_TO_INDEX
(
hwnd
);
if
(
index
>=
NB_USER_HANDLES
)
return
NULL
;
WND
*
ptr
;
USER_Lock
();
if
((
ptr
=
user_handles
[
index
]))
if
((
ptr
=
get_user_handle_ptr
(
hwnd
,
USER_WINDOW
))
==
WND_OTHER_PROCESS
)
{
if
(
ptr
->
dwMagic
==
WND_MAGIC
&&
(
hwnd
==
ptr
->
hwndSelf
||
!
HIWORD
(
hwnd
)
||
HIWORD
(
hwnd
)
==
0xffff
))
return
ptr
;
ptr
=
NULL
;
if
(
is_desktop_window
(
hwnd
))
ptr
=
WND_DESKTOP
;
}
else
if
(
is_desktop_window
(
hwnd
))
ptr
=
WND_DESKTOP
;
else
ptr
=
WND_OTHER_PROCESS
;
USER_Unlock
();
return
ptr
;
}
...
...
@@ -525,7 +507,7 @@ HWND WIN_IsCurrentProcess( HWND hwnd )
HWND
ret
;
if
(
!
(
ptr
=
WIN_GetPtr
(
hwnd
))
||
ptr
==
WND_OTHER_PROCESS
||
ptr
==
WND_DESKTOP
)
return
0
;
ret
=
ptr
->
hwndSelf
;
ret
=
ptr
->
obj
.
handle
;
WIN_ReleasePtr
(
ptr
);
return
ret
;
}
...
...
@@ -542,7 +524,7 @@ HWND WIN_IsCurrentThread( HWND hwnd )
HWND
ret
=
0
;
if
(
!
(
ptr
=
WIN_GetPtr
(
hwnd
))
||
ptr
==
WND_OTHER_PROCESS
||
ptr
==
WND_DESKTOP
)
return
0
;
if
(
ptr
->
tid
==
GetCurrentThreadId
())
ret
=
ptr
->
hwndSelf
;
if
(
ptr
->
tid
==
GetCurrentThreadId
())
ret
=
ptr
->
obj
.
handle
;
WIN_ReleasePtr
(
ptr
);
return
ret
;
}
...
...
@@ -572,7 +554,7 @@ HWND WIN_Handle32( HWND16 hwnd16 )
if
(
ptr
!=
WND_OTHER_PROCESS
)
{
hwnd
=
ptr
->
hwndSelf
;
hwnd
=
ptr
->
obj
.
handle
;
WIN_ReleasePtr
(
ptr
);
}
else
/* may belong to another process */
...
...
@@ -832,7 +814,6 @@ static void destroy_thread_window( HWND hwnd )
sys_menu
=
wndPtr
->
hSysMenu
;
free_dce
(
wndPtr
->
dce
,
hwnd
);
user_handles
[
index
]
=
NULL
;
wndPtr
->
dwMagic
=
0
;
}
USER_Unlock
();
...
...
@@ -1219,7 +1200,7 @@ static HWND WIN_CreateWindowEx( CREATESTRUCTA *cs, LPCWSTR className, UINT flags
if
(
!
(
wndPtr
=
create_window_handle
(
parent
,
owner
,
className
,
cs
->
hInstance
,
unicode
)))
return
0
;
hwnd
=
wndPtr
->
hwndSelf
;
hwnd
=
wndPtr
->
obj
.
handle
;
/* Fill the window structure */
...
...
@@ -3305,7 +3286,7 @@ BOOL WINAPI FlashWindow( HWND hWnd, BOOL bInvert )
wndPtr
=
WIN_GetPtr
(
hWnd
);
if
(
!
wndPtr
||
wndPtr
==
WND_OTHER_PROCESS
||
wndPtr
==
WND_DESKTOP
)
return
FALSE
;
hWnd
=
wndPtr
->
hwndSelf
;
/* make it a full handle */
hWnd
=
wndPtr
->
obj
.
handle
;
/* make it a full handle */
if
(
bInvert
)
wparam
=
!
(
wndPtr
->
flags
&
WIN_NCACTIVATED
);
else
wparam
=
(
hWnd
==
GetForegroundWindow
());
...
...
dlls/user32/win.h
View file @
4bb95f4d
...
...
@@ -28,20 +28,19 @@
#include <winuser.h>
#include <wine/windef16.h>
#
define WND_MAGIC 0x444e4957
/* 'WIND' */
#
include "user_private.h"
struct
tagCLASS
;
struct
tagDIALOGINFO
;
typedef
struct
tagWND
{
HWND
hwndSelf
;
/* Handle of this window
*/
struct
user_object
obj
;
/* object header
*/
HWND
parent
;
/* Window parent */
HWND
owner
;
/* Window owner */
struct
tagCLASS
*
class
;
/* Window class */
struct
dce
*
dce
;
/* DCE pointer */
WNDPROC
winproc
;
/* Window procedure */
DWORD
dwMagic
;
/* Magic number (must be WND_MAGIC) */
DWORD
tid
;
/* Owner thread id */
HINSTANCE
hInstance
;
/* Window hInstance (from CreateWindow) */
RECT
rectClient
;
/* Client area rel. to parent client area */
...
...
dlls/user32/winpos.c
View file @
4bb95f4d
...
...
@@ -1790,7 +1790,7 @@ static BOOL fixup_flags( WINDOWPOS *winpos )
SetLastError
(
ERROR_INVALID_WINDOW_HANDLE
);
return
FALSE
;
}
winpos
->
hwnd
=
wndPtr
->
hwndSelf
;
/* make it a full handle */
winpos
->
hwnd
=
wndPtr
->
obj
.
handle
;
/* make it a full handle */
/* Finally make sure that all coordinates are valid */
if
(
winpos
->
x
<
-
32768
)
winpos
->
x
=
-
32768
;
...
...
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