Jump to content

Auto3Lib


PaulIA
 Share

Recommended Posts

I don't think Auto3Lib can help you out here. From the screen shots that you've posted, it looks like these are derived controls (not native system controls). Auto3Lib is used to control the native system controls. However, I would think the standard AutoIt control functions would work for clicking and send control commands.

That's what I thought, thanks for the response at least!

Link to comment
Share on other sites

I do have a feature request for a future release: it would be nice to be able to save screen captures in formats other than BMP. Specifically, JPG format would be most welcome. Apart from that, the way you simplified that (surprisingly complex) functionality into a single command is fantastic.

I've been running the example scripts again for you. I found only two bugs! Just so you know:

C:\...\Auto3Lib\Examples\Toolbar 2.au3(97,87) : ERROR: _Menu_GetMenuItemText(): undefined function.

_Lib_ConsoleWrite($sItem & "string ........: " & _Menu_GetMenuItemText($hMenu, $iI)

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

The other bug (assuming it is a bug) is that the Tooltip2 example script only returned the first 80 characters of any tooltip, followed by different [control characters]:

Contains files shared with your contacts and files your contacts have shared wit [+ACK]

Provides options for you to customize the appearance and functionality of your c [+VT]

123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789

Thanks for catching these bugs for me. I really appreciate you helping out like this. These bugs will be fixed in the next maintenance release. I had to rework most of the 900+ functions, so hopefully there won't be too many more.

I've looked at writing JPEG files before and I always stop about half way through the explanation of the 9 position polynomial for the Huffman encoding. :P It could be done in AutoIt code, but it would take a lot of time to complete. Maybe something to come back to after I shorten the Auto3Lib "to do" list a bit.

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

I've looked at writing JPEG files before and I always stop about half way through the explanation of the 9 position polynomial for the Huffman encoding. :P It could be done in AutoIt code, but it would take a lot of time to complete. Maybe something to come back to after I shorten the Auto3Lib "to do" list a bit.

:D I see what you mean! If I ever need that feature, I think I'll just write a command-line tool in .Net; Image format conversions are pretty much built-in to the Bitmap object, so it only takes a couple of lines. If that is something you'd be interested in seeing, I might do it sooner rather than later.

Link to comment
Share on other sites

Is it posibole to get the _SetDesktopWallpaper function to support other file formats then bmp? like jpg and gif, mainly jpgs.

Windows only supports the bmp format for this call. When you select a jpg file for wallpaper in Windows, it internally converts it to a bmp file and then makes this call. It would have saved us all some grief if Microsoft would have published the API to do the conversion.
Auto3Lib: A library of over 1200 functions for AutoIt
Link to comment
Share on other sites

I've looked at writing JPEG files before and I always stop about half way through the explanation of the 9 position polynomial for the Huffman encoding. :P It could be done in AutoIt code, but it would take a lot of time to complete. Maybe something to come back to after I shorten the Auto3Lib "to do" list a bit.

Hi PaulIA.

Big thanks for your neverending hard work :D

What is on your Todo list? I thought that your BIG Library has almost everything included already :)

Link to comment
Share on other sites

Windows only supports the bmp format for this call. When you select a jpg file for wallpaper in Windows, it internally converts it to a bmp file and then makes this call. It would have saved us all some grief if Microsoft would have published the API to do the conversion.

oh.

well, thanks for a nice lib btw =)

Link to comment
Share on other sites

What is on your Todo list? I thought that your BIG Library has almost everything included already :)

Still a few controls left and then I have some ideas for future development. I could tell you, but then I'd have to kill you :D
Auto3Lib: A library of over 1200 functions for AutoIt
Link to comment
Share on other sites

In fact i take your example and i want to take my own icon present in an .icl file

I try the example with notepad to add a bitmap

; This shows how to load your own images

$iImage = _Toolbar_LoadImage($hToolbar, @ScriptDir & "\Images\Blue.bmp")

_Toolbar_AddButton($hToolbar, 0x1000, $iImage)

But my problem is to load an icon which is present in an icl files

I see an exaple in A3LImageList on how to load a bitmap whith shell32.dll but i wasn't able to adapt it for the toolbar?

Is anyone can help me ?

THanks

Link to comment
Share on other sites

I try the example with notepad to add a bitmap

But my problem is to load an icon which is present in an icl files

