Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 11/22/2013 in all areas

  1. New version 1.7.3.0 is out! Download current release Place to post bugs and suggestions (Bug tracker) Online help (Wiki) What's new: Graphic editorBetter support of limited accounts and UAC under Vista/SevenStyles editor allow multiple selectionIcons in additional controls (Tab, ListView, TreeView)Redone Object tree, with support of editable descriptionsAwareness of GUI_SS_DEFAULT stylesAnd many smaller changes (see full history) New version 1.7.2.0 is out! What's new: Added small abilities that become in latest beta of AutoitImproved language systemImproved update checkingImproved siteNew version 1.7.1.0 is out! What's new: Customizing colorsExternal import frameworkCustom controls (ones that available via standard UDFs)Rewritten support for icon - now it support full color onesBetter support (bugtracker, wiki)Bugfix release 1.7.0.1 is out! After another year, new version 1.7.0.0 is out! Most significant changes in this release: Customizable toolbarsUndo supportAligning paletteImport Autoit GUI scriptsFull help file, with context sensitive help supportAnd as usually, lots of bugfixes and small changes. After long period of development and testing, new release 1.6.0.0 is finally here! Thanks to all who support us and help done this work! Most significant changes from previous release: New, more fast and reliable form read/write routines.Rewritten form list handling codeMenus support (with visual editor)Obj support (with visual browser)Templates-based code generationGenerating event-based codeHelp file (unfinished)Old topic is here, some bugs posted there are not resolved yet, so please check it too.
    1 point
  2. 1/22/2014: re-Uploaded a new SciTE4AutoIt3.exe installer with the new SciTE v3.3.7 release. This version contains a version of AutoIt3Wrapper and SciTEConfig which are recompiled with AutoIt3 v 3.3.10.2 to avoid te hardcrash with Athlon CPU's. There are a couple of major changes: - Updated our version of SciTE from 3.3.6 to 3.3.7 - AutoIt3Wrapper will now use "c:users<userName>AppdataLocalAutoit v3Aut2Exe" as Temp directory. - Updated syntax files. Enjoy, Jos Addition/Changes/Fixes in the current installer: -------------------------------------------------------------------------------------------------- 01/22/2014 *** Updated AutoIt3Wrapper v2.1.4.5 (Jos) - Fixed issue with undecleared variable error when using /Versioning_Commit - Recompiled with version 3.3.10.2 because 3.3.10.0 could give a hardcrash. *** Updated SciTEConfig v1.6.11.1 (Jos) - Recompiled with version 3.3.10.2 because 3.3.10.0 could give a hardcrash. -------------------------------------------------------------------------------------------------- 12/29/2013 *** Fixed missing SciTEConfig in SciTE4AutoIt3 installer. -------------------------------------------------------------------------------------------------- 12/28/2013 *** Merged the updates of SciTE v 3.3.7 by Neil Hodgson with our own version of SciTE. (Jos) *** Updated Production config files to 3.3.10.0 *** Updated AutoIt3Wrapper v2.1.4.0 (Jos) - Use "c:\users\<userName>\Appdata\Local\Autoit v3\Aut2Exe" as Temp directory for compiling and resource updating like aut2exe. - Fixed issue with Compile both and Pragma(x64,true) - Fixed inputfile in case Obfuscator needs to run but is skipped due to unsupported utf format. - Fixed UPX selection option to default to N and adding the Directive when checkbox is checked. *** Updated Obfuscator.exe v1.0.31.1 (Jos) - Changed the code to leave #include statements that include a a3x file. -------------------------------------------------------------------------------------------------- 11/14/2013 *** Merged the updates of SciTE v 3.3.6 by Neil Hodgson with our own version of SciTE. (Jos) - Added check to avoid double shelling of the script via shortcuts of the tools menu items. - Added Properties option to set the default encoding of new files: NewFileEncoding=CodePage/UTF8/UTF8BOM/UTF16BE/UTF16LE - Fixed issue in AU3 lexer to show the last correctly when the previous line is a commentline, commentblock, Special and Directives. *** Updated AutoIt3Wrapper v2.1.3.0 (Jos) - Fixed issue where a tempfile was left behind when files was checked by au3check and UTF encoded. - Added support for the #PRAGMA statement to avoid any conflicts. Warnings are now displayed in the Console output. - Added SciTE version to the displayed info in the Console Output. - Added #AutoIt3Wrapper_Res_Remove (wraithdu) - Added File compression for Resource Files (wraithdu) #AutoIt3Wrapper_Res_File_Add=%in%, 10, UNCOMPRESSED #AutoIt3Wrapper_Res_File_Add=%in%, -10, COMPRESSED - Updated option to change the TempDir in the INI file. Default changed to @UserProfileDir. (wraithdu) - Fixed adding /Beta to the Obfuscator line when using the /Beta on the commandline of Autoit3wrapper. - Fixed to ensure UPX is ran when needed. - Fixed: Allow | in run_before and Run_After directives. *** Updated Tidy v2.4.0.0 (Jos) - Added support for 3.3.9.x changes. - Changed default EOF setting to add the CRLF. (End_With_NewLine=1) - Fixed removal of spaces for new Var/Func notation - Fixed crash caused by Function table load. *** Updated SciTEConfig v1.6.11.0 - Updates for Abbrev manager and User Calltip Manager (Melba23) *** Updated Obfuscator.exe v1.0.31.0 (Jos) - Fixed ensure #pragma statements are not stripped. - Fixed Regression internal code cleanup done before. The Obfuscation was broken - Fixed #include logic for #Include not first checking the Directory where the file containing the include is located. - Added check for max 4100 character record len without causing a crash. *** Added support for personal LUA functions. Look at "PersonalTools.lua" in your @UserProfileDir subdir for details. *** Updated SciTEJump to the latest version v2.13.103.227 (guinness) -------------------------------------------------------------------------------------------------- ==> ScitillaHistory page containing all SciTE/Scintilla updates. ==> Visit the SciTE4AutoIt3 Download page for the latest versions ==> Check the online documentation for an overview of all extra's you get with this installer.
    1 point
  3. Melba23

    Notification code

    Dep, That particular constant is in the EditConstants.au3 include file - so just add #include <EditConstants.au3> at the top of your script and you are ready to go. I would strongly recommend that you do not replace the constant name with its numerical value (or magic number as it is commonly known). Firstly guinness would get all upset (and we try very hard not to do that) and secondly you will not remember what the numerical value means when you come back to the script a few weeks (or if you are old enough, a few hours) later! M23
    1 point
  4. Melba23

    GUIGetMsg and 2 GUIs

    Bester, Nice to see that the crystal ball still works! M23
    1 point
  5. MHz

    Multiple GUI.

    Hello Victorique, GuiSwitch can do this for you. It tells AutoIt to use another Gui as the current Gui to receive the messages. The 2nd and 3rd Gui can just be put into user defined functions and have their own loops. The good idea about this is that you can make some of the variables local. No need for the GuiGetMsg advanced mode. So now you have _Gui_Select() and _Gui_Thunderbird() functions. Changes I made #NoTrayIcon #RequireAdmin #region ;**** Directives created by AutoIt3Wrapper_GUI **** #AutoIt3Wrapper_Outfile=C:\Users\Accelerator\Desktop\Quicklaunch.exe #AutoIt3Wrapper_UseX64=n #endregion ;**** Directives created by AutoIt3Wrapper_GUI **** #include <ButtonConstants.au3> #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #include <Misc.au3> #include <ComboConstants.au3> #include <EditConstants.au3> ;#include <_UskinLibrary.au3> ;#include <Skins/XXX.au3> ;#include <DesuSplash2.au3> #include <Crypt.au3> ;#region ### Thweme load section (may select soon) ### Form= ;_Uskin_LoadDLL() ;_Uskin_Init(_XXX(True)) ;#endregion ### Thweme load section (may select soon) ### Form= ;#region ### Splash screen ### start= ;SplashImageOn("Desu Splash", _DesuSplash2(True), 650, 303, -1, -1, 1) ;Sleep(5000) ;SplashOff() #endregion ### Splash screen ### start= $hParent = GUICreate("parent");not shown GUISetState(@SW_DISABLE, $hParent) GUISetState(@SW_HIDE, $hParent) #region ### START Koda GUI section ### Form= $maingui = GUICreate("Quick launch V1.5", 225, 315, 470, 34, $WS_DLGFRAME, -1, $hParent) $Firefox = GUICtrlCreateButton("Cyberfox", 0, 0, 105, 49) $File = GUICtrlCreateMenu("File") $Edit = GUICtrlCreateMenuItem("Edit program", $File) $Reset = GUICtrlCreateMenuItem("Reset Configuration file", $File) $admin = GUICtrlCreateMenuItem("Enter Admin key", $File) $Edi = GUICtrlCreateMenu("Edit") $Edit_Config = GUICtrlCreateMenuItem("Edit Config file", $Edi) $Drive_Letter = GUICtrlCreateMenuItem("Change Drive letter", $Edi) $Scite = GUICtrlCreateButton("Scite", 120, 0, 105, 49) $PaleMoon = GUICtrlCreateButton("Pale moon", 0, 56, 105, 49) $STS = GUICtrlCreateButton("STS", 120, 56, 105, 49) GUICtrlSetTip($STS, "Eclipse") $Notepad = GUICtrlCreateButton("notepad++", 0, 112, 105, 49) $Skype = GUICtrlCreateButton("Skype", 120, 112, 105, 49) $Exit = GUICtrlCreateButton("Exit", 120, 224, 105, 49) $Thunderbird = GUICtrlCreateButton("Thunderbird", 120, 168, 105, 49) $Tomcatui = GUICtrlCreateButton("Tomcat", 0, 168, 105, 49) $SQLyog = GUICtrlCreateButton("SQLyog", 0, 224, 105, 49) Dim $maingui_AccelTable[7][2] = [["{F1}", $Firefox],["{F2}", $Scite],["{F3}", $PaleMoon],["{F4}", $STS],["{F5}", $Notepad],["{F6}", $Skype],["{F7}", $Tomcatui]]; 2 dimentinal array to create keyboard shortcuts using "F" keys GUISetAccelerators($maingui_AccelTable) GUISetState(@SW_SHOW) #endregion ### END Koda GUI section ### If _Singleton("I don't know what this does, but it works.", 1) = 0 Then GUISetState(@SW_HIDE, $maingui) GUIDelete($maingui) MsgBox(48, "Error", "The program is already open!") Exit EndIf If Not FileExists("Config.ini") Then GUISetState(@SW_DISABLE, $maingui) MsgBox(48, "Error", "Ini does not exist, a new one will be made with the defult values") GUISetState(@SW_DISABLE, $maingui) _iniWrite("D:") GUISetState(@SW_ENABLE, $maingui) EndIf _Check() #region ### Ini Read start ### ini= $IniFirefox = IniRead("Config.ini", "LocationNames", "$Firefox", "Not found") $IniScite = IniRead("Config.ini", "LocationNames", "$Scite", "Not found") $IniPaleMoon = IniRead("Config.ini", "LocationNames", "$PaleMoon", "Not found") $IniSTS = IniRead("Config.ini", "LocationNames", "$STS", "Not found") $IniNotepad = IniRead("Config.ini", "LocationNames", "$Notepad", "Not found") $IniSkype = IniRead("Config.ini", "LocationNames", "$Skype", "Not found") $Editprogramini = IniRead("Config.ini", "LocationNames", "$EditProgram", "Not found") $Thunderbirdini = IniRead("Config.ini", "LocationNames", "$Thunderbirdini", "Not found") $ThunderbirdInstall = IniRead("Config.ini", "LocationNames", "$ThunderbirdInstall", "Not found") $Thunderbird64 = IniRead("Config.ini", "LocationNames", "$Thunderbird64", "Not found") $Tomcat = IniRead("Config.ini", "LocationNames", "$Tomcat", "Not found") $SQLyogini = IniRead("Config.ini", "LocationNames", "$SQLyog", "Not found") #endregion ### Ini Read start ### ini= While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE, $Exit GUISetState(@SW_DISABLE, $maingui) $quit = MsgBox(52, "Quit", "Are you sure you want to exit?") If $quit = 6 Then Exit Else GUISetState(@SW_ENABLE, $maingui) EndIf Case $Firefox Run($IniFirefox) If @error Then MsgBox(48, "Error", "There was a error while trying to open this program") EndIf Case $Scite Run($IniScite) If @error Then MsgBox(48, "Error", "There was a error while trying to open this program") EndIf Case $PaleMoon Run($IniPaleMoon) If @error Then MsgBox(48, "Error", "There was a error while trying to open this program") EndIf Case $STS Run($IniSTS) If @error Then MsgBox(48, "Error", "There was a error while trying to open this program") EndIf Case $Notepad Run($IniNotepad) If @error Then MsgBox(48, "Error", "There was a error while trying to open this program") EndIf Case $Skype Run($IniSkype) If @error Then MsgBox(48, "Error", "There was a error while trying to open this program") EndIf Case $Edit ShellExecute($Editprogramini) Case $Reset GUISetState(@SW_DISABLE, $maingui) If Not IsDeclared("iMsgBoxAnswer") Then Local $iMsgBoxAnswer $iMsgBoxAnswer = MsgBox(36, "Reset?", "Are you sure you want to reset the configuation? This will reset the config to defults; ALL CHANGES WILL BE LOST") Select Case $iMsgBoxAnswer = 6 $restedelete = FileDelete("config.ini") If $restedelete = 0 Then _iniWrite("D:") Else _iniWrite("D:") EndIf MsgBox(64, "Please restart", "Please restart the program") Exit Case $iMsgBoxAnswer = 7 GUISetState(@SW_ENABLE, $maingui) EndSelect Case $Edit_Config $test = ShellExecute(@WorkingDir & "\Config.ini") Case $Drive_Letter GUISetState(@SW_DISABLE, $maingui) _Gui_Select() GUISetState(@SW_ENABLE, $maingui) WinActivate($maingui) Case $Thunderbird GUISetState(@SW_DISABLE, $maingui) _Gui_Thunderbird() GUISetState(@SW_ENABLE, $maingui) WinActivate($maingui) Case $Tomcatui Run($Tomcat) If @error Then MsgBox(48, "Error", "There was a error while trying to open this program") EndIf Case $admin GUISetState(@SW_DISABLE, $maingui) _Crypt_Startup() While 1 $key = InputBox("Enter key", "Please enter the key to Unlock the code", "Null") If @error = 1 Then GUISetState(@SW_ENABLE, $maingui) ExitLoop EndIf $crypt_Key = (StringTrimLeft(_Crypt_HashData($key, $CALG_SHA1), 2)) If $crypt_Key == "55C388D3015FF7544A9D1FD8186A04FD88000209" Then ;Adminallowed1 GUISetState(@SW_HIDE, $maingui) MsgBox(64, "Correct", "Correct key, features are now unlocked", 5) MsgBox(64, "code on this computer", "This computer is registerd for the code, if you delete the code, you can't get it back... Unless you are clever.") $downloadTest = InetGet("https://dl.dropboxusercontent.com/s/ybcjjrslgtjzlhe/QuickLaunch.au3?dl=1&token_hash=AAHNERKvJbqjw9dt59HX5wPVvnLbQL5pQo-smUbykEwKUg", "Quicklaunch.au3", 1, 0) If $downloadTest = 0 Then ;error downloading MsgBox(16, "error", "There was an Error downloading or genarating the code, please allow the program though the firewall, If this happens again, contact Author") ExitLoop EndIf $errorCrypt = IniWrite(@TempDir & "/Admin.ini", "Isadmin", "$admin", StringTrimLeft(_Crypt_HashData("youareadmin", $CALG_SHA1), 2)) If $errorCrypt = 0 Then MsgBox(16, "Error", "Could not save Admin settings, this is not a problem: continueing...") ExitLoop EndIf MsgBox(64, "Please restart", "Please restart the program") Exit Else MsgBox(48, "Incorrect key", "Key is not correct!") EndIf _Crypt_Shutdown() WEnd Case $SQLyog Run($SQLyogini) If @error Then MsgBox(48, "Error", "There was a error while trying to open this program") EndIf EndSwitch WEnd Func _Gui_Select() ; Second GUI Local $Cancel, $Drive_ID, $read_selection, $Select, $Submist_Drive, $Warning_box ; Global $maingui $Select = GUICreate("select Drive", 131, 120, 192, 124, $WS_DLGFRAME, $ES_READONLY) $Drive_ID = GUICtrlCreateCombo("Select Drive", 8, 8, 113, 25, BitOR($CBS_DROPDOWNLIST, $CBS_AUTOHSCROLL)) GUICtrlSetData(-1, "A:|B:|C:|D:|E:|F:|G:|H:|I:|J:|K:|L:|M:|N:|O:|P:|Q:|R:|S:|T:|U:|V:|W:|X:|Y:|Z:") $Submist_Drive = GUICtrlCreateButton("Change", 8, 32, 113, 25) $Cancel = GUICtrlCreateButton("Cancel", 8, 64, 113, 25) GUISetState() ; GUISwitch($Select); set this Gui as current to receive messages ; While 1 Switch GUIGetMsg() Case $Submist_Drive GUISetState(@SW_DISABLE, $Select) $read_selection = GUICtrlRead($Drive_ID) If $read_selection = "Select Drive" Then MsgBox(48, "Warning", "Please select a drive letter") GUISetState(@SW_ENABLE, $Select) Else $Warning_box = MsgBox(52, "Warning", "Are you sure you want to change the Drive letter in the config file to: " & $read_selection) If $Warning_box = 6 Then _iniWrite($read_selection) GUIDelete($maingui) ; GLOBAL GUIDelete($Select) MsgBox(64, "Please restart", "Please restart the program") Exit Else GUISetState(@SW_ENABLE, $Select) EndIf EndIf Case $Cancel, $GUI_EVENT_CLOSE ExitLoop EndSwitch WEnd ; GUIDelete($Select) EndFunc Func _Gui_Thunderbird() ; Third GUI Local $Cancel, $Installed, $Portable, $ThunderbirdUI ;Global $Thunderbird64, $Thunderbirdini, $ThunderbirdInstall $ThunderbirdUI = GUICreate("Select type", 327, 86, 192, 124, $WS_DLGFRAME) $Portable = GUICtrlCreateButton("Portable", 0, 8, 97, 49) GUICtrlSetFont(-1, 12, 400, 0, "Calibri") $Installed = GUICtrlCreateButton("Installed", 224, 8, 97, 49) GUICtrlSetFont(-1, 12, 400, 0, "Calibri") $Cancel = GUICtrlCreateButton("Cancel", 112, 8, 97, 49) GUICtrlSetFont(-1, 12, 400, 0, "Calibri") GUISetState() ; GUISwitch($ThunderbirdUI); set this Gui as current to receive messages ; While 1 Switch GUIGetMsg() Case $Portable Run($Thunderbirdini) If @error Then MsgBox(48, "Error", "There was a error while trying to open this program") EndIf Case $Installed If @OSArch = "X64" Then Run($Thunderbird64) If @error Then MsgBox(48, "Error", "There was a error while trying to open this program") EndIf Else Run($ThunderbirdInstall) If @error Then MsgBox(48, "Error", "There was a error while trying to open this program") EndIf EndIf Case $Cancel, $GUI_EVENT_CLOSE ExitLoop EndSwitch WEnd ; GUIDelete($ThunderbirdUI) EndFunc Func _Check() $isadmin = IniRead(@TempDir & "/Admin.ini", "Isadmin", "$admin", "apples") If $isadmin = "FA15EB666BCBA6755735B9767F3FE99D80121473" Then GUICtrlSetState($admin, $GUI_DISABLE) Local $i = IniWrite("Config.ini", "LocationNames", "$EditProgram", "Quicklaunch.au3") If $i = 0 Then MsgBox(16, "Error", "file is read-only!") EndIf EndIf EndFunc ;==>_Check Func _iniWrite($reading) $error = IniWrite("Config.ini", "LocationNames", "$Firefox", "C:\Program Files\Cyberfox\Cyberfox.exe") IniWrite("Config.ini", "LocationNames", "$Scite", $reading & "\Portible\AutoIt3\SciTE\SciTE.exe") IniWrite("Config.ini", "LocationNames", "$PaleMoon", $reading & "\Portible\Firefox(x86-64bit)\pale moon\Palemoon-Portable.exe") IniWrite("Config.ini", "LocationNames", "$STS", $reading & "\Portible\springsource\sts-3.4.0.RELEASE\STS.exe") IniWrite("Config.ini", "LocationNames", "$Notepad", $reading & "\Portible\Notepad++\notepad++.exe") IniWrite("Config.ini", "LocationNames", "$Skype", $reading & "\Portible\Skype\SkypePortable.exe") IniWrite("Config.ini", "LocationNames", "$EditProgram", $reading & "\auto it programs\close\close.au3") IniWrite("Config.ini", "LocationNames", "$Thunderbirdini", $reading & "\Portible\ThunderbirdPortable\ThunderbirdPortable.exe") IniWrite("Config.ini", "LocationNames", "$ThunderbirdInstall", "C:\Program Files\Mozilla Thunderbird\Thunderbird.exe") IniWrite("Config.ini", "LocationNames", "$Thunderbird64", "C:\Program Files (x86)\Mozilla Thunderbird\thunderbird.exe") IniWrite("Config.ini", "LocationNames", "$Tomcat", "C:\Program Files\Apache Software Foundation\Tomcat 7.0\bin\Tomcat7.exe") IniWrite("Config.ini", "LocationNames", "$SQLyog", "C:\Program Files\SQLyog Community\SQLyogCommunity.exe") Sleep(1000) If $error = 0 Then GUIDelete($maingui) MsgBox(16, "Error", "Could not make Ini file, reason of this could be that the folder is read only") Exit Else MsgBox(64, "Done", "Ini made") EndIf EndFunc ;==>_iniWrite Just check to make sure that I have not broken something.
    1 point
  6. For the script above I found a little mistake, ist works now. But it seems there ist a general difference between Windows 7 and Windows 8.1 These lines should make tow simple Shortcuts to some cmd files on the network using a dll file on the network to create the icons. $Server = "\\EMI-S4\" $ScriptName = "Test" ; Verknüpfung für die Export- und Importbefehle für das Layout der Metrooberfläche If FileExists($Server & "Programme\Installation\Windows 8\CopyCurrentStartScreen2Default (als Admin ausführen!).cmd") Then FileCreateShortcut ($Server & "Programme\Installation\Windows 8\CopyCurrentStartScreen2Default (als Admin ausführen!).cmd", @DesktopDir & "\Copy Current Start Screen To Default.lnk", "", "", "", $Server & "Administration\AutoIt\Icons\DLLs\Win7-sdcpl.dll" , "", "2") Else MsgBox(16, $ScriptName, "CopyCurrentStartScreen2Default (als Admin ausführen!).cmd konnte nicht gefunden werden") EndIf If FileExists($Server & "Programme\Installation\Windows 8\ImportCustomStartScreen2Default (als Admin ausführen!).cmd") Then FileCreateShortcut ($Server & "Programme\Installation\Windows 8\ImportCustomStartScreen2Default (als Admin ausführen!).cmd", @DesktopDir & "\Import Custom Start Screen To Default.lnk", "", "", "", $Server & "Administration\AutoIt\Icons\DLLs\Win7-sdcpl.dll" , "", "3") Else MsgBox(16, $ScriptName, "ImportCustomStartScreen2Default (als Admin ausführen!).cmd konnte nicht gefunden werden") EndIf When I run the script on a windows 7 system the shortcuts and icons are created. When i run the script on a windows 8.1 system the shortcuts are created without the icons.
    1 point
  7. jdelaney

    Multiple replace

    changed the string on me, here ya go (not sure if those are actual chars, or literal strings...) literal strings: #include <array.au3> Global Enum $giReplace_Find, $giReplace_Replace, $giReplace_UBound ;~ Global $aReplace[2][$giReplace_UBound]=[["a","c"],["c","a"]] Global $aReplace[4][$giReplace_UBound]=[["a","%charmap:0,1%"],["b","%charmap:0,2%"],["t","%charmap:0,3%"],["i","%charmap:0,4%"]] ;~ Global $string = "abc" Global $string = "abti" $string = MultiReplace($string,$aReplace) ConsoleWrite($string & @CRLF) Func MultiReplace($sCallersString, $aCallersReplace) $aString = StringToASCIIArray($sCallersString) Local $aString2d[UBound($aString)][2], $sReturn = "" For $i = 0 to UBound($aString2d)-1 $aString2d[$i][0] = Chr($aString[$i]) $aString2d[$i][1] = False Next ; Do replaces on chars that have not already been replaced For $i = 0 to UBound($aString2d)-1 If Not $aString2d[$i][1] Then For $j = 0 To UBound($aCallersReplace)-1 If $aString2d[$i][0] = $aCallersReplace[$j][$giReplace_Find] Then $aString2d[$i][0] = $aCallersReplace[$j][$giReplace_Replace] $aString2d[$i][1] = True ExitLoop EndIf Next EndIf Next ; Convert the array back to a string For $i = 0 to UBound($aString2d)-1 $sReturn &= $aString2d[$i][0] Next Return $sReturn EndFunc Notice, that you just have to change the conversion array (line 5), to do any replaces...and any count of replaces
    1 point
  8. jdelaney

    Multiple replace

    well, one 'command', that is actually a function ...the function only replaces characters once, so you don't have to worry about it returning cbc, or aba...actual return will be cba #include <array.au3> Global Enum $giReplace_Find, $giReplace_Replace, $giReplace_UBound Global $aReplace[2][$giReplace_UBound]=[["a","c"],["c","a"]] Global $string = "abc" $string = MultiReplace($string,$aReplace) ConsoleWrite($string & @CRLF) Func MultiReplace($sCallersString, $aCallersReplace) $aString = StringToASCIIArray($sCallersString) Local $aString2d[UBound($aString)][2], $sReturn = "" For $i = 0 to UBound($aString2d)-1 $aString2d[$i][0] = Chr($aString[$i]) $aString2d[$i][1] = False Next ; Do replaces on chars that have not already been replaced For $i = 0 to UBound($aString2d)-1 If Not $aString2d[$i][1] Then For $j = 0 To UBound($aCallersReplace)-1 If $aString2d[$i][0] = $aCallersReplace[$j][$giReplace_Find] Then $aString2d[$i][0] = $aCallersReplace[$j][$giReplace_Replace] $aString2d[$i][1] = True ExitLoop EndIf Next EndIf Next ; Convert the array back to a string For $i = 0 to UBound($aString2d)-1 $sReturn &= $aString2d[$i][0] Next Return $sReturn EndFunc
    1 point
  9. Local $Actwin = WinGetHandle("[active]") Local $PidActwin = WinGetProcess($Actwin) Local $NamePidActwin = _Findpidname($PidActwin) MsgBox(0, '', $NamePidActwin) Func _Findpidname($Pid) Local $Processlist = ProcessList() For $i = 1 To $Processlist[0][0] If $Processlist[$i][1] = $Pid Then Return $Processlist[$i][0] Next EndFunc ;==>_Findpidname
    1 point
  10. Hi Mohan, You can use _PathSplit eg: #include <file.au3> Local $szDrive, $szDir, $szFName, $szExt, $EXEpath $EXEpath = FileOpenDialog('Please Choose any File', '', 'All(*.*)', 1) Local $TestPath = _PathSplit($EXEPath, $szDrive, $szDir, $szFName, $szExt) MsgBox(0,"",$szFName)
    1 point
  11. Thanks again. Sorry for the delay but it's a pretty busy period and I didn't have much time left to work on this. Anyway, I didn't take your script as it is, but I tried again to use the RunWait, this time specifying @scriptdir as working directory and using just the file names on print.bat which expect two variables: printer name and zpl name. It worked great, so I think i'll keep building the script from there. Thank you
    1 point
  12. The problem is for code points U+D800 to U+DFFF. Your pattern (x{FFFD} part) will cause wrong results here. Even though the behavior is explainable (you did it actually), it may be seen as unexpected. You see, x{FFFD} matches both U+FFFD and the whole range from U+D800 to U+DFFF. That's what your pattern explicitly tries no to do. So it's either x20-x{FFFD} or the last hex is x{FFFC}.
    1 point
  13. akurakkauaaa

    scite helper

    update, new tab: Include Helper (Include Optimizer). example: Instruction. If not work: 1. run: "Scite Helper" 2. open tab: "Include" 3. used button: 1, 2, 3 4. ;Instruction. ;If not work: ;1. run: "Scite Helper" ;2. open tab: "Include" ;3. used button: 1, 2, 3 ;4. :) Global Const $GUI_AVISTOP = 0 Global Const $GUI_AVISTART = 1 #include "RichEditConstants.au3" #include "Word.au3" Global Const $GUI_AVICLOSE = 2 $Form1 = GUICreate("test") $StatusBar1 = _GUICtrlStatusBar_Create($Form1) GUISetState(@SW_SHOW) While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE Exit EndSwitch If _IsPressed("51") then Exit ;q Sleep(20) WEnd func _IsPressed($test) return false endfunc
    1 point
  14. HotKeySet("{Esc}", "captureEsc") - Assigns the ESC key to the function captureEsc HotKeySet("{Esc}") - Cancel (or unregister) the previous assignment From the help file..
    1 point
  15. For sure , but here's my little example... needed the func for an app. #include <WinAPI.au3> #include <WindowsConstants.au3> #include<GUIConstants.au3> Opt('GuiOnEventMode', 1) $hGui = GUICreate("hWnd, PID and Exe under cursor", 350, 67, 244, 160, BitOR($WS_POPUP, $WS_BORDER, $WS_SIZEBOX), BitOR($WS_EX_TOOLWINDOW, $WS_EX_TOPMOST)) GUISetOnEvent($GUI_EVENT_CLOSE, "_Exit") $label = GUICtrlCreateLabel("", 0, 0, 350, 200, 0, $GUI_WS_EX_PARENTDRAG) GUICtrlSetBkColor(-1, 0xEEF1F6) GUICtrlSetColor(-1, 0x000000) GUISetState(@SW_SHOW) While Sleep(50) $hWndCtrl = HWnd(_WindowFromPoint()) $hWndWin = _WinAPI_GetAncestor($hWndCtrl, $GA_ROOTOWNER) $hWndPid = WinGetProcess($hWndWin) $hWndExeLoc = _ProcessGetLocation($hWndPid) $hWndExe = StringRight($hWndExeLoc, StringLen($hWndExeLoc) - StringInStr($hWndExeLoc, "\", 0, -1)) GUICtrlSetData($label, "$hWndCtrl " & @TAB & $hWndCtrl & @CRLF _ & "$hWndWin " & @TAB & $hWndWin & @CRLF _ & "$hWndPid " & @TAB & $hWndPid & @CRLF _ & "$hWndExe " & @TAB & $hWndExe & @CRLF _ & "$hWndExeLoc " & @TAB & $hWndExeLoc) WEnd Func _WindowFromPoint() ; from _GUICtrl_SetOnHover ; http://www.autoitscript.com/forum/index.php?s=&showtopic=55120 ; by G.Sandler a.k.a MrCreatoR (CreatoR's Lab, http://creator-lab.ucoz.ru) Local $Old_Opt_MCM = Opt("MouseCoordMode", 1) Local $aRet = DllCall("User32.dll", "int", "WindowFromPoint", _ "long", MouseGetPos(0), _ "long", MouseGetPos(1)) ;$aRet = DllCall("user32.dll", "int", "GetDlgCtrlID", "hwnd", $aRet[0]) Opt("MouseCoordMode", $Old_Opt_MCM) Return $aRet[0] EndFunc ;==>_WindowFromPoint Func _ProcessGetLocation($iPID) Local $aProc = DllCall('kernel32.dll', 'hwnd', 'OpenProcess', 'int', BitOR(0x0400, 0x0010), 'int', 0, 'int', $iPID) If $aProc[0] = 0 Then Return SetError(1, 0, '') Local $vStruct = DllStructCreate('int[1024]') DllCall('psapi.dll', 'int', 'EnumProcessModules', 'hwnd', $aProc[0], 'ptr', DllStructGetPtr($vStruct), 'int', DllStructGetSize($vStruct), 'int_ptr', 0) Local $aReturn = DllCall('psapi.dll', 'int', 'GetModuleFileNameEx', 'hwnd', $aProc[0], 'int', DllStructGetData($vStruct, 1), 'str', '', 'int', 2048) If StringLen($aReturn[3]) = 0 Then Return SetError(2, 0, '') Return $aReturn[3] EndFunc ;==>_ProcessGetLocation Func _Exit() Exit EndFunc ;==>_Exit
    1 point
×
×
  • Create New...