I have a question please
I've searched a lot on how to make a GUI for programs designed by Autoit to accepts dragging files from Windows File Explorer
Unfortunately, however, it failed
Is there any way to do this?
Where I am making a audio player and I want to activate the feature of dragging files from Windows Explorer to a program window to play them
I hope to find a simple solution here in this wonderful forum
Thank you very much in advance
A couple week ago i've started learning API Interface for different websites. In this fact sometimes you have to encode your "photo" or "document.body" to send request.
Functions to encode and decode Base64 was already created by others. Unfortunately i have troubles with running it on Windows R 2008, also speed was terrible.
I try to find alternative way to code data.
I've read about Microsoft "XMLDOM" and created a one simple function to Encode / Decode data to base64binary, base64url
Thanks for Ghads on Wordpress i coverted a part of his lines from VBscript to AutoIT
;============================================================================================================================== ; Function: base64($vCode [, $bEncode = True [, $bUrl = False]]) ; ; Description: Decode or Encode $vData using Microsoft.XMLDOM to Base64Binary or Base64Url. ; IMPORTANT! Encoded base64url is without @LF after 72 lines. Some websites may require this. ; ; Parameter(s): $vData - string or integer | Data to encode or decode. ; $bEncode - boolean | True - encode, False - decode. ; $bUrl - boolean | True - output is will decoded or encoded using base64url shema. ; ; Return Value(s): On Success - Returns output data ; On Failure - Returns 1 - Failed to create object. ; ; Author (s): (Ghads on Wordpress.com), Ascer ;=============================================================================================================================== Func base64($vCode, $bEncode = True, $bUrl = False) Local $oDM = ObjCreate("Microsoft.XMLDOM") If Not IsObj($oDM) Then Return SetError(1, 0, 1) Local $oEL = $oDM.createElement("Tmp") $oEL.DataType = "bin.base64" If $bEncode then $oEL.NodeTypedValue = Binary($vCode) If Not $bUrl Then Return $oEL.Text Return StringReplace(StringReplace(StringReplace($oEL.Text, "+", "-"),"/", "_"), @LF, "") Else If $bUrl Then $vCode = StringReplace(StringReplace($vCode, "-", "+"), "_", "/") $oEL.Text = $vCode Return $oEL.NodeTypedValue EndIf EndFunc ;==>base64
First I would like to apologize to you for my many questions.
I have a new question if you allow
I am programming an audio player for blinds
I had a problem
I put an option in the folders context menu to Opens the audio files that in the selected folder
I did not know how to make the Autoit Search the subfolders
Please provide an example of how to search for files in the subfolders
Let's say, for example, MP3 files
Just give me a simple example and I will try to modify it as appropriate for the program I designing it
Please help me to find the solution
Thanks in advance
Have anybody succesfully played around with libmpv for mpv player to embed the player in gui ?
Example of child gui.
#include <GUIConstantsEx.au3> #include <WindowsConstants.au3> Local $hGui, $mpv_pid Local $sStream = "http://distribution.bbb3d.renderfarming.net/video/mp4/bbb_sunflower_1080p_60fps_normal.mp4" $hGui = GUICreate("MPV Test", 640, 360, -1, -1) GUISetState(@SW_SHOW) $mpv_pid = Run(@ScriptDir & '\mpv.exe --wid="' & $hGui & '" "' & $sStream & '"') While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit EndSwitch WEnd MPV Player and Libmpv can be downloaded at https://mpv.srsfckn.biz/
I have a script that is calling 2 browser windows in my GUI and loading up the appropriate URLs. Tested alone it works fine. I also have another script that launches a 3rd party application in the GUI. When I try to modify my 2nd script so that it includes the two browser windows along with the GUI, the GUI loads but not the browser windows. Can someone get a second set of eyes on the script below and tell me where my brain jumped track please? Many Thanks.
#include <GUIConstants.au3> #include <Constants.au3> #include <windowsconstants.au3> #include <IE.au3> Global $oIE_google = _IECreateEmbedded() Global $oIE_autoit = _IECreateEmbedded() Opt("GUIOnEventMode", 1) ; Change to OnEvent mode $mainWindow = GUICreate("Embed Cmd", 1280, 780, 10, 10) GUISetOnEvent($GUI_EVENT_CLOSE, "CLOSEClicked") GUISetState (@SW_SHOW) GUIRegisterMsg(0xF, "WM_PAINT") ; create a borderless window that is a child to the main window $embedWindow = GUICREATE("", 700, 400, 15, 15, $WS_POPUP, -1, $mainWindow) Global $google = GUICtrlCreateObj($oIE_google, 10, 10, 1000, 300) Global $autoit = GUICtrlCreateObj($oIE_autoit, 800, 10, 500, 300) _IENavigate($oIE_google, "http://www.google.com") _IENavigate($oIE_autoit, "http://www.bing.com") DllCall("user32.dll", "hwnd", "SetParent", "hwnd", $embedWindow, "hwnd", $mainWindow) ; launch the command prompt (black on white, without the operating system message) $pid = run("C:\Program Files (x86)\Cisco\Router Manager\Router Administration.exe") ProcessWait ($pid) ; get the handle of the cmd window as i cannot be certain that there will be only one instance of the cmd running with the same window title or class $cmdHandle = _ProcessGetHWnd($pid, 2) $hWndChild = $cmdHandle ; make the command prompt window a child to the earlier created borderless child window DllCall("user32.dll", "hwnd", "SetParent", "hwnd", $hWndChild, "hwnd", $embedWindow) ; resize the command prompt window so that its bolder and title bar are outside the borderless child window ; giving the appearance of a borderless command prompt WinMove($hWndChild, '', 10, 500, 485, 206) ;WinMove($hWndChild, '', 10, 500) WinSetState($hWndChild, '', @SW_SHOW) WinSetState($embedWindow, '', @SW_SHOW) WinSetState($oIE_google, '', @SW_SHOW) WinSetState($oIE_autoit, '', @SW_SHOW) ; inifinite event loop While 1 ; sleep for 100 milliseconds (to not hog the cpu) sleep(100) ; end of event loop WEnd Func CLOSEClicked() ; take care of things to do when exiting Winkill($hWndChild) Exit EndFunc Func WM_PAINT($hWnd, $Msg, $wParam, $lParam) Sleep(100) DllCall("user32.dll", "int", "InvalidateRect", "hwnd", $hWnd, "ptr", 0, "int", 0) EndFunc ;==>WM_PAINT ;=============================================================================== ; ; Function Name: _ProcessGetHWnd ; Description: Returns the HWND(s) owned by the specified process (PID only !). ; ; Parameter(s): $iPid - the owner-PID. ; $iOption - Optional : return/search methods : ; 0 - returns the HWND for the first non-titleless window. ; 1 - returns the HWND for the first found window (default). ; 2 - returns all HWNDs for all matches. ; ; $sTitle - Optional : the title to match (see notes). ; $iTimeout - Optional : timeout in msec (see notes) ; ; Return Value(s): On Success - returns the HWND (see below for method 2). ; $array - number of HWNDs ; $array[x] - title ; $array[x] - HWND ; ; On Failure - returns 0 and sets @error to 1. ; ; Note(s): When a title is specified it will then only return the HWND to the titles ; matching that specific string. If no title is specified it will return as ; described by the option used. ; ; When using a timeout it's possible to use WinWaitDelay (Opt) to specify how ; often it should wait before attempting another time to get the HWND. ; ; ; Author(s): Helge ; ;=============================================================================== Func _ProcessGetHWnd($iPid, $iOption = 1, $sTitle = "", $iTimeout = 2000) Local $aReturn = [], $aWin, $hTimer = TimerInit() While 1 ; Get list of windows $aWin = WinList($sTitle) ; Searches thru all windows For $i = 1 To $aWin ; Found a window owned by the given PID If $iPid = WinGetProcess($aWin[$i]) Then ; Option 0 or 1 used If $iOption = 1 OR ($iOption = 0 And $aWin[$i] <> "") Then Return $aWin[$i] ; Option 2 is used ElseIf $iOption = 2 Then ReDim $aReturn[UBound($aReturn) + 1] $aReturn += 1 $aReturn[$aReturn] = $aWin[$i] $aReturn[$aReturn] = $aWin[$i] EndIf EndIf Next ; If option 2 is used and there was matches then the list is returned If $iOption = 2 And $aReturn > 0 Then Return $aReturn ; If timed out then give up If TimerDiff($hTimer) > $iTimeout Then ExitLoop ; Waits before new attempt Sleep(Opt("WinWaitDelay")) WEnd ; No matches SetError(1) Return 0 EndFunc ;==>_ProcessGetHWnd $StaticTxt = ControlGetText("Embed Cmd","",1007) MsgBox(1,"Static Text", $StaticTxt) GUISetState() While GUIGetMsg() <> -3 WEnd