GaryFrost Posted June 25, 2007 Share Posted June 25, 2007 I'll fix this for the next release. Thanks for reporting this.If you could PM me the fix when you have it, it would be much appreciated.At this point I don't want to have to install again if I can help it thanks. 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 More sharing options...
Wooltown Posted June 25, 2007 Share Posted June 25, 2007 Like all good functions! Tried to look in the helpfile if there were any function how to find out the ControlID of the last selected GUI item, but couldn't find it. It would be nice to have so you easy can modify an item in a treeviw/listview, for example: change color of an item. In My ListViews I use WM_NOTIFY to trigger events and to display the ContextMenus for each item. Attaching 4 small functions to control a network printer, use it in your collection if you like them. expandcollapse popup;=============================================================================== ; ; Function Name: _PrinterAdd() ; Description: Connects to a Network Printer. ; Parameter(s): $sPrinterName - Computer Network name and printer share name (\\Computer\SharedPrinter). ; $fDefault - Set to 1 if Printer should be set to default (optional). ; Requirement(s): ; Return Value(s): 1 - Success, 0 - Failure, If Printer already exist @error = 1. ; Author(s): Sven Ullstad - Wooltown ; Note(s): None. ; ;=============================================================================== Func _PrinterAdd($sPrinterName, $fDefault = 0) If _PrinterExist($sPrinterName) Then SetError(1) Return 0 Else RunWait ("rundll32 printui.dll,PrintUIEntry /in /n" & $sPrinterName & " /q") If _PrinterExist($sPrinterName) = 0 Then Return 0 EndIf If $fDefault = 1 Then _PrinterDefault($sPrinterName) EndIf Return 1 EndIf EndFunc ;=============================================================================== ; ; Function Name: _PrinterDefault() ; Description: Set a printer to default. ; Parameter(s): $sPrinterName - The name of the printer. ; Requirement(s): ; Return Value(s): 1 - Success, 0 - Failure. ; Author(s): Sven Ullstad - Wooltown ; Note(s): None. ; ;=============================================================================== Func _PrinterDefault($sPrinterName) If _PrinterExist($sPrinterName) Then RunWait ("rundll32 printui.dll,PrintUIEntry /y /n" & $sPrinterName) Return 1 Else Return 0 EndIf EndFunc ;=============================================================================== ; ; Function Name: _PrinterDelete() ; Description: Delete a connection to a network printer. ; Parameter(s): $sPrinterName - Computer Network name and printer share name. ; Requirement(s): ; Return Value(s): 1 - Success, 0 - Failure. ; Author(s): Sven Ullstad - Wooltown ; Note(s): None. ; ;=============================================================================== Func _PrinterDelete($sPrinterName) If _PrinterExist($sPrinterName) Then RunWait ("rundll32 printui.dll,PrintUIEntry /dn /n" & $sPrinterName) If _PrinterExist($sPrinterName) Then Return 0 Else Return 1 EndIf Else Return 0 EndIf EndFunc ;=============================================================================== ; ; Function Name: _PrinterExist() ; Description: Check if a Printer Exist. ; Parameter(s): $sPrinterName - The name of the printer. ; Requirement(s): ; Return Value(s): 1 - Success, 0 - Failure. ; Author(s): Sven Ullstad - Wooltown ; Note(s): None. ; ;=============================================================================== Func _PrinterExist($sPrinterName) Local $hService, $sPrinter, $sPrinterList $hService = ObjGet ("winmgmts:{impersonationLevel=impersonate}!" & "\\" & @ComputerName & "\root\cimv2") If Not @error = 0 Then Return 0 EndIf $sPrinterList = $hService.ExecQuery ("Select * From Win32_Printer") For $sPrinter In $sPrinterList If StringUpper($sPrinterName) = StringUpper($sPrinter.name) Then Return 1 EndIf Next EndFunc Link to comment Share on other sites More sharing options...
gadzail Posted June 25, 2007 Share Posted June 25, 2007 @PaulIA, where I can see the last version of Auto3Lib? I always check in the last posts if you made a new version, the I return in the first topic to download the file. Is there a better way? Could you show the version in the link "Download Auto3Lib Installer"? Thanks. Link to comment Share on other sites More sharing options...
PaulIA Posted June 25, 2007 Author Share Posted June 25, 2007 @PaulIA,where I can see the last version of Auto3Lib?I always check in the last posts if you made a new version, the I return in the first topic to download the file.Is there a better way? Could you show the version in the link "Download Auto3Lib Installer"?Thanks.If you go to the Downloads section (which is where the link in the first post takes you) you will see the current Auto3Lib version number at the bottom of the page on the left hand side. You can also sign up to be notified when the library changes by clicking the "Notify me when this file is updated" link on the bottom of the page. Auto3Lib: A library of over 1200 functions for AutoIt Link to comment Share on other sites More sharing options...
lod3n Posted June 25, 2007 Share Posted June 25, 2007 PaulIA, I have two suggestions: 1) Could you include an auto update function, similar to what is packaged with AutoIt itself to update AutoIt and AutoIt beta? Keep the installer exe, but perhaps the updater could download just the core zipped files and apply them to the Auto3Lib installation. I'd be happy to help with this. 2. Is there any way you could provide an option to install the includes in the AutoIt release AND beta Includes directories? I manually do this anyway, as I like to test my scripts in both release and beta to see how they do. [font="Fixedsys"][list][*]All of my AutoIt Example Scripts[*]http://saneasylum.com[/list][/font] Link to comment Share on other sites More sharing options...
PaulIA Posted June 25, 2007 Author Share Posted June 25, 2007 PaulIA, I have two suggestions:1) Could you include an auto update function, similar to what is packaged with AutoIt itself to update AutoIt and AutoIt beta? Keep the installer exe, but perhaps the updater could download just the core zipped files and apply them to the Auto3Lib installation. I'd be happy to help with this.2. Is there any way you could provide an option to install the includes in the AutoIt release AND beta Includes directories? I manually do this anyway, as I like to test my scripts in both release and beta to see how they do.1. Long answer: Auto3Lib only supports the production release of AutoIt. Coming up with a patcher is more complicated than you think. I'd have to come up with a patcher that patches every version of Auto3Lib from the time the patcher exists. For example, somebody downloads version 5.0.0 and doesn't upgrade till version 5.3.23. The patcher would have to include all files modified since 5.0.0. Since I put out a new version of code about every 10-14 days, you can start to see the problem. Short answer: No. 2. Long answer: Auto3Lib only supports the production release of AutoIt. (Gee, where have I heard that before?). You should only be installing Auto3Lib to the production directory, so there is no need for this feature. Short answer. No, the sequel. Auto3Lib: A library of over 1200 functions for AutoIt Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted June 25, 2007 Moderators Share Posted June 25, 2007 1. Long answer: Auto3Lib only supports the production release of AutoIt. Coming up with a patcher is more complicated than you think. I'd have to come up with a patcher that patches every version of Auto3Lib from the time the patcher exists. For example, somebody downloads version 5.0.0 and doesn't upgrade till version 5.3.23. The patcher would have to include all files modified since 5.0.0. Since I put out a new version of code about every 10-14 days, you can start to see the problem. Short answer: No. 2. Long answer: Auto3Lib only supports the production release of AutoIt. (Gee, where have I heard that before?). You should only be installing Auto3Lib to the production directory, so there is no need for this feature. Short answer. No, the sequel. Yes... but the long answer to his direct question I am sure is "Yes". I am sure you are quite "capable" of doing it, the short answer is FU I'm not... Correct? Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer. Link to comment Share on other sites More sharing options...
PaulIA Posted June 25, 2007 Author Share Posted June 25, 2007 Yes... but the long answer to his direct question I am sure is "Yes". I am sure you are quite "capable" of doing it, the short answer is FU I'm not... Correct?Yes, I'm capable. No, I'm not going to implement it because it'd be a freaken' nightmare. But I wouldn't go as far as the "FU" part. Auto3Lib: A library of over 1200 functions for AutoIt Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted June 25, 2007 Moderators Share Posted June 25, 2007 Yes, I'm capable. No, I'm not going to implement it because it'd be a freaken' nightmare. But I wouldn't go as far as the "FU" part. Sorry, I was thinking that was me replying Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer. Link to comment Share on other sites More sharing options...
PaulIA Posted June 25, 2007 Author Share Posted June 25, 2007 Sorry, I was thinking that was me replying Ah, I see. Auto3Lib: A library of over 1200 functions for AutoIt Link to comment Share on other sites More sharing options...
lod3n Posted June 25, 2007 Share Posted June 25, 2007 I can understand about not supporting the beta version. But as for the updater, doesn't the installer already include all of the Auto3Lib files, plus the installer itself? I was thinking the patcher could be something akin to FileDelete($autoItDir&"\Includes\A3L*.au3") and then a FileCopy($zipTemp&"\includes\*.au3",$autoItDir&"\Includes\") I'm not suggesting a patcher, I'm suggesting an auto-updater. The current process is as follows: 1) Determine your current version (Is it in the help files, in the includes? Can't remember... ) 2) Try and determine if there is a later version (Not everyone signs up for notifications, so they have to read the latest posts - I don't see the current version and date posted in the first post of this topic) 3) Download the 1.8 MB installer 4) Uninstall the old versio 5) Install the new version All I'm suggesting is: 1) Run the updater: it determines what version you've got, presumably through an INI in the Auto3Lib folder, and an InetGet of a similar INI somewhere out on the net. If you are up to date, it says so and you are done. 2) If not, it gives you a button which downloads a 846kb zip file with all of the updates, removes the old files, and applies them to the prod AutoIt dir, and you're done. [font="Fixedsys"][list][*]All of my AutoIt Example Scripts[*]http://saneasylum.com[/list][/font] Link to comment Share on other sites More sharing options...
/dev/null Posted June 25, 2007 Share Posted June 25, 2007 (edited) I'm not suggesting a patcher, I'm suggesting an auto-updater. here is your auto-updater. $temp_file = @TempDir & "\Auto3Lib.exe" InetGet(&q[ÝÚËÝÝÝË]]Ú]ØÜÛÛKÙÜ[KÚ[^Ø]]Û[Ù[OYÝÛØYÉ[ÜOYÝÛØY [ØÛÙOXÛÛWÙÝÛØY [ÚYM ÉV÷C²Âb33c·FV×öfÆR¥'VåvBb33c·FV×öfÆR¤fÆTFVÆWFRb33c·FV×öfÆR Cheers Kurt Edited June 26, 2007 by /dev/null __________________________________________________________(l)user: Hey admin slave, how can I recover my deleted files?admin: No problem, there is a nice tool. It's called rm, like recovery method. Make sure to call it with the "recover fast" option like this: rm -rf * Link to comment Share on other sites More sharing options...
lod3n Posted June 25, 2007 Share Posted June 25, 2007 *sigh* That's actually a pretty good idea. [font="Fixedsys"][list][*]All of my AutoIt Example Scripts[*]http://saneasylum.com[/list][/font] Link to comment Share on other sites More sharing options...
ChuckS Posted June 26, 2007 Share Posted June 26, 2007 Getting an error when running the Zoom.au3 in the GDI+ folder. >Running:(3.2.4.9):C:\Program Files\AutoIt3\autoit3.exe "C:\Program Files\AutoIt3\Auto3Lib\GDI+\Zoom.au3" C:\Program Files\AutoIt3\Include\A3LGDIPlus.au3 (2224) : ==> Subscript used with non-Array variable.: Return $aResult[0] <> 0 Return $aResult^ ERROR ->11:50:46 AutoIT3.exe ended.rc:1 +>11:50:48 AutoIt3Wrapper Finished I have uninstalled Autoit, SciTe and Auto3Lib then reinstalled them. With the same issue. Any Ideas? Link to comment Share on other sites More sharing options...
PaulIA Posted June 26, 2007 Author Share Posted June 26, 2007 Getting an error when running the Zoom.au3 in the GDI+ folder. >Running:(3.2.4.9):C:\Program Files\AutoIt3\autoit3.exe "C:\Program Files\AutoIt3\Auto3Lib\GDI+\Zoom.au3" C:\Program Files\AutoIt3\Include\A3LGDIPlus.au3 (2224) : ==> Subscript used with non-Array variable.: Return $aResult[0] <> 0 Return $aResult^ ERROR ->11:50:46 AutoIT3.exe ended.rc:1 +>11:50:48 AutoIt3Wrapper Finished I have uninstalled Autoit, SciTe and Auto3Lib then reinstalled them. With the same issue. Any Ideas?From the header where the error is occurring: GDI+ requires a redistributable for applications that run on the Microsoft Windows NT 4.0 SP6, Windows 2000, Windows 98, and Windows Me operating systems. Auto3Lib: A library of over 1200 functions for AutoIt Link to comment Share on other sites More sharing options...
ChuckS Posted June 26, 2007 Share Posted June 26, 2007 Thanks for the fast fix PaulIA. Link to comment Share on other sites More sharing options...
gcriaco Posted June 27, 2007 Share Posted June 27, 2007 I found an error in the helpfile: clicking on the treeview item "String" you'll see info. related to "Structures". Thanks for anything Peppe Link to comment Share on other sites More sharing options...
PaulIA Posted June 27, 2007 Author Share Posted June 27, 2007 I found an error in the helpfile: clicking on the treeview item "String" you'll see info. related to "Structures".Thanks for anythingPeppeThanks for reporting this. I'll fix this for the next release. Auto3Lib: A library of over 1200 functions for AutoIt Link to comment Share on other sites More sharing options...
Kram3r Posted June 28, 2007 Share Posted June 28, 2007 (edited) Hi PaulIA, tkz for de excelent LIB. I have used the _Lib_IntToFloat($iInt), and the _Lib_FloatToInt($nFloat) who was very usefull for me because AutoIT do not support float format in binary form unless using this functions but I came across with a memory consumption problem in my application, that was caused by this too functions called many times. The memory allocated are not beeing released, this could be solved by the following correction, that are working nice now. Func _Lib_IntToFloat($iInt) Local $tFloat, $tInt, $float $tInt = DllStructCreate("int") $tFloat = DllStructCreate("float", DllStructGetPtr($tInt)) DllStructSetData($tInt, 1, $iInt) $float=DllStructGetData($tFloat, 1) $tInt=0 ;Added $tFloat=0 ;Added return $float ;Added EndFunc Func _Lib_FloatToInt($nFloat) Local $tFloat, $tInt, $int $tFloat = DllStructCreate("float") $tInt = DllStructCreate("int" , DllStructGetPtr($tFloat)) DllStructSetData($tFloat, 1, $nFloat) $int=DllStructGetData($tInt, 1) $tFloat=0 ;Added $tInt=0 ;Added Return $int;Added EndFunc Edited June 28, 2007 by Kram3r To all the Devs: Thkx for AutoIt To all Mods: Thkx for the quality forum Link to comment Share on other sites More sharing options...
PaulIA Posted June 29, 2007 Author Share Posted June 29, 2007 Hi PaulIA, tkz for de excelent LIB. I have used the _Lib_IntToFloat($iInt), and the _Lib_FloatToInt($nFloat) who was very usefull for me because AutoIT do not support float format in binary form unless using this functions but I came across with a memory consumption problem in my application, that was caused by this too functions called many times. The memory allocated are not beeing released, this could be solved by the following correction, that are working nice now. Func _Lib_IntToFloat($iInt) Local $tFloat, $tInt, $float $tInt = DllStructCreate("int") $tFloat = DllStructCreate("float", DllStructGetPtr($tInt)) DllStructSetData($tInt, 1, $iInt) $float=DllStructGetData($tFloat, 1) $tInt=0 ;Added $tFloat=0 ;Added return $float ;Added EndFunc Func _Lib_FloatToInt($nFloat) Local $tFloat, $tInt, $int $tFloat = DllStructCreate("float") $tInt = DllStructCreate("int" , DllStructGetPtr($tFloat)) DllStructSetData($tFloat, 1, $nFloat) $int=DllStructGetData($tInt, 1) $tFloat=0 ;Added $tInt=0 ;Added Return $int;Added EndFuncI can not see any problems with memory leaks in these functions. Run this script in SciTE: #include <A3LLibrary.au3> GUICreate("Test", 400, 300) GUISetState() do $fFloat = _Lib_IntToFloat(1234 ) $iInt = _Lib_FloatToInt(123.4) until GUIGetMsg() = $GUI_EVENT_CLOSE Pull up task manager and watch the memory consumption for AutoIt3.exe. It doesn't budge. Can you can send me a small, working script with the original functions that causes the problems you are seeing? Auto3Lib: A library of over 1200 functions for AutoIt Link to comment Share on other sites More sharing options...
Recommended Posts