Sign in to follow this  
Followers 0
AidanProsser

HELP - Notepad.

8 posts in this topic

#1 ·  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

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

Look at WinMenuSelectItem in the help file

 

Edit: Because things are slow:

WinMenuSelectItem("[CLASS:Notepad]", "",  "F&ormat", "&Font")
Edited by JLogan3o13

√-1 2^3 ∑ π, and it was delicious!

Share this post


Link to post
Share on other sites

#3 ·  Posted (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 by AidanProsser

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

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.


√-1 2^3 ∑ π, and it was delicious!

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

#7 ·  Posted (edited)

Open the menu with the "Alt" key, to see the underlines.

Edited 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.

Share this post


Link to post
Share on other sites

ah, thanks a lot ! xD

Share this post


Link to post
Share on other sites

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
Sign in to follow this  
Followers 0