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
d0af123a
Commit
d0af123a
authored
May 19, 2003
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Catch broadcast window handles in functions that are implemented using
SendMessage.
parent
020f8a4c
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
55 additions
and
7 deletions
+55
-7
message.c
dlls/user/message.c
+0
-6
win.h
include/win.h
+6
-0
win.c
windows/win.c
+27
-0
winpos.c
windows/winpos.c
+22
-1
No files found.
dlls/user/message.c
View file @
d0af123a
...
...
@@ -274,12 +274,6 @@ inline static BOOL listbox_has_strings( HWND hwnd )
return
(
!
(
style
&
(
LBS_OWNERDRAWFIXED
|
LBS_OWNERDRAWVARIABLE
))
||
(
style
&
LBS_HASSTRINGS
));
}
/* check if hwnd is a broadcast magic handle */
inline
static
BOOL
is_broadcast
(
HWND
hwnd
)
{
return
(
hwnd
==
HWND_BROADCAST
||
hwnd
==
HWND_TOPMOST
);
}
/***********************************************************************
* broadcast_message_callback
...
...
include/win.h
View file @
d0af123a
...
...
@@ -136,4 +136,10 @@ extern HBRUSH DEFWND_ControlColor( HDC hDC, UINT ctlType ); /* windows/defwnd.c
extern
BOOL
FOCUS_MouseActivate
(
HWND
hwnd
);
/* check if hwnd is a broadcast magic handle */
inline
static
BOOL
is_broadcast
(
HWND
hwnd
)
{
return
(
hwnd
==
HWND_BROADCAST
||
hwnd
==
HWND_TOPMOST
);
}
#endif
/* __WINE_WIN_H */
windows/win.c
View file @
d0af123a
...
...
@@ -1691,6 +1691,12 @@ BOOL WINAPI EnableWindow( HWND hwnd, BOOL enable )
LONG
style
;
HWND
full_handle
;
if
(
is_broadcast
(
hwnd
))
{
SetLastError
(
ERROR_INVALID_PARAMETER
);
return
FALSE
;
}
if
(
!
(
full_handle
=
WIN_IsCurrentThread
(
hwnd
)))
return
SendMessageW
(
hwnd
,
WM_WINE_ENABLEWINDOW
,
enable
,
0
);
...
...
@@ -1983,6 +1989,11 @@ static LONG WIN_SetWindowLong( HWND hwnd, INT offset, LONG newval,
TRACE
(
"%p %d %lx %x
\n
"
,
hwnd
,
offset
,
newval
,
type
);
if
(
is_broadcast
(
hwnd
))
{
SetLastError
(
ERROR_INVALID_PARAMETER
);
return
FALSE
;
}
if
(
!
WIN_IsCurrentProcess
(
hwnd
))
{
if
(
offset
==
GWL_WNDPROC
)
...
...
@@ -2322,6 +2333,11 @@ INT WINAPI GetWindowTextW( HWND hwnd, LPWSTR lpString, INT nMaxCount )
*/
BOOL
WINAPI
SetWindowTextA
(
HWND
hwnd
,
LPCSTR
lpString
)
{
if
(
is_broadcast
(
hwnd
))
{
SetLastError
(
ERROR_INVALID_PARAMETER
);
return
FALSE
;
}
if
(
!
WIN_IsCurrentProcess
(
hwnd
))
{
FIXME
(
"cannot set text %s of other process window %p
\n
"
,
debugstr_a
(
lpString
),
hwnd
);
...
...
@@ -2337,6 +2353,11 @@ BOOL WINAPI SetWindowTextA( HWND hwnd, LPCSTR lpString )
*/
BOOL
WINAPI
SetWindowTextW
(
HWND
hwnd
,
LPCWSTR
lpString
)
{
if
(
is_broadcast
(
hwnd
))
{
SetLastError
(
ERROR_INVALID_PARAMETER
);
return
FALSE
;
}
if
(
!
WIN_IsCurrentProcess
(
hwnd
))
{
FIXME
(
"cannot set text %s of other process window %p
\n
"
,
debugstr_w
(
lpString
),
hwnd
);
...
...
@@ -2537,6 +2558,12 @@ HWND WINAPI SetParent( HWND hwnd, HWND parent )
HWND
retvalue
,
full_handle
;
BOOL
was_visible
;
if
(
is_broadcast
(
hwnd
)
||
is_broadcast
(
parent
))
{
SetLastError
(
ERROR_INVALID_PARAMETER
);
return
0
;
}
if
(
!
parent
)
parent
=
GetDesktopWindow
();
else
parent
=
WIN_GetFullHandle
(
parent
);
...
...
windows/winpos.c
View file @
d0af123a
...
...
@@ -834,6 +834,12 @@ BOOL WINAPI ShowWindowAsync( HWND hwnd, INT cmd )
{
HWND
full_handle
;
if
(
is_broadcast
(
hwnd
))
{
SetLastError
(
ERROR_INVALID_PARAMETER
);
return
FALSE
;
}
if
((
full_handle
=
WIN_IsCurrentThread
(
hwnd
)))
return
USER_Driver
.
pShowWindow
(
full_handle
,
cmd
);
return
SendNotifyMessageW
(
hwnd
,
WM_WINE_SHOWWINDOW
,
cmd
,
0
);
...
...
@@ -847,8 +853,17 @@ BOOL WINAPI ShowWindow( HWND hwnd, INT cmd )
{
HWND
full_handle
;
if
(
is_broadcast
(
hwnd
))
{
SetLastError
(
ERROR_INVALID_PARAMETER
);
return
FALSE
;
}
if
((
full_handle
=
WIN_IsCurrentThread
(
hwnd
)))
return
USER_Driver
.
pShowWindow
(
full_handle
,
cmd
);
{
if
(
USER_Driver
.
pShowWindow
)
return
USER_Driver
.
pShowWindow
(
full_handle
,
cmd
);
return
FALSE
;
}
return
SendMessageW
(
hwnd
,
WM_WINE_SHOWWINDOW
,
cmd
,
0
);
}
...
...
@@ -1173,6 +1188,12 @@ BOOL WINAPI SetWindowPos( HWND hwnd, HWND hwndInsertAfter,
hwnd
,
hwndInsertAfter
,
x
,
y
,
cx
,
cy
,
flags
);
if
(
TRACE_ON
(
win
))
dump_winpos_flags
(
flags
);
if
(
is_broadcast
(
hwnd
))
{
SetLastError
(
ERROR_INVALID_PARAMETER
);
return
FALSE
;
}
winpos
.
hwnd
=
WIN_GetFullHandle
(
hwnd
);
winpos
.
hwndInsertAfter
=
WIN_GetFullHandle
(
hwndInsertAfter
);
winpos
.
x
=
x
;
...
...
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