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
e4e5566e
Commit
e4e5566e
authored
Jan 27, 2005
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Avoid a few more uses of WIN_FindWndPtr.
parent
611bcf85
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
85 additions
and
63 deletions
+85
-63
win.c
windows/win.c
+25
-15
winpos.c
windows/winpos.c
+60
-48
No files found.
windows/win.c
View file @
e4e5566e
...
...
@@ -2788,7 +2788,8 @@ BOOL WINAPI ShowOwnedPopups( HWND owner, BOOL fShow )
while
(
--
count
>=
0
)
{
if
(
GetWindow
(
win_array
[
count
],
GW_OWNER
)
!=
owner
)
continue
;
if
(
!
(
pWnd
=
WIN_FindWndPtr
(
win_array
[
count
]
)))
continue
;
if
(
!
(
pWnd
=
WIN_GetPtr
(
win_array
[
count
]
)))
continue
;
if
(
pWnd
==
WND_OTHER_PROCESS
)
continue
;
if
(
pWnd
->
dwStyle
&
WS_POPUP
)
{
...
...
@@ -2796,28 +2797,32 @@ BOOL WINAPI ShowOwnedPopups( HWND owner, BOOL fShow )
{
if
(
pWnd
->
flags
&
WIN_NEEDS_SHOW_OWNEDPOPUP
)
{
pWnd
->
flags
&=
~
WIN_NEEDS_SHOW_OWNEDPOPUP
;
WIN_ReleasePtr
(
pWnd
);
/* In Windows, ShowOwnedPopups(TRUE) generates
* WM_SHOWWINDOW messages with SW_PARENTOPENING,
* regardless of the state of the owner
*/
SendMessage
A
(
pWnd
->
hwndSelf
,
WM_SHOWWINDOW
,
SW_SHOW
,
SW_PARENTOPENING
);
pWnd
->
flags
&=
~
WIN_NEEDS_SHOW_OWNEDPOPUP
;
SendMessage
W
(
win_array
[
count
]
,
WM_SHOWWINDOW
,
SW_SHOW
,
SW_PARENTOPENING
);
continue
;
}
}
else
{
if
(
IsWindowVisible
(
pWnd
->
hwndSelf
)
)
if
(
pWnd
->
dwStyle
&
WS_VISIBLE
)
{
pWnd
->
flags
|=
WIN_NEEDS_SHOW_OWNEDPOPUP
;
WIN_ReleasePtr
(
pWnd
);
/* In Windows, ShowOwnedPopups(FALSE) generates
* WM_SHOWWINDOW messages with SW_PARENTCLOSING,
* regardless of the state of the owner
*/
SendMessage
A
(
pWnd
->
hwndSelf
,
WM_SHOWWINDOW
,
SW_HIDE
,
SW_PARENTCLOSING
);
pWnd
->
flags
|=
WIN_NEEDS_SHOW_OWNEDPOPUP
;
SendMessage
W
(
win_array
[
count
]
,
WM_SHOWWINDOW
,
SW_HIDE
,
SW_PARENTCLOSING
);
continue
;
}
}
}
WIN_Release
Wnd
Ptr
(
pWnd
);
WIN_ReleasePtr
(
pWnd
);
}
HeapFree
(
GetProcessHeap
(),
0
,
win_array
);
return
TRUE
;
...
...
@@ -3053,16 +3058,16 @@ BOOL WINAPI AnyPopup(void)
*/
BOOL
WINAPI
FlashWindow
(
HWND
hWnd
,
BOOL
bInvert
)
{
WND
*
wndPtr
=
WIN_FindWndPtr
(
hWnd
)
;
WND
*
wndPtr
;
TRACE
(
"%p
\n
"
,
hWnd
);
if
(
!
wndPtr
)
return
FALSE
;
hWnd
=
wndPtr
->
hwndSelf
;
/* make it a full handle */
if
(
wndPtr
->
dwStyle
&
WS_MINIMIZE
)
if
(
IsIconic
(
hWnd
))
{
RedrawWindow
(
hWnd
,
0
,
0
,
RDW_INVALIDATE
|
RDW_ERASE
|
RDW_UPDATENOW
|
RDW_FRAME
);
wndPtr
=
WIN_GetPtr
(
hWnd
);
if
(
!
wndPtr
||
wndPtr
==
WND_OTHER_PROCESS
)
return
FALSE
;
if
(
bInvert
&&
!
(
wndPtr
->
flags
&
WIN_NCACTIVATED
))
{
wndPtr
->
flags
|=
WIN_NCACTIVATED
;
...
...
@@ -3071,16 +3076,21 @@ BOOL WINAPI FlashWindow( HWND hWnd, BOOL bInvert )
{
wndPtr
->
flags
&=
~
WIN_NCACTIVATED
;
}
WIN_Release
WndPtr
(
wndPtr
);
WIN_Release
Ptr
(
wndPtr
);
return
TRUE
;
}
else
{
WPARAM16
wparam
;
WPARAM
wparam
;
wndPtr
=
WIN_GetPtr
(
hWnd
);
if
(
!
wndPtr
||
wndPtr
==
WND_OTHER_PROCESS
)
return
FALSE
;
hWnd
=
wndPtr
->
hwndSelf
;
/* make it a full handle */
if
(
bInvert
)
wparam
=
!
(
wndPtr
->
flags
&
WIN_NCACTIVATED
);
else
wparam
=
(
hWnd
==
GetForegroundWindow
());
WIN_Release
WndPtr
(
wndPtr
);
WIN_Release
Ptr
(
wndPtr
);
SendMessageW
(
hWnd
,
WM_NCACTIVATE
,
wparam
,
(
LPARAM
)
0
);
return
wparam
;
}
...
...
windows/winpos.c
View file @
e4e5566e
...
...
@@ -928,59 +928,71 @@ BOOL WINAPI GetWindowPlacement( HWND hwnd, WINDOWPLACEMENT *wndpl )
*/
static
BOOL
WINPOS_SetPlacement
(
HWND
hwnd
,
const
WINDOWPLACEMENT
*
wndpl
,
UINT
flags
)
{
WND
*
pWnd
=
WIN_FindWndPtr
(
hwnd
);
if
(
pWnd
)
LPINTERNALPOS
lpPos
;
DWORD
style
;
WND
*
pWnd
=
WIN_GetPtr
(
hwnd
);
if
(
!
pWnd
||
pWnd
==
WND_OTHER_PROCESS
)
return
FALSE
;
lpPos
=
WINPOS_InitInternalPos
(
pWnd
);
if
(
flags
&
PLACE_MIN
)
{
lpPos
->
ptIconPos
.
x
=
wndpl
->
ptMinPosition
.
x
;
lpPos
->
ptIconPos
.
y
=
wndpl
->
ptMinPosition
.
y
;
}
if
(
flags
&
PLACE_MAX
)
{
lpPos
->
ptMaxPos
.
x
=
wndpl
->
ptMaxPosition
.
x
;
lpPos
->
ptMaxPos
.
y
=
wndpl
->
ptMaxPosition
.
y
;
}
if
(
flags
&
PLACE_RECT
)
{
LPINTERNALPOS
lpPos
=
WINPOS_InitInternalPos
(
pWnd
);
lpPos
->
rectNormal
.
left
=
wndpl
->
rcNormalPosition
.
left
;
lpPos
->
rectNormal
.
top
=
wndpl
->
rcNormalPosition
.
top
;
lpPos
->
rectNormal
.
right
=
wndpl
->
rcNormalPosition
.
right
;
lpPos
->
rectNormal
.
bottom
=
wndpl
->
rcNormalPosition
.
bottom
;
}
if
(
flags
&
PLACE_MIN
)
{
lpPos
->
ptIconPos
.
x
=
wndpl
->
ptMinPosition
.
x
;
lpPos
->
ptIconPos
.
y
=
wndpl
->
ptMinPosition
.
y
;
}
if
(
flags
&
PLACE_MAX
)
{
lpPos
->
ptMaxPos
.
x
=
wndpl
->
ptMaxPosition
.
x
;
lpPos
->
ptMaxPos
.
y
=
wndpl
->
ptMaxPosition
.
y
;
}
if
(
flags
&
PLACE_RECT
)
style
=
pWnd
->
dwStyle
;
WIN_ReleasePtr
(
pWnd
);
if
(
style
&
WS_MINIMIZE
)
{
WINPOS_ShowIconTitle
(
hwnd
,
FALSE
);
if
(
wndpl
->
flags
&
WPF_SETMINPOSITION
&&
!
EMPTYPOINT
(
lpPos
->
ptIconPos
))
SetWindowPos
(
hwnd
,
0
,
lpPos
->
ptIconPos
.
x
,
lpPos
->
ptIconPos
.
y
,
0
,
0
,
SWP_NOSIZE
|
SWP_NOZORDER
|
SWP_NOACTIVATE
);
}
else
if
(
style
&
WS_MAXIMIZE
)
{
if
(
!
EMPTYPOINT
(
lpPos
->
ptMaxPos
)
)
SetWindowPos
(
hwnd
,
0
,
lpPos
->
ptMaxPos
.
x
,
lpPos
->
ptMaxPos
.
y
,
0
,
0
,
SWP_NOSIZE
|
SWP_NOZORDER
|
SWP_NOACTIVATE
);
}
else
if
(
flags
&
PLACE_RECT
)
SetWindowPos
(
hwnd
,
0
,
lpPos
->
rectNormal
.
left
,
lpPos
->
rectNormal
.
top
,
lpPos
->
rectNormal
.
right
-
lpPos
->
rectNormal
.
left
,
lpPos
->
rectNormal
.
bottom
-
lpPos
->
rectNormal
.
top
,
SWP_NOZORDER
|
SWP_NOACTIVATE
);
ShowWindow
(
hwnd
,
wndpl
->
showCmd
);
if
(
IsIconic
(
hwnd
))
{
if
(
GetWindowLongW
(
hwnd
,
GWL_STYLE
)
&
WS_VISIBLE
)
WINPOS_ShowIconTitle
(
hwnd
,
TRUE
);
/* SDK: ...valid only the next time... */
if
(
wndpl
->
flags
&
WPF_RESTORETOMAXIMIZED
)
{
lpPos
->
rectNormal
.
left
=
wndpl
->
rcNormalPosition
.
left
;
lpPos
->
rectNormal
.
top
=
wndpl
->
rcNormalPosition
.
top
;
lpPos
->
rectNormal
.
right
=
wndpl
->
rcNormalPosition
.
right
;
lpPos
->
rectNormal
.
bottom
=
wndpl
->
rcNormalPosition
.
bottom
;
pWnd
=
WIN_GetPtr
(
hwnd
);
if
(
pWnd
&&
pWnd
!=
WND_OTHER_PROCESS
)
{
pWnd
->
flags
|=
WIN_RESTORE_MAX
;
WIN_ReleasePtr
(
pWnd
);
}
}
if
(
pWnd
->
dwStyle
&
WS_MINIMIZE
)
{
WINPOS_ShowIconTitle
(
pWnd
->
hwndSelf
,
FALSE
);
if
(
wndpl
->
flags
&
WPF_SETMINPOSITION
&&
!
EMPTYPOINT
(
lpPos
->
ptIconPos
))
SetWindowPos
(
hwnd
,
0
,
lpPos
->
ptIconPos
.
x
,
lpPos
->
ptIconPos
.
y
,
0
,
0
,
SWP_NOSIZE
|
SWP_NOZORDER
|
SWP_NOACTIVATE
);
}
else
if
(
pWnd
->
dwStyle
&
WS_MAXIMIZE
)
{
if
(
!
EMPTYPOINT
(
lpPos
->
ptMaxPos
)
)
SetWindowPos
(
hwnd
,
0
,
lpPos
->
ptMaxPos
.
x
,
lpPos
->
ptMaxPos
.
y
,
0
,
0
,
SWP_NOSIZE
|
SWP_NOZORDER
|
SWP_NOACTIVATE
);
}
else
if
(
flags
&
PLACE_RECT
)
SetWindowPos
(
hwnd
,
0
,
lpPos
->
rectNormal
.
left
,
lpPos
->
rectNormal
.
top
,
lpPos
->
rectNormal
.
right
-
lpPos
->
rectNormal
.
left
,
lpPos
->
rectNormal
.
bottom
-
lpPos
->
rectNormal
.
top
,
SWP_NOZORDER
|
SWP_NOACTIVATE
);
ShowWindow
(
hwnd
,
wndpl
->
showCmd
);
if
(
IsWindow
(
hwnd
)
&&
pWnd
->
dwStyle
&
WS_MINIMIZE
)
{
if
(
pWnd
->
dwStyle
&
WS_VISIBLE
)
WINPOS_ShowIconTitle
(
pWnd
->
hwndSelf
,
TRUE
);
/* SDK: ...valid only the next time... */
if
(
wndpl
->
flags
&
WPF_RESTORETOMAXIMIZED
)
pWnd
->
flags
|=
WIN_RESTORE_MAX
;
}
WIN_ReleaseWndPtr
(
pWnd
);
return
TRUE
;
}
return
FALS
E
;
return
TRU
E
;
}
...
...
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