MFC/HALCON混合编程系列二_打开两个窗口_MFC布局

//Window1
    CRect rect1;    
    HWND hWnd1;    
        
    GetDlgItem(IDC_PICWND1_STATIC)->GetClientRect(&rect1);   //GetDlgItem(HWND hDlg,int nIDDlgItem)通过ID获取一个指定的窗口内的控件,HWND应为当前窗口的句柄    
    hWnd1=GetDlgItem(IDC_PICWND1_STATIC)->m_hWnd;
    Hlong MainWndID1=(Hlong) hWnd1;
    Halcon::set_window_attr("background_color","blue");
    open_window(rect1.left,rect1.top,rect1.Width(),rect1.Height(),MainWndID1,"visible","",&g_oCamera[0].winID);
    set_draw(g_oCamera[0].winID,"margin");

 


    //Window2
    CRect rect2;    
    HWND hWnd2;    
        
    GetDlgItem(IDC_PICWND2_STATIC)->GetClientRect(&rect2);   //GetDlgItem(HWND hDlg,int nIDDlgItem)通过ID获取一个指定的窗口内的控件,HWND应为当前窗口的句柄    
    hWnd2=GetDlgItem(IDC_PICWND2_STATIC)->m_hWnd;
    Hlong MainWndID2=(Hlong) hWnd2;
    Halcon::set_window_attr("background_color","blue");
    open_window(rect2.left,rect2.top,rect2.Width(),rect2.Height(),MainWndID2,"visible","",&g_oCamera[1].winID);
    set_draw(g_oCamera[1].winID,"margin");

 

 

你可能感兴趣的:(Halcon)