vc获得窗口的绝对坐标及复制文件夹

来源:互联网 发布:球球大作战抽奖软件 编辑:程序博客网 时间:2024/06/05 19:18
 1.得到窗口绝对坐标
     CString strNum,strNum1;
  CRect rect;
  GetClientRect(&rect);
  ClientToScreen(&rect);
  strNum.Format("X: %d",rect.top);
  strNum1.Format("   Y: %d",rect.left);
  strNum = strNum + strNum1;
  AfxMessageBox(strNum);
2.复制文件夹
     SHFILEOPSTRUCT  Op;
  
  char FromBuf[]="E://temp/0";
  char ToBuf[]="////SINTEKSERVER//个人文档//陈 伟/0";;
  
  Op.hwnd = NULL;
  Op.wFunc = FO_COPY;
  Op.pFrom = FromBuf;
  Op.pTo = ToBuf;
  Op.fFlags = FOF_NOCONFIRMATION | FOF_RENAMEONCOLLISION ;
  Op.fAnyOperationsAborted = FALSE;
  Op.hNameMappings = NULL;
  Op.lpszProgressTitle = NULL;

  
  if(SHFileOperation(&Op) == 0)
  MessageBox("复制完毕","提示",MB_OK|MB_ICONINFORMATION);