Jump to content

Danny35d

Active Members
  • Posts

    809
  • Joined

  • Last visited

  • Days Won

    1

Danny35d last won the day on December 25 2023

Danny35d had the most liked content!

Profile Information

  • Location
    New Hampshire, USA

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

Danny35d's Achievements

Universalist

Universalist (7/7)

18

Reputation

  1. I just want to make you aware of the double quotes especially if you are manually creating the .ini file. This is the perfect tool I needed for the missing toolbar in the Windows 11 taskbar. I found it even better than the Windows 10 toolbar because I don't have to navigate through directories to get to the application.
  2. The same issue as before didn't work for me, changing to any line code below that includes double quotes after /AutoIt3ExecuteScript works. Local $Txt = '@AutoItExe, /AutoIt3ExecuteScript "' & $AutoIt3Dir & '\Examples\Helpfile\StringRegExpGUI.au3"' Local $Txt = "@AutoItExe, '/AutoIt3ExecuteScript " & Chr(34) & "' & $AutoIt3Dir & '\Examples\Helpfile\StringRegExpGUI.au3" & Chr(34) & "'"
  3. Very nice tool. Section [006] failed because is missing a double quote, fixed by using Chr(34) to add the double quotes. FileWrite($hFileOpen, "Executable=@AutoItExe, '/AutoIt3ExecuteScript " & Chr(34) & "' & $AutoIt3Dir & '\Examples\Helpfile\StringRegExpGUI.au3" & Chr(34) & "'" & @CRLF)
  4. Add the code below after the last #include. It should make your script to runas someone else. The first time the script runs $CMDLine[0] value is zero which will re-run the script as someone else and exit the first script. The second script running as someone else has the parameter /RunAs making $CMDLine[0] value one and continue with the rest of the script. #include <AutoItConstants.au3> If $CMDLine[0] = 0 Then RunAs("Username", "Domain", "Password", $RUN_LOGON_NOPROFILE, @AutoItExe & " /RunAs", @ScriptDir) Exit EndIf
  5. Give it a try #include <Array.au3> #include <File.au3> Local $iCount = 0 Local $sApp_Exe = "F:\App\Nextcloud\nextcloud.exe" Local $aWaitForEXEX = [5, "Nextcloud.exe", "nextcloudcmd.exe", "Nextcloud.exe", "QtWebEngineProcess.exe", "Nextcloud.exe"] For $h = 1 To $aWaitForEXEX[0] If StringInStr($sApp_Exe, $aWaitForEXEX[$h]) Then $iRet = _ArrayDelete($aWaitForEXEX, $h) If $iRet <> -1 Then $h = 1 $iCount += 1 EndIf EndIf If $h >= $aWaitForEXEX[0] - $iCount Then ExitLoop Next $aWaitForEXEX[0] = UBound($aWaitForEXEX) - 1 _ArrayDisplay($aWaitForEXEX)
  6. Hi Chimp, Nine and Marcforce very nice script. Below are the changes I made on the script. Instead of Auto-hide after 5 secs now hide when GUI loose focus Removed Tray management of the deck Improve drag and drop Updated _RestartProgram() function to handle file with .a3x extension Added _GetVirtualScreen() function the handle better multi monitors and undocking laptop Added GUI animation and startup script when login Instead of saving shortcut and config into an ini file, now save to SQLite database Added way to export and import Lauchpad configurations Added About GUI Added and improve to Add, Remove buttons and change icon Improve how to get icons and execute files from extension .lnk Added a way open the database for modification using 3rd party application called DB browser ; =============================================================================================================================== ; Title .........: LaunchPad ; Description ...: button deck to be used as an applications launcher (and not only) ; Author(s) .....: Chimp (Gianni Addiego) ; credits to @KaFu, @Danyfirex, @mikell (see comments for references) ; Modification ..: Marcgforce (drag and drop add, passing ini to links) ; Danny35d Replace passing ini for a SQLite DB, improve drag and drop, improve func called _RestartProgram ; to be able to execute file with the extension .a3x, added func called _GetVirtualScreen to better ; handle Multi monitors and undocking laptop, added GUI animation and Choice to startup when you login. ; URL ...........: https://www.autoitscript.com/forum/topic/202048-button-deck/ ; =============================================================================================================================== #NoTrayIcon #include <Misc.au3> #include <Array.au3> #include <Crypt.au3> #include <String.au3> #include <SQLite.au3> #include <WinAPI.au3> #include <SQLite.dll.au3> #include <GUIConstants.au3> #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> If _Singleton("LaunchPadApps", 2) = 0 Then MsgBox($MB_SYSTEMMODAL, "Warning", "An occurrence of LaunchPad is already running.") Exit EndIf ;Turn off redirection for a 32-bit script on 64-bit system. If @OSArch = "X64" And Not @AutoItX64 Then _WinAPI_Wow64EnableWow64FsRedirection(False) OnAutoItExitRegister('_Exit') ; https://docs.microsoft.com/en-us/windows/win32/winmsg/wm-sizing Global Const $WMSZ_LEFT = 1 Global Const $WMSZ_RIGHT = 2 Global Const $WMSZ_TOP = 3 Global Const $WMSZ_TOPLEFT = 4 Global Const $WMSZ_TOPRIGHT = 5 Global Const $WMSZ_BOTTOM = 6 Global Const $WMSZ_BOTTOMLEFT = 7 Global Const $WMSZ_BOTTOMRIGHT = 8 Global Enum $vButton_Tip = 0, $vButton_IconPath, $vButton_IconNumber, $vButton_Command, $vButton_UniqueID Global Const $AW_FADE_IN = 0x00080000 ;fade-in Global Const $AW_FADE_OUT = 0x00090000 ;fade-out Global Const $AW_SLIDE_IN_LEFT = 0x00040001 ;slide in from left Global Const $AW_SLIDE_OUT_LEFT = 0x00050002 ;slide out to left Global Const $AW_SLIDE_IN_RIGHT = 0x00040002 ;slide in from right Global Const $AW_SLIDE_OUT_RIGHT = 0x00050001 ;slide out to right Global Const $AW_SLIDE_IN_TOP = 0x00040004 ;slide-in from top Global Const $AW_SLIDE_OUT_TOP = 0x00050008 ;slide-out to top Global Const $AW_SLIDE_IN_BOTTOM = 0x00040008 ;slide-in from bottom Global Const $AW_SLIDE_OUT_BOTTOM = 0x00050004 ;slide-out to bottom Global Const $AW_DIAG_SLIDE_IN_TOP_LEFT = 0x00040005 ;diag slide-in from Top-left Global Const $AW_DIAG_SLIDE_OUT_TOP_LEFT = 0x0005000a ;diag slide-out to Top-left Global Const $AW_DIAG_SLIDE_IN_TOP_RIGHT = 0x00040006 ;diag slide-in from Top-Right Global Const $AW_DIAG_SLIDE_OUT_TOP_RIGHT = 0x00050009 ;diag slide-out to Top-Right Global Const $AW_DIAG_SLIDE_IN_BOTTOM_LEFT = 0x00040009 ;diag slide-in from Bottom-left Global Const $AW_DIAG_SLIDE_OUT_BOTTOM_LEFT = 0x00050006 ;diag slide-out to Bottom-left Global Const $AW_DIAG_SLIDE_IN_BOTTOM_RIGHT = 0x0004000a ;diag slide-in from Bottom-right Global Const $AW_DIAG_SLIDE_OUT_BOTTOM_RIGHT = 0x00050005 ;diag slide-out to Bottom-right Global Const $AW_EXPLODE = 0x00040010 ;explode Global Const $AW_IMPLODE = 0x00050010 ;implode Local Const $AppDataUser = @LocalAppDataDir & '\LaunchPad' Local Const $dll_icons = $AppDataUser & '\Bin\iconset.dll' Local $aAnimation = StringSplit('Explode|Fade In|Slide In Left|Slide In Right|Slide In Top|Slide In Bottom|Diag Slide In Top Left|Diag Slide In Top Right|Diag Slide In Bottom Left|Diag Slide In Bottom Right', '|', 2) If Not FileExists($AppDataUser) Then DirCreate($AppDataUser) If Not FileExists($AppDataUser & '\Bin') Then DirCreate($AppDataUser & '\Bin') If Not FileExists($AppDataUser & '\Icons') Then DirCreate($AppDataUser & '\Icons') If Not FileExists($AppDataUser & "\BackupDB") Then DirCreate($AppDataUser & "\BackupDB") If Not FileExists($AppDataUser & '\Bin\iconset.dll') Then FileInstall('.\Include\iconset.dll', $AppDataUser & '\Bin\') If Not FileExists($AppDataUser & '\Bin\sqlite3.exe') Then FileInstall('.\Include\sqlite3.exe', $AppDataUser & '\Bin\') If Not FileExists($AppDataUser & '\Bin\sqlite3.dll') Then FileInstall('.\Include\sqlite3.dll', $AppDataUser & '\Bin\') If Not FileExists($AppDataUser & '\Bin\sqlite3_x64.dll') Then FileInstall('.\Include\sqlite3_x64.dll', $AppDataUser & '\Bin\') #cs The following 2D array contains the settings that determine the behavior of each "Button" namely 4 parameters for each row (for each button); [n][0] the tooltip of the button [n][1] path of an icon or a file containing icons [n][2] the number of the icon (if the previous parameter is a collection) [n][3] AutoIt command(s) to be executed directly on button click (or also the name of a function) #ce Global $aTools[][] = [ _ ['Administrative Tools', 'SHELL32.dll', 177, 'run("explorer.exe shell:::{D20EA4E1-3957-11d2-A40B-0C5020524153}")', ''], _ ['Windows version', 'winver.exe', 1, 'run("explorer.exe shell:::{BB06C0E4-D293-4f75-8A90-CB05B6477EEE}")', ''], _ ; or "Run('winver.exe')" ['This computer', 'netcenter.dll', 6, 'run("explorer.exe shell:::{20D04FE0-3AEA-1069-A2D8-08002B30309D}")', ''], _ ['Devices and Printers', 'SHELL32.dll', 272, 'run("explorer.exe shell:::{A8A91A66-3A7D-4424-8D24-04E180695C7A}")', ''], _ ['Folder options', 'SHELL32.dll', 210, 'run("explorer.exe shell:::{6DFD7C5C-2451-11d3-A299-00C04F8EF6AF}")', ''], _ ['Command Prompt', @ComSpec, 1, 'Run(@ComSpec)', ''], _ ['Internet Explorer', @ProgramFilesDir & '\Internet Explorer\iexplore.exe', 1, "Run(@ProgramFilesDir & '\Internet Explorer\iexplore.exe')", ''], _ ['Media Player', @ProgramFilesDir & '\Windows media player\wmplayer.exe', 1, "Run(@ProgramFilesDir & '\Windows media player\wmplayer.exe')", ''], _ ['File browser', @WindowsDir & '\explorer.exe', 1, "Run(@WindowsDir & '\explorer.exe')", ''], _ ['Notepad', @SystemDir & '\notepad.exe', 1, "Run(@SystemDir & '\notepad.exe')", ''], _ ['Wordpad', @SystemDir & '\write.exe', 1, "Run(@SystemDir & '\write.exe')", ''], _ ['Registry editor', @SystemDir & '\regedit.exe', 1, "ShellExecute('regedit.exe')", ''], _ ['Connect to', 'netcenter.dll', 19, 'run("explorer.exe shell:::{38A98528-6CBF-4CA9-8DC0-B1E1D10F7B1B}")', ''], _ ['Calculator', @SystemDir & '\Calc.exe', 1, "Run(@SystemDir & '\calc.exe')", ''], _ ['Control panel', 'control.exe', 1, 'run("explorer.exe shell:::{5399E694-6CE5-4D6C-8FCE-1D8870FDCBA0}")', ''], _ ['Users manager', @SystemDir & '\Netplwiz.exe', 1, "ShellExecute('Netplwiz.exe')", ''], _ ; {7A9D77BD-5403-11d2-8785-2E0420524153} ['Run', 'SHELL32.dll', 25, 'Run("explorer.exe Shell:::{2559a1f3-21d7-11d4-bdaf-00c04f60b9f0}")', ''], _ ['Search files', 'SHELL32.dll', 135, 'run("explorer.exe shell:::{9343812e-1c37-4a49-a12e-4b2d810d956b}")', ''], _ ['On screen Magnifier', @SystemDir & '\Magnify.exe', 1, "ShellExecute('Magnify.exe')", ''], _ ['Paint', @SystemDir & '\mspaint.exe', 1, "Run(@SystemDir & '\mspaint.exe')", ''], _ ['Remote desktop', @SystemDir & '\mstsc.exe', 1, " Run('mstsc.exe')", ''], _ ['Resource monitoring', @SystemDir & '\resmon.exe', 1, "Run('resmon.exe')", ''], _ ['Device manager', 'SHELL32.dll', 13, 'Run("explorer.exe Shell:::{74246bfc-4c96-11d0-abef-0020af6b0b7a}")', ''], _ ['Audio', 'SndVol.exe', 1, 'Run("explorer.exe Shell:::{F2DDFC82-8F12-4CDD-B7DC-D4FE1425AA4D}")', ''], _ ; or 'run(@SystemDir & "\SndVol.exe")'] ['Task view', 'SHELL32.dll', 133, 'Run("explorer.exe shell:::{3080F90E-D7AD-11D9-BD98-0000947B0257}")', ''], _ ['Task Manager', @SystemDir & '\taskmgr.exe', 1, 'Send("^+{ESC}")', ''], _ ; "Run(@SystemDir & '\taskmgr.exe')"], _ ['On Screen Keyboard', 'osk.exe', 1, 'ProcessExists("osc.exe") ? False : ShellExecute("osk.exe")', ''], _ ; <-- ternary example ['... if Notepad is running Send F5 to it', 'SHELL32.dll', 167, ' WinExists("[CLASS:Notepad]") ? ControlSend("[CLASS:Notepad]", "", "", "{F5}") : MsgBox(16, ":(", "Notepad not found", 2)', ''] _ ; Check if Notepad is currently running ] ; Show desktop {3080F90D-D7AD-11D9-BD98-0000947B0257} ; Desktop Background {ED834ED6-4B5A-4bfe-8F11-A626DCB6A921} ; IE internet option {A3DD4F92-658A-410F-84FD-6FBBBEF2FFFE} ; ['Notes', 'StikyNot.exe', 1, "ShellExecute('StikyNot')"], _ Global $GUI, $hSQLiteDB, $tmpVirtualScreen Global $bSaveSettings = True, $bShowGUI = True Global $SQLiteDB = $AppDataUser & '\Launchpad.sqlite' Local $sqlRow, $sqlColumn Local $SQLiteDBExists = FileExists($SQLiteDB) Global $sSQliteDll = _SQLite_Startup($AppDataUser & '\Bin\sqlite3.dll', False, 1) If @error Then MsgBox($MB_SYSTEMMODAL, "SQLite Error", "SQLite3.dll Can't be Loaded!" & @CRLF & @CRLF & _ "Not FOUND in " & $AppDataUser & '\Bin\') $bSaveSettings = False Exit -1 Else $hSQLiteDB = _SQLite_Open($SQLiteDB) If @error Then MsgBox($MB_SYSTEMMODAL, "SQLite Error", "Can't open or create a permanent Database!" & @CRLF & @CRLF & $SQLiteDB) $bSaveSettings = False Exit -1 EndIf EndIf _SQLite_LaunchPad($hSQLiteDB, "CREATE TABLE IF NOT EXISTS Buttons(Name TEXT, Icon TEXT, IconNum INTEGER, Execute TEXT, Button_ID INTEGER PRIMARY KEY);") _SQLite_LaunchPad($hSQLiteDB, "CREATE TABLE IF NOT EXISTS Settings(LeftPos INTEGER, TopPos INTEGER, ButtonSize INTEGER, xColumns INTEGER, GUIin TEXT, GUIout TEXT, Freeze TEXT, StartUp TEXT);") If Not $SQLiteDBExists Then _SQLite_LaunchPad($hSQLiteDB, "INSERT INTO Settings VALUES(10, 10, 40, " & Ceiling(UBound($aTools) / 2) & ",'AW_EXPLODE', 'AW_IMPLODE', 'False', 'False');") For $x = 0 To UBound($aTools) - 1 $aTools[$x][$vButton_Command] = StringReplace($aTools[$x][$vButton_Command], "'", '"') _SQLite_LaunchPad($hSQLiteDB, "INSERT INTO Buttons (Name, Icon, IconNum, Execute) VALUES ('" & $aTools[$x][$vButton_Tip] & "','" & $aTools[$x][$vButton_IconPath] & "'," & $aTools[$x][$vButton_IconNumber] & ",'" & $aTools[$x][$vButton_Command] & "');") Next EndIf _SQLite_GetTable2d($hSQLiteDB, "SELECT * FROM Buttons;", $aTools, $sqlRow, $sqlColumn) _ArrayDelete($aTools, 0) _SQLite_QuerySingleRow($hSQLiteDB, "SELECT LeftPos FROM Settings;", $sqlRow) Global $iLeftPos = $sqlRow[0] _SQLite_QuerySingleRow($hSQLiteDB, "SELECT TopPos FROM Settings;", $sqlRow) Global $iTopPos = $sqlRow[0] _SQLite_QuerySingleRow($hSQLiteDB, "SELECT ButtonSize FROM Settings;", $sqlRow) Global $iStep = $sqlRow[0] _SQLite_QuerySingleRow($hSQLiteDB, "SELECT xColumns FROM Settings;", $sqlRow) Global $iNrPerLine = $sqlRow[0] _SQLite_QuerySingleRow($hSQLiteDB, "SELECT GUIin FROM Settings;", $sqlRow) Global $GUI_IN = $sqlRow[0] _SQLite_QuerySingleRow($hSQLiteDB, "SELECT GUIout FROM Settings;", $sqlRow) Global $GUI_OUT = $sqlRow[0] _SQLite_QuerySingleRow($hSQLiteDB, "SELECT Freeze FROM Settings;", $sqlRow) Global $bFreezeWindow = $sqlRow[0] _SQLite_QuerySingleRow($hSQLiteDB, "SELECT StartUp FROM Settings;", $sqlRow) Global $bStartUp = $sqlRow[0] If Not IsBool($bFreezeWindow) And $bFreezeWindow = 'True' Then $bFreezeWindow = True ElseIf Not IsBool($bFreezeWindow) And $bFreezeWindow = 'False' Then $bFreezeWindow = False EndIf If Not IsBool($bStartUp) And $bStartUp = 'True' Then $bStartUp = True ElseIf Not IsBool($bStartUp) And $bStartUp = 'False' Then $bStartUp = False EndIf Global $idAddIcon[1], $idRemoveIcon[1], $idChangeIcon[1] Global $iNrOfLines = Ceiling(UBound($aTools) / $iNrPerLine) Global $dllUser32 = DllOpen("user32.dll") $GUI = GUICreate('Launch Pad', 10, 10, $iLeftPos, $iTopPos, BitOR($WS_THICKFRAME, 0), BitOR($WS_EX_TOOLWINDOW, $WS_EX_TOPMOST, $WS_EX_ACCEPTFILES)) Global $GuiContextMenu = GUICtrlCreateContextMenu() Global $idFreezeWindow = GUICtrlCreateMenuItem("Freeze", $GuiContextMenu) Global $idSettings = GUICtrlCreateMenu("Settings", $GuiContextMenu, 1) Global $idDatabase = GUICtrlCreateMenu("Database", $idSettings) Global $idOpenDB = GUICtrlCreateMenuItem("Open DB", $idDatabase) Global $idExportDB = GUICtrlCreateMenuItem("Export DB", $idDatabase) Global $idImportDB = GUICtrlCreateMenuItem("Import DB", $idDatabase) Global $idStartUp = GUICtrlCreateMenuItem("StartUp", $idSettings) Global $idAnimation = GUICtrlCreateMenu("Animate", $GuiContextMenu, 1) GUICtrlCreateMenuItem("", $GuiContextMenu) Global $idAbout = GUICtrlCreateMenuItem("About", $GuiContextMenu) $aMyMatrix = _GuiControlPanel("Button", $iNrPerLine, $iNrOfLines, $iStep, $iStep, BitOR(0x40, 0x1000), -1, 0, 0, 0, 0, 0, 0, False, "") Global $iPreviousX = ($aMyMatrix[0])[1], $iPreviousY = ($aMyMatrix[0])[2] ReDim $idAddIcon[UBound($aMyMatrix)] ReDim $idRemoveIcon[UBound($aMyMatrix)] ReDim $idChangeIcon[UBound($aMyMatrix)] ReDim $aTools[UBound($aMyMatrix)][5] ; Be sure none of the array elements are NULL, otherwise _ArraySearch failed For $i = 0 To UBound($aMyMatrix) - 1 If $idAddIcon[$i] = '' Then $idAddIcon[$i] = 9999 If $idRemoveIcon[$i] = '' Then $idRemoveIcon[$i] = 9999 If $idChangeIcon[$i] = '' Then $idChangeIcon[$i] = 9999 Next For $i = 0 To UBound($aAnimation) - 1 $aAnimation[$i] = GUICtrlCreateMenuItem($aAnimation[$i], $idAnimation) Next For $i = 1 To UBound($aMyMatrix) - 1 GUICtrlSetResizing($aMyMatrix[$i], $GUI_DOCKALL) ; (2+32+256+512) so the control will not move during resizing If $i <= UBound($aTools) Then GUICtrlSetImage($aMyMatrix[$i], $aTools[$i - 1][$vButton_IconPath], $aTools[$i - 1][$vButton_IconNumber]) GUICtrlSetTip($aMyMatrix[$i], $aTools[$i - 1][$vButton_Tip]) EndIf Next _WinSetClientSize($GUI, ($aMyMatrix[0])[11], ($aMyMatrix[0])[12]) ; thanks to KaFu If $bFreezeWindow Then GUICtrlSetState($idFreezeWindow, $GUI_CHECKED) If $bStartUp Then GUICtrlSetState($idStartUp, $GUI_CHECKED) GUISetState() ; https://devblogs.microsoft.com/oldnewthing/20110218-00/?p=11453 GUIRegisterMsg($WM_NCHITTEST, "WM_NCHITTEST") GUIRegisterMsg($WM_SIZING, "WM_SIZING") _MainLoop() _Exit() Func _MainLoop() Local $iDeltaX, $iDeltaY, $row, $col, $left, $top, $awPos, $iAnswer, $sTemp Local $hTimer, $sFileDialog, $sBackupName While 1 Sleep(10) $xyVirtualScreen = _GetVirtualScreen() If Not WinActive($GUI) And Not $bFreezeWindow And $bShowGUI Then _ToggleGuiShowHide($GUI, False) $aPos = MouseGetPos() $hTimer = TimerInit() While ($aPos[0] = $xyVirtualScreen[0] Or $aPos[1] = $xyVirtualScreen[2] Or $aPos[0] = $xyVirtualScreen[1] Or $aPos[1] = $xyVirtualScreen[3]) And Not $bFreezeWindow $aPos = MouseGetPos() If TimerDiff($hTimer) > 1000 Then _ToggleGuiShowHide($GUI, True) Sleep(10) WEnd $Msg = GUIGetMsg() Switch $Msg Case $GUI_EVENT_CLOSE Exit Case $GUI_EVENT_DROPPED Local $iAnswer = $IDNO Local $ProposeLink = StringSplit(@GUI_DragFile, '\') $ProposeLink = StringRegExpReplace($ProposeLink[UBound($ProposeLink) - 1], '(.*)\..*', "$1") $i = _ArrayBinarySearch($aMyMatrix, @GUI_DropId) If $i <> -1 Then If $aTools[$i - 1][$vButton_Command] <> '' Then $iAnswer = MsgBox($MB_YESNO, "LauchPad Drag & Drop", "Are you sure you want to overwrite " & $aTools[$i - 1][$vButton_Tip] & " shortcut?", 0, $GUI) Else $iAnswer = $IDYES EndIf If $iAnswer = $IDYES Then $sTemp = '' Local $sReponse = InputBox("Icon name", "Give the shortcut a title", $ProposeLink) If @error <> 1 Or $sReponse <> '' Then $aTools[$i - 1][$vButton_Tip] = $sReponse $aTools[$i - 1][$vButton_IconNumber] = 1 $aTools[$i - 1][$vButton_IconPath] = $dll_icons $aTools[$i - 1][$vButton_Command] = @GUI_DragFile $sExt = StringRegExpReplace($aTools[$i - 1][$vButton_Command], "^.*\.", "") ; extraction of its extension Switch $sExt Case "doc", "docx", "odt" $aTools[$i - 1][$vButton_IconNumber] = 436 Case "xls", "xlsx", "ods" $aTools[$i - 1][$vButton_IconNumber] = 441 Case "pdf" $aTools[$i - 1][$vButton_IconNumber] = 400 Case "ppt", "pptx", "odp" $aTools[$i - 1][$vButton_IconNumber] = 431 Case "txt", "rtf" $aTools[$i - 1][$vButton_IconNumber] = 406 Case "msg" $aTools[$i - 1][$vButton_IconNumber] = 426 Case Else If $sExt = 'lnk' Then $aDetails = FileGetShortcut($aTools[$i - 1][$vButton_Command]) If IsArray($aDetails) Then $sTemp = $aTools[$i - 1][$vButton_Command] If $aDetails[4] <> '' Then $aTools[$i - 1][$vButton_Command] = $aDetails[4] Else $aTools[$i - 1][$vButton_Command] = $aDetails[0] EndIf EndIf EndIf If _WinAPI_ExtractIconEx($aTools[$i - 1][$vButton_Command], -1, 0, 0, 0) > 0 Then ; allows you to test if the file has one or more icon (s) Local $aIcon[3] = [64, 32, 16] For $a = 0 To UBound($aIcon) - 1 $aIcon[$a] = _WinAPI_Create32BitHICON(_WinAPI_ShellExtractIcon($aTools[$i - 1][$vButton_Command], 0, $aIcon[$a], $aIcon[$a]), 1) Next $aTools[$i - 1][$vButton_IconPath] = $AppDataUser & '\Icons\' & $aTools[$i - 1][$vButton_Tip] & '.ico' _WinAPI_SaveHICONToFile($aTools[$i - 1][$vButton_IconPath], $aIcon) For $a = 0 To UBound($aIcon) - 1 _WinAPI_DestroyIcon($aIcon[$a]) Next Else $aRet = _PickIconDlg($dll_icons) If Not @error Then If GUICtrlSetImage(@GUI_DropId, $aRet[0], $aRet[1]) Then $aTools[$i - 1][$vButton_IconPath] = $aRet[0] $aTools[$i - 1][$vButton_IconNumber] = $aRet[1] EndIf EndIf EndIf EndSwitch EndIf If $sTemp <> '' Then $aTools[$i - 1][$vButton_Command] = $sTemp If $aTools[$i - 1][$vButton_UniqueID] <> '' And $iAnswer = $IDYES Then _SQLite_LaunchPad($hSQLiteDB, "UPDATE Buttons SET Name = '" & $aTools[$i - 1][$vButton_Tip] & "' WHERE Button_ID = " & $aTools[$i - 1][$vButton_UniqueID] & ";") _SQLite_LaunchPad($hSQLiteDB, "UPDATE Buttons SET Execute = '" & $aTools[$i - 1][$vButton_Command] & "' WHERE Button_ID = " & $aTools[$i - 1][$vButton_UniqueID] & ";") _SQLite_LaunchPad($hSQLiteDB, "UPDATE Buttons SET Icon = '" & $aTools[$i - 1][$vButton_IconPath] & "' WHERE Button_ID = " & $aTools[$i - 1][$vButton_UniqueID] & ";") _SQLite_LaunchPad($hSQLiteDB, "UPDATE Buttons SET IconNum = '" & $aTools[$i - 1][$vButton_IconNumber] & "' WHERE Button_ID = " & $aTools[$i - 1][$vButton_UniqueID] & ";") Else _SQLite_LaunchPad($hSQLiteDB, "INSERT INTO Buttons (Name, Icon, IconNum, Execute) VALUES ('" & $aTools[$i - 1][$vButton_Tip] & "', '" & $aTools[$i - 1][$vButton_IconPath] & "', " & $aTools[$i - 1][$vButton_IconNumber] & ", '" & $aTools[$i - 1][$vButton_Command] & "');") _SQLite_GetTable2d($hSQLiteDB, "SELECT * FROM Buttons;", $aTools, $sqlRow, $sqlColumn) _ArrayDelete($aTools, 0) ReDim $aTools[UBound($aMyMatrix)][5] EndIf If $iAnswer = $IDYES Then GUICtrlSetTip(@GUI_DropId, $aTools[$i - 1][$vButton_Tip]) GUICtrlSetImage(@GUI_DropId, $aTools[$i - 1][$vButton_IconPath], $aTools[$i - 1][$vButton_IconNumber]) EndIf EndIf EndIf Case $idFreezeWindow If BitAND(GUICtrlRead($idFreezeWindow), $GUI_UNCHECKED) = $GUI_UNCHECKED Then $bFreezeWindow = True GUICtrlSetState($idFreezeWindow, $GUI_CHECKED) Else $bFreezeWindow = False GUICtrlSetState($idFreezeWindow, $GUI_UNCHECKED) EndIf Case $idStartUp If BitAND(GUICtrlRead($idStartUp), $GUI_UNCHECKED) = $GUI_UNCHECKED Then $bStartUp = True _StartUpProgram($bStartUp) GUICtrlSetState($idStartUp, $GUI_CHECKED) Else $bStartUp = False _StartUpProgram($bStartUp) GUICtrlSetState($idStartUp, $GUI_UNCHECKED) EndIf Case $idOpenDB If Not FileExists($AppDataUser & '\SQLiteDatabaseBrowserPortable') Then If MsgBox($MB_YESNO, "LauchPad DB Browser", "DB Browser for SQLite Portable is needed to change settings or buttons." & @CRLF & _StringRepeat(' ', 30) & "Do you want to download DB Browser?", 0, $GUI) = $IDYES Then ShellExecute('https://portableapps.com/apps/development/sqlite_database_browser_portable') MsgBox($MB_OK, "LauchPad DB Browser", "Installing DB Browser for SQLite Portable" & @CRLF & @CRLF & _ '1) Press green button to download DB Browser' & @CRLF & @CRLF & '2) Execute the downloaded file' & @CRLF & @CRLF & _ '3) Press Next and Destination Folder is ' & $AppDataUser & @CRLF & @CRLF & '4) Press Install and then Finish', 0, $GUI) EndIf Else $dHash = _Crypt_HashFile($SQLiteDB, $CALG_MD5) ShellExecuteWait($AppDataUser & '\SQLiteDatabaseBrowserPortable\SQLiteDatabaseBrowserPortable.exe', $SQLiteDB) If $dHash <> _Crypt_HashFile($SQLiteDB, $CALG_MD5) Then $bSaveSettings = False _RestartProgram() EndIf EndIf Case $idExportDB $sBackupName = 'LaunchPad-' & @YEAR & @MON & @MDAY & @HOUR & @MIN & @SEC & '.sql' $sFileDialog = FileSaveDialog('Export DB - LaunchPad', $AppDataUser & "\BackupDB\", "SQLite (*.sql)", BitOR($FD_PATHMUSTEXIST, $FD_PROMPTOVERWRITE), $sBackupName, $GUI) If Not @error Then $sTemp = '.open ' & StringReplace($SQLiteDB, '\', '/') & @CRLF $sTemp &= '.once "' & StringReplace($sFileDialog, '\', '/') & '"' & @CRLF $sTemp &= '.dump' & @CRLF & '.exit' & @CRLF _SQLite_SQLiteExe($SQLiteDB, $sTemp, $row, $AppDataUser & '\Bin\sqlite3.exe') EndIf Case $idImportDB $sFileDialog = FileOpenDialog('Import DB - LaunchPad', $AppDataUser & "\BackupDB\", "SQLite (*.sql)|All (*.*)", BitOR($FD_FILEMUSTEXIST, $FD_PATHMUSTEXIST), '', $GUI) If Not @error Then $bSaveSettings = False $sTemp = '.open ' & StringReplace($SQLiteDB, '\', '/') & @CRLF $sTemp &= 'DROP TABLE IF EXISTS Buttons;' & @CRLF $sTemp &= 'DROP TABLE IF EXISTS Settings;' & @CRLF $sTemp &= '.read "' & StringReplace($sFileDialog, '\', '/') & '"' & @CRLF $sTemp &= '.exit' & @CRLF _SQLite_SQLiteExe($SQLiteDB, $sTemp, $row, $AppDataUser & '\Bin\sqlite3.exe') _RestartProgram() EndIf Case $idAbout _About() Case Else $i = _ArraySearch($aMyMatrix, $Msg) If $i <> -1 Then If $aTools[$i - 1][$vButton_Command] <> '' Then $dummy = Execute($aTools[$i - 1][$vButton_Command]) If @error Then ShellExecute($aTools[$i - 1][$vButton_Command]) ElseIf $aTools[$i - 1][$vButton_Command] = '' Then MsgBox($MB_OK, "LauchPad Execute Shortcut", "This shortcut doesn't have an Application associated.", 0, $GUI) EndIf EndIf $i = _ArraySearch($aAnimation, $Msg) If $i <> -1 Then If GUICtrlRead($Msg, 1) = 'Explode' Then $GUI_IN = 'AW_EXPLODE' $GUI_OUT = 'AW_IMPLODE' Else $GUI_IN = 'AW_' & StringReplace(GUICtrlRead($Msg, 1), ' ', '_') $GUI_OUT = StringReplace($GUI_IN, '_In', '_Out') EndIf _SQLite_LaunchPad($hSQLiteDB, "UPDATE Settings SET GUIin = '" & $GUI_IN & "';") _SQLite_LaunchPad($hSQLiteDB, "UPDATE Settings SET GUIout = '" & $GUI_OUT & "';") ; Need to add focus EndIf $i = _ArraySearch($idAddIcon, $Msg) If $i <> -1 Then _SQLite_LaunchPad($hSQLiteDB, "INSERT INTO Buttons (Name, Icon, IconNum, Execute) VALUES ('', '', '', '');") _RestartProgram() EndIf $i = _ArraySearch($idRemoveIcon, $Msg) If $i <> -1 Then If MsgBox($MB_YESNO, "LauchPad Removing Icon", "Are you sure you want to delete " & $aTools[$i][$vButton_Tip] & " shortcut?", 0, $GUI) = $IDYES Then _SQLite_LaunchPad($hSQLiteDB, 'DELETE FROM Buttons WHERE Button_ID = ' & $aTools[$i][$vButton_UniqueID] & ';') If StringInStr($aTools[$i][$vButton_IconPath], $AppDataUser & '\Icons') Then FileDelete($aTools[$i][$vButton_IconPath]) _RestartProgram() EndIf EndIf $i = _ArraySearch($idChangeIcon, $Msg) If $i <> -1 Then $aRet = _PickIconDlg($dll_icons) If Not @error Then If GUICtrlSetImage($aMyMatrix[$i + 1], $aRet[0], $aRet[1]) Then $aTools[$i][$vButton_IconPath] = $aRet[0] $aTools[$i][$vButton_IconNumber] = $aRet[1] If $aTools[$i][$vButton_UniqueID] <> '' Then _SQLite_LaunchPad($hSQLiteDB, "UPDATE Buttons SET Icon = '" & $aTools[$i][$vButton_IconPath] & "' WHERE Button_ID = " & $aTools[$i][$vButton_UniqueID] & ";") _SQLite_LaunchPad($hSQLiteDB, "UPDATE Buttons SET IconNum = '" & $aTools[$i][$vButton_IconNumber] & "' WHERE Button_ID = " & $aTools[$i][$vButton_UniqueID] & ";") Else _SQLite_LaunchPad($hSQLiteDB, "INSERT INTO Buttons (Name, Icon, IconNum, Execute) VALUES ('', '" & $aTools[$i][$vButton_IconPath] & "', " & $aTools[$i][$vButton_IconNumber] & ", '');") _SQLite_GetTable2d($hSQLiteDB, "SELECT * FROM Buttons;", $aTools, $sqlRow, $sqlColumn) _ArrayDelete($aTools, 0) ReDim $aTools[UBound($aMyMatrix)][5] EndIf EndIf EndIf EndIf EndSwitch ; check if any size has changed If $iPreviousX <> ($aMyMatrix[0])[1] Or $iPreviousY <> ($aMyMatrix[0])[2] Then ; calculate the variations $iDeltaX = Abs($iPreviousX - ($aMyMatrix[0])[1]) $iDeltaY = Abs($iPreviousY - ($aMyMatrix[0])[2]) ; if both dimensions changed at the same time, the largest variation prevails over the other If $iDeltaX >= $iDeltaY Then ; keep the new number of columns ; calculate and set the correct number of lines accordingly _SubArraySet($aMyMatrix[0], 2, Ceiling((UBound($aMyMatrix) - 1) / ($aMyMatrix[0])[1])) Else ; otherwise keep the new number of rows ; calculate and set the correct number of columns accordingly _SubArraySet($aMyMatrix[0], 1, Ceiling((UBound($aMyMatrix) - 1) / ($aMyMatrix[0])[2])) EndIf ; set client area new sizes _WinSetClientSize($GUI, ($aMyMatrix[0])[1] * $iStep, ($aMyMatrix[0])[2] * $iStep) ; remember the new panel settings $iPreviousX = ($aMyMatrix[0])[1] $iPreviousY = ($aMyMatrix[0])[2] ; rearrange the controls inside the panel For $i = 0 To UBound($aMyMatrix) - 2 ; coordinates 1 based $col = Mod($i, $iPreviousX) + 1 ; Horizontal position within the grid (column) $row = Int($i / $iPreviousX) + 1 ; Vertical position within the grid (row number) $left = ($aMyMatrix[0])[5] + (((($aMyMatrix[0])[3] + ($aMyMatrix[0])[9]) * $col) - ($aMyMatrix[0])[9]) - ($aMyMatrix[0])[3] + ($aMyMatrix[0])[7] $top = ($aMyMatrix[0])[6] + (((($aMyMatrix[0])[4] + ($aMyMatrix[0])[10]) * $row) - ($aMyMatrix[0])[10]) - ($aMyMatrix[0])[4] + ($aMyMatrix[0])[8] GUICtrlSetPos($aMyMatrix[$i + 1], $left, $top) Next EndIf WEnd EndFunc ;==>_MainLoop ; Allow/Disallow specific borders resizing ; thanks to Danyfirex ; --------- ; https://www.autoitscript.com/forum/topic/201464-partially-resizable-window-how-solved-by-danyfirex-%F0%9F%91%8D/?do=findComment&comment=1445748 Func WM_NCHITTEST($hwnd, $iMsg, $iwParam, $ilParam) If $hwnd = $GUI Then Local $iRet = _WinAPI_DefWindowProc($hwnd, $iMsg, $iwParam, $ilParam) ; https://docs.microsoft.com/en-us/windows/win32/inputdev/wm-nchittest If $iRet = $HTBOTTOM Or $iRet = $HTRIGHT Or $iRet = $HTBOTTOMRIGHT Then ; allowed resizing Return $iRet ; default process of border resizing Else ; resizing not allowed Return $HTCLIENT ; do like if cursor is in the client area EndIf EndIf Return $GUI_RUNDEFMSG EndFunc ;==>WM_NCHITTEST ; controls and process resizing operations in real time ; thanks to mikell ; ------ ; https://www.autoitscript.com/forum/topic/201464-partially-resizable-window-how-solved-by-danyfirex-%F0%9F%91%8D/?do=findComment&comment=1445754 Func WM_SIZING($hwnd, $iMsg, $wparam, $lparam) ; https://docs.microsoft.com/en-us/windows/win32/winmsg/wm-sizing Local $iCols = ($aMyMatrix[0])[1] Local $iRows = ($aMyMatrix[0])[2] Local $xClientSizeNew, $yClientSizeNew #cs $wparam The edge of the window that is being sized. $lparam A pointer to a RECT structure with the screen coordinates of the drag rectangle. To change the size or position of the drag rectangle, an application must change the members of this structure. Return value Type: LRESULT #ce $wparam $aPos = WinGetPos($GUI) #cs Success : a 4 - element array containing the following information : $aArray[0] = X position $aArray[1] = Y position $aArray[2] = Width #ce Success : a 4 - element array containing the following information : $aPos2 = WinGetClientSize($GUI) #cs Success: a 2-element array containing the following information: $aArray[0] = Width of window's client area #ce Success: a 2-element array containing the following information: ; https://docs.microsoft.com/en-us/previous-versions//dd162897(v=vs.85) Local $sRect = DllStructCreate("Int[4]", $lparam) ; outer dimensions (includes borders) Local $left = DllStructGetData($sRect, 1, 1) Local $top = DllStructGetData($sRect, 1, 2) Local $Right = DllStructGetData($sRect, 1, 3) Local $bottom = DllStructGetData($sRect, 1, 4) ; border width Local $iEdgeWidth = ($aPos[2] - $aPos2[0]) / 2 Local $iHeadHeigth = $aPos[3] - $aPos2[1] - $iEdgeWidth * 2 Local $aEdges[2] $aEdges[0] = $aPos[2] - $aPos2[0] ; x $aEdges[1] = $aPos[3] - $aPos2[1] ; y $xClientSizeNew = $Right - $left - $aEdges[0] $xClientSizeNew = Round($xClientSizeNew / $iStep) * $iStep $yClientSizeNew = $bottom - $top - $aEdges[1] $yClientSizeNew = Round($yClientSizeNew / $iStep) * $iStep Switch $wparam Case $WMSZ_RIGHT ; calculate the new position of the right border DllStructSetData($sRect, 1, $left + $xClientSizeNew + $aEdges[0], 3) Case $WMSZ_BOTTOM ; calculate the new position of the bottom border DllStructSetData($sRect, 1, $top + $yClientSizeNew + $aEdges[1], 4) Case $WMSZ_BOTTOMRIGHT ; calculate the new position of both borders DllStructSetData($sRect, 1, $left + $xClientSizeNew + $aEdges[0], 3) DllStructSetData($sRect, 1, $top + $yClientSizeNew + $aEdges[1], 4) EndSwitch #cs If DllStructGetData($sRect, 1, 3) > @DesktopWidth Then ; $Right DllStructSetData($sRect, 1, DllStructGetData($sRect, 1, 3) - $iStep, 3) $xClientSizeNew -= $iStep EndIf If DllStructGetData($sRect, 1, 4) > @DesktopHeight Then ; $bottom DllStructSetData($sRect, 1, DllStructGetData($sRect, 1, 4), 4) $yClientSizeNew -= $iStep #ce If DllStructGetData($sRect, 1, 3) > @DesktopWidth Then ; $Right ; check if number of rows has changed If $iRows <> $yClientSizeNew / $iStep Then _SubArraySet($aMyMatrix[0], 2, $yClientSizeNew / $iStep) EndIf ; check if number of columns has changed If $iCols <> $xClientSizeNew / $iStep Then _SubArraySet($aMyMatrix[0], 1, $xClientSizeNew / $iStep) EndIf Return $GUI_RUNDEFMSG EndFunc ;==>WM_SIZING ; set client area new sizes ; thanks to KaFu ; ---- ; https://www.autoitscript.com/forum/topic/201524-guicreate-and-wingetclientsize-mismatch/?do=findComment&comment=1446141 Func _WinSetClientSize($hwnd, $iW, $iH) Local $aWinPos = WinGetPos($hwnd) Local $sRect = DllStructCreate("int;int;int;int;") DllStructSetData($sRect, 3, $iW) DllStructSetData($sRect, 4, $iH) _WinAPI_AdjustWindowRectEx($sRect, _WinAPI_GetWindowLong($hwnd, $GWL_STYLE), _WinAPI_GetWindowLong($hwnd, $GWL_EXSTYLE)) WinMove($hwnd, "", $aWinPos[0], $aWinPos[1], $aWinPos[2] + (DllStructGetData($sRect, 3) - $aWinPos[2]) - DllStructGetData($sRect, 1), $aWinPos[3] + (DllStructGetData($sRect, 4) - $aWinPos[3]) - DllStructGetData($sRect, 2)) EndFunc ;==>_WinSetClientSize ; ; #FUNCTION# ==================================================================================================================== ; Name...........: _GuiControlPanel ; Description ...: Creates a rectangular panel with adequate size to contain the required amount of controls ; and then fills it with the same controls by placing them according to the parameters ; Syntax.........: _GuiControlPanel($ControlType, $nrPerLine, $nrOfLines, $ctrlWidth, $ctrlHeight, $style, $exStyle, $xPos = 0, $yPos = 0, $xBorder, $yBorder, $xSpace = 1, $ySpace = 1, $Group = false, , $sGrpTitle = "") ; Parameters ....: $ControlType - Type of controls to be generated ("Button"; "Text"; ..... ; $nrPerLine - Nr. of controls per line in the matrix ; $nrOfLines - Nr. of lines in the matrix ; $ctrlWidth - Width of each control ; $ctrlHeight - Height of each control ; $Style - Defines the style of the control ; $exStyle - Defines the extended style of the control ; $xPanelPos - x Position of panel in GUI ; $yPanelPos - y Position of panel in GUI ; $xBorder - distance from lateral panel's borders to the matrix (width of left and right margin) default = 0 ; $yBorder - distance from upper and lower panel's borders to the matrix (width of upper and lower margin) default = 0 ; $xSpace - horizontal distance between the controls ; $ySpace - vertical distance between the controls ; $Group - if you want to group the controls (true or false) ; $sGrpTitle - title of the group (ignored if above is false) ; Return values .: an 1 based 1d array containing references to each control ; element [0] contains an 1d array containing various parameters about the panel ; Author ........: Gianni Addiego (Chimp) ; Modified.......: ; Remarks .......: ; Related .......: ; Link ..........: ; Example .......: ; =============================================================================================================================== Func _GuiControlPanel($ControlType, $nrPerLine, $nrOfLines, $ctrlWidth, $ctrlHeight, $style = -1, $exStyle = -1, $xPanelPos = 0, $yPanelPos = 0, $xBorder = 0, $yBorder = 0, $xSpace = 1, $ySpace = 1, $Group = False, $sGrpTitle = "") Local Static $sAllowedControls = "|Label|Input|Edit|Button|CheckBox|Radio|List|Combo|Pic|Icon|Graphic|" If Not StringInStr($sAllowedControls, '|' & $ControlType & '|') Then Return SetError(1, 0, "Unkown control") Local $PanelWidth = (($ctrlWidth + $xSpace) * $nrPerLine) - $xSpace + ($xBorder * 2) Local $PanelHeight = (($ctrlHeight + $ySpace) * $nrOfLines) - $ySpace + ($yBorder * 2) Local $hGroup If $Group Then If $sGrpTitle = "" Then $xPanelPos += 1 $yPanelPos += 1 $hGroup = GUICtrlCreateGroup("", $xPanelPos - 1, $yPanelPos - 7, $PanelWidth + 2, $PanelHeight + 8) Else $xPanelPos += 1 $yPanelPos += 15 $hGroup = GUICtrlCreateGroup($sGrpTitle, $xPanelPos - 1, $yPanelPos - 15, $PanelWidth + 2, $PanelHeight + 16) EndIf EndIf ; create the controls Local $aGuiGridCtrls[$nrPerLine * $nrOfLines + 1] Local $aPanelParams[14] = [ _ $ControlType, $nrPerLine, $nrOfLines, $ctrlWidth, $ctrlHeight, _ $xPanelPos, $yPanelPos, $xBorder, $yBorder, $xSpace, $ySpace, $PanelWidth, $PanelHeight, $hGroup] ReDim $idAddIcon[UBound($aGuiGridCtrls)] ReDim $idRemoveIcon[UBound($aGuiGridCtrls)] ReDim $idChangeIcon[UBound($aGuiGridCtrls)] For $i = 0 To $nrPerLine * $nrOfLines - 1 ; coordinates 1 based $col = Mod($i, $nrPerLine) + 1 ; Horizontal position within the grid (column) $row = Int($i / $nrPerLine) + 1 ; Vertical position within the grid (row) $left = $xPanelPos + ((($ctrlWidth + $xSpace) * $col) - $xSpace) - $ctrlWidth + $xBorder $top = $yPanelPos + ((($ctrlHeight + $ySpace) * $row) - $ySpace) - $ctrlHeight + $yBorder $text = $i + 1 ; "*" ; "." ; "(*)" ; create the control(s) $aGuiGridCtrls[$i + 1] = Execute("GUICtrlCreate" & $ControlType & "($text, $left, $top, $ctrlWidth, $ctrlHeight, $style, $exStyle)") If BitAND($exStyle, $WS_EX_ACCEPTFILES) = $WS_EX_ACCEPTFILES Then GUICtrlSetState($aGuiGridCtrls[$i + 1], $GUI_DROPACCEPTED) $idContextmenu = GUICtrlCreateContextMenu($aGuiGridCtrls[$i + 1]) $idAddIcon[$i] = GUICtrlCreateMenuItem("Add Icon", $idContextmenu) $idRemoveIcon[$i] = GUICtrlCreateMenuItem("Remove Icon", $idContextmenu) $idChangeIcon[$i] = GUICtrlCreateMenuItem("Change icon", $idContextmenu) Next If $Group Then GUICtrlCreateGroup("", -99, -99, 1, 1) ; close group $aGuiGridCtrls[0] = $aPanelParams Return $aGuiGridCtrls EndFunc ;==>_GuiControlPanel ; writes a value to an element of an array embedded in another array Func _SubArraySet(ByRef $aSubArray, $iElement, $vValue) $aSubArray[$iElement] = $vValue EndFunc ;==>_SubArraySet Func _ToggleGuiShowHide($hwnd, $bToggleGUI) If $bToggleGUI Then $bShowGUI = True DllCall($dllUser32, "int", "AnimateWindow", "hwnd", $hwnd, "int", 200, "long", Eval($GUI_IN)) ; show panel WinActivate($hwnd) Else $bShowGUI = False If Not $bFreezeWindow Then DllCall($dllUser32, "int", "AnimateWindow", "hwnd", $hwnd, "int", 200, "long", Eval($GUI_OUT)) ; hide panel EndIf EndFunc ;==>_ToggleGuiShowHide Func _Exit() Local $awPos If $bSaveSettings Then $awPos = WinGetPos($GUI) If $awPos[0] < 0 Then $awPos[0] = 0 If $awPos[1] < 0 Then $awPos[1] = 0 _SQLite_LaunchPad($hSQLiteDB, "UPDATE Settings SET LeftPos = " & $awPos[0] & ";") _SQLite_LaunchPad($hSQLiteDB, "UPDATE Settings SET TopPos = " & $awPos[1] & ";") _SQLite_LaunchPad($hSQLiteDB, "UPDATE Settings SET ButtonSize = " & $iStep & ";") _SQLite_LaunchPad($hSQLiteDB, "UPDATE Settings SET xColumns = " & ($aMyMatrix[0])[1] & ";") _SQLite_LaunchPad($hSQLiteDB, "UPDATE Settings SET GUIin = '" & $GUI_IN & "';") _SQLite_LaunchPad($hSQLiteDB, "UPDATE Settings SET GUIout = '" & $GUI_OUT & "';") _SQLite_LaunchPad($hSQLiteDB, "UPDATE Settings SET Freeze = '" & $bFreezeWindow & "';") _SQLite_LaunchPad($hSQLiteDB, "UPDATE Settings SET StartUp = '" & $bStartUp & "';") EndIf _SQLite_Close($hSQLiteDB) _SQLite_Shutdown() EndFunc ;==>_Exit #Region --- Restart Program --- Func _RestartProgram() If @Compiled And StringRegExpReplace(FileGetShortName(@ScriptFullPath), "^.*\.", "") <> 'a3x' Then Run(FileGetShortName(@ScriptFullPath)) Else Run(FileGetShortName(@AutoItExe) & " " & FileGetShortName(@ScriptFullPath)) EndIf Exit EndFunc ;==>_RestartProgram #EndRegion --- Restart Program --- Func _StartUpProgram($iStartup = True) If $iStartup And @Compiled And StringRegExpReplace(@ScriptFullPath, "^.*\.", "") <> 'a3x' Then FileCreateShortcut(@ScriptFullPath, @StartupDir & '\LaunchPad.lnk', $AppDataUser) ElseIf $iStartup Then FileCreateShortcut(@AutoItExe, @StartupDir & '\LaunchPad.lnk', $AppDataUser, FileGetShortName(@ScriptFullPath)) EndIf If Not $iStartup Then FileDelete(@StartupDir & '\LaunchPad.lnk') EndFunc ;==>_StartUpProgram Func _PickIconDlg($sFileName, $nIconIndex = 0, $hwnd = 0) Local $nRet, $aRetArr[2] $nRet = DllCall("shell32.dll", "int", "PickIconDlg", _ "hwnd", $hwnd, _ "wstr", $sFileName, "int", 1000, "int*", $nIconIndex) If Not $nRet[0] Then Return SetError(1, 0, -1) $aRetArr[0] = $nRet[2] $aRetArr[1] = $nRet[4] + 1 Return $aRetArr EndFunc ;==>_PickIconDlg Func _SQLite_LaunchPad($hwnd, $sqlCMD, $sqlExit = False) If Not _SQLite_Exec($hSQLiteDB, $sqlCMD) = $SQLITE_OK Then _ MsgBox($MB_SYSTEMMODAL, "SQLite Error", _SQLite_ErrMsg() & @CRLF & @CRLF & $sqlCMD, 0, $GUI) If $sqlExit Then Exit -1 EndFunc ;==>_SQLite_LaunchPad ; Return an array which xMin[0], xMax[1], yMin[2], yMax[3] Func _GetVirtualScreen() ;~ 'Virtual Desktop sizes Local $SM_XVIRTUALSCREEN = 76 ; 'Virtual Left Local $SM_YVIRTUALSCREEN = 77 ; 'Virtual Top Local $SM_CXVIRTUALSCREEN = 78 ; 'Virtual Width Local $SM_CYVIRTUALSCREEN = 79 ; 'Virtual Height Dim $xyScreen[4] Local $posWin = WinGetPos($GUI) Dim $VirtualScreen[4] = [$SM_XVIRTUALSCREEN, $SM_CXVIRTUALSCREEN, $SM_YVIRTUALSCREEN, $SM_CYVIRTUALSCREEN] For $x = 0 To 3 $xTemp = DllCall("user32.dll", "int", "GetSystemMetrics", "int", $VirtualScreen[$x]) If $x = 1 Then ;~ Note: $SM_CXVIRTUALSCREEN + $SM_XVIRTUALSCREEN = $RightSideScreen $xyScreen[$x] = ($xTemp[0] + $xyScreen[$x - 1]) - 1 Else $xyScreen[$x] = $xTemp[0] If $x = 3 Then $xyScreen[$x] -= 1 EndIf Next ;~ Note: The if statement below is to deal with multi monitors and undocked laptop move LaunchPad If (IsArray($posWin) And IsArray($xyScreen)) And ($posWin[0] > $xyScreen[1] Or $posWin[1] > $xyScreen[3]) Then $bSaveSettings = False WinMove($GUI, '', 0, 0) EndIf Return ($xyScreen) EndFunc ;==>_GetVirtualScreen Func _About() Local $sAboutText = 'LaunchPad you can easily create panels with buttons for starting applications on a Windows System.' $sAboutText &= @CRLF & @CRLF & 'Author: Chimp' & @CRLF $sAboutText &= 'Modify: Marcgforce, Danny35d' & @CRLF $sAboutText &= 'Credits: @KaFu, @Danyfirex, @mikell' GUISetState(@SW_DISABLE, $GUI) Local $AboutGUI = GuiCreate(' About LaunchPad' , 280, 160, Default, Default, $WS_CAPTION, Default, $GUI) GUISetBkColor (0xf8c848) GuiCtrlCreateLabel($sAboutText, 5, 10, 280, 100) GuiCtrlCreateLabel('____________________________________________', 10, 90, 260, 15, $SS_CENTER) ; separator $WebsiteLink = GuiCtrlCreateLabel('www.autoitscript.com/forum/topic/202048-button-deck/', 5, 105, 270, 20, $SS_CENTER) ; he he! GUICtrlSetCursor($WebsiteLink, 0) GUICtrlSetColor($WebsiteLink, 0x0000ff) Local $ok = GUICtrlCreateButton('OK', 10, 130, 70, 22, $BS_DEFPUSHBUTTON) GUISetState() While 1 $aboutMsg = GUIGetMsg() Select Case $aboutMsg = $GUI_EVENT_CLOSE ExitLoop Case $aboutMsg = $ok ExitLoop Case $aboutMsg = $WebsiteLink ShellExecute ('https://www.autoitscript.com/forum/topic/202048-button-deck/') EndSelect WEnd GUISetState(@SW_ENABLE, $GUI) GUIDelete($AboutGUI) Return EndFunc ;==>About Func Test() MsgBox(0, 0, ":)", 1) EndFunc ;==>Test
  7. @Docfxit There are two UltraVnc installation packages. One of the installation package is the .msi which NOT support /loadinf and /props switches. The second installation package is the .exe which support /loadinf and /props switches.
  8. Correct me if I'm wrong. The first script create a directory either in C:\Program Files (x86)\teste or C:\Program Files\teste. Then create a service called Agente - Teste and finally give you a message box to show you if there were any errors creating the services. What I don't see is the part of the first script copying Agente.Teste.exe into C:\Program Files\teste? That could be the reason for error 1053 "not respond in a timely fashion.
  9. This is an old article and you may have to update the UDF scripts to make work with the latest AutoIt. Ini in Memory
  10. I have the same issue at my work. Now I'm using digital sign tool to add a certificate to my script and the antivirus won't deleted. https://www.autoitscript.com/forum/topic/186971-digital-sign-tool/?tab=comments#comment-1342693
  11. Once way is using StringSplit which create an array and then you can select the month. #include <Date.au3> ;~ Substract one month from the current month $newmonth = _DateAdd('M', -1, _NowCalcDate()) ;~ Write the new date If $newmonth <> 0 Then $Temp = StringSplit($newmonth, '/') $newmonth = $Temp[2] EndIf ConsoleWrite(@LF&@LF&$newmonth&@LF&@LF)
  12. @kylomas thanks for sharing I knew there was a way to do it with RegEx I just couldn't figure out.
  13. Give it a try: #include <Array.au3> Local $i, $file, $aArray RunWait(@ComSpec & " /c " & " net view > C:\Temp\nodes.txt", "", @SW_HIDE) $file = StringRegExp(FileRead('C:\Temp\nodes.txt'), '\\\\.*', 3) For $i In $file $aArray &= StringStripWS(StringLeft($i, 23), 3) & @CR Next $aArray = StringSplit(StringTrimRight($aArray, 1), @CR) FileDelete ("C:\Temp\nodes.txt") _ArrayDisplay($aArray)
  14. @Ciprian The Run function on your script from the 1st post it missing the working directory before the @SW_SHOW. Add the working directory and it works fine. Run(@ComSpec & " /c taskkill /S " & $strServer & " /U " & $strDomain & "\" & $strUsername & " /P " & $strPassword & " /F /IM " & $Process, @WorkingDir, @SW_SHOW) One way to see the output of the batch command is by adding && pause to the Run function. Run(@ComSpec & " /c taskkill /S " & $strServer & " /U " & $strDomain & "\" & $strUsername & " /P " & $strPassword & " /F /IM " & $Process & ' && pause', @WorkingDir, @SW_SHOW)
  15. Give it a try I use the following functions _DateTimeSplit() and _DateToDayValue() to convert the Dates to decimal and then compare if is between the dates. ;~ #Region ;**** Directives created by AutoIt3Wrapper_GUI **** ;~ ;#AutoIt3Wrapper_Run_Au3Stripper=y ;~ ;#Au3Stripper_Parameters= /StripUnusedVars=0/1 /SV=0/1 ;~ #AutoIt3Wrapper_Outfile=L:\Dash Board.exe ;~ #AutoIt3Wrapper_Run_Tidy=y ;~ ;#AutoIt3Wrapper_Au3Check_Parameters =-w 5 ; -q -d -w 1 -w 2 -w 3 -w- 4 -w 5 -w 6 -w- 7 ;~ #AutoIt3Wrapper_Au3Check_Parameters = -q -d -w 1 -w 2 -w 3 -w- 4 -w 5 -w 6 -w- 7 ;~ #EndRegion ;**** Directives created by AutoIt3Wrapper_GUI **** ;<<<<<<<<<<<<<<<<<<<<<<<< #include <Array.au3> #include <Date.au3> #include <GUIConstantsEx.au3> #include <Misc.au3> #include <MsgBoxConstants.au3> #include <StaticConstants.au3> #include <WindowsConstants.au3> #include <GuiDateTimePicker.au3> #include <ButtonConstants.au3> ;<<<<<<<<<<<< Local $main = GUICreate(" Dash Board", 680, 515, 150, 100) Local $Button12 = GUICtrlCreateButton("Date File", 10, 60, 158, 33) GUICtrlSetFont(-1, 8.5, 800, 0, "Verdana") Local $CardStart = GUICtrlCreateRadio("Start:", 475, 10, 55, 20) GUICtrlSetFont($CardStart, 8.5, 800, 0, "Verdana") Local $Labelstart = GUICtrlCreateLabel("N O N E", 560, 11, 80, 20, $SS_LEFT) GUICtrlSetFont(-1, 8.5, 800, 0, "Verdana") GUICtrlSetState($CardStart, $GUI_enABLE) Local $CardEnd = GUICtrlCreateRadio("End:", 475, 27, 50, 20) GUICtrlSetFont($CardEnd, 8.5, 800, 0, "Verdana") Local $Labelend = GUICtrlCreateLabel("N O N E", 560, 29, 80, 20, $SS_LEFT) GUICtrlSetFont(-1, 8.5, 800, 0, "Verdana") GUICtrlSetState($CardEnd, $GUI_enABLE) Global $hdate = GUICtrlCreateDate(_NowCalcDate(), 357, 28, 100, 16, $WS_BORDER) ;465, 28, 100, 16, $WS_BORDER) GUICtrlSetState($hdate, $GUI_show) Local $hWndDate = ControlGetHandle($main, "", $hdate) ;_GUICtrlDTP_SetFormat($hWndDate, "MM/dd/yyyy") ;//////////////// _GUICtrlDTP_SetFormat($hWndDate, "yyyy/MM/dd") ;//////////////// Global $CardDate Global $CardDate1 ;start Global $CardDate2 ;end Local $aDate, $aTime GUISetState(@SW_SHOW) While 1 Local $iMsg = GUIGetMsg() Switch $iMsg Case $GUI_EVENT_CLOSE Exit Case $Button12 ;Check today's date againt a date range assigned by radiobuttons via datepicker $CardDate = today() Local $iDateCalc _DateTimeSplit($CardDate1, $aDate, $aTime) $TempDate1 = _DateToDayValue($aDate[1], $aDate[2], $aDate[3]) _DateTimeSplit($CardDate2, $aDate, $aTime) $TempDate2 = _DateToDayValue($aDate[1], $aDate[2], $aDate[3]) If $CardDate >= $TempDate1 And $CardDate <= $TempDate2 Then MsgBox($MB_SYSTEMMODAL, "" & $CardDate1 & " " & $CardDate2, "start/end date " & $CardDate1 & " Date In Range: " & $iDateCalc) Else MsgBox($MB_SYSTEMMODAL, "" & $CardDate1 & " " & $CardDate2, "start/end date " & $CardDate1 & " Date NOT In Range: " & $iDateCalc) EndIf Case $hdate If GUICtrlRead($CardStart) = 1 Then GUICtrlSetState($hdate, $GUI_enABLE) $1stdate = GUICtrlRead($hdate) $CardDate1 = $1stdate ;GUICtrlRead($hdate) GUICtrlSetData($Labelstart, $CardDate1) EndIf If GUICtrlRead($CardEnd) = 1 Then GUICtrlSetState($hdate, $GUI_enABLE) $2nddate = GUICtrlRead($hdate) $CardDate2 = $2nddate ; GUICtrlRead($hdate) GUICtrlSetData($Labelend, $CardDate2) EndIf EndSwitch WEnd Func today() ; Return (_DateToDayValue(@YEAR, @MON, @MDAY)) EndFunc ;==>today
×
×
  • Create New...