如何使用SendMessage弹出菜单 [英] How popup menu using SendMessage

查看:213
本文介绍了如何使用SendMessage弹出菜单的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在一个项目上,我想弹出记事本的文件菜单
使用SendMessage
非常紧急,请帮助.

i am working on a project and i want to pop up file menu of notepad
using SendMessage
IT''S VERY URGENT PLEASE HELP.

推荐答案

您可以使用文件"菜单项ID向WM_COMMAND消息发送消息,否则将"Alt"和"F"键序列发送到记事本窗口.

我认为您应该在发布问题之前先尝试使用GOOGLE.:)
You can SendMessage the WM_COMMAND message with ''File'' menu item ID or else send the ''Alt'' + ''F'' key sequence to the Notepad Window.

I think you should have tried GOOGLE before posting the question. :)


在Windows 7中,您可以使用 FindWindow [ ^ ]以获得一个记事本窗口的句柄,然后(如另一个解决方案所建议的那样),SendMessage(notepad_hwnd,...);

另请参阅:重新确定有关WM_COMMAND消息的明显内容 [ ^ ]
In Windows 7, you can use the Automation API[^]

In Windows XP, you can use FindWindow[^] to get a handle to the Notepad window, then (as the other solution suggests), SendMessage( notepad_hwnd, ... );

See also: Restating the obvious about the WM_COMMAND message[^]


谢谢大家.
但是我想单击文件菜单,然后从中选择菜单项
全部使用sendmessage或postmessage.
thank you all.
But I want to click on file menu and then select menu item from it
this all by using sendmessage or postmessage.


这篇关于如何使用SendMessage弹出菜单的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