Jump to content

Auto3Lib


PaulIA
 Share

Recommended Posts

Thx for the feedback...I wonder how much effort it would be to write an exe that would , given a message file, build the appropriate dll to register

I guess I could punt, and write a syslog implementation, but I would love to be able to natively integrate with full Windows event log capability.

I'm wondering why you need a unique source? Just use the Application source. Bill won't mind. :)
Auto3Lib: A library of over 1200 functions for AutoIt
Link to comment
Share on other sites

Paul,

I just ran a test script to see whether I installed all these new versions correctly. The script ran, but AU3Check gave a lot of warnings like this:

>Running AU3Check (1.54.7.0)  from:C:\Program Files\AutoIt3\SciTE\..
C:\PROGRA~1\AutoIt3\Include\A3LWinAPI.au3(297,71) : WARNING: $GENERIC_EXECUTE: possibly used before declaration.
  if BitAND($iAccess, 1) <> 0 then $iDA = BitOR($iDA, $GENERIC_EXECUTE)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^

When I went looking for the $GENERIC_EXECUTE constant in the files, I indeed could not find it.

The question is - is the def for this missing or did I screw something up installing A3L?

Thanks for the help!

Charles

Link to comment
Share on other sites

Paul,

I just ran a test script to see whether I installed all these new versions correctly. The script ran, but AU3Check gave a lot of warnings like this:

>Running AU3Check (1.54.7.0)  from:C:\Program Files\AutoIt3\SciTE\..
C:\PROGRA~1\AutoIt3\Include\A3LWinAPI.au3(297,71) : WARNING: $GENERIC_EXECUTE: possibly used before declaration.
  if BitAND($iAccess, 1) <> 0 then $iDA = BitOR($iDA, $GENERIC_EXECUTE)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^

When I went looking for the $GENERIC_EXECUTE constant in the files, I indeed could not find it.

The question is - is the def for this missing or did I screw something up installing A3L?

Thanks for the help!

Charles

Your output looks very similar to the one I had with Microsoft Vista running "non-english":

"C:\Program Files\AutoIt3\" is a different path than "C:\PROGRA~1\AutoIt3\" .

The problem IMHO lies in Microsoft's virtualisation - here in the virtualisation of paths (they also have a virtualisation of other stuff). I tried for quite a while to solve these problems, but in the end made my Vista computer dual-bootable and now only develop Autoit stuff under XP.

As you might have observed, as much as you change the code under Scite, the changes never show their results - because the file being edited is not the one residing on the virtual path (where Vista allows edits), which is the one being compiled.

Someone had given me the hint about setting AutoIt3Dir to $(SciteDefaultHome)\.. in the SciTE configuration, but that only solved the path/mixup problem, not really the "editing one script, but compiling a different one" part.

I hope I'm wrong!

Link to comment
Share on other sites

I've been searching for a function to get whether listbox item is checked for a CUSTOMDRAW listbox (it is not a CHECKLISTBOX). I've failed, so I had to write my own functions. Maybe you would consider modify it (my code is pretty lame) and include into distributive, so anyone could use it for good.

#cs
# A3LListboxAdd.au3
# Copyrights are not necessary
#ce
#include <A3LListbox.au3>

Func _Listbox_SetItemChecked( $hWnd, $hListbox, $idxItem, $bCheck = True, $color = 0x000000 )
  $bState = _Listbox_GetItemChecked( $hWnd, $hListbox, $idxItem, $color )
  If ( $bCheck and not $bState ) or ( not $bCheck and $bState ) Then 
    ControlSend ( $hWnd, "", $hListbox, "{SPACE}" )
  EndIf
  Return ( not $bState )
EndFunc

