Leaderboard
Popular Content
Showing content with the highest reputation on 09/17/2016 in all areas
-
AutoIt GUI Creators (Designers)
nguyentoannta3 reacted to TheSaint for a topic
As many of you may not be aware, of much about AutoIt's humble beginnings, and aspects related to the first GUI version of AutoIt, I thought it might be nice to create a historical reference here for all the many GUI creators that have been created by various people over the years. NOTE - While one could argue, that this topic might be better placed in one of the Chat forums, I would argue, that it links to heaps of good code. While much may be redundant in that code, it is still interesting and forms a great perspective. Many are bound to find useful elements at the very least. Koda, is no doubt the most well-known GUI creator now, but there was a time, when CyberSlug's legendary GUIBuilder (first known as AutoBuilder) ruled the roost, and AutoIt coder's saw it as a Godsend. AutoIt coding was much simpler back then of course. Below, will be a timeline, of any AutoIt GUI creators listed in forum pages. It will be added to by myself as I find them or as others here find them and place a link in a subsequent post ... PLEASE HELP! Comments welcome too. (Also note, that this is also intended to include updates, branches etc by others) Apr 20 2004 - AutoBuilder by CyberSlug. Sep 27 2004 - An interesting topic, where CyberSlug talks about the future of AutoBuilder (etc) and renaming to GUIBuilder and you see the first mentions and links to updates by others (including myself & livewire). Nov 05 2004 - A topic where lookfar is working on a SciTE replacement, talks about starting a Form Designer. Aug 10 2005 - GuiBuilder first update by TheSaint. Sep 26 2005 - GUIBuilder updates by livewire (he also talks about transferring his efforts to Koda). Nov 02 2005 - KODA FormDesigner v1.3 by lookfar Nov 03 2005 - Seemingly interesting topic about forms by tonedeaf Dec 26 2005 - AutoIt Studio(beta) by BillLuvsU Jan 09 2006 - AutoBuilder update (or branch) by _^__darkbytez (livewire also posts). Feb 19 2006 - Koda v1.5 by lookfar Sep 07 2006 - Koda v1.7.3.0 by Lazycat Jan 07 2007 - Form/GUI Builder by FlintBrenick Jun 10 2007 - Gorganizer by _Kurt (more of an assister than actual GUI maker) Jun 27 2007 - Basic GUI Designer by Mast3rpyr0 May 03 2008 - Autoit Programmer's Desktop (APD) by Ealric Jul 11 2008 - Gui Designer by Alek Aug 11 2008 - Gorganizer update by _Kurt Jun 19 2009 - Easy GUI by Mat Aug 13 2009 - GUI Script Creator by Pandemic (not sure this qualifies, but it made me think of templates) Aug 16 2010 - Creation Gui by AZJIO Jan 22 2012 - ISN AutoIt Studio by ISI360 (includes ISN Form Studio 2, a GUI editor) Mar 19 2012 - Arduino GUI Programmer by nikosliapis (creates a specific type of GUI) Aug 01 2012 - GuiBuilder Resurrected update/branch to GUIBuilder by baroquebob Dec 01 2012 - Form Builder beta (v1.0.6) by BuckMaster Jan 12 2015 - GUIBuilderNxt update by jaberwacky of GUIBuilder v0.8 (as a new prototype, modified to work with latest AutoIt) (not a update to the Resurrected version) Aug 12 2016 - The GuiBuilder Return by DFerrato as an update to GUIBuilder, Jan 17 2017 - GUIBuilder Project by TheSaint (a work in progress based on CyberSlug's original ... and later versions, updated by Roy, TheSaint & others). May 29 2019 - The GuiBuilder Return by DFerrato as an update to GUIBuilder, His new and improved version. May 9 2022 - GuiBuilderPlus by kurtykurtyboy as an update to GUIBuilder. A new an improved version with more to come. There are a significant number of creators/designers that have been started and never completed. +++++ STILL UNDER CONSTRUCTION +++++ P.S. Well that's it from me tonight. I know of at least one other major creator, but cannot recall it's name or the name of the coder, though I think it starts with 'L'. Bound to be a few I've missed, and some I cannot seem to find their first appearance here (Koda, Form Builder, etc), but there may be an obvious reason for that. Will probably rely on feedback from others now that I've got the ball rolling. NOTE - If anyone wants to discuss any of these programs above or give some background history, then by all means do so. I will cross-reference (link to) any important comments.1 point -
However, there is a it took me several hours to figure out how to do it on other windows in runtime, so I tought it might help others. So you want to remove buttons like this: #include <WinAPI.au3> #include <Constants.au3> #include <WindowsConstants.au3> $h = WinGetHandle("Untitled - Note") $iOldStyle = _WinAPI_GetWindowLong($h, $GWL_STYLE) ConsoleWrite("+ old style: " &amp; $iOldStyle &amp; @CR) $iNewStyle = BitXOr($iOldStyle, $WS_MINIMIZEBOX, $WS_MAXIMIZEBOX) _WinAPI_SetWindowLong($h, $GWL_STYLE, $iNewStyle) _WinAPI_ShowWindow($h, @SW_SHOW) or remove even the close button: instead of $iNewStyle = BitXOr($iOldStyle, $WS_MINIMIZEBOX, $WS_MAXIMIZEBOX)use $iNewStyle = BitXOr($iOldStyle, $WS_SYSMENU) The cool part about these is that you can still close the window with ALT+F4 or minimize it clicking the tray icon. The trickiest part caused me the biggest headache that if you just set the window style with a SetWindowLong() API call, but don't run _WinAPI_ShowWindow($h, @SW_SHOW) the following can happen. To show up properly after the style change, I tried redrawing the window, redrawing everything, sending WM_PAINT message to the Window, calling SetWindowLong() with different handles and options, nothing worked, until I found this comment. So it is very important to run it after setting the style. You can find more about Window styles on MSDN or Autoit help Now, what if you want only disable the buttons, but don't want to remove them ? Like this: (The close button is "greyed" out, the other two are still visible. but if you click them, nothing happens.) The following forum topic solution is very good: You can disable any of you want with these functions: ; Constants from http://msdn.microsoft.com/en-us/library/windows/desktop/ms646360(v=vs.85).aspx Const $SC_CLOSE = 0xF060 Const $SC_MOVE = 0xF010 Const $SC_MAXIMIZE = 0xF030 Const $SC_MINIMIZE = 0xF020 Const $SC_SIZE = 0xF000 Const $SC_RESTORE = 0xF120 Func GetMenuHandle($hWindow, $bRevert = False) If $bRevert = False Then $iRevert = 0 Else $iRevert = 1 EndIf $aSysMenu = DllCall("User32.dll", "hwnd", "GetSystemMenu", "hwnd", $hWindow, "int", $iRevert) ConsoleWrite("+ Menu Handle: " &amp; $aSysMenu[0] &amp; @CRLF) Return $aSysMenu[0] EndFunc Func DisableButton($hWindow, $iButton) $hSysMenu = GetMenuHandle($hWindow) DllCall("User32.dll", "int", "RemoveMenu", "hwnd", $hSysMenu, "int", $iButton , "int", 0) DllCall("User32.dll", "int", "DrawMenuBar", "hwnd", $hWindow) EndFunc Func EnableButton($hWindow, $iButton) $hSysMenu = GetMenuHandle($hWindow, True) DllCall("User32.dll", "int", "RemoveMenu", "hwnd", $hSysMenu, "int", $iButton , "int", 0) DllCall("User32.dll", "int", "DrawMenuBar", "hwnd", $hWindow) EndFunc by calling the functions like this: DisableButton($handle, $SC_CLOSE) DisableButton($handle, $SC_MAXIMIZE) DisableButton($handle, $SC_RESTORE) DisableButton($handle, $SC_MINIMIZE)Same with EnableButton(). If you disable $SC_SIZE, the window will not be resizeable with the mouse. If you disable SC_MOVE, you also cannot move it. Note: everything was tested on Windows 7 with Aero theme. On other system you might not have the same problem (window becoming a ghost after style update). If you test it on other system, please make a feedback about it ! Hope this helps somebody !1 point
-
_FB_Tools The German company AVM (http://en.avm.de/) sells a router with many extra functions. This router is called FritzBox and comes in different models. Some models have more features than others, but all have a web-interface to control the features. _FB_Tools allows to control this web-interface by reading settings from the generated webpages and settings functions based on those settings. But as the web-interface changes from model to model and from firmware version to firmware version _FB_Tools needs to be constantly modified to work with the latest firmware. Currently I only use the FritzBox model 7490 http://en.avm.de/products/fritzbox/fritzbox-7490/ and i only test with this model. Other models may or may not work out of the box, but if a functions does not work, it is in most cases easy to modify the code to read and send commands for your model. _FB_Tools can help with home automation tasks, like switching WLAN, GuestWLAN, or GuestLAN functions, or DECT (wireless phones) functions. You can also dial numbers or work with phone-books, change settings of an answering machine or upload audio files to it. The ZIP also includes a simple test and demo tool. _FB_Tools_old.zip _FB_Tools_1.636-31656.zip1 point
-
Find and replace and generate logs
pranaynanda reacted to AutoBert for a topic
sorry i missused the func StringReplace. Here my corrected func: Func _ReplaceInFile($sLog, $sFile, $sSearch, $sReplace) Local $hFile = FileOpen($sFile) Local $aLines = FileReadToArray($sFile) FileClose($hFile) For $i = 0 To UBound($aLines) - 1 $aLines[$i]=StringReplace($aLines[$i], $sSearch, $sReplace) If @extended Then _FileWriteLog($sLog, $sFile & @TAB & $i+1 & ': ' & $sSearch & ' ==> ' & $sReplace & @CRLF) Next _FileWriteFromArray($sFile, $aLines) EndFunc ;==>_ReplaceInFile the entry in the log: 2016-09-17 20:04:03:654 : temp.txt 1: Motor ==> PowerUnit if changing _FileWriteLog to FileWrite it would look: temp.txt 1: Motor ==> PowerUnit1 point -
I think you can do something like this. If $CmdLine[0] Then If StringInStr($CmdLine[1], "/") = 1 And $CmdLine[0] >= 2 Then ;I check if the first parameter is a command and if it has the correct parameters Local $sMyFunction = StringReplace($CmdLine[1], "/", "_") ;Convert to correct function name Local $sMyArgument = $CmdLine[2] ;get my parameter Call($sMyFunction,$sMyArgument) ;Call the function EndIf Else ;show -help file EndIf Func _uniqueidentifier($sArgument) MsgBox(0, "", "Im /uniqueidentifier and my argument is: " & $sArgument & @CRLF) EndFunc ;==>_uniqueidentifier call from cmd like: myScript.exe /uniqueidentifier "Hola soy Danyfirex" Saludos1 point
-
Find and replace and generate logs
pranaynanda reacted to AutoBert for a topic
Try this: Func _fnr() $find = InputBox("Find", "Find") $replace = InputBox("Replace With", "Replace With") $time = _Now() MsgBox(0, "hello", $time) Local $logfile = $open & "\" & $time & ".log" ;MsgBox(0, "hello", $FileList[0]) For $i = 1 To $FileList[0] ;MsgBox(0,"hello",$FileList[$i]) _ReplaceInFile($sLog, $FileList[$i], $find, $replace) Next ;MsgBox(0, "Test", $a) EndFunc ;==>_fnr Func _ReplaceInFile($sLog, $sFile, $sSearch, $sReplace) Local $hFile = FileOpen($sFile) Local $aLines = FileReadToArray($sFile) FileClose($hFile) For $i = 0 To UBound($aLines) - 1 If StringReplace($aLines[$i], $sSearch, $sReplace) Then _ _FileWriteLog($sLog, $sFile & @TAB & $i & ': ' & $sSearch & ' ==> ' & $sReplace & @CRLF) Next _FileWriteFromArray($sFile, $aLines) EndFunc ;==>_ReplaceInFile and insert needed: #include <File.au3>1 point -
You can do it a little bit more dynamic according to your file extensions. Just an idea / suggestion: #include <File.au3> #include <ComboConstants.au3> #include <Array.au3> #include <ButtonConstants.au3> #include <GUIConstantsEx.au3> #include <StaticConstants.au3> #include <WindowsConstants.au3> Global $sFilters = "*.psd;*.jpg;*.png;*.gif;*.ico;*.txt;*.mp3" Global $aFilters = StringRegExp($sFilters, "\.(...?)", 3) Global $aFiltersCounter[UBound($aFilters) + 1][4] Global $ScriptDir = @ScriptDir If StringRight($ScriptDir, 1) <> "\" Then $ScriptDir &= "\" Global $MainTitle = "Title" Global $aFolder $Form1 = GUICreate("Form1", 317, 442) $Button2 = GUICtrlCreateButton("Count", 25, 136, 75, 25) $Button1 = GUICtrlCreateButton("Move", 160, 136, 75, 25) $Label1 = GUICtrlCreateLabel("On the desktop :", 24, 24, 118, 17) $Label2 = GUICtrlCreateLabel("", 144, 24, 156, 17) $Label4 = GUICtrlCreateLabel("", 32, 48, 228, 17) $Combo1 = GUICtrlCreateCombo("PSD", 32, 88, 65, 25) GUICtrlSetData(-1, StringReplace(StringUpper(StringTrimLeft($sFilters, 2)), ";*.", "|")) $ButtonBrowse = GUICtrlCreateButton("Browse", 160, 88, 75, 25) $Label3 = GUICtrlCreateLabel("The Number of all files found :", 24, 184, 144, 17) For $i = 0 to UBound($aFilters) - 1 $aFiltersCounter[$i][2] = GUICtrlCreateLabel(StringUpper($aFilters[$i]), 24, 216 + $i * 32, 26, 17) $aFiltersCounter[$i][3] = GUICtrlCreateLabel("0", 64, 216 + $i * 32, 26, 17) Next $ALLFILESLABELSUM = GUICtrlCreateLabel("0", 172, 184, 38, 17) $ALLFILESLABEL = GUICtrlCreateLabel("All files", 210, 184, 81, 17) GUISetState(@SW_SHOW) While 1 ;~ Sleep(10) $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $Button1 _Move() Case $Button2 _count() Case $ButtonBrowse _FileSelectaFolder() EndSwitch WEnd Func _count() Local $extension = GUICtrlRead($Combo1) Local $FileList = _FileListToArray(@ScriptDir, "*." & $extension, 1) If IsArray($FileList) Then For $i = 0 To UBound($FileList[0]) Sleep(20) GUICtrlSetData($Label2, $FileList[$i] & " " & $extension & " Is the file") For $as = 1 To UBound($FileList) - 1 Sleep(25) GUICtrlSetData($Label4, $FileList[$as]) Next GUICtrlSetData($Label4, "") Next Else MsgBox(64, "", "Stated " & $extension & " File Not Found!") EndIf EndFunc ;==>_count Func _Move() Local $extension = GUICtrlRead($Combo1) Local $FileList = _FileListToArray(@ScriptDir, "*." & $extension, 1) For $Move = 0 To UBound($FileList) - 1 If FileExists(@DesktopDir & "\" & $extension & "\") = 1 Then FileMove(@ScriptDir & "\" & $FileList[$Move], @DesktopDir & "\" & $extension & " Archive\" & $FileList[$Move], 9) GUICtrlSetData($Label4, "Moved") Else DirCreate(@DesktopDir & "\" & $extension & " Archive") FileMove(@ScriptDir & "\" & $FileList[$Move], @DesktopDir & "\" & $extension & " Archive\" & $FileList[$Move], 9) GUICtrlSetData($Label4, "Moved") EndIf Next EndFunc ;==>_Move Func _FileSelectaFolder() Local $aFolder = FileSelectFolder("Select folder", "", 1) Local $aFolder_1 = $aFolder If StringRight($aFolder_1, 1) <> "\" Then $aFolder_1 &= "\" If $aFolder_1 = $ScriptDir Then MsgBox(16, $MainTitle, "Please select another folder.") _FileSelectaFolder() EndIf $aResult = _FileListToArrayRec($aFolder, $sFilters, $FLTAR_FILES, $FLTAR_RECUR, $FLTAR_NOSORT, $FLTAR_NOPATH) If @error Then Exit For $i = 1 To $aResult[0] $iPos = _ArraySearch($aFilters, StringRight($aResult[$i], 3)) $aFiltersCounter[$iPos][1] += 1 GUICtrlSetData($aFiltersCounter[$iPos][3], $aFiltersCounter[$iPos][1]) Next For $i = 0 To UBound($aFilters) - 1 If $aFiltersCounter[$i][1] = "" Then $aFiltersCounter[$i][1] = 0 $aFiltersCounter[$i][0] = $aFilters[$i] Next ;$aFiltersCounter[UBound($aFiltersCounter) - 1][0] = "Total Files Scanned" ;$aFiltersCounter[UBound($aFiltersCounter) - 1][1] = $aResult[0] ;_ArrayDisplay($aFiltersCounter, "Extension Counter", "", 0, Default, "Extension|Count") GUICtrlSetData($ALLFILESLABELSUM, $aResult[0]) EndFunc ;==>_FileSelectaFolder1 point
-
never doubted ...... lol @Danyfirex .... thanks p.s. is there any 'regexp' guru that could came out with an an esotheric pattern to get a multidimensional array as well.....1 point
-
You can do this. #include <MsgBoxConstants.au3> #include <StringConstants.au3> #include <Array.au3> Local $Array[1] = ['<ValueRecommendation><Value>- Senza marca/Generico'] $aArray = StringRegExp($Array[0], '(?i)<ValueRecommendation><Value>(.*?)$', $STR_REGEXPARRAYGLOBALMATCH) _ArrayDisplay($aArray) Saludos1 point
-
Just did a quick test. You stated that "user experience is everything". I, as a user, would like to see the general error message "The formula you entered contains errors." replaced by helpful error messages like "no such column exists" etc.1 point
-
Difficulty with Combo Box
spudw2k reacted to JLogan3o13 for a topic
Understand, there is absolutely nothing wrong with your code the way you have it; it is solid and works. You will find, as you continue using AutoIt, that there are often many multiple ways to tackle a problem. Forum members will often offer up alternatives simply as a "You could always do it this way, too" suggestion; often those suggestions may lead to something you've never considered, or you may find an amalgam of several suggestions gives you the code that works best for your situation1 point -
Change the /c to /k and remove the @SW_HIDE so you can see the CMD window and the errors generated. Jos edit: Actually you have an error in your Run command. the second parameter should be the workdir, not the Window status!1 point
-
Z order
tarretarretarre reacted to Melba23 for a topic
bestsmr, Not the best way to behave if you want my help another time. M231 point -
GuiRegisterMsg(0x0100,'keydown')
tarretarretarre reacted to dragan for a topic
Did you check help files for function _WinAPI_SetWindowsHookEx() some example (most code taken from help files): #include <WindowsConstants.au3> #include <WinAPI.au3> $Form1 = GUICreate("", 230, 300) GUISetState(@SW_SHOW) OnAutoItExitRegister("_Cleanup") $hStub_KeyProc = DllCallbackRegister("_KeyProc", "long", "int;wparam;lparam") $hmod = _WinAPI_GetModuleHandle(0) $hHook = _WinAPI_SetWindowsHookEx($WH_KEYBOARD_LL, DllCallbackGetPtr($hStub_KeyProc), $hmod) Do Until GUIGetMsg() = -3 Func _KeyProc($nCode, $wParam, $lParam) Local $tKEYHOOKS, $keyCode $tKEYHOOKS = DllStructCreate($tagKBDLLHOOKSTRUCT, $lParam) If $nCode < 0 Then Return _WinAPI_CallNextHookEx($hHook, $nCode, $wParam, $lParam) EndIf If WinActive($Form1) then If $wParam = $WM_KEYDOWN then Local $keyCode = DllStructGetData($tKEYHOOKS, "vkCode") Switch $keyCode Case 37 ConsoleWrite('+ Arrow LEFT - pressed' & @CRLF) Case 38 ConsoleWrite('+ Arrow UP - pressed' & @CRLF) Case 39 ConsoleWrite('+ Arrow RIGHT - pressed' & @CRLF) Case 40 ConsoleWrite('+ Arrow DOWN - pressed' & @CRLF) EndSwitch ElseIf $wParam = $WM_KEYUP then Local $keyCode = DllStructGetData($tKEYHOOKS, "vkCode") Switch $keyCode Case 37 ConsoleWrite('! Arrow LEFT - released' & @CRLF) Case 38 ConsoleWrite('! Arrow UP - released' & @CRLF) Case 39 ConsoleWrite('! Arrow RIGHT - released' & @CRLF) Case 40 ConsoleWrite('! Arrow DOWN - released' & @CRLF) EndSwitch EndIf EndIf Return _WinAPI_CallNextHookEx($hHook, $nCode, $wParam, $lParam) EndFunc Func _Cleanup() _WinAPI_UnhookWindowsHookEx($hHook) DllCallbackFree($hStub_KeyProc) EndFunc1 point -
Towards approximating a 'yield' statement
errandfox reacted to zfisherdrums for a topic
Not the most useful thing as it is not feature complete, but a fun experiment nonetheless. Edit: What does it do? Well, it attempts to approximate the yield statement found in other languages, i.e. Ruby and C#. The purpose of the yield statement is to give control to a specified function from within the called function's body. Some security limitations - as well as my own intelligence limitations - make this example more of a conceptual example than fully functional. But oh well. Why did I place it here? Perhaps some poor soul will find themselves trapped under mounds of maintenance code, much of which relies on repetitious looping and iterating. Perhaps it will spark a better implementation. Who knows. That's the beauty of these forum thingys. #include <WinAPI.au3> Func Iterator( $loop, $yield ) Local $errorFlag = 0 For $i in $loop if ( IsObj( $i ) ) Then $command = StringFormat( "%s ( $item )", $yield ) ConsoleWrite( $command & @CRLF ) Call( $yield, $i ) If @error <> 0 then $errorFlag = @error Else $command = StringFormat( $yield, $i ) ConsoleWrite( $command & @CRLF ) Execute( $command ) If @error <> 0 then $errorFlag = @error EndIf Next SetError( $errorFlag ) EndFunc #region Example Functions ; The following are example functions that will be called by the Iterator function Func ShowMeFromArray( $msg ) ; Helo Werldz MsgBox(0, "ShowMeFromArray", $msg ) EndFunc Func TwoToThePowerOf( $exponent ) ; Display two to the power of a supplied exponent MsgBox(0, "TwoToThePowerOf", 2 ^ $exponent ) EndFunc Func ShowMeFromCollection( $item ) ; Some kind of window-releated activity is simulated here ; Because of AutoIts restrictions against window-operations ; proceeding from Call'ed, Execute'd statements - we'll use ; the WinAPI include to achieve the desired result. MsgBox(0, "ShowMeFromCollection", "Press 'OK' to maximize " & $item.LocationName ) _WinAPI_ShowWindow( $item.HWND, @SW_MAXIMIZE ) MsgBox(0, "ShowMeFromCollection", "Press 'OK' to minimize " & $item.LocationName ) _WinAPI_ShowWindow( $item.HWND, @SW_MINIMIZE ) SetError( 1 ) EndFunc #EndRegion Dim $test = StringSplit( "1,2,3", "," ) Iterator( $test, 'ShowMeFromArray( "%s" )' ) Iterator( $test, 'TwoToThePowerOf( "%s" )' ) ConsoleWrite( @error & @CRLF) $oShell = ObjCreate("shell.application") $oShellWindows=$oShell.windows Iterator( $oShellWindows, "ShowMeFromCollection" ) ConsoleWrite( @error & @CRLF)1 point