正在阅读:编程必备:VC常用知识重温编程必备:VC常用知识重温

2004-11-12 10:34 出处:CSDN 作者:hongyang1980 责任编辑:linjixiong

  6: 得到窗口绝对坐标


  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);


  
  7: 复制文件夹


  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);

  8: 捕获 Ctrl+鼠标左键 组合


  case WM_LBUTTONDOWN://鼠标消息wParam ==
  if (wParam & MK_CONTROL)
  MessageBox(hwnd,"aaa","bbb",MB_OK);
  break;
  或
  case WM_LBUTTONDOWN:
  if(GetKeyState(VK_CONTROL)<0)
  MessageBox(hwnd,"aaa","bbb",MB_OK);
  break;


察看评论详细内容 我要发表评论
作者笔名 简短内容 发表时间
:
键盘也能翻页,试试“← →”键

关注我们

最新资讯离线随时看 聊天吐槽赢奖品