I see an exaple in A3LImageList on how to load a bitmap whith shell32.dll but i wasn't able to adapt it for the toolbar?

Is anyone can help me ?

THanks

The load functions for the toolbars are for single image, ico, cur and bmp files. The ICL file is an Icon Library File that contains many icons (similar to what you can do in a DLL). Auto3Lib does not have anything that will deal with these files. However, if you can point me to an API call that can extract the icons from this file, I'll be glad to code it up for you. Your other solution is to extract the icons from the ICL file into seperate files and then use the existing functions to load them into the toolbar.
Auto3Lib: A library of over 1200 functions for AutoIt
Link to comment
Share on other sites

The load functions for the toolbars are for single image, ico, cur and bmp files. The ICL file is an Icon Library File that contains many icons (similar to what you can do in a DLL). Auto3Lib does not have anything that will deal with these files. However, if you can point me to an API call that can extract the icons from this file, I'll be glad to code it up for you. Your other solution is to extract the icons from the ICL file into seperate files and then use the existing functions to load them into the toolbar.

Here is the api in your program that allows to load a selected icon (Extract from A3LLIBRAY.au3)

$iIcons = _API_ExtractIconEx("Shell32.dll", $iIconID, 0, $pIcons, 1)

If we use an icl file this function work also

Thanks in davance

Link to comment
Share on other sites

Here is the api in your program that allows to load a selected icon (Extract from A3LLIBRAY.au3)

$iIcons = _API_ExtractIconEx("Shell32.dll", $iIconID, 0, $pIcons, 1)

If we use an icl file this function work also

Thanks in davance

Well, then just use _API_ExtractIconEx to extract the icons in your file instead of Shell32.dll:

#include <A3LWinAPI.au3>

Local $iI, $iIcons, $iResult, $pSmall, $tSmall

$iIcons  = _API_ExtractIconEx(@ScriptDir & "\Test.icl", 0, 0, 0, 0)
$tSmall  = _tagInt($iIcons)
$pSmall  = _tagGetPtr($tSmall)
$iResult = _API_ExtractIconEx(@ScriptDir & "\Test.icl", 0, 0, $pSmall, $iIcons)
for $iI = 1 to $iIcons
  _Lib_ConsoleWrite("Icon " & $iI & " handle: " & Hex(_tagGetData($tSmall, $iI)))
next
Auto3Lib: A library of over 1200 functions for AutoIt
Link to comment
Share on other sites

Hi Paul,

I have two problem with notepad.au3

1) I try to change an icon file instead of a bmp file :

$iImage = _Toolbar_LoadImage($hToolbar, @ScriptDir & "\icon\28.ico",1)

_Toolbar_AddButton($hToolbar, 0x1000,$iimage )

Instead of

; This shows how to load your own images

$iImage = _Toolbar_LoadImage($hToolbar, @ScriptDir & "\Images\Blue.bmp",0)

_Toolbar_AddButton($hToolbar, 0x1000, $iImage)

The function doesn't show anything even if you use a bmp files or an ico file

After I try

Local $iI, $iIcons, $iResult, $pSmall, $tSmall

$iIcons = _API_ExtractIconEx(@ScriptDir & "\cheques.icl", 0, 0, 0, 0)

$tSmall = _tagInt($iIcons) ; Number of icons

$pSmall = _tagGetPtr($tSmall) ; pointer to small icon

$iResult = _API_ExtractIconEx(@ScriptDir & "\cheques.icl",0, 0,$pSmall,$iIcons) ;extract icon files

_Toolbar_AddButton($hToolbar, 0x1000, Hex(_tagGetData($tSmall,15)))

It doesn't work anymore
Link to comment
Share on other sites

Hi!

Windows only supports the bmp format for this call (wallpaper). When you select a jpg file for wallpaper in Windows, it internally converts it to a bmp file and then makes this call

Perso, I use .html file for wallpaper ; no problem with windows ; and I can use javascript IN MY WALLPAPER (and also AutoItX, via "new ActiveXObject"), for load .jpeg (it change all 10 mn times).

Link to comment
Share on other sites

Hi!

Perso, I use .html file for wallpaper ; no problem with windows ; and I can use javascript IN MY WALLPAPER (and also AutoItX, via "new ActiveXObject"), for load .jpeg (it change all 10 mn times).

