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

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

C++ 程序间消息传递(初学)

后端 13.68MB 45 需要积分: 1
立即下载

资源介绍:

平台:VS2022 适用:简单的小例子,只适合了解简单用法; 说明:一个发送一个接收(字符串、整型)
 // ChuangKou1Dlg.cpp: 实现文件 // #include "pch.h" #include "framework.h" #include "ChuangKou1.h" #include "ChuangKou1Dlg.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() // CChuangKou1Dlg 对话框 CChuangKou1Dlg::CChuangKou1Dlg(CWnd* pParent /*=nullptr*/) : CDialogEx(IDD_CHUANGKOU1_DIALOG, pParent) { m_hIcon = AfxGetApp()->LoadIcon(IDR_MAINFRAME); } void CChuangKou1Dlg::DoDataExchange(CDataExchange* pDX) { CDialogEx::DoDataExchange(pDX); } BEGIN_MESSAGE_MAP(CChuangKou1Dlg, CDialogEx) ON_WM_SYSCOMMAND() ON_WM_PAINT() ON_WM_QUERYDRAGICON() ON_BN_CLICKED(IDOK, &CChuangKou1Dlg::OnBnClickedOk) END_MESSAGE_MAP() // CChuangKou1Dlg 消息处理程序 BOOL CChuangKou1Dlg::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 CChuangKou1Dlg::OnSysCommand(UINT nID, LPARAM lParam) { if ((nID & 0xFFF0) == IDM_ABOUTBOX) { CAboutDlg dlgAbout; dlgAbout.DoModal(); } else { CDialogEx::OnSysCommand(nID, lParam); } } // 如果向对话框添加最小化按钮,则需要下面的代码 // 来绘制该图标。 对于使用文档/视图模型的 MFC 应用程序, // 这将由框架自动完成。 void CChuangKou1Dlg::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 CChuangKou1Dlg::OnQueryDragIcon() { return static_cast(m_hIcon); } // 发送消息 注:需设置用管理员权限启动exe(或右键项目属性-链路器-清单文件-UAC执行级别中选择-requireAdministrator) void CChuangKou1Dlg::OnBnClickedOk() { HWND pWnd = ::FindWindow(NULL, TEXT("Win02")); if (pWnd != NULL) { // 方法一(只能相同字符集;多字节传多字节) //CString strMessage = L"ABC"; //COPYDATASTRUCT stData; //stData.cbData = strMessage.GetLength() + 1; //stData.lpData = strMessage.GetBuffer(stData.cbData); //stData.dwData = 100; //::SendMessage(pWnd, WM_COPYDATA, 0, (LPARAM)&stData); // 方法二 char* chr = "ABC"; // string参数 COPYDATASTRUCT stData; stData.cbData = strlen(chr); stData.lpData = chr; stData.dwData = 100; // int参数 ::SendMessage(pWnd, WM_COPYDATA, 0, (LPARAM)&stData); } }

资源文件列表:

