AidanProsser Posted June 18, 2014 Share Posted June 18, 2014 (edited) Hey, this is probably something very trivial to someone with more experience, but how would i select "format" , then "font" then change the size of the font, when using notepad? I have been able to run notepad etc but i cannot find the information to control click any item on the toolbar. Edited June 18, 2014 by AidanProsser Link to comment Share on other sites More sharing options...
Moderators JLogan3o13 Posted June 18, 2014 Moderators Share Posted June 18, 2014 (edited) Look at WinMenuSelectItem in the help file Edit: Because things are slow: WinMenuSelectItem("[CLASS:Notepad]", "", "F&ormat", "&Font") Edited June 18, 2014 by JLogan3o13 "Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball How to get your question answered on this forum! Link to comment Share on other sites More sharing options...
AidanProsser Posted June 18, 2014 Author Share Posted June 18, 2014 (edited) oh ty, by the way.. how do u find the names of the menu items? .. my AutoIt Window Info doesnt seem to work on notepad Edited June 18, 2014 by AidanProsser Link to comment Share on other sites More sharing options...
jdelaney Posted June 18, 2014 Share Posted June 18, 2014 Example of looping through all menu items #include <GuiMenu.au3> Run("notepad.exe") $hwnd = WinWait("[CLASS:Notepad]") $iCounter = 0 $hParent = _GUICtrlMenu_GetMenu($hwnd) RecursiveMenuItems($hParent) Func RecursiveMenuItems($hMenu) $iCounter +=1 For $i = 0 To _GUICtrlMenu_GetItemCount($hMenu) ConsoleWrite(StringFormat("%" & $iCounter & "s","") & _GUICtrlMenu_GetItemText($hMenu,$i) & @CRLF) RecursiveMenuItems(_GUICtrlMenu_GetItemSubMenu($hMenu, $i)) Next $iCounter -=1 EndFunc IEbyXPATH-Grab IE DOM objects by XPATH IEscriptRecord-Makings of an IE script recorder ExcelFromXML-Create Excel docs without excel installed GetAllWindowControls-Output all control data on a given window. Link to comment Share on other sites More sharing options...
Moderators JLogan3o13 Posted June 18, 2014 Moderators Share Posted June 18, 2014 Basically any underlined, or key-combo enabled item, is available (ALT + F for File, Alt + H for help, etc.). As pointed out in the helpfile, the & symbol would go where before the underline char, so File becomes &File and Format becomes F&ormat. "Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball How to get your question answered on this forum! Link to comment Share on other sites More sharing options...
AidanProsser Posted June 19, 2014 Author Share Posted June 19, 2014 hmm, yes but in my notpad, no letters in any menu item are underlined, so in the previous example code, i dont understand why there are things like : "F&ormat" ? .. when the "o" is not underlined in my notepad Link to comment Share on other sites More sharing options...
Solution jdelaney Posted June 19, 2014 Solution Share Posted June 19, 2014 (edited) Open the menu with the "Alt" key, to see the underlines. Edited June 19, 2014 by jdelaney IEbyXPATH-Grab IE DOM objects by XPATH IEscriptRecord-Makings of an IE script recorder ExcelFromXML-Create Excel docs without excel installed GetAllWindowControls-Output all control data on a given window. Link to comment Share on other sites More sharing options...
AidanProsser Posted June 20, 2014 Author Share Posted June 20, 2014 ah, thanks a lot ! xD Link to comment Share on other sites More sharing options...
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