Jump to content

Auto3Lib


PaulIA
 Share

Recommended Posts

I cant start Toolbar.au3

C:\PROGRA~1\AutoIt3\Include\A3LLibrary.au3(50,60) : ERROR: _SendMessage(): undefined function.
  $iPos   = _HiWord(_SendMessage($hWnd, $EM_GETSEL, 0, 0)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
C:\Documents and Settings\Administrator\Desktop\Auto3Lib\Examples\Toolbar.au3 - 1 error(s), 0 warning(s)
You need the latest beta version.

SciTE for AutoItDirections for Submitting Standard UDFs

 

Don't argue with an idiot; people watching may not be able to tell the difference.

 

Link to comment
Share on other sites

_SendMessage was added to Misc.au3 after Auto3Lib was released. I've been trying to stick with the official code release, but I may have to start coding for the betas instead. The problem with the _SendMessage UDF in Misc.au3 is that it doesn't do any error checking, doesn't use a cached DLL handle and I just added code to mine so that you can pass an AutoIt control ID instead of a window handle. ;)

I'll have to think about how to deal with this. For now, just comment out the call in A3LWinAPI.au3 if you need to use Misc.au3.

Sorry to bring back an old subject, but has anyone suggested just improving the version of _SendMessage in Misc.au3 ? I saw gafrost's post saying he was "working on getting some of the functionality into the beta includes", but from the sound of it he was talking about the GUI includes. As PaulIA pointed out, SendMessage is one of the most frequently used API calls. DLL handle cacheing, being able to use control IDs, and having built-in error checks sound like great things to consider adding to the existing function. Is that going to happen?

Also, why didn't PaulIA just rename his _SendMessage function? A Find and Replace or GREP operation could have taken care of the conflict in a few seconds..

All of my software engineering training was with an OO (specifically, Java) bias and I've found that not many of the same design principles seem to apply. With that in mind, I would be interested in learning how more advanced AutoIt users like PaulIA and gafrost make program (or library) design decisions.

Link to comment
Share on other sites

I don't see where caching the DLL handle for user32.dll is really going to do much. If that DLL isn't already loaded into AutoIt you're dead anyway so what's it matter? So using DllCall() without an explicit handle is adding minute overhead of reference counting the DLL up and down (as opposed to loading the DLL into memory which is far more expensive). So I don't think caching the handle is that critical and somebody is going to have to prove it to me with a script showing some significant performance gains before I'll consider that being necessary.

Link to comment
Share on other sites

I don't see where caching the DLL handle for user32.dll is really going to do much. If that DLL isn't already loaded into AutoIt you're dead anyway so what's it matter? So using DllCall() without an explicit handle is adding minute overhead of reference counting the DLL up and down (as opposed to loading the DLL into memory which is far more expensive). So I don't think caching the handle is that critical and somebody is going to have to prove it to me with a script showing some significant performance gains before I'll consider that being necessary.

People do use other DLLs too, though I haven't personally seen any sample scripts using more than 3 or 4. So yes, I'll agree that a valid point. If it's already coded I don't see the harm, but yes, I can see where you didn't go out of your way to do that in the common udf.

I must admit, the error handling is the part I get more excited about.

Edited by sohfeyr
Link to comment
Share on other sites

When in Rome, do as the Romans do...

I pulled the _SendMessage call out of Auto3Lib because it was put in one of the betas and people were getting the error about duplication function declaration. The one in Misc.au3 does the same thing, just without the error checking. It's less hassle this way and programmers always check their function returns, right? ;)

Valik is right about the Dll caching. It only saves a minute amout of time and since AutoIt isn't designed to be a speed demon, it didn't matter in the grand scheme of things.

Auto3Lib: A library of over 1200 functions for AutoIt
Link to comment
Share on other sites

Hi,

after the latest release i see more and more light in the tunnel :lmao: .

But now i want to control a application (trueimage7 - yes i know, it's a old version) and i didn't get

any information about the buttons ...

Maybe anyone have the time to have a look at this?

The trial can be downloaded here : TrueImage 7.0 English

How did i get control of "Create Image"? ;)

Thanks

Dizzy

post-83-1165389309_thumb.jpg

Edited by Dizzy
Link to comment
Share on other sites

Hi,

after the latest release i see more and more light in the tunnel :lmao: .

But now i want to control a application (trueimage7 - yes i know, it's a old version) and i didn't get

any information about the buttons ...

Maybe anyone have the time to have a look at this?

The trial can be downloaded here : TrueImage 7.0 English

How did i get control of "Create Image"? ;)

Thanks

Dizzy

This doesn't appear to be standard system control. Looks like you can probably just move the mouse over the control and click on it with standard AutoIt commands.
Auto3Lib: A library of over 1200 functions for AutoIt
Link to comment
Share on other sites

When in Rome, do as the Romans do...

I pulled the _SendMessage call out of Auto3Lib because it was put in one of the betas and people were getting the error about duplication function declaration. The one in Misc.au3 does the same thing, just without the error checking. It's less hassle this way and programmers always check their function returns, right? ;)

Valik is right about the Dll caching. It only saves a minute amout of time and since AutoIt isn't designed to be a speed demon, it didn't matter in the grand scheme of things.

Hi Paul what is _SendMessage called in the betas

thanks beau

Link to comment
Share on other sites

Hi PaulIa,

I am working on a script that scans e-mail messages in a PST file via Outlook COM. I have been struggling with trying to get the script to "communicate" with dialog boxes that appear when I access encrypted messages (for background refer to this thread in Support). I am now encountering similar issues when trying to work with properties of MailItems as an Outlook security pop-up appears which I can click on manually but again I am not having success trying to use ControlFocus/ControlClick etc.

Came across this thread in my search for an alternative approach to "communicating" with these dialog boxes, in post #23 - 25 there is a conversation about popups that seems similar to my issue. There is also a later reference to A3LWinSDK.

I would appreciate if you could offer some general comments as to whether Auto3Lib might be able to work with the Outlook pop-up's where the standard AU3 Control functions don't seem to, and if so, which UDF's I should be concentrating on. I am not after a "solution", am happy to work on figuring that out for myself. But as I have already spent some time trying to figure out this problem with the dialog boxes, I don't want to delve into Auto3Lib at the moment unless it has some functions that are potientially applicable to my problem.

So if Auto3Lib is an option for me - that's great - a couple of pointers on things to try would be really helpful.

In any event, have to say that your library appears to offer an extensive range of functions.

Thanks

VW

Link to comment
Share on other sites

Hi PaulIa,

I am working on a script that scans e-mail messages in a PST file via Outlook COM. I have been struggling with trying to get the script to "communicate" with dialog boxes that appear when I access encrypted messages (for background refer to this thread in Support). I am now encountering similar issues when trying to work with properties of MailItems as an Outlook security pop-up appears which I can click on manually but again I am not having success trying to use ControlFocus/ControlClick etc.

Came across this thread in my search for an alternative approach to "communicating" with these dialog boxes, in post #23 - 25 there is a conversation about popups that seems similar to my issue. There is also a later reference to A3LWinSDK.

I would appreciate if you could offer some general comments as to whether Auto3Lib might be able to work with the Outlook pop-up's where the standard AU3 Control functions don't seem to, and if so, which UDF's I should be concentrating on. I am not after a "solution", am happy to work on figuring that out for myself. But as I have already spent some time trying to figure out this problem with the dialog boxes, I don't want to delve into Auto3Lib at the moment unless it has some functions that are potientially applicable to my problem.

So if Auto3Lib is an option for me - that's great - a couple of pointers on things to try would be really helpful.

In any event, have to say that your library appears to offer an extensive range of functions.

Thanks

VW

Auto3Lib has several functions that deal with capturing and manipulating popup menus and context menus. I think what you are talking about is just a standard dialog with buttons on it. There is nothing special in Auto3Lib for this as you should be able to do this using standard AutoIt commands. I've taken a look at the thread that you referenced and the approach that you are taking is correct, though you may need to put more debugging in to find where things are going wrong. If you want a second pair of eyes to look over the code, PM or email me what you have and I'll take a look.
Auto3Lib: A library of over 1200 functions for AutoIt
Link to comment
Share on other sites

@PaulIa

A second set of eyes would be great, I will PM you the latest version which does not close a standard Outlook dialog box when the script tries to access certain message properties. The symptoms with the PGP dialog box are identical so with any luck whatever approach works for the Outlook dialog box will also work for the PGP. I'm interested in your comments about the debug code, I had added as much as I could think of to the WhackDialog function so will be interested to see what else I could have considered.

Thank you

VW

Link to comment
Share on other sites

@PaulIa

A second set of eyes would be great, I will PM you the latest version which does not close a standard Outlook dialog box when the script tries to access certain message properties. The symptoms with the PGP dialog box are identical so with any luck whatever approach works for the Outlook dialog box will also work for the PGP. I'm interested in your comments about the debug code, I had added as much as I could think of to the WhackDialog function so will be interested to see what else I could have considered.

Thank you

VW

Since I've seen your full code, I think you're OK with the debug statements that you're using. Hope my analysis of your problem was helpful.
Auto3Lib: A library of over 1200 functions for AutoIt
Link to comment
Share on other sites

Ok ,so I now use the Auto beta because of _SendMessage, only thing is another part is not working now... :P

$rRect = _DllStructCreate(&RECT)
gives an error of Unknown function name.

2015 - Still no flying cars, instead blankets with sleeves.

Link to comment
Share on other sites

Ok ,so I now use the Auto beta because of _SendMessage, only thing is another part is not working now... :P

$rRect = _DllStructCreate(&RECT)
gives an error of Unknown function name.

change to:

$rRect = DllStructCreate($RECT)
Edited by gafrost

SciTE for AutoItDirections for Submitting Standard UDFs

 

Don't argue with an idiot; people watching may not be able to tell the difference.

 

Link to comment
Share on other sites

Here is my problem :

I want to acess to a specific subdirectory ex: c:\mes documents\statististiques and after choosing a file

Control are SysTreeView32 and SysListView32 and i don't know how to begin to program it. I try with that

CODE
#include <A3LTreeView.au3>

Run("c:\windows\explorer.exe")

_WinWaitActive("Mes documents")

$hTree = ControlGetHandle("Mes documents", "", "SysTreeView321")

$hNext = _TreeView_GetRoot($hTree)

while $hNext <> 0

TreeView_ClickItem($hTree, $hNext, "left")

$hNext = _TreeView_GetNext($hTree, $hNext)

Sleep(1000)

wend

Exit

But the problem is that's code allow me to view all item but what i want is to select only one and after opening a sub directory and after choosing a file and i don't know how to do?

Edited by LOULOU
Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
 Share

  • Recently Browsing   0 members

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