首页 星云 工具 资源 星选 资讯 热门工具
:

PDF转图片 完全免费 小红书视频下载 无水印 抖音视频下载 无水印 数字星空

C++ 鼠标移动限制在某一区域(初学)

后端 5.87MB 72 需要积分: 1
立即下载

资源介绍:

平台:VS2022 适用:初学,简单的小例子,只适合了解用法 说明:将鼠标移动范围控制在某一区域,例如GroupBox控件内
 // DisableMouseRectDlg.cpp: 实现文件 // #include "pch.h" #include "framework.h" #include "DisableMouseRect.h" #include "DisableMouseRectDlg.h" #include "afxdialogex.h" #ifdef _DEBUG #define new DEBUG_NEW #endif // 用于应用程序“关于”菜单项的 CAboutDlg 对话框 class CAboutDlg : public CDialogEx { public: CAboutDlg(); // 对话框数据 #ifdef AFX_DESIGN_TIME enum { IDD = IDD_ABOUTBOX }; #endif protected: virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV 支持 // 实现 protected: DECLARE_MESSAGE_MAP() }; CAboutDlg::CAboutDlg() : CDialogEx(IDD_ABOUTBOX) { } void CAboutDlg::DoDataExchange(CDataExchange* pDX) { CDialogEx::DoDataExchange(pDX); } BEGIN_MESSAGE_MAP(CAboutDlg, CDialogEx) END_MESSAGE_MAP() // CDisableMouseRectDlg 对话框 CDisableMouseRectDlg::CDisableMouseRectDlg(CWnd* pParent /*=nullptr*/) : CDialogEx(IDD_DISABLEMOUSERECT_DIALOG, pParent) { m_hIcon = AfxGetApp()->LoadIcon(IDR_MAINFRAME); } void CDisableMouseRectDlg::DoDataExchange(CDataExchange* pDX) { CDialogEx::DoDataExchange(pDX); } BEGIN_MESSAGE_MAP(CDisableMouseRectDlg, CDialogEx) ON_WM_SYSCOMMAND() ON_WM_PAINT() ON_WM_QUERYDRAGICON() ON_BN_CLICKED(IDC_BUTTON3, &CDisableMouseRectDlg::OnBnClickedButton3) ON_BN_CLICKED(IDC_BUTTON4, &CDisableMouseRectDlg::OnBnClickedButton4) ON_BN_CLICKED(IDC_BUTTON2, &CDisableMouseRectDlg::OnBnClickedButton2) END_MESSAGE_MAP() // CDisableMouseRectDlg 消息处理程序 BOOL CDisableMouseRectDlg::OnInitDialog() { CDialogEx::OnInitDialog(); // 将“关于...”菜单项添加到系统菜单中。 // IDM_ABOUTBOX 必须在系统命令范围内。 ASSERT((IDM_ABOUTBOX & 0xFFF0) == IDM_ABOUTBOX); ASSERT(IDM_ABOUTBOX < 0xF000); CMenu* pSysMenu = GetSystemMenu(FALSE); if (pSysMenu != nullptr) { BOOL bNameValid; CString strAboutMenu; bNameValid = strAboutMenu.LoadString(IDS_ABOUTBOX); ASSERT(bNameValid); if (!strAboutMenu.IsEmpty()) { pSysMenu->AppendMenu(MF_SEPARATOR); pSysMenu->AppendMenu(MF_STRING, IDM_ABOUTBOX, strAboutMenu); } } // 设置此对话框的图标。 当应用程序主窗口不是对话框时,框架将自动 // 执行此操作 SetIcon(m_hIcon, TRUE); // 设置大图标 SetIcon(m_hIcon, FALSE); // 设置小图标 // TODO: 在此添加额外的初始化代码 return TRUE; // 除非将焦点设置到控件,否则返回 TRUE } void CDisableMouseRectDlg::OnSysCommand(UINT nID, LPARAM lParam) { if ((nID & 0xFFF0) == IDM_ABOUTBOX) { CAboutDlg dlgAbout; dlgAbout.DoModal(); } else { CDialogEx::OnSysCommand(nID, lParam); } } // 如果向对话框添加最小化按钮,则需要下面的代码 // 来绘制该图标。 对于使用文档/视图模型的 MFC 应用程序, // 这将由框架自动完成。 void CDisableMouseRectDlg::OnPaint() { if (IsIconic()) { CPaintDC dc(this); // 用于绘制的设备上下文 SendMessage(WM_ICONERASEBKGND, reinterpret_cast(dc.GetSafeHdc()), 0); // 使图标在工作区矩形中居中 int cxIcon = GetSystemMetrics(SM_CXICON); int cyIcon = GetSystemMetrics(SM_CYICON); CRect rect; GetClientRect(&rect); int x = (rect.Width() - cxIcon + 1) / 2; int y = (rect.Height() - cyIcon + 1) / 2; // 绘制图标 dc.DrawIcon(x, y, m_hIcon); } else { CDialogEx::OnPaint(); } } //当用户拖动最小化窗口时系统调用此函数取得光标 //显示。 HCURSOR CDisableMouseRectDlg::OnQueryDragIcon() { return static_cast(m_hIcon); } void CDisableMouseRectDlg::OnBnClickedButton4() { // TODO: 在此添加控件通知处理程序代码 } void CDisableMouseRectDlg::OnBnClickedButton3() { CRect rect1; GetDlgItem(IDC_STATIC_RECT_INVILADE)->GetWindowRect(&rect1); // ClipCursor(rect1); } // 取消限制 void CDisableMouseRectDlg::OnBnClickedButton2() { ClipCursor(NULL); }

