Leaderboard
Popular Content
Showing content with the highest reputation on 05/15/2020 in all areas
-
DrJohn, Are you working in an x64 environmment? If so then the problem is because the MS scripting dictionary will only accept x32 numeric values, as I found out when trying to rewrite _ArrayUnique function. If you look in that code you will see that I ended up saving x64 values (such as handles) as concatenated "VarGetType & String(Value)" strings and then recreating them as x64 values once the "unique" values were found. Nothing we can do about it - it is a MS design decision. I have used Nuster's AssocArrays UDF a lot - however, there are still some bugs hidden away inside so be very careful. But Maps may well be coming to the next full release of AutoIt - Jon has been working hard on them and the current Betas have shown good Map stability. Keep your fingers crossed and you may be lucky! M232 points
-
You can do something like this to remove that limitation. #include <WindowsConstants.au3> #include <WinAPIProc.au3> #include <WinAPIMem.au3> #include <String.au3> Global $bExit = False Global $hGUI If $CmdLine[0] And $CmdLine[1] = '/Child' Then $hGUI = GUICreate('Child') GUIRegisterMsg($WM_COPYDATA, '_WM_COPYDATA') Do Sleep(10) Until $bExit Exit EndIf Run(@AutoItExe & ' /AutoIt3ExecuteScript "' & @ScriptFullPath & '" /Child') $hChild = WinWait('[CLASS:AutoIt v3 GUI;TITLE:Child]') $sRet = _Send($hChild) MsgBox(64, 'Return', $sRet) Func _Send($hWnd) Local $stData = DllStructCreate('ulong_ptr;dword;ptr') Local $aRet = DllCall('user32.dll', 'ptr', 'SendMessage', 'hwnd', $hWnd, 'uint', $WM_COPYDATA, 'ptr', 0, 'ptr', DllStructGetPtr($stData)) Local $tSize = _WinAPI_ReadProcessMemoryEx(WinGetProcess($hWnd), Ptr($aRet[0]), 'long iSize') Local $stStr = _WinAPI_ReadProcessMemoryEx(WinGetProcess($hWnd), Ptr($aRet[0] + 4), 'wchar sStr[' & $tSize.iSize & ']') Return DllStructGetData($stStr, 'sStr') EndFunc ;==>_Send Func _WM_COPYDATA($hWnd, $iMsg, $wParam, $lParam) $bExit = True $vRet = "A_" & _StringRepeat('Test', Random(1, 1000)) & "_Y" $iLen = (StringLen($vRet) + 1) $stStr = DllStructCreate('long iSize;wchar sStr[' & $iLen & ']') DllStructSetData($stStr, 'iSize', $iLen) DllStructSetData($stStr, 'sStr', $vRet) Return DllStructGetPtr($stStr) EndFunc ;==>_WM_COPYDATA Func _WinAPI_ReadProcessMemoryEx($iProcessID, $pPointer, $sStructTag) Local $iSYNCHRONIZE = (0x00100000), $iSTANDARD_RIGHTS_REQUIRED = (0x000F0000) Local $iPROCESS_ALL_ACCESS = ($iSTANDARD_RIGHTS_REQUIRED + $iSYNCHRONIZE + 0xFFF) Local $hProcess, $Struct, $StructPtr, $StructSize, $Read $hProcess = _WinAPI_OpenProcess($iPROCESS_ALL_ACCESS, False, $iProcessID) If @error Then Return SetError(@error, 1, $Struct) $Struct = DllStructCreate($sStructTag) $StructSize = DllStructGetSize($Struct) $StructPtr = DllStructGetPtr($Struct) _WinAPI_ReadProcessMemory($hProcess, $pPointer, $StructPtr, $StructSize, $Read) _WinAPI_CloseHandle($hProcess) Return SetError(@error, $Read, $Struct) EndFunc ;==>_WinAPI_ReadProcessMemoryEx Saludos2 points
-
Global $Regex, $String = "ABCDEF123456" Global $Pattern = "^(\w{4})(\w{4})(\w{4})$" ; ^ <-- beginning of the string ... end of string --> $ For $x = 1 To 2 Step 1 If $x = 2 Then $String &= "5_" EndIf If StringRegExp($String, $Pattern) Then $Regex = StringRegExpReplace($String, $Pattern, "$1" & "-" & "$2" & "-" & "$3") MsgBox(0, "Result if string is in the defined format", "String =" & $String & _ @CRLF & "Result =" & $Regex) Else MsgBox(0, "Result if not", $String & " does not match.") EndIf Next1 point
-
Oh yes... you can use some kind of pseudo-loop #include <MsgBoxConstants.au3> $sSerialStringExample1 = "ABCDEF12345" $sDelimiters1 = StringLeft($sSerialStringExample1, 4) & "-" & StringMid($sSerialStringExample1, 5, 4) & "-" & StringRight($sSerialStringExample1, 4) MsgBox($MB_SYSTEMMODAL, "Delimited", $sDelimiters1)1 point
-
Version 2: "Excel didn't return a Workbook object. Could be caused by the inability of Excel to open two Workbooks with the same name at a time"1 point
-
Well I must admit that your regex is more reliable, because it may return an error if let's say the string is 11 chars long only...1 point
-
_Excel_BookOpen Unhandled COM Error
seadoggie01 reacted to Danp2 for a topic
Me too... I'm just going coocoo1 point -
Updated BASS VST UDF DLL Version: 2.4.1.0 http://www.un4seen.com/download.php?z/5/bass_vst24 Changes: _BASS_VST_GetInfo() - Fixed May 03, 2020 (thanks to TheXman for dll structure) _BASS_VST_GetParamInfo() - Fixed May 03, 2020 (thanks to TheXman for dll structure) _BASS_VST_ChannelRemoveDSP() - Fixed May 14, 2020 (added channel handle parameter) Added Functions (May 14, 2020) _BASS_VST_GetProgram() _BASS_VST_SetProgram() _BASS_VST_GetProgramCount() _BASS_VST_HasEditor() Download: BASS_VST.au31 point
-
Source Code for Aut2Exe
TheDcoder reacted to JLogan3o13 for a topic
1 point -
👍 exactly what came to my mind, but what I was too lazy to do 🤫1 point
-
CMD Pipe demo
argumentum reacted to Dan_555 for a topic
Hi, this is not my script. I have used the Autoit Examples\GUI\Advanced\_NamedPipes_Server.au3 script and stripped down everything unneeded. Now it functions like what both Client and Server script did, just in one file: It captures the command-line output directly, using the pipe, and puts it into its own edit field. #include <GuiStatusBar.au3> #include <GuiEdit.au3> #include <GuiConstantsEx.au3> #include <NamedPipes.au3> #include <WinAPI.au3> #include <WindowsConstants.au3> ; =============================================================================================================================== ; Description ...: This was the server side of the pipe demo ; Author ........: Paul Campbell (PaulIA) ; Notes .........: CMD-Mod by dan_555 ; =============================================================================================================================== ; =============================================================================================================================== ; Global constants ; =============================================================================================================================== Global Const $BUFSIZE = 1024 * 4 Global Const $PIPE_NAME = "\\.\\pipe\\AutoIt3PipeTest" Global Const $TIMEOUT = 5000 Global Const $WAIT_TIMEOUT = 250 Global Const $ERROR_IO_PENDING = 997 Global Const $ERROR_PIPE_CONNECTED = 535 Global $locktimer = 0, $lockexit = 0, $inp1Txt Global $h_PID = 0 Global $closingdelay = 1000, $closecounter = 0, $TimeHandle = TimerInit(), $TimeDiff = TimerDiff($TimeHandle) ;Used for CloseGuiOnDoubleClick() Global $formTitle = "Pipe CMD Test" ; =============================================================================================================================== ; Global variables ; =============================================================================================================================== Global $g_hEvent, $g_idMemo, $g_pOverlap, $g_tOverlap, $g_hPipe, $g_hReadPipe, $g_iState, $g_iToWrite ; =============================================================================================================================== ; Main ; =============================================================================================================================== GUIRegisterMsg($WM_SIZE, "WM_SIZE") CreateGUI() InitPipe() MsgLoop() ; =============================================================================================================================== ; Creates a GUI ; =============================================================================================================================== Func CreateGUI() Global $hGUI = GUICreate($formTitle, 500, 400, -1, -1, BitOR($GUI_SS_DEFAULT_GUI, $WS_SIZEBOX, $WS_THICKFRAME)) Global $Button1 = GUICtrlCreateButton("Go", 2, 1, 37, 29) GUICtrlSetTip(-1, "Execute the command from the input box") Global $StatusBar1 = _GUICtrlStatusBar_Create($hGUI) Global $g_idMemo = GUICtrlCreateEdit("", 0, 31, 499, 349) Global $Input1 = GUICtrlCreateInput("", 40, 4, 380, 24) GUICtrlSetTip(-1, "Command to execute. Enter to start!" & @CRLF & "Needs user input to accept enter key!") Global $Button2 = GUICtrlCreateButton("CLS", 421, 1, 30, 29) GUICtrlSetTip(-1, "Clear the output") Global $Button3 = GUICtrlCreateButton("STOP", 461, 1, 35, 29) GUICtrlSetTip(-1, "Emergency stop, works only if a command is running." & @CRLF & "This will close the running Proccess !!!") GUICtrlSetFont($g_idMemo, 9, 400, 0, "Courier New") GUISetState() GUICtrlSetLimit($g_idMemo, 555555555) GuiCtrlSetState ($Button3,$GUI_DISABLE) EndFunc ;==>CreateGUI ; =============================================================================================================================== ; This function creates an instance of a named pipe ; =============================================================================================================================== Func InitPipe() ; Create an event object for the instance $g_tOverlap = DllStructCreate($tagOVERLAPPED) $g_pOverlap = DllStructGetPtr($g_tOverlap) $g_hEvent = _WinAPI_CreateEvent() If $g_hEvent = 0 Then LogMSG("ERR:InitPipe ..........: API_CreateEvent failed") Return EndIf DllStructSetData($g_tOverlap, "hEvent", $g_hEvent) ; Create a named pipe $g_hPipe = _NamedPipes_CreateNamedPipe($PIPE_NAME, _ ; Pipe name 2, _ ; The pipe is bi-directional 2, _ ; Overlapped mode is enabled 0, _ ; No security ACL flags 1, _ ; Data is written to the pipe as a stream of messages 1, _ ; Data is read from the pipe as a stream of messages 0, _ ; Blocking mode is enabled 1, _ ; Maximum number of instances $BUFSIZE, _ ; Output buffer size $BUFSIZE, _ ; Input buffer size $TIMEOUT, _ ; Client time out 0) ; Default security attributes If $g_hPipe = -1 Then LogMSG("ERR:InitPipe ..........: _NamedPipes_CreateNamedPipe failed") EndIf EndFunc ;==>InitPipe ; =============================================================================================================================== ; This function loops, waiting for user input or the GUI to close ; =============================================================================================================================== Func MsgLoop() GUICtrlSetData ($Input1,"cmd.exe /c dir C:\ /oN") While 1 CloseGuiOnDoubleClick("loop") $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE CloseGuiOnDoubleClick("button") Case $Input1 Go() Case $Button1 ;Execute the command from the edit field Go() Case $Button2 ;Clear the Edit field MemoWrite("", 1) EndSwitch WEnd EndFunc ;==>MsgLoop Func Go() $inp1Txt = GUICtrlRead($Input1) If $inp1Txt <> "" Then If ExecuteCmd($inp1Txt) Then GuiCtrlSetState ($Button3,$GUI_ENABLE) While $lockexit = 0 ;Exits the loop when the ReadOutput() stops receiving data. If GUIGetMsg() = $Button3 Then ProcessClose($h_PID) ;Stop Button, closes the proccess id - in case it is stuck _GUICtrlEdit_BeginUpdate($g_idMemo) ;This allows the edit field to be scrolled via scrollbars, while getting data. ReadOutput() ;Read the pipe and set the output into the edit field _GUICtrlEdit_EndUpdate($g_idMemo) WEnd $lockexit = 0 GuiCtrlSetState ($Button3,$GUI_DISABLE) LogMsg("done") EndIf EndIf EndFunc ;==>Go Func ReadOutput() Local $pBuffer, $tBuffer, $sLine, $iRead, $bSuccess, $iWritten $tBuffer = DllStructCreate("char Text[" & $BUFSIZE & "]") $pBuffer = DllStructGetPtr($tBuffer) ; Read data from console pipe _WinAPI_ReadFile($g_hReadPipe, $pBuffer, $BUFSIZE, $iRead) If $iRead = 0 Then _WinAPI_CloseHandle($g_hReadPipe) _WinAPI_FlushFileBuffers($g_hPipe) $lockexit = 1 $h_PID = 0 Return EndIf ; Get the data and strip out the extra carriage returns $sLine = StringLeft(DllStructGetData($tBuffer, "Text"), $iRead) $sLine = StringReplace($sLine, @CR & @CR, @CR) If $sLine <> "" Then MemoWrite($sLine) EndFunc ;==>ReadOutput ; =============================================================================================================================== ; Executes a command and returns the results ; =============================================================================================================================== Func ExecuteCmd($sCmd) Local $tProcess, $tSecurity, $tStartup, $hWritePipe ; Set up security attributes $tSecurity = DllStructCreate($tagSECURITY_ATTRIBUTES) DllStructSetData($tSecurity, "Length", DllStructGetSize($tSecurity)) DllStructSetData($tSecurity, "InheritHandle", True) ; Create a pipe for the child process's STDOUT If Not _NamedPipes_CreatePipe($g_hReadPipe, $hWritePipe, $tSecurity) Then LogMSG("ERR: ExecuteCmd ........: _NamedPipes_CreatePipe failed") Return False EndIf ; Create child process $tProcess = DllStructCreate($tagPROCESS_INFORMATION) $tStartup = DllStructCreate($tagSTARTUPINFO) DllStructSetData($tStartup, "Size", DllStructGetSize($tStartup)) DllStructSetData($tStartup, "Flags", BitOR($STARTF_USESTDHANDLES, $STARTF_USESHOWWINDOW)) DllStructSetData($tStartup, "StdOutput", $hWritePipe) DllStructSetData($tStartup, "StdError", $hWritePipe) If Not _WinAPI_CreateProcess("", $sCmd, 0, 0, True, 0, 0, "", DllStructGetPtr($tStartup), DllStructGetPtr($tProcess)) Then LogMSG("ERR: ExecuteCmd ........: _WinAPI_CreateProcess failed") _WinAPI_CloseHandle($g_hReadPipe) _WinAPI_CloseHandle($hWritePipe) Return False EndIf $h_PID = DllStructGetData($tProcess, "ProcessID") _WinAPI_CloseHandle(DllStructGetData($tProcess, "hProcess")) _WinAPI_CloseHandle(DllStructGetData($tProcess, "hThread")) ; Close the write end of the pipe so that we can read from the read end _WinAPI_CloseHandle($hWritePipe) LogMsg("ExecuteCommand ....: " & $sCmd) Return True EndFunc ;==>ExecuteCmd Func MemoWrite($sMessage = "", $clr = 0) local $CRLF="" If $clr = 1 Then GUICtrlSetData($g_idMemo, "") Else $CRLF=@CRLF EndIf GUICtrlSetData($g_idMemo, $sMessage & $CRLF, 0) EndFunc ;==>MemoWrite Func LogMsg($msg) _GUICtrlStatusBar_SetText($StatusBar1, $msg) EndFunc ;==>LogMsg ; Resize the status bar when GUI size changes Func WM_SIZE($hWnd, $iMsg, $wParam, $lParam) #forceref $hWnd, $iMsg, $wParam, $lParam _GUICtrlStatusBar_Resize($StatusBar1) Return $GUI_RUNDEFMSG EndFunc ;==>WM_SIZE Func CloseGuiOnDoubleClick($typ) $typ = StringLower($typ) Select Case $typ = "button" If $closecounter = 1 And TimerDiff($TimeHandle) <= $closingdelay Then GUIDelete() Exit EndIf If $closecounter = 0 Then $closecounter = 1 $TimeHandle = TimerInit() WinSetTitle($hGUI, "", "To close, use Slow doubleclick on the X ! Or (2* Alt F4) or (2*Esc)") EndIf Case $typ = "loop" If $closecounter = 1 And TimerDiff($TimeHandle) > $closingdelay Then $closecounter = 0 WinSetTitle($hGUI, "", $formTitle) EndIf EndSelect EndFunc ;==>CloseGuiOnDoubleClick Edit: The script may freeze, if the executed command waits for input.1 point -
1 point
-
I used the Example.au3 file and added two functions. 1) _Metro_CreateButtonFromImage() -> should create the button using an image 2) _Metro_CreateButtonWithIcon() -> should add an icon to the button to the left side I added the images using File to Base64 String' Code Generator. Here the code: ; =============================================================================================================================== ; Name ..........: MetroGUI UDF Example ; Version .......: v5.1 ; Author ........: BB_19 ; =============================================================================================================================== ;!Highly recommended for improved overall performance and responsiveness of the GUI effects etc.! (after compiling): #AutoIt3Wrapper_Run_Au3Stripper=y #Au3Stripper_Parameters=/so /rm /pe ;YOU NEED TO EXCLUDE FOLLOWING FUNCTIONS FROM AU3STRIPPER, OTHERWISE IT WON'T WORK: #Au3Stripper_Ignore_Funcs=_iHoverOn,_iHoverOff,_iFullscreenToggleBtn,_cHvr_CSCP_X64,_cHvr_CSCP_X86,_iControlDelete ;Please not that Au3Stripper will show errors. You can ignore them as long as you use the above Au3Stripper_Ignore_Funcs parameters. ;Required if you want High DPI scaling enabled. (Also requries _Metro_EnableHighDPIScaling()) #AutoIt3Wrapper_Res_HiDpi=y ; =============================================================================================================================== #NoTrayIcon #include "MetroGUI-UDF\MetroGUI_UDF.au3" #include "MetroGUI-UDF\_GUIDisable.au3" ; For dim effects when msgbox is displayed #include <GUIConstants.au3> ;=======================================================================Creating the GUI=============================================================================== ;Enable high DPI support: Detects the users DPI settings and resizes GUI and all controls to look perfectly sharp. _Metro_EnableHighDPIScaling() ; Note: Requries "#AutoIt3Wrapper_Res_HiDpi=y" for compiling. To see visible changes without compiling, you have to disable dpi scaling in compatibility settings of Autoit3.exe ;Set Theme _SetTheme("DarkTeal") ;See MetroThemes.au3 for selectable themes or to add more ;Create resizable Metro GUI $Form1 = _Metro_CreateGUI("Example", 500, 300, -1, -1, True) ;Add/create control buttons to the GUI $Control_Buttons = _Metro_AddControlButtons(True, True, True, True, True) ;CloseBtn = True, MaximizeBtn = True, MinimizeBtn = True, FullscreenBtn = True, MenuBtn = True ;Set variables for the handles of the GUI-Control buttons. (Above function always returns an array this size and in this order, no matter which buttons are selected.) $GUI_CLOSE_BUTTON = $Control_Buttons[0] $GUI_MAXIMIZE_BUTTON = $Control_Buttons[1] $GUI_RESTORE_BUTTON = $Control_Buttons[2] $GUI_MINIMIZE_BUTTON = $Control_Buttons[3] $GUI_FULLSCREEN_BUTTON = $Control_Buttons[4] $GUI_FSRestore_BUTTON = $Control_Buttons[5] $GUI_MENU_BUTTON = $Control_Buttons[6] ;====================================================================================================================================================================== ;Create Buttons Global $hImage_Btn1 = _GDIPlus_BitmapCreateFromMemory(_Button1()) $Button1 = _Metro_CreateButtonFromImage($hImage_Btn1, 37, 235) Global $hImage_Icon1 = _GDIPlus_BitmapCreateFromMemory(_Icon1()) $Button2 = _Metro_CreateButtonWithIcon("Excel", $hImage_Icon1, 190, 245, 130, 35) $Button3 = _Metro_CreateButtonEx2("Button Style 3", 340, 245, 115, 35) ;Create Checkboxes $Checkbox1 = _Metro_CreateCheckbox("Checkbox 1", 30, 70, 125, 30) $Checkbox2 = _Metro_CreateCheckboxEx("Checkbox 2", 30, 107, 125, 30) $Checkbox3 = _Metro_CreateCheckboxEx2("Checkbox 3", 29, 142, 125, 30) ;Set status to checked _Metro_CheckboxCheck($Checkbox1, True) _Metro_CheckboxCheck($Checkbox2, True) _Metro_CheckboxCheck($Checkbox3, True) ;Create 3 Radios that are assigned to Radio Group 1 $Radio1 = _Metro_CreateRadio("1", "Radio 1", 180, 70, 100, 30) $Radio2 = _Metro_CreateRadio("1", "Radio 2", 180, 110, 100, 30) $Radio3 = _Metro_CreateRadioEx("1", "Radio 3", 180, 150, 100, 30) ;Style with colored checkmark _Metro_RadioCheck("1", $Radio1) ;check $Radio1 which is assigned to radio group "1" and uncheck any other radio in group "1" ;Create Toggles $Toggle1 = _Metro_CreateToggle("Toggle 1", 320, 70, 130, 30) $Toggle2 = _Metro_CreateToggleEx("Toggle 2", 322, 107, 128, 30) $Toggle3 = _Metro_CreateOnOffToggle("Enabled", "Disabled", 320, 144, 130, 30) ; Creates a toggle with different texts for on/off. Alternatively you can use _Metro_CreateOnOffToggleEx for the secondary toggle style. ;Create Progressbar $Progress1 = _Metro_CreateProgress(100, 195, 300, 26) ;Set resizing options for the controls so they don't change in size or position. This can be customized to match your gui perfectly for resizing. See AutoIt Help file. GUICtrlSetResizing($Button1, 768 + 8) GUICtrlSetResizing($Button2, 768 + 8) GUICtrlSetResizing($Button3, 768 + 8) GUICtrlSetResizing($Checkbox1, 768 + 2 + 32) GUICtrlSetResizing($Checkbox2, 768 + 2 + 32) GUICtrlSetResizing($Checkbox3, 768 + 2 + 32) GUICtrlSetResizing($Radio1, 768 + 2 + 32) GUICtrlSetResizing($Radio2, 768 + 2 + 32) GUICtrlSetResizing($Radio3, 768 + 2 + 32) GUICtrlSetResizing($Toggle1, 768 + 2 + 32) GUICtrlSetResizing($Toggle2, 768 + 2 + 32) GUICtrlSetResizing($Toggle3, 768 + 2 + 32) GUICtrlSetResizing($Progress1[0], 768 + 2 + 32) GUISetState(@SW_SHOW) While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE, $GUI_CLOSE_BUTTON _GDIPlus_ImageDispose($hImage_Btn1) _GDIPlus_ImageDispose($hImage_Icon1) _Metro_GUIDelete($Form1) ;Delete GUI/release resources, make sure you use this when working with multiple GUIs! Exit Case $GUI_MAXIMIZE_BUTTON GUISetState(@SW_MAXIMIZE, $Form1) Case $GUI_MINIMIZE_BUTTON GUISetState(@SW_MINIMIZE, $Form1) Case $GUI_RESTORE_BUTTON GUISetState(@SW_RESTORE, $Form1) Case $GUI_FULLSCREEN_BUTTON, $GUI_FSRestore_BUTTON ConsoleWrite("Fullscreen toggled" & @CRLF) ;Fullscreen toggle is processed automatically when $ControlBtnsAutoMode is set to true, otherwise you need to use here _Metro_FullscreenToggle($Form1) Case $GUI_MENU_BUTTON ;Create an Array containing menu button names Local $MenuButtonsArray[5] = ["Themes Demo", "Settings", "About", "Contact", "Exit"] ; Open the metro Menu. See decleration of $MenuButtonsArray above. Local $MenuSelect = _Metro_MenuStart($Form1, 150, $MenuButtonsArray) Switch $MenuSelect ;Above function returns the index number of the selected button from the provided buttons array. Case "0" ConsoleWrite("Returned 0 = Starting themes demo. Please note that the window border colors are not updated during this demo." & @CRLF) _ThemesDemo() Case "1" ConsoleWrite("Returned 1 = Settings button clicked." & @CRLF) Case "2" ConsoleWrite("Returned 2 = About button clicked." & @CRLF) Case "3" ConsoleWrite("Returned 3 = Contact button clicked." & @CRLF) Case "4" ConsoleWrite("Returned 4 = Exit button clicked." & @CRLF) _Metro_GUIDelete($Form1) Exit EndSwitch Case $Button3 _GUIDisable($Form1, 0, 30) ;For better visibility of the MsgBox on top of the first GUI. _Metro_MsgBox(0, "Metro MsgBox Example", "Try a rightclick on this button for rightclick menu demo.", 400, 11, $Form1) ; with 3 secs timeout _GUIDisable($Form1) Case $GUI_EVENT_SECONDARYDOWN ;Demo for starting rightclick menu Local $aCInfo = GUIGetCursorInfo($Form1) If $aCInfo[4] = $Button3 Then ;Create an Array containing menu button names Local $MenuButtonsArray[4] = ["Button 1", "Button 2", "Button 3", "Button 4"] ; Open the rightclick Menu. See decleration of $MenuButtonsArray above. Local $MenuSelect = _Metro_RightClickMenu($Form1, 300, $MenuButtonsArray) Switch $MenuSelect ;Above function returns the index number of the selected button from the provided buttons array. Case "0" ConsoleWrite("Returned 0 = Button 1 clicked." & @CRLF) Case "1" ConsoleWrite("Returned 1 = Button 2 clicked." & @CRLF) Case "2" ConsoleWrite("Returned 2 = Button 3 clicked." & @CRLF) Case "3" ConsoleWrite("Returned 3 = Button 4 clicked." & @CRLF) EndSwitch EndIf Case $Button2 _GUIDisable($Form1, 0, 30) ;For better visibility of the MsgBox on top of the first GUI. _Metro_MsgBox(0, "Metro MsgBox Example", "Button 2 clicked. (Button with 3 secs timeout)", 400, 11, $Form1, 3) ; with 3 secs timeout _GUIDisable($Form1) Case $Button1 _GUIDisable($Form1, 0, 30) Local $mInput = _Metro_InputBox("Please enter your name.", 11, "", False, True) If Not @error Then _Metro_MsgBox(0, "Metro MsgBox Example", "Hello " & $mInput & ", Press ok to set the progressbar.", 350, 11, $Form1) _GUIDisable($Form1) For $i = 0 To 85 Step +2 Sleep(1) _Metro_SetProgress($Progress1, $i) Next _GUIDisable($Form1, 0, 30) Local $Select_YesNo = _Metro_MsgBox(4, "Metro MsgBox Example", "Select yes to create a second GUI.", 350, 11, $Form1) If $Select_YesNo = "Yes" Then _SecondGUI() _GUIDisable($Form1) Case $Toggle1 If _Metro_ToggleIsChecked($Toggle1) Then _Metro_ToggleUnCheck($Toggle1) ConsoleWrite("Toggle unchecked!" & @CRLF) Else _Metro_ToggleCheck($Toggle1) ConsoleWrite("Toggle checked!" & @CRLF) EndIf Case $Toggle2 If _Metro_ToggleIsChecked($Toggle2) Then _Metro_ToggleUnCheck($Toggle2) ConsoleWrite("Toggle unchecked!" & @CRLF) Else _Metro_ToggleCheck($Toggle2) ConsoleWrite("Toggle checked!" & @CRLF) EndIf Case $Toggle3 If _Metro_ToggleIsChecked($Toggle3) Then _Metro_ToggleUnCheck($Toggle3) ConsoleWrite("Disabled!" & @CRLF) Else _Metro_ToggleCheck($Toggle3) ConsoleWrite("Enabled!" & @CRLF) EndIf Case $Checkbox1 If _Metro_CheckboxIsChecked($Checkbox1) Then _Metro_CheckboxUnCheck($Checkbox1) ConsoleWrite("Checkbox unchecked!" & @CRLF) Else _Metro_CheckboxCheck($Checkbox1) ConsoleWrite("Checkbox checked!" & @CRLF) EndIf Case $Checkbox2 If _Metro_CheckboxIsChecked($Checkbox2) Then _Metro_CheckboxUnCheck($Checkbox2) ConsoleWrite("Checkbox unchecked!" & @CRLF) Else _Metro_CheckboxCheck($Checkbox2) ConsoleWrite("Checkbox checked!" & @CRLF) EndIf Case $Checkbox3 If _Metro_CheckboxIsChecked($Checkbox3) Then _Metro_CheckboxUnCheck($Checkbox3) ConsoleWrite("Checkbox unchecked!" & @CRLF) Else _Metro_CheckboxCheck($Checkbox3) ConsoleWrite("Checkbox checked!" & @CRLF) EndIf Case $Radio1 _Metro_RadioCheck(1, $Radio1) ConsoleWrite("Radio 1 selected!" & @CRLF) Case $Radio2 _Metro_RadioCheck(1, $Radio2) ConsoleWrite("Radio 2 selected = " & _Metro_RadioIsChecked(1, $Radio2) & @CRLF) Case $Radio3 _Metro_RadioCheck(1, $Radio3) ConsoleWrite("Radio 3 (ExStyle) selected!" & @CRLF) EndSwitch WEnd Func _SecondGUI() Local $Form2 = _Metro_CreateGUI("Example2", 600, 400, -1, -1, True) ;Add control buttons Local $Control_Buttons_2 = _Metro_AddControlButtons(True, True, True, True) Local $GUI_CLOSE_BUTTON = $Control_Buttons_2[0] Local $GUI_MAXIMIZE_BUTTON = $Control_Buttons_2[1] Local $GUI_RESTORE_BUTTON = $Control_Buttons_2[2] Local $GUI_MINIMIZE_BUTTON = $Control_Buttons_2[3] Local $Button1 = _Metro_CreateButton("Close", 250, 340, 100, 40) GUICtrlSetResizing($Button1, 768 + 8) GUISetState(@SW_SHOW) While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE, $Button1, $GUI_CLOSE_BUTTON _Metro_GUIDelete($Form2) ;Delete GUI/release resources, make sure you use this when working with multiple GUIs! Return 0 Case $GUI_MAXIMIZE_BUTTON GUISetState(@SW_MAXIMIZE, $Form2) Case $GUI_MINIMIZE_BUTTON GUISetState(@SW_MINIMIZE, $Form2) Case $GUI_RESTORE_BUTTON GUISetState(@SW_RESTORE, $Form2) EndSwitch WEnd EndFunc ;==>_SecondGUI Func _ThemesDemo() ;Loop through all themes by recreating all controls Local $ThemesArray[25] = ["DarkMidnightTeal", "DarkMidnightBlue", "DarkMidnightCyan", "DarkMidnight", "DarkTeal", "DarkBlueV2", "DarkBlue", "DarkCyan", "DarkRuby", "DarkGray", "DarkGreen", "DarkGreenV2", "DarkPurple", "DarkAmber", "DarkOrange", "LightTeal", "LightGray", "LightBlue", "LightCyan", "LightGreen", "LightRed", "LightOrange", "LightPurple", "LightPink", "DarkTealV2"] For $i = 0 To 24 GUISetState($Form1, @SW_LOCK) ConsoleWrite($ThemesArray[$i] & @CRLF) _SetTheme($ThemesArray[$i]) ;See MetroThemes.au3 for selectable themes or to add more GUICtrlDelete($Button1) GUICtrlDelete($Button2) GUICtrlDelete($Button3) GUICtrlDelete($Checkbox1) GUICtrlDelete($Checkbox2) GUICtrlDelete($Checkbox3) GUICtrlDelete($Radio1) GUICtrlDelete($Radio2) GUICtrlDelete($Radio3) GUICtrlDelete($Toggle1) GUICtrlDelete($Toggle2) GUICtrlDelete($Toggle3) GUICtrlDelete($Progress1[0]) GUICtrlDelete($GUI_CLOSE_BUTTON) GUICtrlDelete($GUI_MAXIMIZE_BUTTON) GUICtrlDelete($GUI_RESTORE_BUTTON) GUICtrlDelete($GUI_MINIMIZE_BUTTON) GUICtrlDelete($GUI_FULLSCREEN_BUTTON) GUICtrlDelete($GUI_FSRestore_BUTTON) GUICtrlDelete($GUI_MENU_BUTTON) GUISetBkColor($GUIThemeColor, $Form1) $Control_Buttons = _Metro_AddControlButtons(True, True, True, True, True) $GUI_CLOSE_BUTTON = $Control_Buttons[0] $GUI_MAXIMIZE_BUTTON = $Control_Buttons[1] $GUI_RESTORE_BUTTON = $Control_Buttons[2] $GUI_MINIMIZE_BUTTON = $Control_Buttons[3] $GUI_FULLSCREEN_BUTTON = $Control_Buttons[4] $GUI_FSRestore_BUTTON = $Control_Buttons[5] $GUI_MENU_BUTTON = $Control_Buttons[6] $Button1 = _Metro_CreateButton("Button Style 1", 50, 245, 115, 40) $Button2 = _Metro_CreateButtonEx("Button Style 2", 195, 245, 115, 40) $Button3 = _Metro_CreateButtonEx2("Button Style 3", 340, 245, 115, 40) $Checkbox1 = _Metro_CreateCheckbox("Checkbox 1", 30, 70, 125, 30) $Checkbox2 = _Metro_CreateCheckboxEx("Checkbox 2", 30, 107, 125, 30) $Checkbox3 = _Metro_CreateCheckboxEx2("Checkbox 3", 29, 142, 125, 30) _Metro_CheckboxCheck($Checkbox1, True) _Metro_CheckboxCheck($Checkbox2, True) _Metro_CheckboxCheck($Checkbox3, True) $Radio1 = _Metro_CreateRadio("1", "Radio 1", 180, 70, 100, 30) $Radio2 = _Metro_CreateRadio("1", "Radio 2", 180, 110, 100, 30) $Radio3 = _Metro_CreateRadioEx("1", "Radio 3", 180, 150, 100, 30) _Metro_RadioCheck("1", $Radio1) $Toggle1 = _Metro_CreateToggle("Toggle 1", 320, 70, 130, 30) $Toggle2 = _Metro_CreateToggleEx("Toggle 2", 322, 107, 128, 30) $Toggle3 = _Metro_CreateOnOffToggle("Enabled", "Disabled", 320, 144, 130, 30) $Progress1 = _Metro_CreateProgress(100, 195, 300, 26) GUICtrlSetResizing($Button1, 768 + 8) GUICtrlSetResizing($Button2, 768 + 8) GUICtrlSetResizing($Button3, 768 + 8) GUICtrlSetResizing($Checkbox1, 768 + 2 + 32) GUICtrlSetResizing($Checkbox2, 768 + 2 + 32) GUICtrlSetResizing($Checkbox3, 768 + 2 + 32) GUICtrlSetResizing($Radio1, 768 + 2 + 32) GUICtrlSetResizing($Radio2, 768 + 2 + 32) GUICtrlSetResizing($Radio3, 768 + 2 + 32) GUICtrlSetResizing($Toggle1, 768 + 2 + 32) GUICtrlSetResizing($Toggle2, 768 + 2 + 32) GUICtrlSetResizing($Toggle3, 768 + 2 + 32) GUICtrlSetResizing($Progress1[0], 768 + 2 + 32) GUISetState($Form1, @SW_UNLOCK) Sleep(1500) Next EndFunc ;==>_ThemesDemo Func _Metro_CreateButtonFromImage($hImage, $Left, $Top, $BG_Color = $ButtonBKColor, $FrameColor = "0xFFFFFF", $DisableColor = 0x40000000) Local $Button_Array[16] Local $aDim = _GDIPlus_ImageGetDimension($hImage) If @error Then Return 0 Local $Width = $aDim[0] Local $Height = $aDim[1] ;HighDPI Support Local $btnDPI = _HighDPICheck() If $HIGHDPI_SUPPORT Then $Left = Round($Left * $gDPI) $Top = Round($Top * $gDPI) $Width = Round($aDim[0] * $gDPI) $Height = Round($aDim[1] * $gDPI) EndIf $Button_Array[1] = False ; Set hover OFF $Button_Array[3] = "2" ; Type $Button_Array[15] = GetCurrentGUI() ;Calculate Framesize Local $FrameSize = Round(4 * $btnDPI) If Not (Mod($FrameSize, 2) = 0) Then $FrameSize = $FrameSize - 1 ;Set Colors $BG_Color = "0xFF" & Hex($BG_Color, 6) $FrameColor = "0xFF" & Hex($FrameColor, 6) Local $Pen_BTN_FrameHoverColor = _GDIPlus_PenCreate($FrameColor, $FrameSize) Local $hBrush_Btn_Disable = _GDIPlus_BrushCreateSolid($DisableColor) ;Create Button graphics Local $Button_Graphic1 = _iGraphicCreate($Width, $Height, $BG_Color) ;Default _GDIPlus_GraphicsDrawImageRect($Button_Graphic1[0], $hImage, 0, 0, $Width, $Height) Local $Button_Graphic2 = _iGraphicCreate($Width, $Height, $BG_Color, 0, 5) ;Hover _GDIPlus_GraphicsDrawImageRect($Button_Graphic2[0], $hImage, 0, 0, $Width, $Height) Local $Button_Graphic3 = _iGraphicCreate($Width, $Height, $BG_Color, 0, 5) ;Disabled _GDIPlus_GraphicsDrawImageRect($Button_Graphic3[0], $hImage, 0, 0, $Width, $Height) _GDIPlus_GraphicsFillRect($Button_Graphic3, 0, 0, $Width, $Height, $hBrush_Btn_Disable) ;Add frame _GDIPlus_GraphicsDrawRect($Button_Graphic2[0], 0, 0, $Width, $Height, $Pen_BTN_FrameHoverColor) ;Release created objects _GDIPlus_PenDispose($Pen_BTN_FrameHoverColor) _GDIPlus_BrushDispose($hBrush_Btn_Disable) ;Set graphic and return Bitmap handle $Button_Array[0] = GUICtrlCreatePic("", $Left, $Top, $Width, $Height) $Button_Array[5] = _iGraphicCreateBitmapHandle($Button_Array[0], $Button_Graphic1) $Button_Array[6] = _iGraphicCreateBitmapHandle($Button_Array[0], $Button_Graphic2, False) $Button_Array[7] = _iGraphicCreateBitmapHandle($Button_Array[0], $Button_Graphic3, False) ;For GUI Resizing GUICtrlSetResizing($Button_Array[0], 768) _cHvr_Register($Button_Array[0], "_iHoverOff", "_iHoverOn", "", "", _iAddHover($Button_Array)) Return $Button_Array[0] EndFunc ;==>_Metro_CreateButtonFromImage Func _Metro_CreateButtonWithIcon($Text, $hImage, $Left, $Top, $Width, $Height, $BG_Color = $ButtonBKColor, $Font_Color = $ButtonTextColor, $Font = "Arial", $Fontsize = 10, $FontStyle = 1, $FrameColor = "0xFFFFFF", $DisableColor = 0x40000000) Local $Button_Array[16] Local $btnDPI = _HighDPICheck() ;HighDPI Support If $HIGHDPI_SUPPORT Then $Left = Round($Left * $gDPI) $Top = Round($Top * $gDPI) $Width = Round($Width * $gDPI) $Height = Round($Height * $gDPI) Else $Fontsize = ($Fontsize / $Font_DPI_Ratio) EndIf $Button_Array[1] = False ; Set hover OFF $Button_Array[3] = "2" ; Type $Button_Array[15] = GetCurrentGUI() ;Calculate Framesize Local $FrameSize = Round(4 * $btnDPI) If Not (Mod($FrameSize, 2) = 0) Then $FrameSize = $FrameSize - 1 ;Set Colors $BG_Color = "0xFF" & Hex($BG_Color, 6) $Font_Color = "0xFF" & Hex($Font_Color, 6) $FrameColor = "0xFF" & Hex($FrameColor, 6) Local $Brush_BTN_FontColor = _GDIPlus_BrushCreateSolid($Font_Color) Local $Brush_BTN_FontColorDis = _GDIPlus_BrushCreateSolid(StringReplace(_AlterBrightness($Font_Color, -30), "0x", "0xFF")) Local $Pen_BTN_FrameHoverColor = _GDIPlus_PenCreate($FrameColor, $FrameSize) Local $hBrush_Btn_Disable = _GDIPlus_BrushCreateSolid($DisableColor) Local $aDim = _GDIPlus_ImageGetDimension($hImage) Local $minBtn = $Width < $Height ? $Width : $Height Local $maxImg = $aDim[0] < $aDim ? $aDim[0] : $aDim[1] Local $fFactor = 1 If $maxImg > $minBtn Then $fFactor = ($minBtn / $maxImg) * 0.8 Local $hImage_Icon = _GDIPlus_ImageScale($hImage, $fFactor, $fFactor) Local $aDim2 = _GDIPlus_ImageGetDimension($hImage_Icon) Local $hGfx = _GDIPlus_ImageGetGraphicsContext($hImage_Icon) ;Create Button graphics Local $Button_Graphic1 = _iGraphicCreate($Width, $Height, $BG_Color, 0, 5) ;Default _GDIPlus_GraphicsDrawImageRect($Button_Graphic1[0], $hImage_Icon, $Width * 0.05, ($Height - $aDim2[1]) / 2, $aDim2[0], $aDim2[1]) Local $Button_Graphic2 = _iGraphicCreate($Width, $Height, $BG_Color, 0, 5) ;Hover _GDIPlus_GraphicsDrawImageRect($Button_Graphic2[0], $hImage_Icon, $Width * 0.05, ($Height - $aDim2[1]) / 2, $aDim2[0], $aDim2[1]) Local $Button_Graphic3 = _iGraphicCreate($Width, $Height, $BG_Color, 0, 5) ;Disabled _GDIPlus_GraphicsDrawImageRect($Button_Graphic3[0], $hImage_Icon, $Width * 0.05, ($Height - $aDim2[1]) / 2, $aDim2[0], $aDim2[1]) _GDIPlus_GraphicsFillRect($Button_Graphic3, 0, 0, $Width, $Height, $hBrush_Btn_Disable) ;Create font, Set font options Local $hFormat = _GDIPlus_StringFormatCreate(), $hFamily = _GDIPlus_FontFamilyCreate($Font), $hFont = _GDIPlus_FontCreate($hFamily, $Fontsize, $FontStyle) Local $tLayout = _GDIPlus_RectFCreate(0, 0, $Width, $Height) _GDIPlus_StringFormatSetAlign($hFormat, 1) _GDIPlus_StringFormatSetLineAlign($hFormat, 1) ;Draw button text _GDIPlus_GraphicsDrawStringEx($Button_Graphic1[0], $Text, $hFont, $tLayout, $hFormat, $Brush_BTN_FontColor) _GDIPlus_GraphicsDrawStringEx($Button_Graphic2[0], $Text, $hFont, $tLayout, $hFormat, $Brush_BTN_FontColor) _GDIPlus_GraphicsDrawStringEx($Button_Graphic3[0], $Text, $hFont, $tLayout, $hFormat, $Brush_BTN_FontColorDis) ;Add frame _GDIPlus_GraphicsDrawRect($Button_Graphic2[0], 0, 0, $Width, $Height, $Pen_BTN_FrameHoverColor) ;Release created objects _GDIPlus_BrushDispose($hBrush_Btn_Disable) _GDIPlus_ImageDispose($hImage_Icon) _GDIPlus_FontDispose($hFont) _GDIPlus_FontFamilyDispose($hFamily) _GDIPlus_StringFormatDispose($hFormat) _GDIPlus_BrushDispose($Brush_BTN_FontColor) _GDIPlus_BrushDispose($Brush_BTN_FontColorDis) _GDIPlus_PenDispose($Pen_BTN_FrameHoverColor) ;Set graphic and return Bitmap handle $Button_Array[0] = GUICtrlCreatePic("", $Left, $Top, $Width, $Height) $Button_Array[5] = _iGraphicCreateBitmapHandle($Button_Array[0], $Button_Graphic1) $Button_Array[6] = _iGraphicCreateBitmapHandle($Button_Array[0], $Button_Graphic2, False) $Button_Array[7] = _iGraphicCreateBitmapHandle($Button_Array[0], $Button_Graphic3, False) ;For GUI Resizing GUICtrlSetResizing($Button_Array[0], 768) _cHvr_Register($Button_Array[0], "_iHoverOff", "_iHoverOn", "", "", _iAddHover($Button_Array)) Return $Button_Array[0] EndFunc ;==>_Metro_CreateButtonWithIcon ;Code below was generated by: 'File to Base64 String' Code Generator v1.20 Build 2018-02-02 Func _Button1($bSaveBinary = False, $sSavePath = @ScriptDir) Local $Button1 $Button1 &= 'iVBORw0KGgoAAAANSUhEUgAAAIIAAAA0CAIAAADJ8nfCAAAe50lEQVR4Xu18B5RURf7uV3VTh+nJiSGPoEQFFVBRUXAVMAYU0dUnu2vAHHbNKLpiWBb+KooKIrorLqioKCBJRQQRRGCIwwyTA5On8+2bql5v9X/6DMJyWHff+s5ZPurcU0NV161bX/1i3W4CTMMvjeOQ8QuA48gg+G+FBJz3HyZAokSWFc5pYgKEyJKUbP0vZeI/qZQ4QCRZdmwbaBB/KoAjJNILpBFicM6PXSyO08A7j0DIkXrwQ/p07HQK1AJs3PiTLxiTe9FFfYuLyz//fN9nn1W2txOgl+hjH5eGYyKAEFAqAZLj2IAjGpi40k7DygAkiTPGOlHSOHJk7zVf/tqtFeAQNP7x2XefnPo1MBTwHp2J4zRwQoiiyKZJAD8QFCyaQMzlcrndNC3NaG+jgaAMMNGUAqiAD1AJ4ZxXTpzYf9Gi+wDYFogMiQgCGSgFYCz6YM6kiZ8BZxOics6O03BktU4IOJeBxnjxevteeWXq5MnDRo8+H0dAdE/ppvmvb1uxonH//hZBhuRyeXR9JoDa+oZuBfm33HLrrl17NE3JyMj49NNPmpsDGWnsiScfefHFEuBiQnTOHYAcd1g7ayHCebxEgLILLhj26KOTRo8+Ex2wHMs2bcdhRECWJUnSBvYdM2tWvESLir6bO3fTnDnla9c+CKC+vlEiHMBbb82bOHHS+eef+9RT0wA4js6RM+nX18x/58GWxkpKezpO5HjckOSAUEoZs4GazOyUrVv/1LtnIQCHO+1toRSvy6WqiiQrbgVJgAGUOZZh8nDYPuWU8197bdTMmQGXK9uyDMCRZQXAq6++eueddx44cGDBgncSJj0UCfYsGHzGWb5ln+xgrDBp2P/LaeCJDoy1A63PPHPp1KlXAdB1wx8MdsnNSXWRyvL9X23YvG7t2q3FtW1RnT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sru5VSnDRwkkDuYw2LZjGUZba3tzS6ShbMeunUVnDh0w48HrcrJzv9+6Q1FUPRb79NP3P//8G2AgMAbIFRywTq66+pMMpTgqsIXiUgD5sCYT4KIpTbi8kY5vMzJCAEidgwrBKBd8KIQckiUVrf97I0AmxCM4c4sP6oSYwkBYogMXhcTRkYNJgnfqwwApOeefPMuxfNuHi6G9wI6TTy6eMmVcWtqASCTGmXnKoBMpVZauXv/Oih9suNMzslPzuuTnZUhUBjjhiJuqlta2YENNOOIv7JZ3zzWjThk8oKGpqeRAldfr8fubVq78bM2aLY4zEDgfyAf0Q103jp+LY07PkeSNjtrKDnv99PAcNf95dxEgR6chyYQkhHFf167bbrq578mDfuU4rlAonOrzFPYoyMpIKypv' $Button1 &= '+m7Dd9uKy5uDTszmRNUUZsky7dYl87yBvc8+7+wu6VppRU1tfQNAJFmtqSn9YuWyTRuLgKGEnMt5ppiA1XlCx78XfRSZqAVWjxubN27cyMzMk2ybR/UoY06X/Kze3booLg9zENJjDEyTZLeqSW5XsK21tLQsahiqolFJ0vXAli3rV6/5pq42BpwGDANyO+SAJ2k4TsPRmXALI7MtLbdo3IUnjRh2TmZ6F1VNi8XMmKlrmtvj1tyaAoA5jmlZkWjMcZiqagBvaqqLn0qsX7+xtDQMZAMDRfEl7cGx4DgN6LBFCueSEItil3vLGcP79D/lxK453TIyCzTNRaA5jsM5A5EZtyxTN4xw3cHa/fviJ2YHqqujwuAPB7qIYJgB+s+WgOPfi6aEaJzbQAjYBuxSVLWwl+525WTkutxuF7jEYAbags1NkUBAF2m4XFH6AD0IyeBcSzpqPxPHaUgqcUGGKvzlGFACtAiVxUQlC9CBrqJnoYjOfIC3wwbY4vpvw/GfLpEIAaByrhBiCX2ld4Q/docXL3FwcJ6UgP+H1vj4T5ckfGqQRIV1NPLk0v8Hfi7p+A/58H/TiyTHafilcRz/F2SpKN30Uej4AAAAAElFTkSuQmCC' Local $bString = _WinAPI_Base64Decode($Button1) If @error Then Return SetError(1, 0, 0) $bString = Binary($bString) If $bSaveBinary Then Local Const $hFile = FileOpen($sSavePath & "\AutoIt Logo4.png", 18) If @error Then Return SetError(2, 0, $bString) FileWrite($hFile, $bString) FileClose($hFile) EndIf Return $bString EndFunc ;==>_Button1 Func _Icon1($bSaveBinary = False, $sSavePath = @ScriptDir) Local $Icon1 $Icon1 &= 'iVBORw0KGgoAAAANSUhEUgAAAEAAAABACAYAAACqaXHeAAAACXBIWXMAAAsTAAALEwEAmpwYAAAFUUlEQVR42uWbXWhcRRTHf7NdaxrWUGus67KGUEotwYpoTKO2PhRphaaCPqggfjyJHxWLIAgi0gfJi7W0UfHBjxetvkjVCuKDIkVES5VQfCittFrL2pJY7bZs0yS914d7Ns4OE3fu7s7dG/cPQ3JnZ+bOnJk55/zPzFVKKcIwpI1YDawCCsBaYF1GqT3Ay7XFon6GtLav2YQGmQH6gDwwAKwBVsjAV5uFw5DFSqnaPGj54H0JoAu4GeiXQd8KDMsMu+JCrUBCL4NvVgA5oChpWJZvnwy0t1Ud9Dn4OAJYDgzKYK+TAQ8BPb46plAEYeB18DYB5GWwK4H12qALwOKktKJSajKad//KOQuMijIakIEnpRjnRRAGa4HDCbxqVomC7VhkgPMdPP6pDJ2N6WxKO7Yf+MZT2/cAN+kZ5+YcrfSkJzwKd6v2nrNp3QLXemx7makE04hLHttetBAEkJhlSqsSfBrYrD1XgAfkb3Uf3+vQznfAS/UKpVEJ2pLOO75wrHPUMt7tC0EJ2rZEoD2fcqx3wsUTXAjIGX0tOtZb2S4dUFVik8C3QAm4U2i0C8aBz4wAyZT2vFP2dz0cd3mZiw74k3/DV7cDG4Bt85Q9J9GgnPGeV2Ls960eV1ONDnAVwCXgLktjf1jKfmgpl5dZdBXAU0kJwHULZGRgVxv5o8Auy0yb2EsUK3TFbUY8IBB+UFWEAyLUevgb+KmVZvAxi1up//6jpf0VHszgXsc6E602gzuM5zPAW9rz2Dyz3zRvN8xg2bFe2WVpxyUSwxaJVvGR8VsRuDHtEaG4eNF4PiWSP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SetError(1, 0, 0) $bString = Binary($bString) If $bSaveBinary Then Local Const $hFile = FileOpen($sSavePath & "\Excel_Off.png", 18) If @error Then Return SetError(2, 0, $bString) FileWrite($hFile, $bString) FileClose($hFile) EndIf Return $bString EndFunc ;==>_Icon1 Func _WinAPI_Base64Decode($sB64String) Local $aCrypt = DllCall("Crypt32.dll", "bool", "CryptStringToBinaryA", "str", $sB64String, "dword", 0, "dword", 1, "ptr", 0, "dword*", 0, "ptr", 0, "ptr", 0) If @error Or Not $aCrypt[0] Then Return SetError(1, 0, "") Local $bBuffer = DllStructCreate("byte[" & $aCrypt[5] & "]") $aCrypt = DllCall("Crypt32.dll", "bool", "CryptStringToBinaryA", "str", $sB64String, "dword", 0, "dword", 1, "struct*", $bBuffer, "dword*", $aCrypt[5], "ptr", 0, "ptr", 0) If @error Or Not $aCrypt[0] Then Return SetError(2, 0, "") Return DllStructGetData($bBuffer, 1) EndFunc ;==>_WinAPI_Base64Decode @BBs19 feel free to add these two functions to your UDF if you want. It should look like this:1 point
-
Hi everyone, Some good news for you among all the gloom of these virus-ridden times: Nine, Subz and Danyfirex have accepted the invitation to become MVPs. Please join me in congratulating them on their new status in our community. Keep safe out there, M231 point
-
Script becomes way slower after a msgbox - (Moved)
Professor_Bernd reacted to Jon for a topic
Public beta uploaded.1 point -
This (now ex)member has gained an unfortunate reputation on other fora of asking for help via PM and attaching a script which, when run, tries to steal your account information/credentials, etc for a whole list of applications before sending them to the OP. If you have received a PM from this (ex)member asking for help with a script DO NOT RUN IT - just delete the PM and/or the downloaded script ASAP. M231 point
-
How can I dynamically enable/disable context menu items
jaberwacky reacted to Melba23 for a topic
Christian Blackburn, Really, this looks pretty dynamic to me: #include <GUIConstantsEx.au3> #include <MsgBoxConstants.au3> Example() Func Example() GUICreate("My GUI Context Menu", 300, 200) Local $idContextmenu = GUICtrlCreateContextMenu() Local $idMenuDeactivate = GUICtrlCreateMenuItem("Deactivate", $idContextmenu) Local $idMenuActivate = GUICtrlCreateMenuItem("Activate", $idContextmenu) GUISetState(@SW_SHOW) ; Loop until the user exits. While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE ExitLoop Case $idMenuDeactivate MsgBox($MB_SYSTEMMODAL, "Menu Deactivated", 'Deactivated') GUICtrlSetState($idMenuDeactivate, $GUI_DISABLE) Case $idMenuActivate MsgBox($MB_SYSTEMMODAL, "Menu Activated", 'Activated') GUICtrlSetState($idMenuDeactivate, $GUI_ENABLE) EndSwitch WEnd GUIDelete() EndFunc ;==>Example M231 point -
DISM console progress using StdoutRead
dreamscd reacted to tydyedsyko for a topic
First off I want to say that this community is great. I have been using AutoIT for years now and typically whenever I am having an issue a quick search through the forums yields the necessary solution. I made an attempt to create a progress bar for DISM a year or so ago but was unsuccessful. A recent requirement has brought me back to investigate. I was still seeing the same results however this time during my troubleshooting I noticed my command was actually being inserted into the CMD window's title. By simply specifying the title explicitly I was able to resolve the issue. I created this forum account simply because this is the first time I felt I have something to share that may help someone else in the future. $wimfile = "C:\Windows\temp\boot.wim" $targetpath = "D:\mount" $percent = 0 $value = 0 $Title = "Bogus" $DISMp = Run(@ComSpec & " /c title " & $Title & "|" & 'Dism.exe /mount-wim /wimfile:"' & $wimfile & '" /index:1 /mountdir:"' & $targetpath, "", "", 2 + 4) ProgressOn("Image Load", "Deploying Image", "0 percent") While ProcessExists($DISMp) $line = StdoutRead($DISMp, 5) If StringInStr($line, ".0%") Then $line1 = StringSplit($line, ".") $value = StringRight($line1[$line1[0] - 1], 2) $value = StringStripWS($value, 7) EndIf If $value == "00" Then $value = 100 If @error Then ExitLoop Sleep(50) If $percent <> $value Then ProgressSet($value, "Deploying Image", "Boot.wim" & $value & "%") $percent = $value EndIf If $value = 100 Then ExitLoop WEnd ProgressOff()1 point -
Wrong screen resolution detected
GoogleGonnaSaveUs reacted to mLipok for a topic
This was even in track ticket https://www.autoitscript.com/trac/autoit/ticket/3141 Try to use: DllCall("User32.dll", "bool", "SetProcessDPIAware") Is this help you ?1 point -
tnx but how u got 71? Where i can get list of keys?1 point
-
Autoit installer for MAC
JLogan3o13 reacted to FORUMUSER for a topic
I am trying to install Autoit on my mac but couldn't find it one. Can anyone help me to find the way to install and work on Autoit software. Here is the link that I referring but it is for windows, https://www.autoitscript.com/site/autoit/downloads/0 points