在同一个线程中开两个窗口,窗口1隐藏在后面,并真正的打开一个网址
    通过窗口1的IWebBrowser2的IViewObject接口,向窗口2画图,也就是说窗口2实际上就是窗口1的截屏。这个已经实现。    我的问题是,当用户在窗口2上操作时,达到和操作窗口1一样的效果。或者说,窗口1接收到鼠标移动、按下、键盘按下这些消息时,如何发送至窗口1?
    我试过PostMessage,在窗口2的WndProc中向窗口1 PostMessage ,但是似乎没起作用,代码如下:
switch(message)
{
case WM_MOUSEMOVE:
case WM_LBUTTONDOWN:
case WM_LBUTTONUP:
case WM_SETCURSOR:
::PostMessage(hWnd2, message, wParam, lParam);
break;
                ....
}
    另外还有一个疑问,用此种方式,窗口2接收到消息时的坐标就是上边的lParam吗?    谢谢您的帮助。

解决方案 »

  1.   

    WS_EX_TRANSPARENT   Specifies that a window created with this style is to be transparent. That is, any windows that are beneath the window are not obscured by the window. A window created with this style receives WM_PAINT messages only after all sibling windows beneath it have been updated. 
      

  2.   

    看看WM_COPYDATA行不?少量数据可以用这个。
      

  3.   

    大概已经OK了,可以通过PostMessage给隐藏的窗口但是PostMessage得第一个参数必须是IWebBrowser的窗口句柄,这样IWebBrowser才可以接收到消息,谢谢大家的帮忙。