资源文件列表:

鼠标点击区域失效.zip 大约有48个文件
  1. 鼠标点击区域失效/
  2. 鼠标点击区域失效/DisableMouseRect/
  3. 鼠标点击区域失效/DisableMouseRect/DisableMouseRect/
  4. 鼠标点击区域失效/DisableMouseRect/DisableMouseRect.sln 1.43KB
  5. 鼠标点击区域失效/DisableMouseRect/DisableMouseRect/DisableMouseRect.aps 107.15KB
  6. 鼠标点击区域失效/DisableMouseRect/DisableMouseRect/DisableMouseRect.cpp 2.96KB
  7. 鼠标点击区域失效/DisableMouseRect/DisableMouseRect/DisableMouseRect.h 538B
  8. 鼠标点击区域失效/DisableMouseRect/DisableMouseRect/DisableMouseRect.rc 10.86KB
  9. 鼠标点击区域失效/DisableMouseRect/DisableMouseRect/DisableMouseRect.vcxproj 10.22KB
  10. 鼠标点击区域失效/DisableMouseRect/DisableMouseRect/DisableMouseRect.vcxproj.filters 2.11KB
  11. 鼠标点击区域失效/DisableMouseRect/DisableMouseRect/DisableMouseRect.vcxproj.user 242B
  12. 鼠标点击区域失效/DisableMouseRect/DisableMouseRect/DisableMouseRectDlg.cpp 3.94KB
  13. 鼠标点击区域失效/DisableMouseRect/DisableMouseRect/DisableMouseRectDlg.h 801B
  14. 鼠标点击区域失效/DisableMouseRect/DisableMouseRect/framework.h 1.52KB
  15. 鼠标点击区域失效/DisableMouseRect/DisableMouseRect/pch.cpp 158B
  16. 鼠标点击区域失效/DisableMouseRect/DisableMouseRect/pch.h 544B
  17. 鼠标点击区域失效/DisableMouseRect/DisableMouseRect/res/
  18. 鼠标点击区域失效/DisableMouseRect/DisableMouseRect/resource.h 925B
  19. 鼠标点击区域失效/DisableMouseRect/DisableMouseRect/res/DisableMouseRect.ico 66.19KB
  20. 鼠标点击区域失效/DisableMouseRect/DisableMouseRect/res/DisableMouseRect.rc2 688B
  21. 鼠标点击区域失效/DisableMouseRect/DisableMouseRect/targetver.h 295B
  22. 鼠标点击区域失效/DisableMouseRect/DisableMouseRect/x64/
  23. 鼠标点击区域失效/DisableMouseRect/DisableMouseRect/x64/Debug/
  24. 鼠标点击区域失效/DisableMouseRect/DisableMouseRect/x64/Debug/DisableMouseRect.exe.recipe 348B
  25. 鼠标点击区域失效/DisableMouseRect/DisableMouseRect/x64/Debug/DisableMouseRect.ilk 2.46MB
  26. 鼠标点击区域失效/DisableMouseRect/DisableMouseRect/x64/Debug/DisableMouseRect.log 167B
  27. 鼠标点击区域失效/DisableMouseRect/DisableMouseRect/x64/Debug/DisableMouseRect.obj 100.6KB
  28. 鼠标点击区域失效/DisableMouseRect/DisableMouseRect/x64/Debug/DisableMouseRect.res 68.14KB
  29. 鼠标点击区域失效/DisableMouseRect/DisableMouseRect/x64/Debug/DisableMouseRect.tlog/
  30. 鼠标点击区域失效/DisableMouseRect/DisableMouseRect/x64/Debug/DisableMouseRect.tlog/CL.command.1.tlog 5.51KB
  31. 鼠标点击区域失效/DisableMouseRect/DisableMouseRect/x64/Debug/DisableMouseRect.tlog/Cl.items.tlog 691B
  32. 鼠标点击区域失效/DisableMouseRect/DisableMouseRect/x64/Debug/DisableMouseRect.tlog/CL.read.1.tlog 104.62KB
  33. 鼠标点击区域失效/DisableMouseRect/DisableMouseRect/x64/Debug/DisableMouseRect.tlog/CL.write.1.tlog 3.05KB
  34. 鼠标点击区域失效/DisableMouseRect/DisableMouseRect/x64/Debug/DisableMouseRect.tlog/DisableMouseRect.lastbuildstate 204B
  35. 鼠标点击区域失效/DisableMouseRect/DisableMouseRect/x64/Debug/DisableMouseRect.tlog/link.command.1.tlog 4.41KB
  36. 鼠标点击区域失效/DisableMouseRect/DisableMouseRect/x64/Debug/DisableMouseRect.tlog/link.read.1.tlog 7.22KB
  37. 鼠标点击区域失效/DisableMouseRect/DisableMouseRect/x64/Debug/DisableMouseRect.tlog/link.write.1.tlog 1.28KB
  38. 鼠标点击区域失效/DisableMouseRect/DisableMouseRect/x64/Debug/DisableMouseRect.tlog/rc.command.1.tlog 1.12KB
  39. 鼠标点击区域失效/DisableMouseRect/DisableMouseRect/x64/Debug/DisableMouseRect.tlog/rc.read.1.tlog 3.96KB
  40. 鼠标点击区域失效/DisableMouseRect/DisableMouseRect/x64/Debug/DisableMouseRect.tlog/rc.write.1.tlog 382B
  41. 鼠标点击区域失效/DisableMouseRect/DisableMouseRect/x64/Debug/DisableMouseRectDlg.obj 75.02KB
  42. 鼠标点击区域失效/DisableMouseRect/DisableMouseRect/x64/Debug/pch.obj 810.63KB
  43. 鼠标点击区域失效/DisableMouseRect/DisableMouseRect/x64/Debug/vc143.idb 1.75MB
  44. 鼠标点击区域失效/DisableMouseRect/DisableMouseRect/x64/Debug/vc143.pdb 6.87MB
  45. 鼠标点击区域失效/DisableMouseRect/x64/
  46. 鼠标点击区域失效/DisableMouseRect/x64/Debug/
  47. 鼠标点击区域失效/DisableMouseRect/x64/Debug/DisableMouseRect.exe 254.5KB
  48. 鼠标点击区域失效/DisableMouseRect/x64/Debug/DisableMouseRect.pdb 14.3MB
