Answer the question
In order to leave comments, you need to log in
How to change the main menu in the application through win32api?
Good afternoon!
There is a task: to change the menu in win application. As an example, I took a notepad, learned how to enter text into it through win32api.
We also managed to get the menu handle and count the number of items.
But how to get the text (name) of this menu itself?
Get subitems and click on them?
I use python3.7 and the win32api library for this.
Tell me, please, in which direction to dig?
Answer the question
In order to leave comments, you need to log in
Click on the menu. This is a C# analog in python, look at the likeness.
[DllImport("user32.dll")]
public static extern IntPtr PostMessage(IntPtr hWnd, Message msg, int wParam, int lParam);
PostMessage(handle, WM_COMMAND, 2, 0); // File->New subtitle
PostMessage(handle, WM_COMMAND, 3, 0); // File->New from clipboard
PostMessage(handle, WM_COMMAND, 5, 0); // File->Open text or subtitle
PostMessage(handle, WM_COMMAND, 6, 0); // File->Open video
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question