ClientToScreen( )是把窗口坐标转换为屏幕坐标

ClientToScreen 和ScreenToClient 用法-LMLPHPScreenToClient( )是把屏幕坐标转换为窗口坐标

ClientToScreen 和ScreenToClient 用法-LMLPHP屏幕坐标是相对于屏幕左上角的,而窗口坐标是相对于窗口用户区左上角的

ClientToScreen 和ScreenToClient 用法-LMLPHPVC下,有些函数使用窗口坐标,有些使用屏幕坐标,使用时要分清。

ClientToScreen 和ScreenToClient 用法-LMLPHP

ClientToScreen 和ScreenToClient 用法-LMLPHP

ClientToScreen 和ScreenToClient 用法-LMLPHP一个窗体分为两部分:系统区和客户区

ClientToScreen 和ScreenToClient 用法-LMLPHP象标题和菜单之类的是系统区,由系统来控制,客户区就是你的地盘喽!!!

ClientToScreen 和ScreenToClient 用法-LMLPHPWidth, Height 是指整体的,ClientWidth, ClientHeight是指客户区的,两者相减就是

ClientToScreen 和ScreenToClient 用法-LMLPHP系统区的啦!!!

ClientToScreen 和ScreenToClient 用法-LMLPHPClientToScreen是把坐标从当前窗体转化成全屏幕的!!!

ClientToScreen 和ScreenToClient 用法-LMLPHPScreenToClient是把屏幕坐标转化成相对当前窗体的坐标!!!!

ClientToScreen 和ScreenToClient 用法-LMLPHP
 
 //Resize window to proper size based on video standard

 CRect recDstD1( 0, 0, 720, 576 );  

 static_preview_window.ClientToScreen(&recDstD1); //    recDstD1 {top=53 bottom=629 left=200 right=920} CRect



 static_preview_window.SetWindowPos(&CWnd::wndBottom, recDstD1.left, recDstD1.top, recDstD1.right - recDstD1.left + 10, new_height + 10, SWP_NOMOVE | SWP_SHOWWINDOW); 
 


ClientToScreen 和ScreenToClient 用法-LMLPHPbool   m_bIsLButtonDawn =false;

ClientToScreen 和ScreenToClient 用法-LMLPHP

ClientToScreen 和ScreenToClient 用法-LMLPHPvoid CDrawDlg::OnMouseMove(UINT nFlags, CPoint point)


ClientToScreen 和ScreenToClient 用法-LMLPHPClientToScreen 和ScreenToClient 用法-LMLPHPClientToScreen 和ScreenToClient 用法-LMLPHP{

ClientToScreen 和ScreenToClient 用法-LMLPHP // TODO: Add your message handler code here and/or call default

ClientToScreen 和ScreenToClient 用法-LMLPHP CWnd *pwnd=GetDlgItem(IDC_EDIT1);

ClientToScreen 和ScreenToClient 用法-LMLPHP     CDC *pdc=pwnd->GetDC();

ClientToScreen 和ScreenToClient 用法-LMLPHP CRect rect;

ClientToScreen 和ScreenToClient 用法-LMLPHP this->ClientToScreen(&point);

ClientToScreen 和ScreenToClient 用法-LMLPHP pwnd->ScreenToClient(&point);

ClientToScreen 和ScreenToClient 用法-LMLPHP pwnd->GetClientRect(&rect);

ClientToScreen 和ScreenToClient 用法-LMLPHP

ClientToScreen 和ScreenToClient 用法-LMLPHP//   HCURSOR hcur=::LoadCursorFromFile("pen.cur");


ClientToScreen 和ScreenToClient 用法-LMLPHP //   SetClassLong(GetSafeHwnd(),GCL_HCURSOR,(LONG)hcur);  

ClientToScreen 和ScreenToClient 用法-LMLPHP

ClientToScreen 和ScreenToClient 用法-LMLPHP// CPen pen(PS_INSIDEFRAME,-1,RGB(255,255,255));

ClientToScreen 和ScreenToClient 用法-LMLPHP//      CPen* olePen=pdc->SelectObject(&pen);

ClientToScreen 和ScreenToClient 用法-LMLPHP if(rect.PtInRect(point) &&   m_bIsLButtonDawn )

ClientToScreen 和ScreenToClient 用法-LMLPHPClientToScreen 和ScreenToClient 用法-LMLPHP
ClientToScreen 和ScreenToClient 用法-LMLPHP{

ClientToScreen 和ScreenToClient 用法-LMLPHP

ClientToScreen 和ScreenToClient 用法-LMLPHP   pdc->DPtoLP(&m_fp);

ClientToScreen 和ScreenToClient 用法-LMLPHP   pdc->MoveTo(m_fp);

ClientToScreen 和ScreenToClient 用法-LMLPHP   pdc->DPtoLP(&point);

ClientToScreen 和ScreenToClient 用法-LMLPHP   pdc->LineTo(point);

ClientToScreen 和ScreenToClient 用法-LMLPHP

ClientToScreen 和ScreenToClient 用法-LMLPHP }

ClientToScreen 和ScreenToClient 用法-LMLPHP   m_fp=point;

ClientToScreen 和ScreenToClient 用法-LMLPHP//   pdc->SelectObject(olePen);

ClientToScreen 和ScreenToClient 用法-LMLPHP ReleaseDC(pdc);

ClientToScreen 和ScreenToClient 用法-LMLPHP CDialog::OnMouseMove(nFlags, point);

ClientToScreen 和ScreenToClient 用法-LMLPHP}

