Sign in to follow this  
Followers 0
Astinov

Activate menu items in a ribbon

3 posts in this topic

#1 ·  Posted (edited)

I am new to AutoIt. Trying to activate the "Resize" menu item in MS Paint but with no success. I am using Windows 8.1 Enterrpise and Paint.exe is with a ribbon UI. Anybody help...

Here is my (stupid) code:

=====================================

#include <MsgBoxConstants.au3>


$WinName = "[CLASS:MSPaintApp]"


    ; Test if the window exists and display the results.
    ;If WinExists("[CLASS:MSPaintApp]") Then

   If WinExists($WinName) Then
        MsgBox($MB_SYSTEMMODAL, "", "Window exists")
    Else
        MsgBox($MB_SYSTEMMODAL, "", "Window does not exist")
    EndIf

WinActivate($WinName)


$Result = WinMenuSelectItem($WinName, "", "&Home", "Resize")

;Send ("^W", flag = 0)
;Send ("!f")


sleep (5000)

============ and here is the "Resize" function, which I want to activate

Edited by Astinov

Share this post


Link to post
Share on other sites



Send("{CTRLDOWN}W{CTRLUP}") will activate the menu


Get Scite to add a popup when you use a 3rd party UDF -> http://www.autoitscript.com/autoit3/scite/docs/SciTE4AutoIt3/user-calltip-manager.html

Share this post


Link to post
Share on other sites

Tx computergroove, but still no effect. The script works correctly till the line

WinActivate($WinName)

I inserted your code after this line but...

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