Jump to content

Recommended Posts

Posted (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 by AidanProsser
  • Moderators
Posted (edited)

Look at WinMenuSelectItem in the help file

 

Edit: Because things are slow:

WinMenuSelectItem("[CLASS:Notepad]", "",  "F&ormat", "&Font")
Edited 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!

Posted

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.
  • Moderators
Posted

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!

Posted

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

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...