r0ash Posted July 19, 2017 Posted July 19, 2017 (edited) Hey guys, MattDiesel over Stackoverflow mentioned this beautiful piece of code #include <WindowsConstants.au3> #include <WinAPI.au3> Local $IDM_FONT = 33 Local $hWindow = WinGetHandle("Untitled - Notepad") _WinAPI_PostMessage($hWindow, $WM_COMMAND, $IDM_FONT, 0) Local $hFontWin = WinWait("Font") $select = ControlCommand($hFontWin, "", "ComboBox1", "GetCurrentSelection", "") WinClose($hFontWin) MsgBox(0,"", $select) I realized that _WinAPI_PostMessage can trigger menu click event, even if Notepad is minimized. How do we know what is the decimal value of *any menu item or sub-menu item*? How we know "Format > Font" menu-item is 33 as wParam to _WinAPI_PostMessage()? Have a look at snapshot. Regards. Edited July 19, 2017 by r0ash typo + tags addition
junkew Posted July 19, 2017 Posted July 19, 2017 (edited) For that you have to look in Win32 API SDK or SPY++ see for example https://www.codeproject.com/Tips/1029254/SendMessage-and-PostMessagehttps://www.codeproject.com/Articles/33459/Spying-Window-Messages-from-the-Inside Edited July 19, 2017 by junkew r0ash 1 FAQ 31 How to click some elements, FAQ 40 Test automation with AutoIt, Multithreading CLR .NET Powershell CMDLets
r0ash Posted July 21, 2017 Author Posted July 21, 2017 (edited) Thanks a bunch @junkew I am using Spy++ tool for the first time, I am unable to log messages, watch, do you think I am missing something? Unable to display content. Adobe Flash is required. Edited July 21, 2017 by r0ash
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now