ClientToScreen 和ScreenToClient 用法-LMLPHP

ClientToScreen 和ScreenToClient 用法-LMLPHPvoid CDrawDlg::OnLButtonUp(UINT nFlags, CPoint point)


ClientToScreen 和ScreenToClient 用法-LMLPHPClientToScreen 和ScreenToClient 用法-LMLPHPClientToScreen 和ScreenToClient 用法-LMLPHP{

ClientToScreen 和ScreenToClient 用法-LMLPHP   m_bIsLButtonDawn =false;

ClientToScreen 和ScreenToClient 用法-LMLPHP // TODO: Add your message handler code here and/or call default

ClientToScreen 和ScreenToClient 用法-LMLPHPClientToScreen 和ScreenToClient 用法-LMLPHP/**//*

ClientToScreen 和ScreenToClient 用法-LMLPHP    CWnd *pwnd=GetDlgItem(IDC_EDIT1);

ClientToScreen 和ScreenToClient 用法-LMLPHP      CDC *pdc=pwnd->GetDC();

ClientToScreen 和ScreenToClient 用法-LMLPHP   CRect rect;

ClientToScreen 和ScreenToClient 用法-LMLPHP   this->ClientToScreen(&point);

ClientToScreen 和ScreenToClient 用法-LMLPHP   pwnd->ScreenToClient(&point);

ClientToScreen 和ScreenToClient 用法-LMLPHP   pwnd->GetClientRect(&rect);

ClientToScreen 和ScreenToClient 用法-LMLPHP  

ClientToScreen 和ScreenToClient 用法-LMLPHP   if(rect.PtInRect(point))

ClientToScreen 和ScreenToClient 用法-LMLPHP   {

ClientToScreen 和ScreenToClient 用法-LMLPHP    pdc->DPtoLP(&m_fp);

ClientToScreen 和ScreenToClient 用法-LMLPHP    pdc->MoveTo(m_fp);

ClientToScreen 和ScreenToClient 用法-LMLPHP    pdc->DPtoLP(&point);

ClientToScreen 和ScreenToClient 用法-LMLPHP    pdc->LineTo(point);

ClientToScreen 和ScreenToClient 用法-LMLPHP

ClientToScreen 和ScreenToClient 用法-LMLPHP   }

ClientToScreen 和ScreenToClient 用法-LMLPHP   ReleaseDC(pdc);*/

ClientToScreen 和ScreenToClient 用法-LMLPHP

ClientToScreen 和ScreenToClient 用法-LMLPHP CDialog::OnLButtonUp(nFlags, point);

ClientToScreen 和ScreenToClient 用法-LMLPHP}

ClientToScreen 和ScreenToClient 用法-LMLPHP

ClientToScreen 和ScreenToClient 用法-LMLPHPvoid CDrawDlg::OnLButtonDown(UINT nFlags, CPoint point)


ClientToScreen 和ScreenToClient 用法-LMLPHPClientToScreen 和ScreenToClient 用法-LMLPHPClientToScreen 和ScreenToClient 用法-LMLPHP{

ClientToScreen 和ScreenToClient 用法-LMLPHP // TODO: Add your message handler code here and/or call default

ClientToScreen 和ScreenToClient 用法-LMLPHP CWnd *pwnd=GetDlgItem(IDC_EDIT1);

ClientToScreen 和ScreenToClient 用法-LMLPHP CDC *pDC=pwnd->GetDC();

ClientToScreen 和ScreenToClient 用法-LMLPHP CRect rect;

ClientToScreen 和ScreenToClient 用法-LMLPHP this->ClientToScreen(&point);

ClientToScreen 和ScreenToClient 用法-LMLPHP pwnd->ScreenToClient(&point);

ClientToScreen 和ScreenToClient 用法-LMLPHP pwnd->GetClientRect(&rect);

ClientToScreen 和ScreenToClient 用法-LMLPHP if(rect.PtInRect(point))

ClientToScreen 和ScreenToClient 用法-LMLPHPClientToScreen 和ScreenToClient 用法-LMLPHP
ClientToScreen 和ScreenToClient 用法-LMLPHP{

ClientToScreen 和ScreenToClient 用法-LMLPHP   m_fp.x=point.x;

ClientToScreen 和ScreenToClient 用法-LMLPHP   m_fp.y=point.y;

ClientToScreen 和ScreenToClient 用法-LMLPHP }

ClientToScreen 和ScreenToClient 用法-LMLPHP ReleaseDC(pDC);

ClientToScreen 和ScreenToClient 用法-LMLPHP   m_bIsLButtonDawn =true;

ClientToScreen 和ScreenToClient 用法-LMLPHP CDialog::OnLButtonDown(nFlags, point);
04-28 02:30