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
6382ffae
Commit
6382ffae
authored
Jan 20, 2005
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Replace a number of calls to WIN_FindWndPtr by WIN_GetPtr.
parent
97199823
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
113 additions
and
97 deletions
+113
-97
menu.c
dlls/user/menu.c
+13
-9
scroll.c
dlls/user/scroll.c
+16
-17
event.c
dlls/x11drv/event.c
+6
-6
window.c
dlls/x11drv/window.c
+8
-10
winpos.c
dlls/x11drv/winpos.c
+4
-3
dialog.c
windows/dialog.c
+4
-4
mdi.c
windows/mdi.c
+4
-3
nonclient.c
windows/nonclient.c
+21
-21
win.c
windows/win.c
+16
-6
winpos.c
windows/winpos.c
+21
-18
No files found.
dlls/user/menu.c
View file @
6382ffae
...
...
@@ -311,11 +311,11 @@ static POPUPMENU *MENU_GetMenu(HMENU hMenu)
static
HMENU
get_win_sys_menu
(
HWND
hwnd
)
{
HMENU
ret
=
0
;
WND
*
win
=
WIN_
FindWnd
Ptr
(
hwnd
);
if
(
win
)
WND
*
win
=
WIN_
Get
Ptr
(
hwnd
);
if
(
win
&&
win
!=
WND_OTHER_PROCESS
)
{
ret
=
win
->
hSysMenu
;
WIN_Release
Wnd
Ptr
(
win
);
WIN_ReleasePtr
(
win
);
}
return
ret
;
}
...
...
@@ -3584,10 +3584,14 @@ BOOL WINAPI DestroyMenu( HMENU hMenu )
*/
HMENU
WINAPI
GetSystemMenu
(
HWND
hWnd
,
BOOL
bRevert
)
{
WND
*
wndPtr
=
WIN_
FindWnd
Ptr
(
hWnd
);
WND
*
wndPtr
=
WIN_
Get
Ptr
(
hWnd
);
HMENU
retvalue
=
0
;
if
(
wndPtr
)
if
(
wndPtr
==
WND_OTHER_PROCESS
)
{
if
(
IsWindow
(
hWnd
))
FIXME
(
"not supported on other process window %p
\n
"
,
hWnd
);
}
else
if
(
wndPtr
)
{
if
(
wndPtr
->
hSysMenu
)
{
...
...
@@ -3627,7 +3631,7 @@ HMENU WINAPI GetSystemMenu( HWND hWnd, BOOL bRevert )
if
(
menu
)
menu
->
hSysMenuOwner
=
wndPtr
->
hSysMenu
;
}
WIN_Release
WndPtr
(
wndPtr
);
WIN_Release
Ptr
(
wndPtr
);
}
return
bRevert
?
0
:
retvalue
;
}
...
...
@@ -3638,13 +3642,13 @@ HMENU WINAPI GetSystemMenu( HWND hWnd, BOOL bRevert )
*/
BOOL
WINAPI
SetSystemMenu
(
HWND
hwnd
,
HMENU
hMenu
)
{
WND
*
wndPtr
=
WIN_
FindWndPtr
(
hwnd
);
WND
*
wndPtr
=
WIN_
GetPtr
(
hwnd
);
if
(
wndPtr
)
if
(
wndPtr
&&
wndPtr
!=
WND_OTHER_PROCESS
)
{
if
(
wndPtr
->
hSysMenu
)
DestroyMenu
(
wndPtr
->
hSysMenu
);
wndPtr
->
hSysMenu
=
MENU_GetSysMenu
(
hwnd
,
hMenu
);
WIN_Release
WndPtr
(
wndPtr
);
WIN_Release
Ptr
(
wndPtr
);
return
TRUE
;
}
return
FALSE
;
...
...
dlls/user/scroll.c
View file @
6382ffae
...
...
@@ -151,9 +151,9 @@ LPSCROLLINFO info /* [in] The SCROLLINFO struct to be tested */)
static
SCROLLBAR_INFO
*
SCROLL_GetScrollBarInfo
(
HWND
hwnd
,
INT
nBar
)
{
SCROLLBAR_INFO
*
infoPtr
;
WND
*
wndPtr
=
WIN_
FindWnd
Ptr
(
hwnd
);
WND
*
wndPtr
=
WIN_
Get
Ptr
(
hwnd
);
if
(
!
wndPtr
)
return
NULL
;
if
(
!
wndPtr
||
wndPtr
==
WND_OTHER_PROCESS
)
return
NULL
;
switch
(
nBar
)
{
case
SB_HORZ
:
infoPtr
=
(
SCROLLBAR_INFO
*
)
wndPtr
->
pHScroll
;
break
;
...
...
@@ -175,7 +175,7 @@ static SCROLLBAR_INFO *SCROLL_GetScrollBarInfo( HWND hwnd, INT nBar )
else
wndPtr
->
pVScroll
=
infoPtr
;
}
}
WIN_Release
Wnd
Ptr
(
wndPtr
);
WIN_ReleasePtr
(
wndPtr
);
return
infoPtr
;
}
...
...
@@ -197,7 +197,9 @@ static BOOL SCROLL_GetScrollBarRect( HWND hwnd, INT nBar, RECT *lprect,
{
INT
pixels
;
BOOL
vertical
;
WND
*
wndPtr
=
WIN_FindWndPtr
(
hwnd
);
WND
*
wndPtr
=
WIN_GetPtr
(
hwnd
);
if
(
!
wndPtr
||
wndPtr
==
WND_OTHER_PROCESS
)
return
FALSE
;
switch
(
nBar
)
{
...
...
@@ -236,7 +238,7 @@ static BOOL SCROLL_GetScrollBarRect( HWND hwnd, INT nBar, RECT *lprect,
break
;
default:
WIN_Release
WndPtr
(
wndPtr
);
WIN_Release
Ptr
(
wndPtr
);
return
FALSE
;
}
...
...
@@ -281,7 +283,7 @@ static BOOL SCROLL_GetScrollBarRect( HWND hwnd, INT nBar, RECT *lprect,
+
MulDiv
(
pixels
,
(
info
->
curVal
-
info
->
minVal
),(
max
-
info
->
minVal
));
}
}
WIN_Release
WndPtr
(
wndPtr
);
WIN_Release
Ptr
(
wndPtr
);
return
vertical
;
}
...
...
@@ -660,22 +662,22 @@ void SCROLL_DrawScrollBar( HWND hwnd, HDC hdc, INT nBar,
INT
arrowSize
,
thumbSize
,
thumbPos
;
RECT
rect
;
BOOL
vertical
;
WND
*
wndPtr
=
WIN_FindWndPtr
(
hwnd
);
SCROLLBAR_INFO
*
infoPtr
=
SCROLL_GetScrollBarInfo
(
hwnd
,
nBar
);
BOOL
Save_SCROLL_MovingThumb
=
SCROLL_MovingThumb
;
DWORD
style
=
GetWindowLongW
(
hwnd
,
GWL_STYLE
);
if
(
!
wndPtr
||
!
infoPtr
||
((
nBar
==
SB_VERT
)
&&
!
(
wndPtr
->
dwStyle
&
WS_VSCROLL
))
||
((
nBar
==
SB_HORZ
)
&&
!
(
wndPtr
->
dwStyle
&
WS_HSCROLL
)))
goto
END
;
if
(
!
WIN_IsWindowDrawable
(
hwnd
,
FALSE
))
goto
END
;
hwnd
=
wndPtr
->
hwndSelf
;
/* make it a full handle */
if
(
!
(
hwnd
=
WIN_GetFullHandle
(
hwnd
)))
return
;
if
(
!
infoPtr
||
((
nBar
==
SB_VERT
)
&&
!
(
style
&
WS_VSCROLL
))
||
((
nBar
==
SB_HORZ
)
&&
!
(
style
&
WS_HSCROLL
)))
return
;
if
(
!
WIN_IsWindowDrawable
(
hwnd
,
FALSE
))
return
;
vertical
=
SCROLL_GetScrollBarRect
(
hwnd
,
nBar
,
&
rect
,
&
arrowSize
,
&
thumbSize
,
&
thumbPos
);
/* do not draw if the scrollbar rectangle is empty */
if
(
IsRectEmpty
(
&
rect
))
goto
END
;
if
(
IsRectEmpty
(
&
rect
))
return
;
if
(
Save_SCROLL_MovingThumb
&&
(
SCROLL_TrackingWin
==
hwnd
)
&&
...
...
@@ -715,9 +717,6 @@ void SCROLL_DrawScrollBar( HWND hwnd, HDC hdc, INT nBar,
SetCaretPos
(
rect
.
top
+
1
,
thumbPos
+
1
);
}
}
END:
WIN_ReleaseWndPtr
(
wndPtr
);
}
/***********************************************************************
...
...
dlls/x11drv/event.c
View file @
6382ffae
...
...
@@ -1062,7 +1062,7 @@ static void EVENT_DropFromOffiX( HWND hWnd, XClientMessageEvent *event )
(
unsigned
int
*
)
&
aux_long
);
wine_tsx11_unlock
();
pWnd
=
WIN_
FindWnd
Ptr
(
hWnd
);
pWnd
=
WIN_
Get
Ptr
(
hWnd
);
/* find out drop point and drop window */
if
(
x
<
0
||
y
<
0
||
...
...
@@ -1089,7 +1089,7 @@ static void EVENT_DropFromOffiX( HWND hWnd, XClientMessageEvent *event )
bAccept
=
FALSE
;
}
}
WIN_Release
Wnd
Ptr
(
pWnd
);
WIN_ReleasePtr
(
pWnd
);
if
(
!
bAccept
)
return
;
...
...
@@ -1128,7 +1128,7 @@ static void EVENT_DropFromOffiX( HWND hWnd, XClientMessageEvent *event )
if
(
lpDrop
)
{
WND
*
pDropWnd
=
WIN_
FindWnd
Ptr
(
hScope
);
WND
*
pDropWnd
=
WIN_
Get
Ptr
(
hScope
);
lpDrop
->
pFiles
=
sizeof
(
DROPFILES
);
lpDrop
->
pt
.
x
=
x
;
lpDrop
->
pt
.
y
=
y
;
...
...
@@ -1138,7 +1138,7 @@ static void EVENT_DropFromOffiX( HWND hWnd, XClientMessageEvent *event )
x
>
(
pDropWnd
->
rectClient
.
right
-
pDropWnd
->
rectWindow
.
left
)
||
y
>
(
pDropWnd
->
rectClient
.
bottom
-
pDropWnd
->
rectWindow
.
top
)
);
lpDrop
->
fWide
=
FALSE
;
WIN_Release
Wnd
Ptr
(
pDropWnd
);
WIN_ReleasePtr
(
pDropWnd
);
p_drop
=
(
char
*
)(
lpDrop
+
1
);
p
=
p_data
;
while
(
*
p
)
...
...
@@ -1226,7 +1226,7 @@ static void EVENT_DropURLs( HWND hWnd, XClientMessageEvent *event )
lpDrop
=
(
DROPFILES
*
)
GlobalLock
(
hDrop
);
if
(
lpDrop
)
{
WND
*
pDropWnd
=
WIN_
FindWnd
Ptr
(
hWnd
);
WND
*
pDropWnd
=
WIN_
Get
Ptr
(
hWnd
);
lpDrop
->
pFiles
=
sizeof
(
DROPFILES
);
lpDrop
->
pt
.
x
=
(
INT
)
x
;
lpDrop
->
pt
.
y
=
(
INT
)
y
;
...
...
@@ -1237,7 +1237,7 @@ static void EVENT_DropURLs( HWND hWnd, XClientMessageEvent *event )
y
>
(
pDropWnd
->
rectClient
.
bottom
-
pDropWnd
->
rectWindow
.
top
)
);
lpDrop
->
fWide
=
FALSE
;
p_drop
=
(
char
*
)(
lpDrop
+
1
);
WIN_Release
Wnd
Ptr
(
pDropWnd
);
WIN_ReleasePtr
(
pDropWnd
);
}
/* create message content */
...
...
dlls/x11drv/window.c
View file @
6382ffae
...
...
@@ -1133,22 +1133,20 @@ BOOL X11DRV_CreateWindow( HWND hwnd, CREATESTRUCTA *cs, BOOL unicode )
/* Send the size messages */
if
(
!
(
wndPtr
=
WIN_
FindWndPtr
(
hwnd
))
)
return
FALSE
;
if
(
!
(
wndPtr
=
WIN_
GetPtr
(
hwnd
))
||
wndPtr
==
WND_OTHER_PROCESS
)
return
FALSE
;
if
(
!
(
wndPtr
->
flags
&
WIN_NEED_SIZE
))
{
RECT
rect
=
wndPtr
->
rectClient
;
WIN_ReleasePtr
(
wndPtr
);
/* send it anyway */
if
(((
wndPtr
->
rectClient
.
right
-
wndPtr
->
rectClient
.
left
)
<
0
)
||
((
wndPtr
->
rectClient
.
bottom
-
wndPtr
->
rectClient
.
top
)
<
0
))
if
(((
rect
.
right
-
rect
.
left
)
<
0
)
||
((
rect
.
bottom
-
rect
.
top
)
<
0
))
WARN
(
"sending bogus WM_SIZE message 0x%08lx
\n
"
,
MAKELONG
(
wndPtr
->
rectClient
.
right
-
wndPtr
->
rectClient
.
left
,
wndPtr
->
rectClient
.
bottom
-
wndPtr
->
rectClient
.
top
));
MAKELONG
(
rect
.
right
-
rect
.
left
,
rect
.
bottom
-
rect
.
top
));
SendMessageW
(
hwnd
,
WM_SIZE
,
SIZE_RESTORED
,
MAKELONG
(
wndPtr
->
rectClient
.
right
-
wndPtr
->
rectClient
.
left
,
wndPtr
->
rectClient
.
bottom
-
wndPtr
->
rectClient
.
top
));
SendMessageW
(
hwnd
,
WM_MOVE
,
0
,
MAKELONG
(
wndPtr
->
rectClient
.
left
,
wndPtr
->
rectClient
.
top
)
);
MAKELONG
(
rect
.
right
-
rect
.
left
,
rect
.
bottom
-
rect
.
top
));
SendMessageW
(
hwnd
,
WM_MOVE
,
0
,
MAKELONG
(
rect
.
left
,
rect
.
top
)
);
}
WIN_ReleaseWnd
Ptr
(
wndPtr
);
else
WIN_Release
Ptr
(
wndPtr
);
/* Show the window, maximizing or minimizing if needed */
...
...
dlls/x11drv/winpos.c
View file @
6382ffae
...
...
@@ -926,16 +926,17 @@ static POINT WINPOS_FindIconPos( WND* wndPtr, POINT pt )
{
if
(
list
[
i
]
==
wndPtr
->
hwndSelf
)
continue
;
if
(
!
IsIconic
(
list
[
i
]
))
continue
;
if
(
!
(
childPtr
=
WIN_FindWndPtr
(
list
[
i
]
)))
continue
;
if
(
!
(
childPtr
=
WIN_GetPtr
(
list
[
i
]
))
||
childPtr
==
WND_OTHER_PROCESS
)
continue
;
if
((
childPtr
->
rectWindow
.
left
<
x
+
xspacing
)
&&
(
childPtr
->
rectWindow
.
right
>=
x
)
&&
(
childPtr
->
rectWindow
.
top
<=
y
)
&&
(
childPtr
->
rectWindow
.
bottom
>
y
-
yspacing
))
{
WIN_Release
Wnd
Ptr
(
childPtr
);
WIN_ReleasePtr
(
childPtr
);
break
;
/* There's a window in there */
}
WIN_Release
Wnd
Ptr
(
childPtr
);
WIN_ReleasePtr
(
childPtr
);
}
if
(
list
[
i
])
{
...
...
windows/dialog.c
View file @
6382ffae
...
...
@@ -996,15 +996,15 @@ static HWND DIALOG_FindMsgDestination( HWND hwndDlg )
HWND
hParent
=
GetParent
(
hwndDlg
);
if
(
!
hParent
)
break
;
pParent
=
WIN_
FindWnd
Ptr
(
hParent
);
if
(
!
pParent
)
break
;
pParent
=
WIN_
Get
Ptr
(
hParent
);
if
(
!
pParent
||
pParent
==
WND_OTHER_PROCESS
)
break
;
if
(
!
(
pParent
->
flags
&
WIN_ISDIALOG
))
{
WIN_Release
Wnd
Ptr
(
pParent
);
WIN_ReleasePtr
(
pParent
);
break
;
}
WIN_Release
Wnd
Ptr
(
pParent
);
WIN_ReleasePtr
(
pParent
);
hwndDlg
=
hParent
;
}
...
...
windows/mdi.c
View file @
6382ffae
...
...
@@ -1655,13 +1655,14 @@ void WINAPI CalcChildScroll( HWND hwnd, INT scroll )
}
if
(
style
&
WS_VISIBLE
)
{
WND
*
pWnd
=
WIN_FindWndPtr
(
list
[
i
]
)
;
UnionRect
(
&
childRect
,
&
pWnd
->
rectWindow
,
&
childR
ect
);
WIN_ReleaseWndPtr
(
pWnd
);
RECT
rect
;
GetWindowRect
(
list
[
i
],
&
r
ect
);
UnionRect
(
&
childRect
,
&
rect
,
&
childRect
);
}
}
HeapFree
(
GetProcessHeap
(),
0
,
list
);
}
MapWindowPoints
(
0
,
hwnd
,
(
POINT
*
)
&
childRect
,
2
);
UnionRect
(
&
childRect
,
&
clientRect
,
&
childRect
);
/* set common info values */
...
...
windows/nonclient.c
View file @
6382ffae
...
...
@@ -428,7 +428,9 @@ LONG NC_HandleNCCalcSize( HWND hwnd, RECT *winRect )
*/
static
void
NC_GetInsideRect
(
HWND
hwnd
,
RECT
*
rect
)
{
WND
*
wndPtr
=
WIN_FindWndPtr
(
hwnd
);
WND
*
wndPtr
=
WIN_GetPtr
(
hwnd
);
if
(
!
wndPtr
||
wndPtr
==
WND_OTHER_PROCESS
)
return
;
rect
->
top
=
rect
->
left
=
0
;
rect
->
right
=
wndPtr
->
rectWindow
.
right
-
wndPtr
->
rectWindow
.
left
;
...
...
@@ -462,8 +464,7 @@ static void NC_GetInsideRect( HWND hwnd, RECT *rect )
}
END:
WIN_ReleaseWndPtr
(
wndPtr
);
return
;
WIN_ReleasePtr
(
wndPtr
);
}
...
...
@@ -628,13 +629,12 @@ static LONG NC_DoNCHitTest (WND *wndPtr, POINT pt )
LONG
NC_HandleNCHitTest
(
HWND
hwnd
,
POINT
pt
)
{
LONG
retvalue
;
WND
*
wndPtr
=
WIN_
FindWndPtr
(
hwnd
);
WND
*
wndPtr
=
WIN_
GetPtr
(
hwnd
);
if
(
!
wndPtr
)
return
HTERROR
;
if
(
!
wndPtr
||
wndPtr
==
WND_OTHER_PROCESS
)
return
HTERROR
;
retvalue
=
NC_DoNCHitTest
(
wndPtr
,
pt
);
WIN_Release
WndPtr
(
wndPtr
);
WIN_Release
Ptr
(
wndPtr
);
return
retvalue
;
}
...
...
@@ -1092,24 +1092,24 @@ LONG NC_HandleNCPaint( HWND hwnd , HRGN clip)
*/
LONG
NC_HandleNCActivate
(
HWND
hwnd
,
WPARAM
wParam
)
{
WND
*
wndPtr
=
WIN_FindWndPtr
(
hwnd
);
WND
*
wndPtr
=
WIN_GetPtr
(
hwnd
);
if
(
!
wndPtr
||
wndPtr
==
WND_OTHER_PROCESS
)
return
FALSE
;
/* Lotus Notes draws menu descriptions in the caption of its main
* window. When it wants to restore original "system" view, it just
* sends WM_NCACTIVATE message to itself. Any optimizations here in
* attempt to minimize redrawings lead to a not restored caption.
*/
if
(
wndPtr
)
{
if
(
wParam
)
wndPtr
->
flags
|=
WIN_NCACTIVATED
;
else
wndPtr
->
flags
&=
~
WIN_NCACTIVATED
;
WIN_ReleaseWndPtr
(
wndPtr
);
if
(
wParam
)
wndPtr
->
flags
|=
WIN_NCACTIVATED
;
else
wndPtr
->
flags
&=
~
WIN_NCACTIVATED
;
WIN_ReleasePtr
(
wndPtr
);
if
(
IsIconic
(
hwnd
))
WINPOS_RedrawIconTitle
(
hwnd
);
else
NC_DoNCPaint
(
hwnd
,
(
HRGN
)
1
,
FALSE
);
if
(
IsIconic
(
hwnd
))
WINPOS_RedrawIconTitle
(
hwnd
);
else
NC_DoNCPaint
(
hwnd
,
(
HRGN
)
1
,
FALSE
);
}
return
TRUE
;
}
...
...
@@ -1173,8 +1173,8 @@ void NC_GetSysPopupPos( HWND hwnd, RECT* rect )
if
(
IsIconic
(
hwnd
))
GetWindowRect
(
hwnd
,
rect
);
else
{
WND
*
wndPtr
=
WIN_
FindWnd
Ptr
(
hwnd
);
if
(
!
wndPtr
)
return
;
WND
*
wndPtr
=
WIN_
Get
Ptr
(
hwnd
);
if
(
!
wndPtr
||
wndPtr
==
WND_OTHER_PROCESS
)
return
;
NC_GetInsideRect
(
hwnd
,
rect
);
OffsetRect
(
rect
,
wndPtr
->
rectWindow
.
left
,
wndPtr
->
rectWindow
.
top
);
...
...
@@ -1182,7 +1182,7 @@ void NC_GetSysPopupPos( HWND hwnd, RECT* rect )
ClientToScreen
(
GetParent
(
hwnd
),
(
POINT
*
)
rect
);
rect
->
right
=
rect
->
left
+
GetSystemMetrics
(
SM_CYCAPTION
)
-
1
;
rect
->
bottom
=
rect
->
top
+
GetSystemMetrics
(
SM_CYCAPTION
)
-
1
;
WIN_Release
Wnd
Ptr
(
wndPtr
);
WIN_ReleasePtr
(
wndPtr
);
}
}
...
...
windows/win.c
View file @
6382ffae
...
...
@@ -1751,9 +1751,9 @@ BOOL WINAPI IsWindowUnicode( HWND hwnd )
WND
*
wndPtr
;
BOOL
retvalue
;
if
(
!
(
wndPtr
=
WIN_
FindWndPtr
(
hwnd
))
)
return
FALSE
;
if
(
!
(
wndPtr
=
WIN_
GetPtr
(
hwnd
))
||
wndPtr
==
WND_OTHER_PROCESS
)
return
FALSE
;
retvalue
=
(
WINPROC_GetProcType
(
wndPtr
->
winproc
)
==
WIN_PROC_32W
);
WIN_Release
WndPtr
(
wndPtr
);
WIN_Release
Ptr
(
wndPtr
);
return
retvalue
;
}
...
...
@@ -3104,10 +3104,15 @@ BOOL WINAPI FlashWindowEx( PFLASHWINFO pfwi )
DWORD
WINAPI
GetWindowContextHelpId
(
HWND
hwnd
)
{
DWORD
retval
;
WND
*
wnd
=
WIN_
FindWnd
Ptr
(
hwnd
);
WND
*
wnd
=
WIN_
Get
Ptr
(
hwnd
);
if
(
!
wnd
)
return
0
;
if
(
wnd
==
WND_OTHER_PROCESS
)
{
if
(
IsWindow
(
hwnd
))
FIXME
(
"not supported on other process window %p
\n
"
,
hwnd
);
return
0
;
}
retval
=
wnd
->
helpContext
;
WIN_Release
WndPtr
(
wnd
);
WIN_Release
Ptr
(
wnd
);
return
retval
;
}
...
...
@@ -3117,10 +3122,15 @@ DWORD WINAPI GetWindowContextHelpId( HWND hwnd )
*/
BOOL
WINAPI
SetWindowContextHelpId
(
HWND
hwnd
,
DWORD
id
)
{
WND
*
wnd
=
WIN_
FindWnd
Ptr
(
hwnd
);
WND
*
wnd
=
WIN_
Get
Ptr
(
hwnd
);
if
(
!
wnd
)
return
FALSE
;
if
(
wnd
==
WND_OTHER_PROCESS
)
{
if
(
IsWindow
(
hwnd
))
FIXME
(
"not supported on other process window %p
\n
"
,
hwnd
);
return
0
;
}
wnd
->
helpContext
=
id
;
WIN_Release
WndPtr
(
wnd
);
WIN_Release
Ptr
(
wnd
);
return
TRUE
;
}
...
...
windows/winpos.c
View file @
6382ffae
...
...
@@ -630,10 +630,9 @@ BOOL WINAPI MoveWindow( HWND hwnd, INT x, INT y, INT cx, INT cy,
/***********************************************************************
* WINPOS_InitInternalPos
*/
static
LPINTERNALPOS
WINPOS_InitInternalPos
(
WND
*
wnd
,
POINT
pt
,
const
RECT
*
restoreRect
)
static
LPINTERNALPOS
WINPOS_InitInternalPos
(
WND
*
wnd
)
{
LPINTERNALPOS
lpPos
=
(
LPINTERNALPOS
)
GetPropA
(
wnd
->
hwndSelf
,
atomInternalPos
);
LPINTERNALPOS
lpPos
=
GetPropA
(
wnd
->
hwndSelf
,
atomInternalPos
);
if
(
!
lpPos
)
{
/* this happens when the window is minimized/maximized
...
...
@@ -654,20 +653,20 @@ static LPINTERNALPOS WINPOS_InitInternalPos( WND* wnd, POINT pt, const RECT *res
if
(
wnd
->
dwStyle
&
WS_MINIMIZE
)
{
lpPos
->
ptIconPos
.
x
=
pt
.
x
;
lpPos
->
ptIconPos
.
y
=
pt
.
y
;
lpPos
->
ptIconPos
.
x
=
wnd
->
rectWindow
.
left
;
lpPos
->
ptIconPos
.
y
=
wnd
->
rectWindow
.
top
;
}
else
if
(
wnd
->
dwStyle
&
WS_MAXIMIZE
)
{
lpPos
->
ptMaxPos
.
x
=
pt
.
x
;
lpPos
->
ptMaxPos
.
y
=
pt
.
y
;
lpPos
->
ptMaxPos
.
x
=
wnd
->
rectWindow
.
left
;
lpPos
->
ptMaxPos
.
y
=
wnd
->
rectWindow
.
top
;
}
else
if
(
restoreRect
)
else
{
lpPos
->
rectNormal
.
left
=
restoreRect
->
left
;
lpPos
->
rectNormal
.
top
=
restoreRect
->
top
;
lpPos
->
rectNormal
.
right
=
restoreRect
->
right
;
lpPos
->
rectNormal
.
bottom
=
restoreRect
->
bottom
;
lpPos
->
rectNormal
.
left
=
wnd
->
rectWindow
.
left
;
lpPos
->
rectNormal
.
top
=
wnd
->
rectWindow
.
top
;
lpPos
->
rectNormal
.
right
=
wnd
->
rectWindow
.
right
;
lpPos
->
rectNormal
.
bottom
=
wnd
->
rectWindow
.
bottom
;
}
return
lpPos
;
}
...
...
@@ -891,12 +890,17 @@ UINT WINAPI GetInternalWindowPos( HWND hwnd, LPRECT rectWnd,
*/
BOOL
WINAPI
GetWindowPlacement
(
HWND
hwnd
,
WINDOWPLACEMENT
*
wndpl
)
{
WND
*
pWnd
=
WIN_
FindWnd
Ptr
(
hwnd
);
WND
*
pWnd
=
WIN_
Get
Ptr
(
hwnd
);
LPINTERNALPOS
lpPos
;
if
(
!
pWnd
)
return
FALSE
;
if
(
!
pWnd
)
return
FALSE
;
if
(
pWnd
==
WND_OTHER_PROCESS
)
{
if
(
IsWindow
(
hwnd
))
FIXME
(
"not supported on other process window %p
\n
"
,
hwnd
);
return
FALSE
;
}
lpPos
=
WINPOS_InitInternalPos
(
pWnd
,
*
(
LPPOINT
)
&
pWnd
->
rectWindow
.
left
,
&
pWnd
->
rectWindow
);
lpPos
=
WINPOS_InitInternalPos
(
pWnd
);
wndpl
->
length
=
sizeof
(
*
wndpl
);
if
(
pWnd
->
dwStyle
&
WS_MINIMIZE
)
wndpl
->
showCmd
=
SW_SHOWMINIMIZED
;
...
...
@@ -914,7 +918,7 @@ BOOL WINAPI GetWindowPlacement( HWND hwnd, WINDOWPLACEMENT *wndpl )
wndpl
->
rcNormalPosition
.
top
=
lpPos
->
rectNormal
.
top
;
wndpl
->
rcNormalPosition
.
right
=
lpPos
->
rectNormal
.
right
;
wndpl
->
rcNormalPosition
.
bottom
=
lpPos
->
rectNormal
.
bottom
;
WIN_Release
WndPtr
(
pWnd
);
WIN_Release
Ptr
(
pWnd
);
return
TRUE
;
}
...
...
@@ -927,8 +931,7 @@ static BOOL WINPOS_SetPlacement( HWND hwnd, const WINDOWPLACEMENT *wndpl, UINT f
WND
*
pWnd
=
WIN_FindWndPtr
(
hwnd
);
if
(
pWnd
)
{
LPINTERNALPOS
lpPos
=
(
LPINTERNALPOS
)
WINPOS_InitInternalPos
(
pWnd
,
*
(
LPPOINT
)
&
pWnd
->
rectWindow
.
left
,
&
pWnd
->
rectWindow
);
LPINTERNALPOS
lpPos
=
WINPOS_InitInternalPos
(
pWnd
);
if
(
flags
&
PLACE_MIN
)
{
...
...
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