Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 10/30/2025 in all areas

  1. On that point I should confess that I haven't updated my everyday PC to the latest version and that have projects still in v3.3.14.2 on other PCs ( quite shamelessly too ). If I had to start a new project, it'd be advisable to use the latest. In this case, that is so involved with the OS, is more important than just a SQLite script ( for example ), were the GUI is just to have a working interface. So yes, I too am of the opinion that you should focus the project on the updated engine/stub and it's UDFs. And as you've discovered yourself, a portable instance of other versions are quite simple to have. ( suck on that python !. ppl had to invent "Docker" to solve your issues ! )
    2 points
  2. Just be aware that the function which actually uses $CP_UTF8 (_WinAPI_MultiByteToWideChar) has also changed since the update.... The old version of this doesn't work as the strings in the metadata files aren't null-terminated. Not that we're necessarily calling this func in this project - but just FYI!
    2 points
  3. Ah apologies... so we've all stuffed up well here! - I haven't re-tested, but from looking at things... In the first one, we are: IMediaPlayerElement_GetIsFullWindow($pPlayer) But. $pPlayer is the mediaplayer object. not the mediaplayerelement object! So we think we're calling function #19 in the IMediaPlayerElement vtable. but we're actually calling function #19 in IMediaPlayer. which is IMediaPlayer::GetIsMuted My last demo I'm also using the wrong obj in both the getter and setter. Func _MediaPlayer_SetIsFullWindow($iMPIdx, $bState) If $iMPIdx < 1 Or $iMPIdx >= UBound($__g_apPlayers) Then Return False _WinRT_SwitchInterface($__g_apMPElements[$iMPIdx], $sIID_IMediaPlayerElement) If Not @error Then IMediaPlayerElement_SetIsFullWindow($__g_apPlayers[$iMPIdx], $bState) Return @error = $S_OK EndFunc $__g_apPlayers[$iMPIdx] should be $__g_apMPElements[$iMPIdx].
    1 point
  4. Ah ok, In the second example, and $hPlayer isn't an object pointer - its a psuedo handle. Basically I've dumped the associated objects of a "player" into an arrays, and hplayer is simply an index. ;from _MediaPlayer_Create, $hPlayer is $iMPIdx! Local $iMPIdx = UBound($__g_apXamlSources) ReDim $__g_apXamlSources[$iMPIdx + 1] ReDim $__g_apMPElements[$iMPIdx + 1] ReDim $__g_apPlayers[$iMPIdx + 1] Try these ones! - Edit 31/10: Corrected error as discussed below. Func _MediaPlayer_SetIsFullWindow($iMPIdx, $bState) If $iMPIdx < 1 Or $iMPIdx >= UBound($__g_apPlayers) Then Return False _WinRT_SwitchInterface($__g_apMPElements[$iMPIdx], $sIID_IMediaPlayerElement) If Not @error Then IMediaPlayerElement_SetIsFullWindow($__g_apMPElements[$iMPIdx], $bState) Return @error = $S_OK EndFunc Func _MediaPlayer_GetIsFullWindow($iMPIdx) If $iMPIdx < 1 Or $iMPIdx >= UBound($__g_apPlayers) Then Return False _WinRT_SwitchInterface($__g_apMPElements[$iMPIdx], $sIID_IMediaPlayerElement) If Not @error Then $bState = IMediaPlayerElement_GetIsFullWindow($__g_apMPElements[$iMPIdx]) Return SetError(@error, @extended, $bState) EndFunc Then for the transport button - not that it achieves anything!. Func _MediaPlayer_SetIsFullScreenVisible($iMPIdx, $bState) Local $iErr If $iMPIdx < 1 Or $iMPIdx >= UBound($__g_apPlayers) Then Return False Local $pTransport = __MediaPlayer_GetTransport($iMPIdx) If @error Then Return SetError(@error, @extended, False) IMediaTransportControls_SetIsFullWindowButtonVisible($pTransport, $bState) $iErr = @error IUnknown_Release($pTransport) Return $iErr = $S_OK EndFunc Func _MediaPlayer_SetIsFullScreenEnabled($iMPIdx, $bState) Local $iErr If $iMPIdx < 1 Or $iMPIdx >= UBound($__g_apPlayers) Then Return False Local $pTransport = __MediaPlayer_GetTransport($iMPIdx) If @error Then Return SetError(@error, @extended, False) IMediaTransportControls_SetIsFullWindowEnabled($pTransport, $bState) $iErr = @error IUnknown_Release($pTransport) Return $iErr = $S_OK EndFunc Func _MediaPlayer_GetIsFullScreenVisible($iMPIdx) Local $iErr, $iExt, $bState = False If $iMPIdx < 1 Or $iMPIdx >= UBound($__g_apPlayers) Then Return False Local $pTransport = __MediaPlayer_GetTransport($iMPIdx) If @error Then Return SetError(@error, @extended, False) $bState = IMediaTransportControls_GetIsFullWindowButtonVisible($pTransport) $iErr = @error $iExt = @extended IUnknown_Release($pTransport) Return $iErr = $S_OK EndFunc Func _MediaPlayer_GetIsFullScreenEnabled($iMPIdx) Local $iErr, $iExt, $bState = False If $iMPIdx < 1 Or $iMPIdx >= UBound($__g_apPlayers) Then Return False Local $pTransport = __MediaPlayer_GetTransport($iMPIdx) If @error Then Return SetError(@error, @extended, False) $bState = IMediaTransportControls_GetIsFullWindowEnabled($pTransport) $iErr = @error $iExt = @extended IUnknown_Release($pTransport) Return SetError($iErr, $iExt, $bState) EndFunc
    1 point
  5. @SOLVE-SMART I updated the script in the first post to support 3.3.16.1. Thanks for letting me know about that. Now I've got a portable setup of 3.3.16.1 so that I can test any of my scripts on as well.
    1 point
  6. Local. Inside the function.
    1 point
  7. Local Const $CP_UTF8 = 65001 should solve that. For _IsPressed(), people can press F1 to find out what UDF is that in. Easy peasy lemon squeezy
    1 point
  8. You are 100% right, Sven. You made me realize that I haven’t paid any attention at all regarding compatibility between AutoIt versions. I really appreciate that you pointed that out because I never thought about it. I suppose the easiest way for me to test would be to run several versions side by side. I imagine I would need to have the previous version(s) as portable maybe and run by command lines. I’ll have to think about how to set this up. In the meantime, I will update the script later tonight and I will have to pay closer attention to this going forward. Thank you so much.
    1 point
  9. Apologies if I'm overstepping - but if its useful, this was something that I was playing with a little while back. Click to place a button, then you can drag and resize it. #include <guiConstants.au3> #include <winapi.au3> #include <misc.au3> ;~ #include <SendMessage.au3> Global $hCursor_Cross = _WinAPI_LoadCursor(0, $IDC_CROSS) Global $hGui = GUICreate("", 300, 200, 100, 100, BitOR($WS_SIZEBOX, $WS_MINIMIZEBOX)) Global $hBtnProc = DllCallbackRegister("btnProc", "lresult", "hwnd;uint;wparam;lparam;uint_ptr;dword_ptr") Global $pBtnProc = DllCallbackGetPtr($hBtnProc) Global $hWndProc = DllCallbackRegister("WndProc", "lresult", "hwnd;uint;wparam;lparam;uint_ptr;dword_ptr") Global $pWndProc = DllCallbackGetPtr($hWndProc) _WinAPI_SetWindowSubclass($hGui, $pWndProc, 1000) GUISetState() Local $iMsg While WinExists($hGui) $iMsg = GUIGetMsg() Switch $iMsg Case $GUI_EVENT_CLOSE ExitLoop EndSwitch WEnd _WinAPI_RemoveWindowSubclass($hGui, $pWndProc, 1000) Func WndProc($hWnd, $iMsg, $wParam, $lParam, $iIdSubclass, $dwRefData) Local $iRet Switch $iMsg Case $WM_SETCURSOR Local $iSrc = BitAND($lParam, 0xFFFF), $iEvent = BitShift($lParam, 16) If $iSrc = $HTCLIENT Then _WinAPI_SetCursor($hCursor_Cross) $iRet = 1 Else $iRet = _WinAPI_DefSubclassProc($hWnd, $iMsg, $wParam, $lParam) EndIf Case $WM_LBUTTONDOWN Local $iX = BitAND($lParam, 0xFFFF), $iY = BitShift($lParam, 16) Local $idBtn = GUICtrlCreateButton("", $iX - 12, $iY - 12, 25, 25) _WinAPI_SetWindowSubclass(GUICtrlGetHandle($idBtn), $pBtnProc, $idBtn) $iRet = _WinAPI_DefSubclassProc($hWnd, $iMsg, $wParam, $lParam) Case $WM_SIZE ;This prevents autoit's docking logic from moving controls around on window restore. $iRet = _WinAPI_DefWindowProcW($hWnd, $iMsg, $wParam, $lParam) Case Else $iRet = _WinAPI_DefSubclassProc($hWnd, $iMsg, $wParam, $lParam) EndSwitch Return $iRet EndFunc Func btnProc($hWnd, $iMsg, $wParam, $lParam, $iIdSubclass, $dwRefData) Local $iRet Switch $iMsg Case $WM_NCHITTEST Local $aPoint[2] = [BitAND($lParam, 0xFFFF), BitShift($lParam, 16)] ;Mouse coords can be negative on edge cases! If BitAND($aPoint[0], 0x8000) Then $aPoint[0] = BitOR(0xFFFF0000, $aPoint[0]) If BitAND($aPoint[1], 0x8000) Then $aPoint[1] = BitOR(0xFFFF0000, $aPoint[1]) Local $aPos = WinGetPos($hWnd), $iMar = 10 $iRet = $HTCAPTION If $aPoint[0] - $aPos[0] < $iMar Then $iRet = $HTLEFT If $aPoint[0] - $aPos[0] > ($aPos[2] - $iMar) Then $iRet = $HTRIGHT If $aPoint[1] - $aPos[1] < $iMar Then Switch $iRet Case $HTLEFT $iRet = $HTTOPLEFT Case $HTRIGHT $iRet = $HTTOPRIGHT Case Else $iRet = $HTTOP EndSwitch ElseIf $aPoint[1] - $aPos[1] > ($aPos[3] - $iMar) Then Switch $iRet Case $HTLEFT $iRet = $HTBOTTOMLEFT Case $HTRIGHT $iRet = $HTBOTTOMRIGHT Case Else $iRet = $HTBOTTOM EndSwitch EndIf If $aPoint[0] < 0 Then $iRet = _WinAPI_DefSubclassProc($hWnd, $iMsg, $wParam, $lParam) If $aPoint[1] < 0 Then $iRet = _WinAPI_DefSubclassProc($hWnd, $iMsg, $wParam, $lParam) _WinAPI_RedrawWindow($hWnd) Case $WM_NCLBUTTONDBLCLK ;Prevent double-click maximizing in "caption" If $wParam <> $HTCAPTION Then $iRet = _WinAPI_DefSubclassProc($hWnd, $iMsg, $wParam, $lParam) Case $WM_SETCURSOR Local $iSrc = BitAND($lParam, 0xFFFF), $iEvent = BitShift($lParam, 16) If $iSrc = $HTCAPTION And $iEvent = $WM_LBUTTONDOWN Then _WinAPI_SetCursor($hCursor_Cross) $iRet = 1 Else $iRet = _WinAPI_DefSubclassProc($hWnd, $iMsg, $wParam, $lParam) EndIf Case Else $iRet = _WinAPI_DefSubclassProc($hWnd, $iMsg, $wParam, $lParam) EndSwitch Return $iRet EndFunc ;==>btnProc
    1 point
×
×
  • Create New...