本帖最后由 VisualEleven 于 2014-11-01 20:11:15 编辑

解决方案 »

  1.   

    HWND SetParent(        
        HWND hWndChild,
        HWND hWndNewParent
    );An application can use the SetParent function to set the parent window of a pop-up, overlapped, or child window. The new parent window and the child window must belong to the same application. If the window identified by the hWndChild parameter is visible, the system performs the appropriate redrawing and repainting. For compatibility reasons, SetParent does not modify the WS_CHILD or WS_POPUP window styles of the window whose parent is being changed. Therefore, if hWndNewParent is NULL, you should also clear the WS_CHILD bit and set the WS_POPUP style after calling SetParent. Conversely, if hWndNewParent is not NULL and the window was previously a child of the desktop, you should clear the WS_POPUP style and set the WS_CHILD style before calling SetParent. 
      

  2.   


    原来要先去掉WS_POPUP,然后再去设置WS_CHILD,平时也没仔细去看MSDN...我去试试。
      

  3.   

    把代码改了一下,去掉WS_POPOUP后设置WS_CHILD,然后SetParent问题依旧
                        
                                              long style=::GetWindowLong(hwnd,GWL_STYLE);                       style=style+WS_CHILD+WS_CLIPSIBLINGS;                      ::SetWindowLong(hwnd,GWL_STYLE,style&~WS_POPUP);

       ::SetParent(hwnd,m_hWnd);
      

  4.   

    需要把 第3方程序 的 input  加到 你的 程序中。AttachThreadInput