如何使用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中,您可以使用 ^ ]

在Windows XP中,您可以使用 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.