LRESULT SendMessage(
  HWND hWnd, 
  UINT Msg, 
  WPARAM wParam, 
  LPARAM lParam 
); 
我想发送一个WM_PAINT消息给m_pWndHack窗口
目标窗口却接受不到该消息,我的方法是:
::SendMessage(m_pWndHack->m_hWnd,WM_PRINT,0,0);
不知道,第三个和第四个参数,如何设置。

解决方案 »

  1.   

    楼上的兄弟,m_pWndHack窗口 是一个独立的窗口和,当前程序没关系
    我在本程序InvalidateRect()又有什么用呢?
    我的目的是想向目标窗口发送WM_PAINT 消息
      

  2.   


    先发送自定义消息,接受到消息后再InvalidateRect();
      

  3.   

    An internal WM_PAINT message is sent only once by Windows. After an internal WM_PAINT message is sent to a window by the UpdateWindow member function, no further WM_PAINT messages will be sent or posted until the window is invalidated or until the RedrawWindow member function is called again with the RDW_INTERNALPAINT flag set
      意思是WM_PAINT是内部消息,你不能主动发送,你可以自定义一个消息,然后在目标窗口接收到这个消息后可以updatewindow或者invalide函数.
      

  4.   

    ::SendMessage(m_pWndHack->m_hWnd,WM_PRINT,0,0); 
    打错了吧。。
      

  5.   

    这个消息不是随便可以发的
    用Invalidate就可以了