Func _Listbox_GetItemChecked( $hWnd, $hListbox, $idxItem, $color = 0x000000 )
  Local $aMargins[4]
  $aMargins[0] = 4
  $aMargins[1] = 6
  $aMargins[2] = 4
  $aMargins[3] = 2
  _Listbox_ClickItem( $hListbox, $idxItem )
  AutoItSetOption( "PixelCoordMode", 2 )
  $aRectListbox = ControlGetPos( $hWnd, "", $hListbox )
  $aRectItem = _Listbox_GetItemRect( $hListbox, $idxItem )
  Local $aItem[4]
  $aItem[0] = $aRectListbox[0] + $aMargins[0]
  $aItem[1] = $aRectListbox[1] + ( $aRectItem[3] - $aRectItem[1] ) + $aMargins[1]
  $aItem[2] = $aRectListbox[0] + $aRectItem[1] - $aMargins[2]
  $aItem[3] = $aRectListbox[1] + $aRectItem[3] - $aMargins[3]
  $aCoords = PixelSearch( $aItem[0], $aItem[1], $aItem[2], $aItem[3], $color )
  If not @error Then
    Return True
  EndIf
  Return False
EndFunc
Link to comment
Share on other sites

Paul,

I just ran a test script to see whether I installed all these new versions correctly. The script ran, but AU3Check gave a lot of warnings like this:

>Running AU3Check (1.54.7.0)  from:C:\Program Files\AutoIt3\SciTE\..
C:\PROGRA~1\AutoIt3\Include\A3LWinAPI.au3(297,71) : WARNING: $GENERIC_EXECUTE: possibly used before declaration.
  if BitAND($iAccess, 1) <> 0 then $iDA = BitOR($iDA, $GENERIC_EXECUTE)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^

When I went looking for the $GENERIC_EXECUTE constant in the files, I indeed could not find it.

The question is - is the def for this missing or did I screw something up installing A3L?

Thanks for the help!

Charles

This must be a bug in AU3Check. The constant $GENERIC_EXECUTE is defined in A3LConstants. A3LWinAPI includes A3LSecurity, which includes A3LLibray, which includes A3LConstants. If you write a small script and put this at the top:

#include <A3LConstants.au3>
#include <A3LWinAPI.au3>

You'll see that AU3Check is happy. I'd say your installation is find.

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

@flyingboz

Regarding making a Custom EventLog you can use either a Script or a tool called EventCreate.exe in XP.

For the first one use this (not tested)

; Creates a custom event log named Scripts.

Const $NO_VALUE = ""

$WshShell = ObjCreate("WScript.Shell")
$WshShell.RegWrite "HKLM\System\CurrentControlSet\Services\EventLog\Scripts\", $NO_VALUE

For the second option look in my signature for my SMART analysis scritps.

regards

ptrex

Edited by ptrex
Link to comment
Share on other sites

@flyingboz

Regarding making a Custom EventLog you can use either a Script or a tool called EventCreate.exe in XP.

For the first one use this (not tested)

; Creates a custom event log named Scripts.

Const $NO_VALUE = ""

$WshShell = ObjCreate("WScript.Shell")
$WshShell.RegWrite "HKLM\System\CurrentControlSet\Services\EventLog\Scripts\", $NO_VALUE

For the second option look in my signature for my SMART analysis scritps.

regards

ptrex

He wants to create an event source, which requires that you register a DLL that contains the event source message templates. Creating the registry entries for a new event source is not the problem. He wants to know how to create the message DLL, which is outlined in the MSDN link that I referred him to.
Auto3Lib: A library of over 1200 functions for AutoIt
Link to comment
Share on other sites

Found your library, and used it for the first time after struggling with some automated test cases for list boxes for quite some time. I gotta say, you da man, PaulIA!

Welcome to the forum. And thank you. :)
Auto3Lib: A library of over 1200 functions for AutoIt
Link to comment
Share on other sites

Hi, I become this Error:

C:\PROGRA~1\AutoIt3\Include\A3LTabControl.au3(851,45) : ERROR: syntax error

DllStructSetData($tItem, "Text", pBuffer)

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^

$handle = ControlGetHandle("[CLASS:#32770]", "", "SysTabControl32")
$Tab_Count = _Tab_GetCount($handle)
MsgBox(0, '', $Tab_Count)

regards

Frank

