如何使用SendMessage/PostMessage函数?
我想将这些消息发送到应用程序:
<00010> 00830BB8 S WM_GETDLGCODE
<00011> 00830BB8 R WM_GETDLGCODE fuDlgCode:DLGC_WANTARROWS
<00012> 00830BB8 P WM_PAINT hdc:00000000
<00013> 00830BB8 S WM_ERASEBKGND hdc:DD012964
<00014> 00830BB8 R WM_ERASEBKGND fErased:True
<00015> 00830BB8 P WM_TIMER wTimerID:1 tmprc:00000000
<00016> 00830BB8 S WM_GETDLGCODE
<00017> 00830BB8 R WM_GETDLGCODE fuDlgCode:DLGC_WANTARROWS
<00018> 00830BB8 S WM_GETDLGCODE
<00019> 00830BB8 R WM_GETDLGCODE fuDlgCode:DLGC_WANTARROWS
<00020> 00830BB8 P WM_PAINT hdc:00000000
<00021> 00830BB8 S WM_ERASEBKGND hdc:7601294E
<00022> 00830BB8 R WM_ERASEBKGND fErased:True
这些消息来自 Spy++。 如何使用 C# 使用 SendMessage/PostMessage 函数发送?
编辑.. 谢谢你们的回复! 我解决了我的问题,再次感谢!
I want to send these messages to an application:
<00010> 00830BB8 S WM_GETDLGCODE
<00011> 00830BB8 R WM_GETDLGCODE fuDlgCode:DLGC_WANTARROWS
<00012> 00830BB8 P WM_PAINT hdc:00000000
<00013> 00830BB8 S WM_ERASEBKGND hdc:DD012964
<00014> 00830BB8 R WM_ERASEBKGND fErased:True
<00015> 00830BB8 P WM_TIMER wTimerID:1 tmprc:00000000
<00016> 00830BB8 S WM_GETDLGCODE
<00017> 00830BB8 R WM_GETDLGCODE fuDlgCode:DLGC_WANTARROWS
<00018> 00830BB8 S WM_GETDLGCODE
<00019> 00830BB8 R WM_GETDLGCODE fuDlgCode:DLGC_WANTARROWS
<00020> 00830BB8 P WM_PAINT hdc:00000000
<00021> 00830BB8 S WM_ERASEBKGND hdc:7601294E
<00022> 00830BB8 R WM_ERASEBKGND fErased:True
These are from Spy++.
How do I send using the SendMessage/PostMessage function, using C#?
Edit..
Thank you guys for your replies!
I solved my problem, thanks again!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我尝试将密钥发送到应用程序,并使用 Spy++ 查看消息。
具体来说,我想将箭头键发送到应用程序。从 Spy++ 中,我看到发送了上述消息。在我尝试了一切之后,我在应用程序中发送了以下消息:
现在可以正常工作了!谢谢你们!
I tried to send keys to an application, and I used the Spy++ to see the messages goes to this.
Specifically I wanted to send arrow keys to the application. From the Spy++, I saw that sent the above messages. After I had tried everything, I sent in the application, the below messages:
Now works properly! Thanks guys!
您无法发送与绘制窗口相关的消息。只有系统可以发送它们。如果您需要强制重新绘制,那么您只需调用 InvalidateRect 即可。
您可能可以成功发布计时器消息。
您可能不需要发送 WM_GETDLGCODE 消息,因为它们没有副作用。
You cannot send the messages related to painting the window. Only the system can send them. If you need to force a re-paint then you simply call InvalidateRect.
Timer messages you could probably post successfully.
The WM_GETDLGCODE messages you probably don't need to send since they don't have side effects.