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
dd573925
Commit
dd573925
authored
May 15, 2013
by
Piotr Caban
Committed by
Alexandre Julliard
May 15, 2013
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
user32: Use SendNotifyMessage to send WM_DRAWCLIPBOARD.
parent
50303274
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
80 additions
and
2 deletions
+80
-2
clipboard.c
dlls/user32/clipboard.c
+2
-2
clipboard.c
dlls/user32/tests/clipboard.c
+78
-0
No files found.
dlls/user32/clipboard.c
View file @
dd573925
...
...
@@ -287,7 +287,7 @@ BOOL WINAPI CloseClipboard(void)
bCBHasChanged
=
FALSE
;
if
(
hWndViewer
)
SendMessageW
(
hWndViewer
,
WM_DRAWCLIPBOARD
,
(
WPARAM
)
GetClipboardOwner
(),
0
);
Send
Notify
MessageW
(
hWndViewer
,
WM_DRAWCLIPBOARD
,
(
WPARAM
)
GetClipboardOwner
(),
0
);
}
bRet
=
TRUE
;
...
...
@@ -393,7 +393,7 @@ HWND WINAPI SetClipboardViewer( HWND hWnd )
HWND
hwndPrev
=
CLIPBOARD_SetClipboardViewer
(
hWnd
);
if
(
hWnd
)
SendMessageW
(
hWnd
,
WM_DRAWCLIPBOARD
,
(
WPARAM
)
GetClipboardOwner
(),
0
);
Send
Notify
MessageW
(
hWnd
,
WM_DRAWCLIPBOARD
,
(
WPARAM
)
GetClipboardOwner
(),
0
);
TRACE
(
"(%p): returning %p
\n
"
,
hWnd
,
hwndPrev
);
return
hwndPrev
;
...
...
dlls/user32/tests/clipboard.c
View file @
dd573925
...
...
@@ -269,6 +269,83 @@ static void test_synthesized(void)
ok
(
r
,
"gle %d
\n
"
,
GetLastError
());
}
static
CRITICAL_SECTION
clipboard_cs
;
static
LRESULT
CALLBACK
clipboard_wnd_proc
(
HWND
hwnd
,
UINT
msg
,
WPARAM
wp
,
LPARAM
lp
)
{
switch
(
msg
)
{
case
WM_DRAWCLIPBOARD
:
EnterCriticalSection
(
&
clipboard_cs
);
LeaveCriticalSection
(
&
clipboard_cs
);
break
;
case
WM_USER
:
PostQuitMessage
(
0
);
break
;
}
return
DefWindowProc
(
hwnd
,
msg
,
wp
,
lp
);
}
static
DWORD
WINAPI
clipboard_thread
(
void
*
param
)
{
HWND
win
=
param
;
BOOL
r
;
EnterCriticalSection
(
&
clipboard_cs
);
SetLastError
(
0xdeadbeef
);
SetClipboardViewer
(
win
);
ok
(
GetLastError
()
==
0xdeadbeef
,
"GetLastError = %d
\n
"
,
GetLastError
());
LeaveCriticalSection
(
&
clipboard_cs
);
r
=
OpenClipboard
(
win
);
ok
(
r
,
"OpenClipboard failed: %d
\n
"
,
GetLastError
());
r
=
EmptyClipboard
();
ok
(
r
,
"EmptyClipboard failed: %d
\n
"
,
GetLastError
());
EnterCriticalSection
(
&
clipboard_cs
);
r
=
CloseClipboard
();
ok
(
r
,
"CloseClipboard failed: %d
\n
"
,
GetLastError
());
LeaveCriticalSection
(
&
clipboard_cs
);
r
=
PostMessage
(
win
,
WM_USER
,
0
,
0
);
ok
(
r
,
"PostMessage failed: %d
\n
"
,
GetLastError
());
return
0
;
}
static
void
test_messages
(
void
)
{
WNDCLASS
cls
;
HWND
win
;
MSG
msg
;
HANDLE
thread
;
DWORD
tid
;
InitializeCriticalSection
(
&
clipboard_cs
);
memset
(
&
cls
,
0
,
sizeof
(
cls
));
cls
.
lpfnWndProc
=
clipboard_wnd_proc
;
cls
.
hInstance
=
GetModuleHandle
(
0
);
cls
.
lpszClassName
=
"clipboard_test"
;
RegisterClass
(
&
cls
);
win
=
CreateWindow
(
"clipboard_test"
,
NULL
,
0
,
0
,
0
,
0
,
0
,
NULL
,
0
,
NULL
,
0
);
ok
(
win
!=
NULL
,
"CreateWindow failed: %d
\n
"
,
GetLastError
());
thread
=
CreateThread
(
NULL
,
0
,
clipboard_thread
,
(
void
*
)
win
,
0
,
&
tid
);
ok
(
thread
!=
NULL
,
"CreateThread failed: %d
\n
"
,
GetLastError
());
while
(
GetMessage
(
&
msg
,
NULL
,
0
,
0
))
{
TranslateMessage
(
&
msg
);
DispatchMessage
(
&
msg
);
}
ok
(
WaitForSingleObject
(
thread
,
INFINITE
)
==
WAIT_OBJECT_0
,
"WaitForSingleObject failed
\n
"
);
CloseHandle
(
thread
);
UnregisterClass
(
"clipboard_test"
,
GetModuleHandle
(
0
));
DeleteCriticalSection
(
&
clipboard_cs
);
}
START_TEST
(
clipboard
)
{
SetLastError
(
0xdeadbeef
);
...
...
@@ -278,4 +355,5 @@ START_TEST(clipboard)
test_RegisterClipboardFormatA
();
test_ClipboardOwner
();
test_synthesized
();
test_messages
();
}
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