Link to comment
Share on other sites

Hi,

I would dearly like to be able to use the AutoIt3lib funcs, but have had no success;

Here are 2 errors for instance [from the example files] so I have neber been able to see how the LV functions work?

C:\Program Files\AutoIt3\Include\A3LWinAPI.au3 (1810) : ==> Variable must be of type "Object".: 
$iPID    = $tPID.ID 
$iPID    = $tPID^ ERRORoÝ÷ Ù«­¢+ØÐíIÕ¹¹¥¹è ̸ȸиȤéèÀäÈíAɽɴ¥±ÌÀäÈíÕѽ%ÐÌÀäÈíÕѽ¥Ð̹áÅÕ½ÐíèÀäÈíAɽɴ¥±ÌÀäÈíÕѽ%ÐÌÀäÈíÕѼÍ1¥ÀäÈí1¥ÍÑY¥ÜĹÔÌÅÕ½Ðì)èÀäÈíAɽɴ¥±ÌÀäÈíÕѽ%ÐÌÀäÈí%¹±ÕÀäÈíÍ11¥ÍйÔÌ ÌÔà¤èôôÐìYÉ¥±µÕÍнÑåÁÅÕ½Ðí=©ÐÅÕ½Ðì¸è(ÀÌØíM¥élÁtôÀÌØíÑA½¥¹Ð¹`(ÀÌØíM¥élÁtôÀÌØíÑA½¥¹ÑxII=
Is this an installation problem , or are the example files just not working?

Best, randall

Link to comment
Share on other sites

Hi,

I would dearly like to be able to use the AutoIt3lib funcs, but have had no success;

Here are 2 errors for instance [from the example files] so I have neber been able to see how the LV functions work?

C:\Program Files\AutoIt3\Include\A3LWinAPI.au3 (1810) : ==> Variable must be of type "Object".:
Is this an installation problem , or are the example files just not working?

Best, randall

You are not using the latest release of Auto3Lib. The structure dot notation was removed from Auto3Lib in version 4.0.0 due to "somebody" removing it from AutoIt. :) Uninstall what ever version of Auto3Lib you currently have and then install the latest version from the the link in the first post of this thread. Edited by PaulIA
Auto3Lib: A library of over 1200 functions for AutoIt
Link to comment
Share on other sites

Hi, thanks;

Uninstall what ever version of Auto3Lib you currently have

I would like to try to get it right this time1; I thought it was being installed with AutoIt installer now? - (wrong?)

Is there an "uninstall" option in Windows installed programs/ or an uninstall program to run?;

Or do I just delete directories/ files?

thanks, randall

Link to comment
Share on other sites

Hi again,

I cannot follow the instructions in your installer, as it wants me to download the beta zip file of AutoIt when I am only installling to the distribution release directory?... Is that just an error or am I really confused?

If you only have the distribution release of AutoIt installed and are not interested in switching back and forth between the distribution release and beta release of AutoIt, installation is fairly straight foward:

1. Make sure you uninstall any prior versions of Auto3Lib from your machine

2. Download the latest beta zip file from the AutoIt web site

Randall
Link to comment
Share on other sites

Hi again,

I cannot follow the instructions in your installer, as it wants me to download the beta zip file of AutoIt when I am only installling to the distribution release directory?... Is that just an error or am I really confused?

Randall

The read me in the installer was to remind people to download the latest version of AutoIt, which usually is a beta version. At this point in AutoIt history, it's the distribution release. If you've already got the latest version of AutoIt installed in the "C:\Program Files\AutoIt3" directory, just run the Auto3Lib installer and accept the default installation directory.
Auto3Lib: A library of over 1200 functions for AutoIt
Link to comment
Share on other sites

I get too error, but with pipes:

D:\Program Files\AutoIt3\Auto3Lib\Pipes\Server.au3 (156) : ==> Variable must be of type "Object".:

if not ExecuteCmd($tBuffer.Text) then

if not ExecuteCmd($tBuffer^ ERROR

And i use latest Auto3Lib and autoit3....

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