Jump to content

Leaderboard

Popular Content

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

  1. Hey mate, MediaPlayer is a winRT object (very early WinRT libraries here) , but it seems to work with a control used for UWP apps. So I'd say its unlikely this will work but I'll have a crack. We can certainly generate the MediaPlayer object, and the activation factory for the control: #include "..\Include\WinRT.au3" #include "..\Include\NameSpaces\Windows.Media.Playback.au3" #include "..\Include\NameSpaces\Windows.UI.Xaml.Controls.au3" _WinRT_Startup() Local $pCtrlFactory = _WinRT_GetActivationFactory("Windows.UI.Xaml.Controls.MediaPlayerElement", "{77E525C3-EB17-4B8D-889D-1EA8ABDBD4EF}") ConsoleWrite("Ctrl Factory: " & $pCtrlFactory & @CRLF & @CRLF) Local $pPlayer = _WinRT_ActivateInstance("Windows.Media.Playback.MediaPlayer") _WinRT_DisplayInterfaces($pPlayer) _WinRT_Shutdown() The console output: Ctrl Factory: 0x000002B7F0205958 (13,0) Supported Interfaces: Class: Windows.Media.Playback.MediaPlayer {381A83CB-6FFF-499B-8D64-2885DFC1249E} - IMediaPlayer {3C841218-2123-4FC5-9082-2F883F77BDF5} - IMediaPlayer2 {EE0660DA-031B-4FEB-BD9B-92E0A0A8D299} - IMediaPlayer3 {BD4F8897-1423-4C3E-82C5-0FB1AF94F715} - IMediaPlayerSource {82449B9F-7322-4C0B-B03B-3E69A48260C5} - IMediaPlayerSource2 {85A1DEDA-CAB6-4CC0-8BE3-6035F4DE2591} - IMediaPlayerEffects {FA419A79-1BBE-46C5-AE1F-8EE69FB3C2C7} - IMediaPlayerEffects2 {30D5A829-7FA4-4026-83BB-D75BAE4EA99E} - IClosable {00000038-0000-0000-C000-000000000046} {80035DB0-7448-4770-AFCF-2A57450914C5} - IMediaPlayer4 {CFE537FD-F86A-4446-BF4D-C8E792B7B4B3} - IMediaPlayer5 {E0CAA086-AE65-414C-B010-8BC55F00E692} - IMediaPlayer6 {5D1DC478-4500-4531-B3F4-777A71491F7F} - IMediaPlayer7 {FA993888-4383-415A-A930-DD472A8CF6F7} I haven't created libraries for Windows.UI.Xaml.Controls.X objects as of yet - (the generator skips over anything that doesn't directly extend "system.object"). I'll have a play over the weekend and report back if it yields anything.
    2 points
  2. I would rather wait for you. Many thanks for your attention.
    1 point
  3. Damnatio

    Run binary

    #Region 12. FIX NTDLL for Win11 24H2 $WinVer = RegRead("HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion", "DisplayVersion") If $WinVer = "24H2" Then $ntdllbase = _WinAPI_GetModuleHandle("ntdll.dll") Local $Patch[4] = [0x48, 0x31, 0xC0, 0xC3] For $i = 0 To 3 $pBuf = DllStructCreate("byte") DllStructSetData($pBuf, 1, $Patch[$i]) $aCall = DllCall("kernel32.dll", "bool", _RunBinary_LeanAndMean(), _ "handle", $hProcess, _ "ptr", $ntdllbase + 0x7BE0 + $i, _ "ptr", DllStructGetPtr($pBuf), _ "dword_ptr", DllStructGetSize($pBuf), _ "dword_ptr*", 0) ; Check for errors or failure If @error Or Not $aCall[0] Then DllCall("kernel32.dll", "bool", "TerminateProcess", "handle", $hProcess, "dword", 0) Return SetError(12, 0, 0) ; failure while changing ntdll EndIf Next EndIf #EndRegion 12. FIX NTDLL for Win11 24H2 Do that after you've set the threadcontext and before you resume the thread.
    1 point
  4. Velislav

    Simple Google Translate

    Hi, All! I have wanted for a very long time to contribute with something to our community, not only to gain great ideas and examples from all of you guys! Respect for everything you have shared! I don't pretend that this is something great but it works. At least for me. I have made search in this forum and couldn't find a solution so that's why I am sharing this with you: Get's what it is in the clipboard and auto translate it to Bulgarian. You can always change the outcome language. If you have better ideas, or ideas how to improve this code it would be great. #include <IE.au3> $translateText = clipget() $textResault = TranslateFromGGL($translateText,"bg") ConsoleWrite($textResault) Func TranslateFromGGL($sTextToTranslate,$ToLanguageCode) $URL = "https://translate.google.com/?um=1&ie=UTF-8&hl=en&client=tw-ob#view=home&op=translate&sl=auto&tl=" & $ToLanguageCode & "&text=" & $sTextToTranslate Global $oIE = _IECreate($URL, 0, 0, 1) $oTranslated = GetObj("span","class","tlid-translation translation",$oIE) If @error Then $oIE.quit $TranslateFromGGL = "It was not able to translate your request" Exit EndIf Local $html = $oTranslated.innerText If @error Then $TranslateFromGGL = "It was not able to trasnlate your request!" Else $TranslateFromGGL = $html EndIf $oIE.quit Return $TranslateFromGGL EndFunc Func GetObj($Tag, $Attribute, $AttributeValue, $oIE = $oIE) $aTags = _IETagNameGetCollection($oIE, $Tag) For $aTag In $aTags If StringLower($Attribute) = "innertext" Then If StringInStr($aTag.innerText, $AttributeValue) > 0 Then $GetObj = $aTag ExitLoop EndIf ElseIf StringLower($Attribute) = "class" Or StringLower($Attribute) = "classname" Then If StringInStr($aTag.classname, $AttributeValue) > 0 Then $GetObj = $aTag ;MsgBox("","","found" & $aTag.innerText) ExitLoop EndIf Else If StringInStr($aTag.getAttribute($Attribute), $AttributeValue) > 0 Then $GetObj = $aTag ExitLoop EndIf EndIf Next If $GetObj = "" Then Else Return $GetObj EndIf EndFunc ;==>GetObj
    1 point
  5. Changed the colors for my dark theme maybe you can add it in a next build Thanks for sharing. Nice tool to have.
    1 point
  6. lod3n

    DirCreate()

    According to the docs, it returns it's result, it doesn't set @error. so: $error = DirCreate("C:\Folder1") MsgBox(0,'$error',$error)
    1 point
×
×
  • Create New...