I not sure this has anything to do with the fact that the Windows API call to change the desktop wallpaper (SystemParametersInfo) only accepts a BMP file. If you're using Active Desktop to display HTML backgrounds, that's great, but it isn't relevant to the question the OP asked. If you're not using Active Desktop, the only files that can be used for backgrounds in the Display Properties|Desktop dialog are BMP, GIF, JPG, DIB and PNG. Of these, BMP is the only one that is NOT converted prior to being loaded. If you want to read up on SystemParametersInfo, take a look at this MSDN reference for further information.
Auto3Lib: A library of over 1200 functions for AutoIt
Link to comment
Share on other sites

When using this instruction

$hNode = _TreeView_FindNode($hTree, "Poste de travail")

The system return these error

_API_OpenProcess : Access denied

Regards,

When you suspect that Auto3Lib has a bug, you need to post a small script that demonstrates the problem. As it is, I'm going to have to guess that you're passing an invalid handle (not a windows handle to a TreeView control) in the $hTree value.
Auto3Lib: A library of over 1200 functions for AutoIt
Link to comment
Share on other sites

When you suspect that Auto3Lib has a bug, you need to post a small script that demonstrates the problem. As it is, I'm going to have to guess that you're passing an invalid handle (not a windows handle to a TreeView control) in the $hTree value.

Hi,

Here is my code. My code serves to create a printer port and it appears this is a special kind of systreeview

Sorry it's a french version and i am not sure of translating when waiting for screen

#include-once

#include <A3LMenu.au3>

#include <A3LListView.au3>

#include <A3LLIbrary.au3>

#include <A3LToolbar.au3>

#include <A3LTabControl.au3>

#include <A3LListBox.au3>

#include <A3LTreeview.au3>

Run("explorer.exe /root, ,::{2227A280-3AEA-1069-A2DE-08002B30309D}")

_Lib_WinWaitActive("Imprimantes") ====Impirmante = printers

$hToolbar = _Toolbar_FindToolbar("Imprimantes", "&Fichier" ) ===== Fichier = &File

$hwnd = ControlGethandle("Imprimantes","","SysListView321")

_ListView_SetItemSelected($hWnd, _ListView_FindInText($hWnd, "Adobe PDF"))

_Toolbar_ClickAccel($hToolbar, "F")

_Menu_ClickPopupAccel("P")

_Lib_WinWaitActive("Adobe PDF Propriétés") ==> Name of the printer port for PDF property

$hwnd1= ControlGethandle("Adobe PDF Propriétés","","SysTabControl321")

;Msgbox(0,"", _Tab_FindTab($hWnd, "Ports") )

_Tab_ClickTab($hWnd1, 2 )

_Lib_WinWaitActive("Adobe PDF Propriétés", "Ports") ===Ports=ports

$hwnd = ControlGethandle("Adobe PDF Propriétés","","SysListView321")

;If _ListView_FindInText($hWnd, "Bureau\*.pdf") ) < 0 then

;msgbox(0,"" ,_ListView_GetItemText($hWnd, _ListView_FindInText($hWnd, "Bureau\*.pdf"),0) )

ControlClick("Adobe PDF Propriétés","Ports","Aj&outer un port...")--- Add a port

_Lib_WinWaitActive("Ports d'imprimante", "Types de ports &disponibles :")

$hwnd= ControlGethandle("Ports d'imprimante", "Types de ports &disponibles :","ListBox1")

If _ListBox_FindInText($hWnd, "Adobe PDF Port" ) > -1 then ;teste le prot existe dejà

;donc on crée le nouveau Port

ControlClick("Ports d'imprimante", "Types de ports","Ajouter un &port...")

_Lib_WinWaitActive("Rechercher un dossier", "Ajout d'un nouveau port PDF")

$hwnd= ControlGethandle("Rechercher un dossier", "Ajout d'un nouveau port PDF","SysTreeView321")

$hnode = _TreeView_GetFirstNode($hwnd)

Msgbox(0,"",_TreeView_Select($hWnd, $hNode))

Msgbox(0,"", _TreeView_GetText($hWnd, $hNode) )

;msgbox(0,"",_ListBox_FindInText($hWnd, "Adobe PDF Port" ) ) <===== this is this instruction that cause trouble on Windows 2000

;Sinon il faudra le créer

;Else

Endif

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...