Sign in to follow this  
Followers 0
Sinnach

Access to toolbar with python

5 posts in this topic

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

Share this post


Link to post
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

Share this post


Link to post
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

Share this post


Link to post
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

Share this post


Link to post
Share on other sites

Functions that start with _ are user defined functions. You can recode them in other languages. They aren't part of AutoIt at all, just user submitted stuff that is written in AutoIt.

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