mfc 窗口消息传递---popup窗口

总的头文件包含 #define WM_MYMESSAGE   WM_USER + 100

非弹出窗口
map
ON_MESSAGE(WM_MYMESSAGE, OnCurTaskChanged)

afx_msg LRESULT OnCurTaskChanged(WPARAM wParam, LPARAM lParam);


dlgcliplaybtndlg *dlgbtn;
    dlgbtn = new dlgcliplaybtndlg();
    dlgbtn->Create(IDD_DLGCLIPLAYBTNDLG, GetDesktopWindow());
    dlgbtn->ShowWindow(SW_SHOW);

LRESULT Codinsys0129Dlg::OnCurTaskChanged(WPARAM wParam, LPARAM lParam)
{
    int i = 0;
    return 0;
}

弹出窗口
dlgclient *pFrame;
    pFrame = (dlgclient*)AfxGetMainWnd();
    ::PostMessage(pFrame->m_hWnd, WM_MYMESSAGE, NULL, NULL);
    ::PostMessage(pFrame->m_hWnd, WM_GET_DIALOG_INT_VAL, 0, 0);

你可能感兴趣的:(c++基础知识)