Jump to content

Access to toolbar with python


Sinnach
 Share

Recommended Posts

Hi,

i'm stuck, anyone can help me?

I try to access to ToolbarWindow32 with python/autoitX combo, but i don't find any solution in help or forum.

Is anyone have an idea,

  • how can i click on Toolbar buttons?
  • how can i ask Tooltip of Toolbar buttons?
  • how can i ask states of Toolbar buttons?
Thank you for your answers:

Sinnach

Link to comment
Share on other sites

From, Stackoverflow:

How to use Autoit COM in python:

In order to call Autoit functions from python using Autoit's COM interface, there are few prerequisites:

  • An installation of python with the appropriate python for windows extentions (pywin32)
  • An full installation of Autoit. (It is possible to only install the COM portion, but it is more involved than a full installation.)

In order to call autoit functions from python, add the following code:

import win32com.client

autoit = win32com.client.Dispatch("AutoItX3.Control")

You can now call autoit functions with the autoit variable.

autoit.Run("NotePad.exe")

autoit.ControlClick(WINDOW, "", "[CLASSNN:TTreeView1]", "left", 1, 53, 41)

Note that not all autoit functions are available through the COM interface. To see which functions are, see the help file on AutoItX. This help file can be found in the start menu at ("AutoIt v3" -> "AutoItX" -> "AutoItX Help File") or in the AutoIt install directory (...AutoIt3AutoItXAutoItX.chm)

----------------------------------------

:bye: Hey there, was I helpful?

----------------------------------------

My Current OS: Win8 PRO (64-bit); Current AutoIt Version: v3.3.8.1

Link to comment
Share on other sites

From, Stackoverflow:

How to use Autoit COM in python:

In order to call Autoit functions from python using Autoit's COM interface, there are few prerequisites:

  • An installation of python with the appropriate python for windows extentions (pywin32)
  • An full installation of Autoit. (It is possible to only install the COM portion, but it is more involved than a full installation.)
In order to call autoit functions from python, add the following code:

import win32com.client

autoit = win32com.client.Dispatch("AutoItX3.Control")

You can now call autoit functions with the autoit variable.

autoit.Run("NotePad.exe")

autoit.ControlClick(WINDOW, "", "[CLASSNN:TTreeView1]", "left", 1, 53, 41)

Note that not all autoit functions are available through the COM interface. To see which functions are, see the help file on AutoItX. This help file can be found in the start menu at ("AutoIt v3" -> "AutoItX" -> "AutoItX Help File") or in the AutoIt install directory (...AutoIt3AutoItXAutoItX.chm)

Thank you for your answare, but i think we missunderstand eachother.

I already build python/autoitX environment, and i can click on almost everithink except Toolbar buttons.

And i know well help files ofc. ;)

So, i explain more specific:

In default autoit the ControlCommand have this parameter: "SendCommandID", Command ID Simulates the WM_COMMAND message. Usually used for ToolbarWindow32 controls - use the ToolBar tab of Au3Info to get the Command ID.

But in autoitX this parameter is missing...

In default autoit there is many user defined _GuiCtrlToolbar_... functions. Those are missing from autoitX.

After this information, can anyone tell me something about my original questions?

  • how can i click on Toolbar buttons?
  • how can i ask Tooltip of Toolbar buttons?
  • how can i ask states of Toolbar buttons?
Thanks

Sinnach

Link to comment
Share on other sites

In default autoit there is many user defined _GuiCtrlToolbar_... functions. Those are missing from autoitX

Because those functions are in-built in Windows Dll's and surely, Python would allow you to call them from there. Furthermore, including these functions in AutoItX would mean increasing the size with unnecessary junk.

----------------------------------------

:bye: Hey there, was I helpful?

----------------------------------------

My Current OS: Win8 PRO (64-bit); Current AutoIt Version: v3.3.8.1

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...