线程暂停和线程继续,以及线程结束后发送自定义消息更新状态

上传者: habao123456 | 上传时间: 2022-08-03 19:03:50 | 文件大小: 24.51MB | 文件类型: RAR
本人在做运动控制时开了个线程,来控制平台运动,当时想在运动结束时将开始按钮颜色变成默认色,弄了很久,一直不成功。WaitForSingleObject(thread,INFINITE);确实实现了,但是问题也来了:主线程里的计时器也停止了,直到运动结束,计时器才起作用,所以计时器里很多限位开关的开关信息也不能及时反馈给运动。网上找了些代码,也没成功,试了全局变量也失败了,最后看了别人的代码,人家在运动结束时发出个消息来刷新,恩...后来OK了。

文件下载

资源详情

[{"title":"( 72 个子文件 24.51MB ) 线程暂停和线程继续,以及线程结束后发送自定义消息更新状态","children":[{"title":"ThreadTest","children":[{"title":"ThreadTest.sln <span style='color:#111;'> 897B </span>","children":null,"spread":false},{"title":"ipch","children":[{"title":"threadtest-36245bb4","children":[{"title":"threadtest-69f79e84.ipch <span style='color:#111;'> 256.00KB </span>","children":null,"spread":false}],"spread":true}],"spread":true},{"title":"ThreadTest","children":[{"title":"resource.h <span style='color:#111;'> 2.84KB </span>","children":null,"spread":false},{"title":"ThreadTestDoc.cpp <span style='color:#111;'> 2.77KB </span>","children":null,"spread":false},{"title":"ThreadTest.vcxproj.filters <span style='color:#111;'> 2.68KB </span>","children":null,"spread":false},{"title":"stdafx.h <span style='color:#111;'> 1.76KB </span>","children":null,"spread":false},{"title":"ThreadTest.vcxproj <span style='color:#111;'> 6.14KB </span>","children":null,"spread":false},{"title":"ThreadTest.rc <span style='color:#111;'> 39.77KB </span>","children":null,"spread":false},{"title":"targetver.h <span style='color:#111;'> 314B </span>","children":null,"spread":false},{"title":"MainFrm.h <span style='color:#111;'> 1.05KB </span>","children":null,"spread":false},{"title":"ThreadTestView.h <span style='color:#111;'> 1.59KB </span>","children":null,"spread":false},{"title":"Debug","children":[{"title":"link.1520.read.1.tlog <span style='color:#111;'> 2B </span>","children":null,"spread":false},{"title":"ThreadTest.res <span style='color:#111;'> 86.95KB </span>","children":null,"spread":false},{"title":"ThreadTest.log <span style='color:#111;'> 2.60KB </span>","children":null,"spread":false},{"title":"link.read.1.tlog <span style='color:#111;'> 5.97KB </span>","children":null,"spread":false},{"title":"vc100.pdb <span style='color:#111;'> 3.32MB </span>","children":null,"spread":false},{"title":"link-cvtres.read.1.tlog <span style='color:#111;'> 2B </span>","children":null,"spread":false},{"title":"link.command.1.tlog <span style='color:#111;'> 2.31KB </span>","children":null,"spread":false},{"title":"rc.write.1.tlog <span style='color:#111;'> 646B </span>","children":null,"spread":false},{"title":"link.5544-cvtres.read.1.tlog <span style='color:#111;'> 2B </span>","children":null,"spread":false},{"title":"ThreadTest.exe.embed.manifest <span style='color:#111;'> 915B </span>","children":null,"spread":false},{"title":"stdafx.obj <span style='color:#111;'> 625.27KB </span>","children":null,"spread":false},{"title":"CL.write.1.tlog <span style='color:#111;'> 3.52KB </span>","children":null,"spread":false},{"title":"link.1520-cvtres.write.1.tlog <span style='color:#111;'> 2B </span>","children":null,"spread":false},{"title":"rc.command.1.tlog <span style='color:#111;'> 1.27KB </span>","children":null,"spread":false},{"title":"ThreadTestView.obj <span style='color:#111;'> 59.26KB </span>","children":null,"spread":false},{"title":"cl.command.1.tlog <span style='color:#111;'> 4.02KB </span>","children":null,"spread":false},{"title":"ThreadTest.lastbuildstate <span style='color:#111;'> 69B </span>","children":null,"spread":false},{"title":"ThreadTest.exe.intermediate.manifest <span style='color:#111;'> 640B </span>","children":null,"spread":false},{"title":"link.5372.write.1.tlog <span style='color:#111;'> 2B </span>","children":null,"spread":false},{"title":"ThreadTest_manifest.rc <span style='color:#111;'> 210B </span>","children":null,"spread":false},{"title":"link-cvtres.write.1.tlog <span style='color:#111;'> 2B </span>","children":null,"spread":false},{"title":"mt.read.1.tlog <span style='color:#111;'> 820B </span>","children":null,"spread":false},{"title":"ThreadTest.obj <span style='color:#111;'> 56.13KB </span>","children":null,"spread":false},{"title":"link.5544.write.1.tlog <span style='color:#111;'> 2B </span>","children":null,"spread":false},{"title":"ThreadTest.exe.embed.manifest.res <span style='color:#111;'> 980B </span>","children":null,"spread":false},{"title":"mt.write.1.tlog <span style='color:#111;'> 546B </span>","children":null,"spread":false},{"title":"link.5372-cvtres.read.1.tlog <span style='color:#111;'> 2B </span>","children":null,"spread":false},{"title":"rc.read.1.tlog <span style='color:#111;'> 4.03KB </span>","children":null,"spread":false},{"title":"ThreadTest.pch <span style='color:#111;'> 32.19MB </span>","children":null,"spread":false},{"title":"MainFrm.obj <span style='color:#111;'> 80.90KB </span>","children":null,"spread":false},{"title":"link.5544-cvtres.write.1.tlog <span style='color:#111;'> 2B </span>","children":null,"spread":false},{"title":"link.5544.read.1.tlog <span style='color:#111;'> 2B </span>","children":null,"spread":false},{"title":"ThreadTestDoc.obj <span style='color:#111;'> 55.19KB </span>","children":null,"spread":false},{"title":"CL.read.1.tlog <span style='color:#111;'> 66.99KB </span>","children":null,"spread":false},{"title":"vc100.idb <span style='color:#111;'> 1.90MB </span>","children":null,"spread":false},{"title":"link.1520-cvtres.read.1.tlog <span style='color:#111;'> 2B </span>","children":null,"spread":false},{"title":"link.5372.read.1.tlog <span style='color:#111;'> 2B </span>","children":null,"spread":false},{"title":"mt.command.1.tlog <span style='color:#111;'> 766B </span>","children":null,"spread":false},{"title":"link.5372-cvtres.write.1.tlog <span style='color:#111;'> 2B </span>","children":null,"spread":false},{"title":"link.write.1.tlog <span style='color:#111;'> 1.62KB </span>","children":null,"spread":false},{"title":"link.1520.write.1.tlog <span style='color:#111;'> 2B </span>","children":null,"spread":false}],"spread":false},{"title":"stdafx.cpp <span style='color:#111;'> 212B </span>","children":null,"spread":false},{"title":"ThreadTest.aps <span style='color:#111;'> 127.91KB </span>","children":null,"spread":false},{"title":"ReadMe.txt <span style='color:#111;'> 5.18KB </span>","children":null,"spread":false},{"title":"ThreadTest.vcxproj.user <span style='color:#111;'> 143B </span>","children":null,"spread":false},{"title":"MainFrm.cpp <span style='color:#111;'> 5.95KB </span>","children":null,"spread":false},{"title":"ThreadTest.cpp <span style='color:#111;'> 5.46KB </span>","children":null,"spread":false},{"title":"res","children":[{"title":"ThreadTest.rc2 <span style='color:#111;'> 804B </span>","children":null,"spread":false},{"title":"Toolbar256.bmp <span style='color:#111;'> 5.68KB </span>","children":null,"spread":false},{"title":"ThreadTestDoc.ico <span style='color:#111;'> 4.60KB </span>","children":null,"spread":false},{"title":"ThreadTest.ico <span style='color:#111;'> 66.19KB </span>","children":null,"spread":false},{"title":"Toolbar.bmp <span style='color:#111;'> 1.05KB </span>","children":null,"spread":false}],"spread":false},{"title":"ThreadTest.h <span style='color:#111;'> 721B </span>","children":null,"spread":false},{"title":"UserImages.bmp <span style='color:#111;'> 7.79KB </span>","children":null,"spread":false},{"title":"ThreadTestDoc.h <span style='color:#111;'> 958B </span>","children":null,"spread":false},{"title":"ThreadTestView.cpp <span style='color:#111;'> 4.68KB </span>","children":null,"spread":false}],"spread":false},{"title":"ThreadTest.suo <span style='color:#111;'> 14.50KB </span>","children":null,"spread":false},{"title":"ThreadTest.sdf <span style='color:#111;'> 63.52MB </span>","children":null,"spread":false},{"title":"Debug","children":[{"title":"ThreadTest.ilk <span style='color:#111;'> 1.89MB </span>","children":null,"spread":false},{"title":"ThreadTest.exe <span style='color:#111;'> 246.50KB </span>","children":null,"spread":false},{"title":"ThreadTest.pdb <span style='color:#111;'> 5.25MB </span>","children":null,"spread":false}],"spread":true}],"spread":true}],"spread":true}]

评论信息

免责申明

【只为小站】的资源来自网友分享,仅供学习研究,请务必在下载后24小时内给予删除,不得用于其他任何用途,否则后果自负。基于互联网的特殊性,【只为小站】 无法对用户传输的作品、信息、内容的权属或合法性、合规性、真实性、科学性、完整权、有效性等进行实质审查;无论 【只为小站】 经营者是否已进行审查,用户均应自行承担因其传输的作品、信息、内容而可能或已经产生的侵权或权属纠纷等法律责任。
本站所有资源不代表本站的观点或立场,基于网友分享,根据中国法律《信息网络传播权保护条例》第二十二条之规定,若资源存在侵权或相关问题请联系本站客服人员,zhiweidada#qq.com,请把#换成@,本站将给予最大的支持与配合,做到及时反馈和处理。关于更多版权及免责申明参见 版权及免责申明