Jump to content

Recommended Posts

Posted

Update:

I've been working on merging his libraries into the UDFs.

All except the WinAPI have working examples for each function

The Includes for the above including the constants, structures etc... files

...

Now I have to go back thru, look for type-o's, and extra code in the examples, double check to make sure all are working correctly.

Then I should be able to submit them.

Gary

Great Gary.

I only wonder about including the constants.

This may be problem when they are declared in Auto3Lib already.

Auto3Lib is not updated anymore as far as I know so take a mind on that please.

Thanks for your great UDF work!!

Posted

Great Gary.

I only wonder about including the constants.

This may be problem when they are declared in Auto3Lib already.

Auto3Lib is not updated anymore as far as I know so take a mind on that please.

Thanks for your great UDF work!!

Constants will be done, I've been modifying the a3l files at the same time, so when things are done, should be able to post a zip file with the a3l files for those that need them.

SciTE for AutoItDirections for Submitting Standard UDFs

 

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

 

Posted

amazing work you did

but, i think that all of our scripts developed with the library will have to be recoded ?

callback, udf for dllcall, mmm why not chosing autoit ?

-- Arck System _ Soon -- Ideas make everything

"La critique est facile, l'art est difficile"

Projects :

[list] [*]Au3Service : Run your exe as service V3 / Updated 29/07/2013 Get it Here [/list]
Posted

amazing work you did

but, i think that all of our scripts developed with the library will have to be recoded ?

callback, udf for dllcall, mmm why not chosing autoit ?

Nope, won't have to re-do your scripts done with the library

The merged functions have new names so as to not collide with the current ones.

Also the old udf functions will be depricated but still functional.

SciTE for AutoItDirections for Submitting Standard UDFs

 

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

 

Posted

Update:

I've been working on merging his libraries into the UDFs.

