Re: SetClipboardViewer()
Thanks joe.
If I launch clipbrd.exe firstly before my app, Yes, SetClipboardViewer()
returns a valid handle. By Spy++, I can confirm it is clipbrd's handle.
And then, I copy something by NOTEPAD or MSPAINT, by CMyDlg::WindowProc(UINT
message, WPARAM wParam, LPARAM lParam), I can catch WM_DRAWCLIPBOARD
message.
After that, I exit clipbrd, I fail to catch WM_CHANGECBCHAIN message.
I think it is not necessary for a clipboard viewer to be a top window(CMyDlg
is a child-window).
Another question: should I return (LRESULT) NULL or call
CDialog::WindowProc(message, wParam, lParam) after dealing with
WM_DRAWCLIPBOARD /WM_CHANGECBCHAIN as follows,
LRESULT CMyDlg::WindowProc(UINT message, WPARAM wParam, LPARAM lParam)
{
if ( message == WM_DRAWCLIPBOARD )
{
UpdateClipSizeShow();
::SendMessage(hNextWnd, message, wParam, lParam);
//Should I return NULL here?
return (LRESULT) NULL
}
else if ( message == WM_CHANGECBCHAIN )
{
if (hNextWnd == (HWND) wParam )
hNextWnd = (HWND) lParam;
else if (hNextWnd != NULL)
::SendMessage(hNextWnd, message, wParam, lParam);
//Should I return NULL here?
return (LRESULT) NULL
}
return CDialog::WindowProc(message, wParam, lParam);
}
ou