::PostMessage

const int WM_RESIZE_APP     = WM_USER + 11; // 控制线程的消息

ON_MESSAGE(WM_RESIZE_APP, &CServerDlg::OnResizeApp)


// 绘制主界面
::PostMessage(m_hWnd, WM_RESIZE_APP, NULL, NULL);


LRESULT CServerDlg::OnResizeApp( WPARAM wParam, LPARAM lParam )
{
    //获得屏幕的宽(像素值)
    int iScrWidth  = GetSystemMetrics (SM_CXSCREEN);
    //获得屏幕的高(像素值)
    int iScrHeight = GetSystemMetrics (SM_CYSCREEN);
    
    ...

    return TRUE;
}


你可能感兴趣的:(::PostMessage)