Re: Copy / Paste not working
From: Peter Carlson (peter_at___NO__SPAM___howudodat.com)
Date: 04/30/04
- Previous message: Igor Tandetnik: "Re: Copy / Paste not working"
- In reply to: Igor Tandetnik: "Re: Copy / Paste not working"
- Messages sorted by: [ date ] [ thread ]
Date: Thu, 29 Apr 2004 21:38:35 -0600
Igor...thanks for the tip
my CWndBrowser class is a CAXWindow and also now a CMessageFilter
PreTranslateMessage looks like:
BOOL CWndBrowser::PreTranslateMessage(MSG* pMsg)
{
if((pMsg->message < WM_KEYFIRST || pMsg->message > WM_KEYLAST) &&
(pMsg->message < WM_MOUSEFIRST || pMsg->message > WM_MOUSELAST))
return FALSE;
// give HTML page a chance to translate this message
return (BOOL)SendMessage(WM_FORWARDMSG, 0, (LPARAM)pMsg);
}
The paste now works for the WBC that is in edit mode, however copy still
doesn't work. What's interesting is this:
the menu has the following options:
cut/copy/paste/select all/print with cut and paste greyed out (this menu
pops up if I right click on selected text)
if I click on select all or print they work
if I click on copy it doesn't
Peter
"Igor Tandetnik" <itandetnik@mvps.org> wrote in message
news:OBwbYVkLEHA.4052@TK2MSFTNGP11.phx.gbl...
> "Peter Carlson" <peter@__NO__SPAM___howudodat.com> wrote in message
> news:Oclng$jLEHA.3012@tk2msftngp13.phx.gbl
> > Simple WBC hosted in WTL application.
> > 1. WBC is set to edit mode, with the context menu disabled. - If you
> > hit CTRL-V it wont paste the clipboard. Do I need to implememt my
> > own handler for that? I thought WBC would pick that up by itself
> > (CTRL-V that is)
> > 2. WBC is set to browse, context menu enabled. Highlight something
> > in the browser, right click hit copy, or hit CTRL-C - nothing is
> > copied to the clipboard.
>
> Register your view (or dialog, or whatever you host your control on) for
> message filtering (see CMessageFilter). In PretranslateMessage, call
>
> myAxWindow.SendMessage(WM_FORWARDMSG, 0, (LPARAM)pMsg);
>
> where myAxWindow is the CWindow or CAxWindow representing the window
> hosting WebBrowser control (alternatively, you can use
> SendDlgItemMessage or ::SendMessage(hwnd, ...) - whatever it takes to
> send WM_FORWARDMSG to ATL hosting window), and pMsg is the MSG* pointer
> passed to your filter.
> --
> With best wishes,
> Igor Tandetnik
>
> "For every complex problem, there is a solution that is simple, neat,
> and wrong." H.L. Mencken
>
>
- Previous message: Igor Tandetnik: "Re: Copy / Paste not working"
- In reply to: Igor Tandetnik: "Re: Copy / Paste not working"
- Messages sorted by: [ date ] [ thread ]