Leaderboard
Popular Content
Showing content with the highest reputation on 11/17/2012 in all areas
-
Current functions: _Service_Change _Service_Create _Service_Delete _Service_Enum _Service_EnumDependent _Service_Exists _Service_Pause _Service_Resume _Service_QueryAccount _Service_QueryBinaryPath _Service_QueryConfig _Service_QueryDependencies _Service_QueryDesc _Service_QueryDisplayName _Service_QueryErrorControl _Service_QueryFailureActions _Service_QueryGroup _Service_QueryStartType _Service_QueryStatus _Service_QueryType _Service_SetAccount _Service_SetBinaryPath _Service_SetDependencies _Service_SetDesc _Service_SetDisplayName _Service_SetErrorControl _Service_SetFailureActions _Service_SetGroup _Service_SetStartType _Service_SetType _Service_Start _Service_Stop All functions are Windows API based. Download here -> Services.au3 Requires -> SecurityEx.au31 point
-
ChooseFileFolder - Interim Version 11 Mar 21
SkysLastChance reacted to Melba23 for a topic
INTERIM VERSION 11 Mar 21 A bug in the x64 implementation of some the library TreeView functions meant that some replacement working functions were added to the UDF. Now the Beta TreeView library (from 15.3) has been modified, these functions are no longer required, but they will remain until the modified library is formally released. However, other changes in the Beta mean that the replacement functions will not work under it - don't you just love compatibility problems! So here is an interim release with a modified replacement function so that it will function with Release and Beta versions under both x32 and x64 - I hope! New UDF and examples in zip below. Previous version descriptions: ChangeLog.txt I was fed up with using the native FileOpenDialog and FileSelectFolder which appeared anywhere on the screen in seemingly random sizes and often allowed users to select files from other than the path desired. So I decided to write my own version of an Explorer-type treeview and here it is: ChooseFileFolder. What are the main advantages of this UDF over the normal dialogs? Common format for both file and folder selection. Ability to size and place the dialog where you want it rather than how Windows last left it. Ability to select (and delete) multiple items - even from different folders or drives. You can also select both files and folders from the same tree Ability to preselect items. And there is also a function to allow you to use an existing treeview in your own GUI to display the folder tree - no need to have a dialog at all. Here is a zip file with the UDF and several example scripts: ChooseFileFolder.zip As usual happy to take feedback and, preferably, plaudits. M231 point -
Notify - New version 17 Mar 22
pixelsearch reacted to Melba23 for a topic
[NEW VERSION] - 17 Mar 22 Added: A new function _Notify_Size which allows you to adjust the size of the notification from its default 160x40. Please read the function header to see the max/min sizes that you can set for the width and height - the function returns informative @error/@extended values if these are not respected. Regardless of the size set, each notification will still display only 2 lines of text with the size of font used set automatically by the UDF. New UDF in the zip below. Previous changes: Changelog.txt A while ago I was asked to help port an AHK UDF to AutoIt. This was not too difficult and I found it useful myself (as a replacement for ConsoleWrite when debugging compiled scripts among other things). I have been polishing it for a while and thought I might release it in case it proves useful to anyone else. The notifications produced by Notify are small 2-line boxes that pop out of the edge of the display one above the other (you can select which side and in which direction they appear) - you can have as many as you want although only as many as can fit on your display will appear, the others will appear as soon as there is room. You can select whether they will retract after a certain time and/or when clicked. Colours and font are user-definable, and you can add an icon or image (bmp, jpg, gif or png) if you wish. When a notification retracts, the others move to leave space for more (you can select a smoooth slide or an instant move) - run the examples to see them in action. If you find the default sizing of the notifications is not to your liking you can change it by amending these values in the UDF (lines #354-356): ; Set default auto-sizing Notify dimensions Local $iNotify_Width_max = 300 Local $iNotify_Width_min = 150 Local $iNotify_Height = 40 A zip containing the UDF, example scripts and my StringSize UDF (which is also required): Notify.zip As usual happy for comments and/or compliments. M231 point -
I've recently been uncovering the useful commandline tools that can be found natively in Windows, one of which was findstr (there is also a GUI interface available in SciTE4AutoIt3.) After coming across this little gem and implementing in >SciTE Jump, it felt only right that I should share this on the forums as a standalone UDF. Thanks Function: ; #FUNCTION# ==================================================================================================================== ; Name ..........: _FindInFile ; Description ...: Search for a string within files located in a specific directory. ; Syntax ........: _FindInFile($sSearch, $sFilePath[, $sMask = '*'[, $fRecursive = True[, $fLiteral = Default[, ; $fCaseSensitive = Default[, $fDetail = Default]]]]]) ; Parameters ....: $sSearch - The keyword to search for. ; $sFilePath - The folder location of where to search. ; $sMask - [optional] A list of filetype extensions separated with ';' e.g. '*.au3;*.txt'. Default is all files. ; $fRecursive - [optional] Search within subfolders. Default is True. ; $fLiteral - [optional] Use the string as a literal search string. Default is False. ; $fCaseSensitive - [optional] Use Search is case-sensitive searching. Default is False. ; $fDetail - [optional] Show filenames only. Default is False. ; Return values .: Success - Returns a one-dimensional and is made up as follows: ; $aArray[0] = Number of rows ; $aArray[1] = 1st file ; $aArray[n] = nth file ; Failure - Returns an empty array and sets @error to non-zero ; Author ........: guinness ; Remarks .......: For more details: http://ss64.com/nt/findstr.html ; Example .......: Yes ; =============================================================================================================================== Func _FindInFile($sSearch, $sFilePath, $sMask = '*', $fRecursive = True, $fLiteral = Default, $fCaseSensitive = Default, $fDetail = Default) Local $sCaseSensitive = $fCaseSensitive ? '' : '/i', $sDetail = $fDetail ? '/n' : '/m', $sRecursive = ($fRecursive Or $fRecursive = Default) ? '/s' : '' If $fLiteral Then $sSearch = ' /c:' & $sSearch EndIf If $sMask = Default Then $sMask = '*' EndIf $sFilePath = StringRegExpReplace($sFilePath, '[\\/]+$', '') & '\' Local Const $aMask = StringSplit($sMask, ';') Local $iPID = 0, $sOutput = '' For $i = 1 To $aMask[0] $iPID = Run(@ComSpec & ' /c ' & 'findstr ' & $sCaseSensitive & ' ' & $sDetail & ' ' & $sRecursive & ' "' & $sSearch & '" "' & $sFilePath & $aMask[$i] & '"', @SystemDir, @SW_HIDE, $STDOUT_CHILD) ProcessWaitClose($iPID) $sOutput &= StdoutRead($iPID) Next Return StringSplit(StringStripWS(StringStripCR($sOutput), BitOR($STR_STRIPLEADING, $STR_STRIPTRAILING)), @LF) EndFunc ;==>_FindInFileExample use of Function: #include <Array.au3> #include <Constants.au3> Example() Func Example() Local $hTimer = TimerInit() Local $aArray = _FindInFile('findinfile', @ScriptDir, '*.au3;*.txt') ; Search for 'findinfile' within the @ScripDir and only in .au3 & .txt files. ConsoleWrite(Ceiling(TimerDiff($hTimer) / 1000) & ' second(s)' & @CRLF) _ArrayDisplay($aArray) $hTimer = TimerInit() $aArray = _FindInFile('autoit', @ScriptDir, '*.au3') ; Search for 'autoit' within the @ScripDir and only in .au3 files. ConsoleWrite(Ceiling(TimerDiff($hTimer) / 1000) & ' second(s)' & @CRLF) _ArrayDisplay($aArray) EndFunc ;==>Example1 point
-
GUIHyperLink - Create HyperLink controls
jparnell8839 reacted to MrCreatoR for a topic
AutoIt version: 3.3.6.1 UDF version: 1.2 Description: This library allows easily to create HyperLink controls. Few Label-distinctive features: Example: Attachments: GUIHyperLink_1.2.zip GUICtrlHyperLink_1.1.zip GUICtrlHyperLink_1.0.zip Screenshot: Changelog:1 point -
A simple script to save an Array in ini file and load one or more sectionkey's ini file to array. IniToArray.au3 Read this, >FRED is script to code (string, number, array, Scripting.Dictionary) into string. This string can be save in file, and read/load again, rebuild the structure's data with your values.1 point
-
I would be willing to pay a 3 figure anual subscription fee just to keep these idiots out! kylomas1 point
-
It's fairly easy to do that. Considering you are updaing bitmap resource it's even easier copying from one place to another than it would be to do it from a bitmap file. First you have to lock(ate) the original resource in your executable. You do that in few easy steps, ::GetModuleHandle(NULL) -> ::FindResourceEx -> ::LoadResource -> ::LockResource + ::SizeofResource Now you have the data to write. All you do then is ::BeginUpdateResource -> ::UpdateResource(locked_data, size_of_that_data) -> ::EndUpdateResource ... on target module. In C++ you would write nice simple class with two constructors (default and with the file name of the target), locking method, writing method. Then you would do something like this (boring details omitted for brevity): SuperEasyThing oMGEasyIndeed(szDest); DWORD dwSize = 0; LPVOID pData = oMGEasyIndeed.LockResData(MY_RES_NAME, RT_BITMAP, &dwSize); oMGEasyIndeed.Write(pData, dwSize, RT_BITMAP, RES_NAME_BY_YOUR_CHOICE);1 point
-
how to align text in listbox
coolcurrent reacted to AZJIO for a topic
listbox #include <ListBoxConstants.au3> #NoTrayIcon GUICreate("List", 360, 175) $StatusBar = GUICtrlCreateLabel('StatusBar', 5, 175 - 25, 150, 24) GUICtrlSetFont(-1, 13) $iCombo = GUICtrlCreateList("", 10, 5, 340, 100, $GUI_SS_DEFAULT_LIST + $LBS_NOINTEGRALHEIGHT) GUICtrlSetFont(-1, Default, 400, 0, 'Lucida Console') _ComboBox_SetDrive($iCombo, 'd') GUISetState() While 1 Switch GUIGetMsg() Case $iCombo GUICtrlSetData($StatusBar, 'Selecting a disk: ' & StringLeft(GUICtrlRead($iCombo), 1)) Case -3 ExitLoop EndSwitch WEnd Func _ComboBox_SetDrive($i_ID_Combo, $SelectDrive = 'C') Local $aDrives = DriveGetDrive('all'), $Current, $Type, $i, $list = '', $sString For $i = 1 To $aDrives[0] $Type = DriveGetType($aDrives[$i] & '') If $aDrives[$i] = 'A:' Or $Type = 'CDROM' Then ContinueLoop If $Type = 'Removable' Then $Type = 'Rem' $sLabel = DriveGetLabel($aDrives[$i] & '') If StringLen($sLabel)>15 Then $sLabel = StringLeft($sLabel, 12) & '...' $sString = StringFormat("%-2s %-5s %-15s %-5s %9.03f Gb", StringUpper($aDrives[$i]), $Type, $sLabel, DriveGetFileSystem($aDrives[$i] & ''), DriveSpaceTotal($aDrives[$i] & '') / 1024) $list &= '|' & $sString If $aDrives[$i] = $SelectDrive & ':' Then $Current = $sString Next GUICtrlSetData($i_ID_Combo, $list, $Current) EndFuncComboBox #include <WindowsConstants.au3> #include <GuiComboBox.au3> #NoTrayIcon GUICreate("List", 160, 75) $StatusBar = GUICtrlCreateLabel('StatusBar', 5, 75 - 25, 150, 24) GUICtrlSetFont(-1, 13) $iCombo = GUICtrlCreateCombo('', 10, 5, 50, 23, $CBS_DROPDOWNLIST + $WS_VSCROLL) _GUICtrlComboBox_SetDroppedWidth($iCombo, 340) GUICtrlSetFont(-1, Default, 400, 0, 'Lucida Console') _ComboBox_SetDrive($iCombo, 'd') GUISetState() While 1 Switch GUIGetMsg() Case $iCombo GUICtrlSetData($StatusBar, 'Selecting a disk: ' & StringLeft(GUICtrlRead($iCombo), 1)) Case -3 ExitLoop EndSwitch WEnd Func _ComboBox_SetDrive($i_ID_Combo, $SelectDrive = 'C') Local $aDrives = DriveGetDrive('all'), $Current, $Type, $i, $list = '', $sString For $i = 1 To $aDrives[0] $Type = DriveGetType($aDrives[$i] & '') If $aDrives[$i] = 'A:' Or $Type = 'CDROM' Then ContinueLoop If $Type = 'Removable' Then $Type = 'Rem' $sLabel = DriveGetLabel($aDrives[$i] & '') If StringLen($sLabel)>15 Then $sLabel = StringLeft($sLabel, 12) & '...' $sString = StringFormat("%-2s %-5s %-15s %-5s %9.03f Gb", StringUpper($aDrives[$i]), $Type, $sLabel, DriveGetFileSystem($aDrives[$i] & ''), DriveSpaceTotal($aDrives[$i] & '') / 1024) $list &= '|' & $sString If $aDrives[$i] = $SelectDrive & ':' Then $Current = $sString Next GUICtrlSetData($i_ID_Combo, $list, $Current) EndFunc1 point -
adding a button to GUI with tabs
JScript reacted to WalterCarreiro for a topic
Hope this helps, it works the way you wanted #include #include Local $Button_1, $msg Example() Func Example() GUICreate("DAW3 Scripts") ; will create a dialog box that when displayed is centered GUISetBkColor(0x0CCCCCC) GUISetFont(9, 300) GUICtrlCreateTabItem("") ; end tabitem definition GUICtrlCreateTab(10, 10, 370, 370); for all tabs GUICtrlCreateTabItem("tab0") GUICtrlCreateLabel("label0", 30, 80, 50, 20) GUICtrlCreateButton("OK0", 20, 50, 50, 20) GUICtrlCreateInput("default", 80, 50, 70, 20) $Button_0 = GUICtrlCreateButton("OK_Tab0", 250, 30, 80,30, $BS_LEFT) GUICtrlCreateTabItem("tab----1") GUICtrlCreateLabel("label1", 30, 80, 50, 20) GUICtrlCreateCombo("", 20, 50, 60, 120) GUICtrlSetData(-1, "Trids|CyberSlug|Larry|Jon|Tylo", "Jon") ; default Jon GUICtrlCreateButton("OK1", 80, 50, 50, 20) $Button_1 = GUICtrlCreateButton("OK_Tab1", 250, 30, 80,30, $BS_LEFT) GUICtrlCreateTabItem("tab2") GUICtrlSetState(-1, $GUI_SHOW) ; will be display first GUICtrlCreateLabel("label2", 30, 80, 50, 20) GUICtrlCreateButton("OK2", 140, 50, 50) $Button_2 = GUICtrlCreateButton("OK_Tab2", 250, 30, 80,30, $BS_LEFT) GUISetState(@SW_SHOW) Opt("GUICoordMode", 2) ; Run the GUI until the dialog is closed While 1 $msg = GUIGetMsg() Select Case $msg = $GUI_EVENT_CLOSE ExitLoop Case $msg = $Button_0 MsgBox(8192, "Test", "you pushed " & GUICtrlRead($msg), 5) Case $msg = $Button_1 MsgBox(8192, "Test", "you pushed " & GUICtrlRead($msg), 5) Case $msg = $Button_2 MsgBox(8192, "Test", "you pushed " & GUICtrlRead($msg), 5) EndSelect WEnd EndFunc1 point