首页
社区
课程
招聘
[讨论]PostThreadMessage/WM_DESTROY为什么没反应
发表于: 2009-4-8 14:41 5125

[讨论]PostThreadMessage/WM_DESTROY为什么没反应

2009-4-8 14:41
5125
PostMessage和SendMessage都能可以

为什么用GetWindowThreadProcessId得到线程ID然后用PostThreadMessage没效果?函数返回1

[课程]Android-CTF解题方法汇总!

收藏
免费 0
支持
分享
最新回复 (7)
雪    币: 40
活跃值: (10)
能力值: ( LV2,RANK:10 )
在线值:
发帖
回帖
粉丝
2
PostThreadMessage 返回1是成功啊

msdn:
If the function succeeds, the return value is nonzero.
2009-4-8 16:14
0
雪    币: 40
活跃值: (10)
能力值: ( LV2,RANK:10 )
在线值:
发帖
回帖
粉丝
3
The thread to which the message is posted retrieves the message by calling the GetMessage or PeekMessage function. The hwnd member of the returned MSG structure is NULL.

Messages sent by PostThreadMessage are not associated with a window.
As a general rule, messages that are not associated with a window cannot be dispatched by the DispatchMessage function. Therefore, if the recipient thread is in a modal loop (as used by MessageBox or DialogBox), the messages will be lost.
2009-4-8 16:26
0
雪    币: 635
活跃值: (101)
能力值: ( LV12,RANK:420 )
在线值:
发帖
回帖
粉丝
4
不看MSDN,一辈子编程没长进
2009-4-8 16:36
0
雪    币: 203
活跃值: (11)
能力值: ( LV2,RANK:10 )
在线值:
发帖
回帖
粉丝
5
PostThreadMessage/WM_QUIT就可以,不管是Modal还是Modeless

PostThreadMessage/WM_DESTROY就是没效果,不管是Modal还是Modeless

PostMessage/SendMessage懒得试了,估计不管是WM_DESTROY/WM_QUIT、Modal/Modeless都可以
2009-4-8 16:49
0
雪    币: 203
活跃值: (11)
能力值: ( LV2,RANK:10 )
在线值:
发帖
回帖
粉丝
6
笑话,MSDN上错误多着呢

你就吃MSDN一辈子吧
2009-4-8 16:53
0
雪    币: 393
活跃值: (100)
能力值: ( LV6,RANK:80 )
在线值:
发帖
回帖
粉丝
7
哦耶哦耶.不知道有没有热闹看
2009-4-8 16:55
0
雪    币: 203
活跃值: (11)
能力值: ( LV2,RANK:10 )
在线值:
发帖
回帖
粉丝
8
明白了,忘了QUIT比DESTROY厉害
2009-4-8 18:22
0
游客
登录 | 注册 方可回帖
返回
//