Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 11/23/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 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. Come to think of it, 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 a while if they feel the urge 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. The latest version can be downloaded here.
    1 point
  2. @mr-es335 What about changing this single line in your initial script ? ; Case $_aGetType[0] < 3 Case $_aGetType[0] <> 3
    1 point
  3. TheXman

    Call to JSON REST API

    The example below should work also. It's a bit longer because it has comments, error checking, and several ConsoleWrites to see the progress, response, and any errors that may occur. Since you were using COM before, the syntax below should be familiar to you. post_authentication_test() Func post_authentication_test() Local $oHttp = Null, _ $oComErr = Null Local $iHttpStatus = 0 Local $sResponse = "", _ $sPostData = "" ConsoleWrite(@CRLF & "Executing API" & @CRLF) ;Set COM error handler $oComErr = ObjEvent("AutoIT.Error", "com_error_handler") ;Create a HTTP COM object $oHttp = ObjCreate("winhttp.winhttprequest.5.1") If @error Then ConsoleWrite("Unable to create http request object." & @CRLF) Exit -1 EndIf ConsoleWrite("WinHttpRequest object created." & @CRLF) With $oHttp ;Open POST request .Open("POST", "http://localhost/ARXivarNextWebApi/api/Authentication", False) ;Set request headers and options .SetRequestHeader("Content-Type", "application/json") ;Send request .Send('{"username":"admin","password":"123","clientId":"AUTOIT_TEST","clientSecret":"E5AE290AB76A4B1E"}') If @error Then ConsoleWrite(StringFormat("SEND ERROR: (0x%X) %s", $oComErr.Number, $oComErr.Description) & @CRLF) Return EndIf ;Get status code and response $iHttpStatus = .Status $sResponse = .ResponseText ;If status code isn't okay If $iHttpStatus <> 200 Then ConsoleWrite("HTTP Status : " & String($iHttpStatus) & @CRLF) ConsoleWrite("HTTP Response: " & @CRLF & $sResponse & @CRLF) Return EndIf EndWith ConsoleWrite("API Response:" & @CRLF & $sResponse & @CRLF) EndFunc Func com_error_handler($oError) #forceref $oError Return EndFunc
    1 point
  4. @Lar, Thanks a lot - it looks as if it could be the answer. I get answers to the following: DllStructGetData($logfont1, 1) - might be the point size, although -12 seems a bit odd DllStructGetData($logfont1, 5) - reads 400 and so looks like the weight (as in GUICtrlSetFont) and DllStructGetData($logfont1, 14) - is the font name. I will play with the -12 answer a bit and see if I can get anywhere. And also look into your struct code to see if I can learn more about that side of things. Thanks again, M23 Edit: Yes, -12 is basically a point value. For normal fonts the point size is .75 of this value (based on a wonderful calculation using dots per inch and points per inch). It is negative for some internal Windows font mapping ID reason. So again thanks for a complete solution. M23
    1 point
  5. I am not very good at DLLStructCreate... and I have not much time... but this is some SystemParametersInfo stuff from microsoft that is supposed to return the info you want... somone else might fix it. #cs typedef struct tagNONCLIENTMETRICS { UINT cbSize; int iBorderWidth; int iScrollWidth; int iScrollHeight; int iCaptionWidth; int iCaptionHeight; LOGFONT lfCaptionFont; int iSmCaptionWidth; int iSmCaptionHeight; LOGFONT lfSmCaptionFont; int iMenuWidth; int iMenuHeight; LOGFONT lfMenuFont; LOGFONT lfStatusFont; LOGFONT lfMessageFont; #if (WINVER >= 0x0600) int iPaddedBorderWidth; #endif } NONCLIENTMETRICS, *LPNONCLIENTMETRICS; typedef struct tagLOGFONT { LONG lfHeight; LONG lfWidth; LONG lfEscapement; LONG lfOrientation; LONG lfWeight; BYTE lfItalic; BYTE lfUnderline; BYTE lfStrikeOut; BYTE lfCharSet; BYTE lfOutPrecision; BYTE lfClipPrecision; BYTE lfQuality; BYTE lfPitchAndFamily; TCHAR lfFaceName[LF_FACESIZE]; } LOGFONT, *PLOGFONT; #ce $nonclientmetrics = DllStructCreate("uint;int;int;int;int;int;byte[60];int;int;byte[60];int;int;byte[60];byte[60];byte[60]") DLLStructSetData($nonclientmetrics,1,DllStructGetSize($nonclientmetrics)) Global Const $SPI_GETNONCLIENTMETRICS = 41 $a = DLLCall("user32.dll","int","SystemParametersInfo","int",41, _ "int",DllStructGetSize($nonclientmetrics), _ "ptr",DllStructGetPtr($nonclientmetrics),"int",0) $b = DLLCall("kernel32.dll","int","GetLastError") MsgBox(4096,$b[0],$a[0]) $logfont1 = DllStructCreate("long;long;long;long;long;byte;byte;byte;byte;byte;byte;byte;byte;char[32]",DLLStructGetPtr($nonclientmetrics,7)) $logfont2 = DllStructCreate("long;long;long;long;long;byte;byte;byte;byte;byte;byte;byte;byte;char[32]",DLLStructGetPtr($nonclientmetrics,10)) $logfont3 = DllStructCreate("long;long;long;long;long;byte;byte;byte;byte;byte;byte;byte;byte;char[32]",DLLStructGetPtr($nonclientmetrics,13)) $logfont4 = DllStructCreate("long;long;long;long;long;byte;byte;byte;byte;byte;byte;byte;byte;char[32]",DLLStructGetPtr($nonclientmetrics,14)) $logfont5 = DllStructCreate("long;long;long;long;long;byte;byte;byte;byte;byte;byte;byte;byte;char[32]",DLLStructGetPtr($nonclientmetrics,15)) MsgBox(4096,"",DllStructGetData($logfont1,14) & @LF & _ DllStructGetData($logfont2,14) & @LF & _ DllStructGetData($logfont3,14) & @LF & _ DllStructGetData($logfont4,14) & @LF & _ DllStructGetData($logfont5,14)) Lar.
    1 point
×
×
  • Create New...