0评论
提交 加载更多评论
其他资源 LABVIEW相机硬件触发,事件模式硬件触发,连续模式硬件触发
最近有好多朋友找我咨询LABVIEW怎么做相机硬件外部触发(外部IO触发),其实这个很简单,下面给大家介绍两种常用的方法。 1、相机连续采集模式。 2、事件触发模式。 下面附上博客链接:http://t.csdnimg.cn/91Ayk
苹果4 6.1.3无shsh降级方法
苹果4 3.1无shsh证书这是利用mac系统漏洞进行降级,从7.1.2降级到6.1.3或者更低都行 必须使用mac系统如果没有windows虚拟机或者黑苹果都行
SpaceSniffer是一个可以让您硬盘中文件和文件夹的分布情况的应用程序 通过使用TreeMap的可视化布局,你可以直
SpaceSniffer是一个可以让您硬盘中文件和文件夹的分布情况的应用程序。通过使用TreeMap的可视化布局,你可以直观地看到在你硬盘上大的文件和文件夹。
Java servlet + jsp 实现的图书管理系统
这是使用servlet+jsp+mysql实现的一个图书管理系统,本图书管理系统主要注重后台逻辑 首页为图书搜索,图书搜索采用分页查询,查询后的结果使用图表展示。展示的图表中有借阅按钮,当用户点击借阅,在对应的借阅表中会插入相应的字段。当然,会判断是否登录,所以,本图书管理系统有最基本的登录验证系统,分为普通用户登录和管理员登录,登录成功进入管理后台首页,失败则给出提示。在本系统中,普通用户只具有查询图书和借阅图书的功能,而管理员具有增删改查,对图书的增加、修改、删除,此外,本项目还具有一次添加多本书的操作。本项目设计美观,采用最新的MySQL8.0数据库存放数据,项目中还使用了echarts图表丰富项目,使用字体图标来美化样式。认真学习此项目,你会学会如何在servlet中使用分页查询和在项目中使用ajax来实现一次添加多本书籍的操作。
C++ 程序间消息传递(初学)
平台:VS2022 适用:简单的小例子,只适合了解简单用法; 说明:一个发送一个接收(字符串、整型)
身份证阅读器gcc-arm-8.3.0-2019.03-x86-64-arm-linux-gnueabihf SDK开发包
arm-linux-gnueabihf-gcc -v Using built-in specs. COLLECT_GCC=arm-linux-gnueabihf-gcc file libdonsee.so libdonsee.so: ELF 32-bit LSB shared object, ARM, EABI5 version 1 (SYSV), dynamically linked, with debug_info, not stripped file output output: ELF 32-bit LSB executable, ARM, EABI5 version 1 (SYSV), dynamically linked, interpreter /lib/ld-linux-armhf.so.3, for GNU/Linux 3.2.0, with debug_info, not stripped
身份证阅读器Linux开发包gcc-linaro-5.3-2016.02-x86-64-arm-linux-gnueabihf
身份证阅读器Linux开发包 gcc-linaro-5.3-2016.02-x86_64_arm-linux-gnueabihf 编译output命令: gcc donseeTest.c -o output ./libdonsee.so # arm-linux-gnueabihf-gcc -v #file libdonsee.so libdonsee.so: ELF 32-bit LSB shared object, ARM, EABI5 version 1 (SYSV), dynamically linked, BuildID[sha1]=4cb43bd31cc828a97e94d4c3f0bc5410e3598457, with debug_info, not stripped #file output output: ELF 32-bit LSB executable, ARM, EABI5 version 1 (SYSV), dynamically linked, interpreter /lib/ld-linux-armhf.so.3, for GNU/Linux
idea-jprofiler
idea-jprofiler