嗯...我前天把笔记本屏幕按坏了,外接个显示器,在WIN8下直接右键有选项,显示到监控屏幕设备就好了

解决方案 »

  1.   

    http://msdn.microsoft.com/zh-cn/library/windows/desktop/dd162827(v=vs.85).aspx
    你看上面这个网址,我查到了这样一个。
    但是不知道怎么用谁来看看
      

  2.   

    MonitorFromPoint, MonitorFromRect, and MonitorFromWindow.
    GetMonitorInfo 
     SetWindowPos 
    用以上几个函数就可以实现
      

  3.   

    WINDOWINFO  wininf;
    AfxGetApp()->GetMainWnd()->GetWindowInfo(&wininf);
    int  Num = GetSystemMetrics(SM_CMONITORS);
    MONITORINFO   inf,inf2;
    int ret;
    if(Num >= 2)
    {
    HMONITOR hMonitor = ::MonitorFromPoint( CPoint( 0,0 ), MONITOR_DEFAULTTOPRIMARY ); inf.cbSize = sizeof(inf);
    inf2.cbSize = sizeof(inf2);
    GetMonitorInfo(hMonitor,&inf);
    HMONITOR    mo    = ::MonitorFromPoint( CPoint( inf.rcMonitor.right + 100,0 ), MONITOR_DEFAULTTONEAREST );
    GetMonitorInfo(mo,&inf2);
    ret = SetWindowPos(AfxGetApp()->GetMainWnd(),
    wininf.rcWindow.left+inf2.rcMonitor.left,
    wininf.rcWindow.top+inf2.rcMonitor.top,
    wininf.rcWindow.right,
    wininf.rcWindow.bottom,
    SWP_NOSIZE|SWP_NOZORDER|SWP_SHOWWINDOW);
    }
    MFC实现,win32同理