Here's what I have done so far (including documentation):

  • ComboBox (added 15 functions, re-worked existing functions)
  • ComboBoxEx (http://www.autoitscript.com/fileman/users/gafrost/new4a.gif 65 functions, see pic below)
  • DateTime Picker
  • Edit (added 19 functions, re-worked existing functions)
  • Image Lists
  • IPAddress (added 4 functions, re-worked existing functions)
  • ListBox (added 20 functons, re-worked existing functions)
  • ListView (added 11 functions, re-worked existing functions)
  • MonthCal (added 35 functions, re-worked existing functions)
  • StatusBar (added 9 functions, re-worked existing functions)
  • Tab (added 26 functions, re-worked existing functions)
  • WinAPI
The Includes for the above including the constants, structures etc... files

Posted Image

Good work Gary. Just before I left home I noticed that _GUIStatusBarSetBKColor() (I think that's the function name) wasn't working so you might want to take a look at that while you're att it.

Keep up the great work.

George

Question about decompiling code? Read the decompiling FAQ and don't bother posting the question in the forums.

Be sure to read and follow the forum rules. -AKA the AutoIt Reading and Comprehension Skills test.***

The PCRE (Regular Expression) ToolKit for AutoIT - (Updated Oct 20, 2011 ver:3.0.1.13) - Please update your current version before filing any bug reports. The installer now includes both 32 and 64 bit versions. No change in version number.

Visit my Blog .. currently not active but it will soon be resplendent with news and views. Also please remove any links you may have to my website. it is soon to be closed and replaced with something else.

"Old age and treachery will always overcome youth and skill!"

Posted

Hi,

I am trying to work with a Control which I believe to be a ListBox, a screenshot can be found here

I want to be able to click on either the entry for C:\ or D:\ - once I understand how to do that I can write logic around that.

As the following code did not return a result of -1 (value 0 is returned), I thought the ListBox routines might work with this control.

$hListBox = ControlGetHandle("Restore Wizard", "", 102)
$iIndex = _ListBox_FindText($hListBox,"C:\")
If $iIndex = -1 Then
; No Match
Else    
_ListBox_ClickItem($hListBox,$iIndex)
EndIf

However the _ListBox_ClickItem code clicks on the "+" next to drive rather than the box adjacent to the C:\

I then tried a loop to see what would happen if I used different index values

#include <A3LListbox.au3>
$hListBox = ControlGetHandle("Restore Wizard", "", 102)
For $iIndex = 0 To 5
     _ListBox_ClickItem($hListBox,$iIndex)
     MsgBox(0,"Index",$iIndex)
    _ListBox_ClickItem($hListBox,$iIndex)
Next

Depending of the value of $iIndex again the "+" next to one of the drives is clicked rather than any of boxes next to the destination partitions.

Suggestions on things to try would be helpful.

Thanks

VW

Posted (edited)

Hi,

I am trying to work with a Control which I believe to be a ListBox, a screenshot can be found here

I want to be able to click on either the entry for C:\ or D:\ - once I understand how to do that I can write logic around that.

As the following code did not return a result of -1 (value 0 is returned), I thought the ListBox routines might work with this control.

$hListBox = ControlGetHandle("Restore Wizard", "", 102)
$iIndex = _ListBox_FindText($hListBox,"C:\")
If $iIndex = -1 Then
; No Match
Else    
_ListBox_ClickItem($hListBox,$iIndex)
EndIf

However the _ListBox_ClickItem code clicks on the "+" next to drive rather than the box adjacent to the C:\

I then tried a loop to see what would happen if I used different index values

#include <A3LListbox.au3>
$hListBox = ControlGetHandle("Restore Wizard", "", 102)
For $iIndex = 0 To 5
     _ListBox_ClickItem($hListBox,$iIndex)
     MsgBox(0,"Index",$iIndex)
    _ListBox_ClickItem($hListBox,$iIndex)
Next

Depending of the value of $iIndex again the "+" next to one of the drives is clicked rather than any of boxes next to the destination partitions.

Suggestions on things to try would be helpful.

Thanks

VW

Look at _Listbox_ClickItem() sources.

There is called _Listbox_GetItemRectEx() and then is clicked in this area (probably left top corner point).

So make your modified version which will click in centre of item rect.

Func _Listbox_ClickItem($hWnd, $iIndex, $sButton="left", $bMove=False, $iClicks=1, $iSpeed=0, $bPopupScan=False)
  Local $iX, $iY, $tPoint, $tRect

  $tRect  = _Listbox_GetItemRectEx($hWnd, $iIndex)
  $tPoint = _Lib_PointFromRect($tRect) ; at this line make your change ...
  $tPoint = _API_ClientToScreen($hWnd, $tPoint)
  _Lib_GetXYFromPoint($tPoint, $iX, $iY)
  _Lib_MouseClick($sButton, $iX, $iY, $bMove, $iClicks, $iSpeed, $bPopupScan)
EndFunc
Edited by Zedna
Posted

Look at _Listbox_ClickItem() sources.

There is called _Listbox_GetItemRectEx() and then is clicked in this area (probably left top corner point).

So make your modified version which will click in centre of item rect.

@Zedna

Thanks for your tip, I would not have thought of that, I will keep that in mind.

I have done some further testing and realise that there is another issue and that is that _ListBox_FindText is not matching the text correctly or at least not returning the correct value.

If I substitute "D:\" instead of "C:\" in the initial code snippet

$hListBox = ControlGetHandle("Restore Wizard", "", 102)
$iIndex = _ListBox_FindText($hListBox,"C:\")
If $iIndex = -1 Then
; No Match
Else    
_ListBox_ClickItem($hListBox,$iIndex)
EndIf

then I would expect that the $iIndex value returned should be different, however it is not.

Any ideas?

VW

Posted

I have a possibly rather simple question that I hope someone can answer. I really don't want the code written for me, only a pointer in the right direction.

I have a program that we use at work, that is completely inaccesible to others or I would share a link, etc. It is a web based system for entering employee evaluations. I am automating the time consuming entry of these evaluations into the system using the IE library and A3L. All was great until I stumbled upon a treeview control that seems to be custom that I cannot find any information on anywhere and of course the treeview functions withing A3L do not work for it.

You may see all the control details here: My Forum Post (Unanswered)

So in order to work around this I have taken it upon myself to create some functions based off the A3L treeview ones. I have found myself stuck however in one particular area even after many hours of internet searching. That area is where SendMessage is used to actually get info to/or to control the control. First a couple of excerpts:

From A3LTreeview.au3

Func _TreeView_GetCount($hWnd, $hNode=0)
  Local $hNext, $iResult

  if $hNode = 0 then
    $iResult = _API_SendMessage($hWnd, $TVM_GETCOUNT, 0, 0)
  else
    $iResult = 0
    $hNext   = _TreeView_GetFirstChild($hWnd, $hNode)
    while $hNext <> 0
      $iResult = $iResult + 1
      $hNext   = _Treeview_GetNextChild($hWnd, $hNext)
    wend
  endif
  Return $iResult
EndFuncoÝ÷ ØkiÇIéÝ1ë,jiÉ- 
ËZ)À

Again, someassistance would be much appreciated. A detailed description, a tutorial link, a list of links to 10 different sites to read up at...any would be very helpful and once again.

Posted

Escuse me, Can I resize an image with auto3lib?

Thnk in advance. :)

Yes.

Have a look at the zoom.au3 example in the Auto3lib\GDI+ folder

Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script.
Posted

Sorry, but I don't understand.

I write this:

#include <A3LGDIPlus.au3>
#include <A3LScreenCap.au3>
_ScreenCap_Capture("C:\image.bmp", 0, 0, 400, 300)

; Create a GUI for the original image
$hGUI1 = GUICreate("Original", 400, 300, 0,   0)
GUISetState()

; Create a GUI for the zoomed image
$hGUI2 = GUICreate("Zoomed"  , 400, 300, 0, 400)
GUISetState()

; Initialize GDI+ library and load image
_GDIP_Startup()
$hImage = _GDIP_ImageLoadFromFile("C:\image.bmp")

; Draw original image
$hGraphic1 = _GDIP_GraphicsCreateFromHWND($hGUI1)
_GDIP_GraphicsDrawImage($hGraphic1, $hImage, 0, 0)

; Draw 2x zoomed image
$hGraphic2 = _GDIP_GraphicsCreateFromHWND($hGUI2)
_GDIP_GraphicsDrawImageRectRect($hGraphic2, $hImage, 0, 0, 200, 200, 0, 0, 50, 50)
$sCLSID = _GDIP_EncodersGetCLSID("JPG")

_GDIP_ImageSaveToFileEx($hImage, "C:\A3LImage.jpg", $sCLSID)

; Shut down GDI+ library
_GDIP_ShutDown()

To reduce an image I use _GDIP_GraphicsDrawImageRectRect? But how can I save it?

A lan chat (Multilanguage)LanMuleFile transferTank gameTank 2 an online game[center]L'esperienza è il nome che tutti danno ai propri errori.Experience is the name everyone gives to their mistakes.Oscar Wilde[/center]
Posted

Done!!! It's approximatly, but works.

#include <A3LGDIPlus.au3>
#include <A3LScreenCap.au3>

Global $hBitmap1, $hBitmap2, $hImage1, $hImage2
Dim $altezza =50;set max heigth
; Initialize GDI+ library
_GDIP_Startup()

$hImage2 = _GDIP_ImageLoadFromFile(FileOpenDialog('Scegli immagine',@ScriptDir,'Img (*.png;*.jpg;*.bmp)'));choose a file

$larghezza=$altezza/(_GDIP_ImageGetHeight($hImage2)/ _GDIP_ImageGetWidth($hImage2)); Set size in proporzione
$hBitmap1 = _ScreenCap_Capture("",0,0,$larghezza,$altezza);capture screen the same size
$hImage1  = _GDIP_BitmapCreateFromHBITMAP($hBitmap1);create bitmap

 

$hGraphics = _GDIP_ImageGetGraphicsContext($hImage1)
 _GDIP_GraphicsClear($hGraphics,0xFFFFFFFF);delete the first image
; Draw one image in another
_GDIP_GraphicsDrawImageRectRect($hGraphics, $hImage2, 0, 0, _GDIP_ImageGetWidth($hImage2), _GDIP_ImageGetHeight($hImage2), 0, 0, $larghezza, $altezza)


; Save resultant image
$sCLSID = _GDIP_EncodersGetCLSID("JPG")

_GDIP_ImageSaveToFileEx($hImage1, "C:\A3LImage.jpg", $sCLSID)

; Clean up resources
_GDIP_ImageDispose($hImage1)
_API_DeleteObject($hBitmap1)
_API_DeleteObject($hImage2)

; Shut down GDI+ library
_GDIP_ShutDown()
A lan chat (Multilanguage)LanMuleFile transferTank gameTank 2 an online game[center]L'esperienza è il nome che tutti danno ai propri errori.Experience is the name everyone gives to their mistakes.Oscar Wilde[/center]
Posted

@PaulIA

is that an error in A3LMemory.au3 ("Kernel3232.dll" should be "Kernel32.dll" ?)

Func _Mem_MoveMemory($pSource, $pDest, $iLength)
  DllCall("Kernel3232.dll", "none", "RtlMoveMemory", "ptr", $pDest, "ptr", $pSource, "dword", $iLength)
EndFunc

regards, fuwi

Posted

Hello everyone, I'm trying to test out the event viewer functions and I think I'm having some issues here...

The code (part found from a previous reply in this topic) is as such:

#include <A3LEventLog.au3>
Global $hEventLog, $iI, $aEvent, $event_end, $file

FileDelete("test.txt")
$file = FileOpen("test.txt", 1)


    $hEventLog = _EventLog_Open ("", "System")
    $event_end = _EventLog_Count ($hEventLog)
    For $iI = 1 To $event_end
        $aEvent = _EventLog_Read ($hEventLog, True, False)
        FileWrite($file, "Result ............: " & $aEvent[ 0] & @CRLF)
        FileWrite($file, "Record number .....: " & $aEvent[ 1] & @CRLF)
        FileWrite($file, "Submitted .........: " & $aEvent[ 2] & " " & $aEvent[ 3] & @CRLF)
        FileWrite($file, "Generated .........: " & $aEvent[ 4] & " " & $aEvent[ 5] & @CRLF)
        FileWrite($file, "Event Type.........: " & $aEvent[ 7] & @CRLF)
        FileWrite($file, "Event ID ..........: " & $aEvent[ 6] & @CRLF)
        FileWrite($file, "Type ..............: " & $aEvent[ 8] & @CRLF)
        FileWrite($file, "Category ..........: " & $aEvent[ 9] & @CRLF)
        FileWrite($file, "Source ............: " & $aEvent[10] & @CRLF)
        FileWrite($file, "Computer ..........: " & $aEvent[11] & @CRLF)
        FileWrite($file, "Username ..........: " & $aEvent[12] & @CRLF)
        FileWrite($file, "Description .......: " & $aEvent[13] & @CRLF)
        FileWrite($file, "Event Error Text...: " & $aEvent[14] & @CRLF)
        FileWrite($file, @CRLF)
    Next
    _EventLog_Close ($hEventLog)
    FileClose($file)

Here's an example of part of the output in the text file:

Result ............: True

Record number .....: 1835

Submitted .........: 08/03/2007 10:21:50 PM

Generated .........: 08/03/2007 10:21:50 PM

Event Type.........: 1

Event ID ..........: 1001

Type ..............: Error

Category ..........: 0

Source ............: Dhcp

Computer ..........: LAPTOP

Username ..........:

Description .......: Your computer was not assigned an address from the network (by the DHCP

Server) for the Network Card with network address xxXXxxXXxxXX. The following error

occurred:

%%1223.

Your computer will continue to try and obtain an address on its own from

the network address (DHCP) server.

Event Error Text...:

The problem I have is the %%1223 text in the Description section. I'm not sure where it's getting that. Here's that same entry but taken directly from my event viewer....

8/3/2007 10:21:50 PM Dhcp Error None 1001 N/A LAPTOP Your computer was not assigned an address from the network (by the DHCP Server) for the Network Card with network address xxXXxxXXxxXX. The following error occurred:

The operation was canceled by the user. . Your computer will continue to try and obtain an address on its own from the network address (DHCP) server.

Notice the differences in both quotes after it says "The following error occurred:" . Out of 1,849 events in my System event log this %%nnnn thing happens roughly 250 times and %%nnnn is any of the following %%1223, %%126, %%121, or %%1053, depending on the event. Anyone able to give me some info or tell m what I'm doing wrong?

Partie

Posted

Hello everyone, I'm trying to test out the event viewer functions and I think I'm having some issues here...

The code (part found from a previous reply in this topic) is as such:

#include <A3LEventLog.au3>
Global $hEventLog, $iI, $aEvent, $event_end, $file

FileDelete("test.txt")
$file = FileOpen("test.txt", 1)
    $hEventLog = _EventLog_Open ("", "System")
    $event_end = _EventLog_Count ($hEventLog)
    For $iI = 1 To $event_end
        $aEvent = _EventLog_Read ($hEventLog, True, False)
        FileWrite($file, "Result ............: " & $aEvent[ 0] & @CRLF)
        FileWrite($file, "Record number .....: " & $aEvent[ 1] & @CRLF)
        FileWrite($file, "Submitted .........: " & $aEvent[ 2] & " " & $aEvent[ 3] & @CRLF)
        FileWrite($file, "Generated .........: " & $aEvent[ 4] & " " & $aEvent[ 5] & @CRLF)
        FileWrite($file, "Event Type.........: " & $aEvent[ 7] & @CRLF)
        FileWrite($file, "Event ID ..........: " & $aEvent[ 6] & @CRLF)
        FileWrite($file, "Type ..............: " & $aEvent[ 8] & @CRLF)
        FileWrite($file, "Category ..........: " & $aEvent[ 9] & @CRLF)
        FileWrite($file, "Source ............: " & $aEvent[10] & @CRLF)
        FileWrite($file, "Computer ..........: " & $aEvent[11] & @CRLF)
        FileWrite($file, "Username ..........: " & $aEvent[12] & @CRLF)
        FileWrite($file, "Description .......: " & $aEvent[13] & @CRLF)
        FileWrite($file, "Event Error Text...: " & $aEvent[14] & @CRLF)
        FileWrite($file, @CRLF)
    Next
    _EventLog_Close ($hEventLog)
    FileClose($file)

Here's an example of part of the output in the text file:

The problem I have is the %%1223 text in the Description section. I'm not sure where it's getting that. Here's that same entry but taken directly from my event viewer....

Notice the differences in both quotes after it says "The following error occurred:" . Out of 1,849 events in my System event log this %%nnnn thing happens roughly 250 times and %%nnnn is any of the following %%1223, %%126, %%121, or %%1053, depending on the event. Anyone able to give me some info or tell m what I'm doing wrong?

Partie

Possibly standard Windows error codes?

If you search Developer chat I've posted a list of them. If those are standard codes then the post should show you the error.

George

Question about decompiling code? Read the decompiling FAQ and don't bother posting the question in the forums.

Be sure to read and follow the forum rules. -AKA the AutoIt Reading and Comprehension Skills test.***

The PCRE (Regular Expression) ToolKit for AutoIT - (Updated Oct 20, 2011 ver:3.0.1.13) - Please update your current version before filing any bug reports. The installer now includes both 32 and 64 bit versions. No change in version number.

Visit my Blog .. currently not active but it will soon be resplendent with news and views. Also please remove any links you may have to my website. it is soon to be closed and replaced with something else.

"Old age and treachery will always overcome youth and skill!"

Guest
This topic is now closed to further replies.
  • Recently Browsing   0 members

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