窗口间消息传递.zip 大约有95个文件
  1. 窗口间消息传递/
  2. 窗口间消息传递/ChuangKou1/
  3. 窗口间消息传递/ChuangKou1/ChuangKou1/
  4. 窗口间消息传递/ChuangKou1/ChuangKou1.sln 1.42KB
  5. 窗口间消息传递/ChuangKou1/ChuangKou1/ChuangKou1.aps 106.43KB
  6. 窗口间消息传递/ChuangKou1/ChuangKou1/ChuangKou1.cpp 2.88KB
  7. 窗口间消息传递/ChuangKou1/ChuangKou1/ChuangKou1.h 502B
  8. 窗口间消息传递/ChuangKou1/ChuangKou1/ChuangKou1.rc 10.51KB
  9. 窗口间消息传递/ChuangKou1/ChuangKou1/ChuangKou1.vcxproj 10.24KB
  10. 窗口间消息传递/ChuangKou1/ChuangKou1/ChuangKou1.vcxproj.filters 2.07KB
  11. 窗口间消息传递/ChuangKou1/ChuangKou1/ChuangKou1.vcxproj.user 236B
  12. 窗口间消息传递/ChuangKou1/ChuangKou1/ChuangKou1Dlg.cpp 4.17KB
  13. 窗口间消息传递/ChuangKou1/ChuangKou1/ChuangKou1Dlg.h 692B
  14. 窗口间消息传递/ChuangKou1/ChuangKou1/framework.h 1.52KB
  15. 窗口间消息传递/ChuangKou1/ChuangKou1/pch.cpp 158B
  16. 窗口间消息传递/ChuangKou1/ChuangKou1/pch.h 544B
  17. 窗口间消息传递/ChuangKou1/ChuangKou1/res/
  18. 窗口间消息传递/ChuangKou1/ChuangKou1/resource.h 643B
  19. 窗口间消息传递/ChuangKou1/ChuangKou1/res/ChuangKou1.ico 66.19KB
  20. 窗口间消息传递/ChuangKou1/ChuangKou1/res/ChuangKou1.rc2 676B
  21. 窗口间消息传递/ChuangKou1/ChuangKou1/targetver.h 295B
  22. 窗口间消息传递/ChuangKou1/ChuangKou1/x64/
  23. 窗口间消息传递/ChuangKou1/ChuangKou1/x64/Debug/
  24. 窗口间消息传递/ChuangKou1/ChuangKou1/x64/Debug/ChuangKou1.exe.recipe 328B
  25. 窗口间消息传递/ChuangKou1/ChuangKou1/x64/Debug/ChuangKou1.ilk 2.42MB
  26. 窗口间消息传递/ChuangKou1/ChuangKou1/x64/Debug/ChuangKou1.log 419B
  27. 窗口间消息传递/ChuangKou1/ChuangKou1/x64/Debug/ChuangKou1.obj 99.86KB
  28. 窗口间消息传递/ChuangKou1/ChuangKou1/x64/Debug/ChuangKou1.res 68KB
  29. 窗口间消息传递/ChuangKou1/ChuangKou1/x64/Debug/ChuangKou1.tlog/
  30. 窗口间消息传递/ChuangKou1/ChuangKou1/x64/Debug/ChuangKou1.tlog/ChuangKou1.lastbuildstate 190B
  31. 窗口间消息传递/ChuangKou1/ChuangKou1/x64/Debug/ChuangKou1.tlog/CL.command.1.tlog 7.55KB
  32. 窗口间消息传递/ChuangKou1/ChuangKou1/x64/Debug/ChuangKou1.tlog/Cl.items.tlog 547B
  33. 窗口间消息传递/ChuangKou1/ChuangKou1/x64/Debug/ChuangKou1.tlog/CL.read.1.tlog 103.87KB
  34. 窗口间消息传递/ChuangKou1/ChuangKou1/x64/Debug/ChuangKou1.tlog/CL.write.1.tlog 2.3KB
  35. 窗口间消息传递/ChuangKou1/ChuangKou1/x64/Debug/ChuangKou1.tlog/link.command.1.tlog 5.92KB
  36. 窗口间消息传递/ChuangKou1/ChuangKou1/x64/Debug/ChuangKou1.tlog/link.read.1.tlog 13.35KB
  37. 窗口间消息传递/ChuangKou1/ChuangKou1/x64/Debug/ChuangKou1.tlog/link.write.1.tlog 1.69KB
  38. 窗口间消息传递/ChuangKou1/ChuangKou1/x64/Debug/ChuangKou1.tlog/rc.command.1.tlog 1.4KB
  39. 窗口间消息传递/ChuangKou1/ChuangKou1/x64/Debug/ChuangKou1.tlog/rc.read.1.tlog 7.62KB
  40. 窗口间消息传递/ChuangKou1/ChuangKou1/x64/Debug/ChuangKou1.tlog/rc.write.1.tlog 622B
  41. 窗口间消息传递/ChuangKou1/ChuangKou1/x64/Debug/ChuangKou1Dlg.obj 71.46KB
  42. 窗口间消息传递/ChuangKou1/ChuangKou1/x64/Debug/pch.obj 810.38KB
  43. 窗口间消息传递/ChuangKou1/ChuangKou1/x64/Debug/vc143.idb 1.77MB
  44. 窗口间消息传递/ChuangKou1/ChuangKou1/x64/Debug/vc143.pdb 9.16MB
  45. 窗口间消息传递/ChuangKou1/x64/
  46. 窗口间消息传递/ChuangKou1/x64/Debug/
  47. 窗口间消息传递/ChuangKou1/x64/Debug/ChuangKou1.exe 254.5KB
  48. 窗口间消息传递/ChuangKou1/x64/Debug/ChuangKou1.pdb 18.96MB
  49. 窗口间消息传递/ChuangKou2/
  50. 窗口间消息传递/ChuangKou2/ChuangKou2/
  51. 窗口间消息传递/ChuangKou2/ChuangKou2.sln 1.42KB
  52. 窗口间消息传递/ChuangKou2/ChuangKou2/ChuangKou2.aps 106.47KB
  53. 窗口间消息传递/ChuangKou2/ChuangKou2/ChuangKou2.cpp 2.88KB
  54. 窗口间消息传递/ChuangKou2/ChuangKou2/ChuangKou2.h 502B
  55. 窗口间消息传递/ChuangKou2/ChuangKou2/ChuangKou2.rc 10.63KB
  56. 窗口间消息传递/ChuangKou2/ChuangKou2/ChuangKou2.vcxproj 10.24KB
  57. 窗口间消息传递/ChuangKou2/ChuangKou2/ChuangKou2.vcxproj.filters 2.13KB
  58. 窗口间消息传递/ChuangKou2/ChuangKou2/ChuangKou2.vcxproj.user 236B
  59. 窗口间消息传递/ChuangKou2/ChuangKou2/ChuangKou2Dlg.cpp 3.73KB
  60. 窗口间消息传递/ChuangKou2/ChuangKou2/ChuangKou2Dlg.h 750B
  61. 窗口间消息传递/ChuangKou2/ChuangKou2/framework.h 1.52KB
  62. 窗口间消息传递/ChuangKou2/ChuangKou2/pch.cpp 158B
  63. 窗口间消息传递/ChuangKou2/ChuangKou2/pch.h 544B
  64. 窗口间消息传递/ChuangKou2/ChuangKou2/res/
  65. 窗口间消息传递/ChuangKou2/ChuangKou2/resource.h 689B
  66. 窗口间消息传递/ChuangKou2/ChuangKou2/res/ChuangKou2.ico 66.19KB
  67. 窗口间消息传递/ChuangKou2/ChuangKou2/res/ChuangKou2.rc2 676B
  68. 窗口间消息传递/ChuangKou2/ChuangKou2/targetver.h 295B
  69. 窗口间消息传递/ChuangKou2/ChuangKou2/x64/
  70. 窗口间消息传递/ChuangKou2/ChuangKou2/x64/Debug/
  71. 窗口间消息传递/ChuangKou2/ChuangKou2/x64/Debug/ChuangKou2.exe.recipe 333B
  72. 窗口间消息传递/ChuangKou2/ChuangKou2/x64/Debug/ChuangKou2.ilk 2.77MB
  73. 窗口间消息传递/ChuangKou2/ChuangKou2/x64/Debug/ChuangKou2.log 140B
  74. 窗口间消息传递/ChuangKou2/ChuangKou2/x64/Debug/ChuangKou2.obj 100.39KB
  75. 窗口间消息传递/ChuangKou2/ChuangKou2/x64/Debug/ChuangKou2.res 68.03KB
  76. 窗口间消息传递/ChuangKou2/ChuangKou2/x64/Debug/ChuangKou2.tlog/
  77. 窗口间消息传递/ChuangKou2/ChuangKou2/x64/Debug/ChuangKou2.tlog/ChuangKou2.lastbuildstate 195B
  78. 窗口间消息传递/ChuangKou2/ChuangKou2/x64/Debug/ChuangKou2.tlog/CL.command.1.tlog 4.88KB
  79. 窗口间消息传递/ChuangKou2/ChuangKou2/x64/Debug/ChuangKou2.tlog/Cl.items.tlog 577B
  80. 窗口间消息传递/ChuangKou2/ChuangKou2/x64/Debug/ChuangKou2.tlog/CL.read.1.tlog 104.32KB
  81. 窗口间消息传递/ChuangKou2/ChuangKou2/x64/Debug/ChuangKou2.tlog/CL.write.1.tlog 2.53KB
  82. 窗口间消息传递/ChuangKou2/ChuangKou2/x64/Debug/ChuangKou2.tlog/link.command.1.tlog 3.82KB
  83. 窗口间消息传递/ChuangKou2/ChuangKou2/x64/Debug/ChuangKou2.tlog/link.read.1.tlog 6.88KB
  84. 窗口间消息传递/ChuangKou2/ChuangKou2/x64/Debug/ChuangKou2.tlog/link.write.1.tlog 1.05KB
  85. 窗口间消息传递/ChuangKou2/ChuangKou2/x64/Debug/ChuangKou2.tlog/rc.command.1.tlog 878B
  86. 窗口间消息传递/ChuangKou2/ChuangKou2/x64/Debug/ChuangKou2.tlog/rc.read.1.tlog 3.8KB
  87. 窗口间消息传递/ChuangKou2/ChuangKou2/x64/Debug/ChuangKou2.tlog/rc.write.1.tlog 306B
  88. 窗口间消息传递/ChuangKou2/ChuangKou2/x64/Debug/ChuangKou2Dlg.obj 79.9KB
  89. 窗口间消息传递/ChuangKou2/ChuangKou2/x64/Debug/pch.obj 825.19KB
  90. 窗口间消息传递/ChuangKou2/ChuangKou2/x64/Debug/vc143.idb 1.75MB
  91. 窗口间消息传递/ChuangKou2/ChuangKou2/x64/Debug/vc143.pdb 9.13MB
  92. 窗口间消息传递/ChuangKou2/x64/
  93. 窗口间消息传递/ChuangKou2/x64/Debug/
  94. 窗口间消息传递/ChuangKou2/x64/Debug/ChuangKou2.exe 253KB
  95. 窗口间消息传递/ChuangKou2/x64/Debug/ChuangKou2.pdb 13.42MB
0评论
提交 加载更多评论
其他资源 C++ 鼠标移动限制在某一区域(初学)
平台:VS2022 适用:初学,简单的小例子,只适合了解用法 说明:将鼠标移动范围控制在某一区域,例如GroupBox控件内
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的可视化布局,你可以直观地看到在你硬盘上大的文件和文件夹。
身份证阅读器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
实测通过身份证阅读器/社保卡读卡器安卓SDK,包括Java/Kotlin/Uni-app/Web等多种语言demo
东信智能读写器SDK简介 本文档描述了广东东信智能科技有限公司DONSEE系列读写器SDK的函数定义、调用方法、参数以及返回值说明,供开发人员进行二次开发时使用。 SDK会自动检查是否拥有USB设备权限,如没有权限,会自动进行申请,如果您的安卓设备是定制设备,遇到找不到设备时,请询问设备定制方是否开放了USB接口的系统层权限。 步骤 1:将DonseeDevice.aar拷贝到app/libs目录: 步骤 2:在app/build.gradle里面添加如下代码: 步骤 3:类名: import com.donsee.devices.CardReader; //读卡器设备类 import com.donsee.bean.IDCardInfo; //身份证信息类 import com.donsee.bean.SciCardInfo; //社保卡信息类