Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 11/20/2024 in all areas

  1. CYCho

    No UI Music Player

    These are the hotkeys that control this no-UI music player: Ctrl+Alt+c Change folder Ctrl+Alt+f Open/Close file properties window Ctrl+Alt+h Open/Close help message window Ctrl+Alt+l Open/Close playlist Ctrl+Alt+m Mute/Unmute audio volume Ctrl+Alt+p Pause/Resume playback Ctrl+Alt+r Repeat mode On/Off Ctrl+Alt+s Shuffle/Sort playlist Ctrl+Alt+Left Play previous file Ctrl+Alt+Right Play next file Ctrl+Alt+Up Increase volume Ctrl+Alt+Down Decrease volume Ctrl+Alt+End Exit program Come to think of it, I spend many hours in front of a computer doing something. It has been my habit to play music in the background. As I'm not an audiophile with discerning ears, my zPlayer has been enough for my listening needs. Even though zPlayer has substantial UIs, I rarely use them once I load a folder of my liking except when changing the folder. So I came up with this No UI Music Player. It basically runs with no UI. However, the user can bring up a playlist window or a file properties window once in while if they are urged to see something on the screen, If these windows are kept open, their contents are updated as necessary. In the playlist window, the user can search the playlist for strings like "beeth 9" to go to Beethoven's Symphony 9, for example, and double-click it to play it. In the file properties window, the user can see the essential file information such as file type, bitrate and total length. The current playback position is updated in 0:00:00 format every second. The properties window also shows whether repeat mode is on or off. I hope this can be of use to someone. zPlayer-NoUI.zip
    2 points
  2. ioa747

    Active_FileDlg

    prologue On the occasion of @TheDcoder post (I wonder if someone can port it to AutoIt ) and because in the past I already had something similar (Active_SaveFileDlg), ( in which I remember making an effort so that it wouldn't catch windows other than Scite's) So I took it as a challenge. Of course, since I don't know much, I skipped the extras and stuck to the basics A brief description While the script is running in the background when you display the SaveFileDlg or OpenFileDlg window, display a button-icon in the center of the window title. Click it brings up a list of some favorite path plus the paths from all open folders. by selecting one of them, WindowDlg goes to the selected path. Active_FileDlg.au3 #NoTrayIcon #Region ;**** Directives created by AutoIt3Wrapper_GUI **** #AutoIt3Wrapper_Icon=shell32-68.ico #AutoIt3Wrapper_UseX64=y #AutoIt3Wrapper_Res_Description=Add All open folder & some extra as contex menu in SaveFileDlg & OpenFileDlg #AutoIt3Wrapper_Res_Fileversion=0.0.0.3 #AutoIt3Wrapper_Res_ProductName=Active_FileDlg.au3 ;~ #AutoIt3Wrapper_AU3Check_Parameters=-d -w 1 -w 2 -w 3 -w 4 -w 5 -w 6 -w 7 #EndRegion ;**** Directives created by AutoIt3Wrapper_GUI **** ; https://www.autoitscript.com/forum/topic/212478-active_filedlg/ ;---------------------------------------------------------------------------------------- ; Title...........: Active_FileDlg.au3 ; Description.....: Add All open folder & some extra as contex menu in SaveFileDlg & OpenFileDlg ; AutoIt Version..: 3.3.16.1 Author: ioa747 ;---------------------------------------------------------------------------------------- ;~ #AutoIt3Wrapper_UseX64=Y #include <WindowsConstants.au3> #include <ButtonConstants.au3> #include <WinAPISysWin.au3> #include <Misc.au3> #include <GuiTreeView.au3> #include <Array.au3> Global $aFavFolder[3] ; Fav folder $aFavFolder[0] = 2 $aFavFolder[1] = @DesktopDir ; * <--------- Fav1 folder (get one of your own) $aFavFolder[2] = @MyDocumentsDir ; * <--------- Fav2 folder (get one of your own) Global $hGUI While 1 _main() Sleep(500) WEnd Exit ;-------------------------------------------------------------------------------------------------------------------------------- Func _main() If WinActive("[CLASS:#32770]") Then Local $hWnd = WinGetHandle("[ACTIVE]") ;specify FileDlg criteria Local $sCurPath = _AddressBarPath($hWnd) If @error Then Local $sText = WinGetText($hWnd) If StringInStr($sText, "File &name") Then _FoldersGUI($hWnd, 2) EndIf Else ;ConsoleWrite("$sCurPath=" & $sCurPath & @CRLF) _FoldersGUI($hWnd, 1) EndIf EndIf EndFunc ;==>_main ;---------------------------------------------------------------------------------------- Func _FoldersGUI($hWnd, $iFlag) ; $iFlag: 1=_AddressBarPath, 2=File &name $hGUI = GUICreate("MyGUI", 24, 24, -50, -50, $WS_POPUP, BitOR($WS_EX_TOOLWINDOW, $WS_EX_NOACTIVATE), $hWnd) Local $idDummy = GUICtrlCreateDummy() Local $idButton = GUICtrlCreateButton("contex button", 0, 0, 24, 24, $BS_ICON) GUICtrlSetImage(-1, "shell32.dll", -68) Local $idContext = GUICtrlCreateContextMenu($idButton) Local $OpenFolders = _EnumAllOpenFolder() ;If not open folder, just add fav If $OpenFolders[0][0] = 0 Then ReDim $OpenFolders[UBound($OpenFolders) + 1][2] Else _ArrayInsert($OpenFolders, 1, "0|") ; separator EndIf ; Add Fav folder (the numbers on the front don't matter) For $i = 1 To $aFavFolder[0] _ArrayInsert($OpenFolders, 1, $i & "|" & $aFavFolder[$i]) Next $OpenFolders[0][0] = UBound($OpenFolders) - 1 ;_ArrayDisplay($OpenFolders) ; Create Context Menu For $i = 1 To $OpenFolders[0][0] GUICtrlCreateMenuItem($OpenFolders[$i][1], $idContext) Next Local $Wpos = WinGetPos($hWnd) WinMove($hGUI, "", $Wpos[0] + $Wpos[2] * 0.5, $Wpos[1] + 3) Sleep(50) GUISetState(@SW_SHOWNOACTIVATE, $hGUI) WinActivate($hWnd) Local $MsgId While WinExists($hWnd) $Wpos = WinGetPos($hWnd) WinMove($hGUI, "", $Wpos[0] + $Wpos[2] * 0.5, $Wpos[1] + 3) $MsgId = GUIGetMsg() Switch $MsgId Case 6 To $OpenFolders[0][0] + 6 Switch $iFlag Case 1 _AddressBarPath($hWnd, $OpenFolders[$MsgId - 5][1]) Case 2 _AltName($hWnd, $OpenFolders[$MsgId - 5][1]) EndSwitch Case $idButton GUICtrlSendToDummy($idDummy) Case $idDummy MouseClick("right") EndSwitch WEnd GUIDelete($hGUI) EndFunc ;==>_FoldersGUI ;---------------------------------------------------------------------------------------- Func _EnumAllOpenFolder() ; enumerating all open folders Local $oShell = ObjCreate("Shell.Application") Local $sPath, $index = 0 Local $aArray[$oShell.Windows.Count + 1][2] = [["hWnd", "Path"]] For $oWin In $oShell.Windows $index += 1 $aArray[0][0] = $index $sPath = StringTrimLeft($oWin.LocationURL, 8) ; trim 'file:///' $sPath = StringReplace($sPath, "/", "\") $sPath = _UnicodeURLDecode($sPath) $aArray[$index][0] = HWnd($oWin.HWND) $aArray[$index][1] = $sPath Next Return $aArray EndFunc ;==>_EnumAllOpenFolder ;---------------------------------------------------------------------------------------- Func _UnicodeURLDecode($toDecode) Local $strChar = "", $iOne, $iTwo Local $aryHex = StringSplit($toDecode, "") For $i = 1 To $aryHex[0] If $aryHex[$i] = "%" Then $i = $i + 1 $iOne = $aryHex[$i] $i = $i + 1 $iTwo = $aryHex[$i] $strChar = $strChar & Chr(Dec($iOne & $iTwo)) Else $strChar = $strChar & $aryHex[$i] EndIf Next Local $Process = StringToBinary($strChar) Local $DecodedString = BinaryToString($Process, 4) Return $DecodedString EndFunc ;==>_UnicodeURLDecode ;---------------------------------------------------------------------------------------- Func _AddressBarPath($hWnd, $sNewBarPath = "") WinActivate($hWnd) For $i = 1 To 10 Local $hCtrl = ControlGetHandle($hWnd, "", "ToolbarWindow32" & $i) If @error Then ExitLoop Local $sControlText = ControlGetText($hWnd, "", $hCtrl) If StringLeft($sControlText, 9) = "Address: " Then Local $aTextPart = StringSplit($sControlText, ": ", 1) If $aTextPart[0] = 2 Then ; Get AddressBarPath If $sNewBarPath == "" Then Return $aTextPart[2] Else ; Set AddressBarPath ControlCommand($hWnd, "", $hCtrl, "SendCommandID", 1280) Local $sCtrlNN = ControlGetFocus($hWnd) Local $hCtrlHnd = ControlGetHandle($hWnd, "", $sCtrlNN) ControlSetText($hWnd, "", $hCtrlHnd, $sNewBarPath) ControlSend($hWnd, "", $hCtrlHnd, "{ENTER}") Return $sNewBarPath EndIf EndIf EndIf Next ; If Error, return an empty string Return SetError(1, 0, "") EndFunc ;==>_AddressBarPath ;---------------------------------------------------------------------------------------- Func _AltName($hWnd, $sNewBarPath) WinActivate($hWnd) ControlSend($hWnd, "", "", "!n") ; File &name ;File &name: Local $sCtrlNN = ControlGetFocus($hWnd) Local $hCtrlHnd = ControlGetHandle($hWnd, "", $sCtrlNN) ControlSetText($hWnd, "", $hCtrlHnd, $sNewBarPath) ControlSend($hWnd, "", $hCtrlHnd, "{ENTER}") Return $sNewBarPath EndFunc ;==>_AltName Please, every comment is appreciated! leave your comments and experiences here! Thank you very much
    1 point
  3. Dan_555

    Active_FileDlg

    I used to use a program named FolderMenu (on my PC) a lot. I knew it was written in AutoIt ... This post remided me of it and i started googling for it and to my surprise ... there is a sourcecode available at https://github.com/Silvernine0S/FolderMenu3EX/tree/master I haven't tested it yet. It worked very well with almost every save/open dialog (with rare exceptions) As for your code ... it would be nice if it worked with more dialogs, so far chrome save as and crimson editor are not working.
    1 point
  4. Or from the hybrid school : #include <Array.au3> $aText = FileReadToArray("Test.txt") For $i = 0 To UBound($aText) - 1 $aText[$i] = StringRegExpReplace($aText[$i], "(?<=[[:xdigit:]]{5})([[:xdigit:]])(?=[[:xdigit:]]{2})", Hex(Mod(Number(StringRegExp($aText[$i], "X(\d+)", 1)[0]), 16), 1)) Next ConsoleWrite(_ArrayToString($aText, @CRLF) & @CRLF) ; or _FileWriteFromArray
    1 point
  5. Thank You.. I tried and I think it works well
    1 point
  6. Regex school: Local $text = FileRead(@ScriptDir & "\" & "source.txt") Local $hex = Execute('"' & StringRegExpReplace($text, '(?m)(?<=[[:xdigit:]]{5})([[:xdigit:]])(?=[[:xdigit:]]{2})', '" & _IncHex() & "') & '"') ConsoleWrite($hex) Func _IncHex() Local Static $Inc = 15 $Inc += 1 Return Hex(Mod($Inc, 16), 1) EndFunc I added two extra line in the source file, yielding: X0 00112033 X1 AABBC1DD X2 22446288 X3 BBDDF300 X4 11335477 X5 AACCE5FF X6 11AA26BB X7 CC33D744 X8 55EE68FF X9 ABCD9988 X10 8800AADD X11 EEFF3B44 X12 6622ACEE X13 5599CDFF X14 AAFF2E00 X15 0099AFCC X16 FD5A00B6 X17 10E51194
    1 point
  7. GuiBuilderPlus GuiBuilderPlus is a small, easy to use GUI designer for AutoIt. Originally created long ago as AutoBuilder by the user CyberSlug, enhanced as GuiBuilder by TheSaint, and further enhanced and expanded as GuiBuilderNxt by jaberwacky, GuiBuilderPlus is a continuation of their great work, with a focus on increased stability and usability followed by new features. ------ Yes, I have decided to bring back our old friend the GuiBuilder. This utility has a long history, which you can read about in TheSaint's Gui Creators topic, starting all the back back with CyberSlug's AutoBuilder. Even though I've hacked the original code to pieces in order to document and better understand what is going on, the essence of GuiBuilder still lives on! I am using the awesome updates from GuiBuilderNxt by jaberwacky as a starting point since he already did a lot of the hard work of parsing and updating the original code, plus I really like the layout that came about from that update. Unfortunately development seems to have stopped in 2016. Not sure how much interest there is in this, but suggestions and bug reports are welcome. See Full Changelog: Download the latest version: v1.3.0 (2024-03-24) GuiBuilderPlus v1.3.0 - 2024-03-24.zip FIXED: Wrong line endings when copying from code preview window FIXED: Issue changing properties when Obect Explorer window is not open FIXED: Issue when selecting controls under certain other conditions FIXED: SaveAs keyboard shortcut FIXED: Undo/Redo for Global property ADDED: Auto-size property for Labels, Buttons, and Inputs GitHub Repository: https://github.com/KurtisLiggett/GuiBuilderPlus
    1 point
  8. ioa747

    Simple calculator

    Simple calculator Perform basic arithmetic operations directly from the numeric keypad. Easy copy and paste (data transfer) between different applications. Advanced Features (and the reason I did it) The calculator also includes an checkbox that enables you to apply offsets to your calculations. For instance, using the "+23" offset will add 23 to your result, making it perfect for scenarios where you need to adjust the position of graphical elements in a user interface (GUI). Imagine you want to reposition existing elements by 23 pixels on the Y-axis, you can easily recalculate the new coordinates by adding an offset. SimpleCalculator.au3 ; https://www.autoitscript.com/forum/topic/211838-simple-calculator/ ;---------------------------------------------------------------------------------------- ; Title...........: SimpleCalculator.au3 ; Description.....: Simple Calculator GUI ; AutoIt Version..: 3.3.16.1 Author: ioa747 ; Note............: Testet in Win10 22H2 ;---------------------------------------------------------------------------------------- #Region ;**** Directives created by AutoIt3Wrapper_GUI **** #AutoIt3Wrapper_Res_Description=Simple Calculator GUI #AutoIt3Wrapper_Res_Fileversion=0.0.0.1 #AutoIt3Wrapper_Res_ProductName=SimpleCalculator.au3 #AutoIt3Wrapper_AU3Check_Parameters=-d -w 1 -w 2 -w 3 -w 4 -w 5 -w 6 -w 7 #EndRegion ;**** Directives created by AutoIt3Wrapper_GUI **** #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #include <GuiButton.au3> #include <EditConstants.au3> _CalcGUI() ;-------------------------------------------------------------------------------------------------------------------------------- Func _CalcGUI() #Region ### START Koda GUI section ### Local $hCalcGui = GUICreate("🧮 Simple Calculator", 355, 75, -1, -1, -1, BitOR($WS_EX_TOOLWINDOW, $WS_EX_TOPMOST)) Local $Cmd_Get = GUICtrlCreateButton(">>", 3, 4, 30, 30, $BS_ICON) GUICtrlSetTip(-1, "Get") Local $Id_Input = GUICtrlCreateInput("", 35, 5, 285, 28) GUICtrlSetFont(-1, 12, 400, 0, "MS Sans Serif") Local $Cmd_PasteIn = GUICtrlCreateButton("", 322, 4, 30, 30, $BS_ICON) GUICtrlSetImage(-1, "shell32.dll", -261) GUICtrlSetTip(-1, "Paste") Local $Cmd_Set = GUICtrlCreateButton("<<", 3, 39, 30, 30, $BS_ICON) GUICtrlSetTip(-1, "Set") Local $Id_Output = GUICtrlCreateLabel("", 35, 40, 265, 28) GUICtrlSetFont(-1, 12, 400, 0, "MS Sans Serif") GUICtrlSetBkColor(-1, 0xE1E1E1) Local $Cmd_CopyOut = GUICtrlCreateButton("", 322, 39, 30, 30, $BS_ICON) GUICtrlSetImage(-1, "shell32.dll", -135) GUICtrlSetTip(-1, "Copy") Local $Id_AutoCalc = GUICtrlCreateInput("", 186, 40, 115, 28) GUICtrlSetFont(-1, 12, 400, 0, "MS Sans Serif") GUICtrlSetState(-1, $GUI_HIDE) Local $id_Checkbox = GUICtrlCreateCheckbox("", 305, 40, 17, 17) GUICtrlSetTip(-1, "Auto Calc") ; Set focus to the $Id_Input control. GUICtrlSetState($Id_Input, $GUI_FOCUS) GUISetState(@SW_SHOW) #EndRegion ### END Koda GUI section ### Local $nMsg, $hActiveWin, $sActiveTitle, $sOut, $sAuto, $ClipBack Local $iSlp = 10 ;Sleep between copy-paste, increase if necessary * <- ;********************************** While 1 If WinGetHandle("[ACTIVE]") <> $hActiveWin And WinGetHandle("[ACTIVE]") <> $hCalcGui Then $hActiveWin = WinGetHandle("[ACTIVE]") $sActiveTitle = WinGetTitle($hActiveWin) ConsoleWrite("$sActiveTitle=" & $sActiveTitle & @CRLF) ;*** EndIf $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $id_Checkbox $sOut = GUICtrlRead($Id_Input) If _IsChecked($id_Checkbox) Then GUICtrlSetState($Id_AutoCalc, $GUI_SHOW) GUICtrlSetPos($Id_Output, 35, 40, 145, 28) $sAuto = GUICtrlRead($Id_AutoCalc) $sOut = GUICtrlRead($Id_Input) GUICtrlSetData($Id_Output, Execute("(" & $sOut & ") " & $sAuto)) ControlFocus($hCalcGui, "", $Id_AutoCalc) Else GUICtrlSetState($Id_AutoCalc, $GUI_HIDE) GUICtrlSetPos($Id_Output, 35, 40, 265, 28) $sOut = Execute($sOut) GUICtrlSetData($Id_Output, $sOut) ControlFocus($hCalcGui, "", $Id_Input) EndIf Case $Id_Input, $Id_AutoCalc $sOut = GUICtrlRead($Id_Input) If GUICtrlRead($id_Checkbox) = $GUI_CHECKED Then $sAuto = GUICtrlRead($Id_AutoCalc) $sOut = GUICtrlRead($Id_Input) GUICtrlSetData($Id_Output, Execute("(" & $sOut & ") " & $sAuto)) Else $sOut = Execute($sOut) GUICtrlSetData($Id_Output, $sOut) EndIf GUICtrlSetState($Cmd_Set, $GUI_FOCUS) Case $Cmd_PasteIn GUICtrlSetData($Id_Input, ClipGet()) Case $Cmd_CopyOut ClipPut(GUICtrlRead($Id_Output)) Case $Cmd_Get $ClipBack = ClipGet() ; backup clip data ; Add new data to the clipboard. Sleep($iSlp) WinActivate($hActiveWin) Send("^c") ; copy Sleep($iSlp) GUICtrlSetData($Id_Input, ClipGet()) ClipPut($ClipBack) ; restore clip data GUICtrlSetData($Id_Output, "") If GUICtrlRead($id_Checkbox) = $GUI_CHECKED Then $sAuto = GUICtrlRead($Id_AutoCalc) $sOut = GUICtrlRead($Id_Input) GUICtrlSetData($Id_Output, Execute("(" & $sOut & ") " & $sAuto)) GUICtrlSetState($Cmd_Set, $GUI_FOCUS) Else ControlFocus($hCalcGui, "", $Id_Input) WinActivate($hCalcGui) EndIf Case $Cmd_Set $sOut = GUICtrlRead($Id_Output) If $sOut Then $ClipBack = ClipGet() ; backup clip data ; Add new data to the clipboard. ClipPut($sOut) Sleep($iSlp) WinActivate($hActiveWin) Send("^v") ; paste ClipPut($ClipBack) ; restore clip data EndIf EndSwitch ;~ Sleep(50) WEnd ;********************************** EndFunc ;==>_CalcGUI ;-------------------------------------------------------------------------------------------------------------------------------- Func _IsChecked($idControlID) Return BitAND(GUICtrlRead($idControlID), $GUI_CHECKED) = $GUI_CHECKED EndFunc ;==>_IsChecked ;-------------------------------------------------------------------------------------------------------------------------------- Please, every comment is appreciated! leave your comments and experiences here! Thank you very much
    1 point
×
×
  • Create New...