Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 04/23/2023 in all areas

  1. You can cut off borders of windows with _WinAPI_SetWindowRgn() and _WinAPI_CreateRectRgn(), here's an example where I do it with the Irrlicht render window which then gets embedded in an AutoIt gui, you can adjust it to that VLC window you mentioned... ;Embed Irrlicht RenderWindow--------------------------------------------------------------------------------------- _IrrStart($IRR_EDT_opengl, 1024, 768, $IRR_BITS_PER_PIXEL_32, $IRR_windowed, $IRR_SHADOWS, $IRR_capture_EVENTS, $IRR_VERTICAL_SYNC_Off) _IrrSetWindowCaption( "IrrLicht Window") _WinAPI_SetWindowRgn(WinGetHandle("IrrLicht Window", ""), _WinAPI_CreateRectRgn(3, 22, 1024, 768)) ; Cut off IrrLicht Window Border WinMove("IrrLicht Window", "", -3, -22) ; It wants to be moved before set as child for some reason, not vice versa. _WinAPI_Setparent(WinGetHandle("IrrLicht Window", ""), $Gui); Set as child for autoit window WinActivate("AutoIt Window") GUISetState() ;-------------------------------------------------------------------------------------------------------------------- or post an example of that VLC window so I can give it a try. Using autoit to embed the vlc window in an autoit gui using _WinAPI_SetParent is perhaps better than having vlc embedding itself, just a guess,
    1 point
  2. Hi @Belini. After googling a bit more i found a page explaining the cause of the freezing issue better: https://github.com/ZeBobo5/Vlc.DotNet/wiki/Vlc.DotNet-freezes-(don't-call-Vlc.DotNet-from-a-Vlc.DotNet-callback). I will do some testing with and without the libvlc_media_player_set_hwnd. Due to race conditions the issue has, on average ~50% change of triggering in my experience, so i will verify if it works. If the temporary solution works, I imagine it got something to do with attaching the player to a hwnd not owned by the libvlc process causes the player calls to be affected by the main program GUI message loop. I also found a thread that suggest this problem is still in libvlc v3, but v4 solves this by introducing an async version of these calls. Biggest issue is that v4 is still in pre-release, so I'm not sure how stable it is yet.
    1 point
  3. Well show some code you have made with this (like a simple reach to Google). So we can evaluate how incredible this solution is. Stating grandiosity is not enough in this forum.
    1 point
  4. If you set the styles of a control with GUICtrlSetStyle() and happen to forget the styles you set, then why not try GUICtrlGetStyle() To get the Hex value e.g. 00100000 then use this little conversion >> Local $aArray = GUICtrlGetStyle($iLabel) _GUICtrlGetStyle_Convert($aArray) _ArrayDisplay($aArray, 'The Style = 0101 & the ExStyle = 00100000'))Function: #include-once #include <WinAPI.au3> ; #FUNCTION# ==================================================================================================================== ; Name ..........: GUICtrlGetStyle ; Description ...: Retrieves the Styles/ExStyles value(s) of a control. ; Syntax ........: GUICtrlGetStyle($hWnd) ; Parameters ....: $hWnd - Control ID/Handle to the control ; Return values .: $aArray[2] = [Style, ExStyle] ; Author ........: guinness ; Example .......: Yes ; =============================================================================================================================== Func GUICtrlGetStyle($hWnd) If Not IsHWnd($hWnd) Then $hWnd = GUICtrlGetHandle($hWnd) EndIf Local $aReturn = [_WinAPI_GetWindowLong($hWnd, $GWL_STYLE), _WinAPI_GetWindowLong($hWnd, $GWL_EXSTYLE)] Return $aReturn EndFunc ;==>GUICtrlGetStyleExample use of Function: #include <Array.au3> ; Required only for _ArrayDisplay(), but not the UDF! #include <GUIConstantsEx.au3> #include 'GUICtrlGetStyle.au3' Example() Func Example() Local $hGUI = GUICreate('GUICtrlGetStyle() Example', 280, 90) ; This label is using 'magic numbers' instead of the constant variables. It's advisable to use $SS_CENTER & $GUI_WS_EX_PARENTDRAG ; instead of 0x0101 & 0x00100000, but this has been done for proof of concept only. See the second _Array display for more details. Local $iLabel = GUICtrlCreateLabel('This is a Label with $SS_CENTER & $GUI_WS_EX_PARENTDRAG set as the Styles.', 10, 10, 270, 45, 0x0101, 0x00100000) ; $SS_CENTER, $GUI_WS_EX_PARENTDRAG Local $iButton = GUICtrlCreateButton('GetStyle Array', 95, 55, 85, 25) GUISetState(@SW_SHOW, $hGUI) Local $aArray = 0 While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE ExitLoop Case $iButton $aArray = GUICtrlGetStyle($iLabel) _ArrayDisplay($aArray) GUICtrlDelete($iLabel) GUICtrlCreateLabel('This is a NEW Label with $SS_CENTER & $GUI_WS_EX_PARENTDRAG set as the Styles/ExStyles.', 10, 10, 270, 50, $aArray[0], $aArray[1]) ; This is the reason why 'magic numbers' were used, so as to see they match the same values in GUICtrlCreateLabel. $aArray = GUICtrlGetStyle($iLabel) _GUICtrlGetStyle_Convert($aArray) _ArrayDisplay($aArray, 'The Style = 0x0101 & the ExStyle = 0x00100000') EndSwitch WEnd GUIDelete($hGUI) EndFunc ;==>Example Func _GUICtrlGetStyle_Convert(ByRef $aArray) If UBound($aArray) = 2 Then $aArray[0] = '0x' & Hex($aArray[0], 4) $aArray[1] = '0x' & Hex($aArray[1], 8) EndIf EndFunc ;==>_GUICtrlGetStyle_Convert
    1 point
  5. You're posting to the wrong thread: and that function works fine for me: #include <WinAPIGdi.au3> $mainwindow = GUICreate("# WINDOW #", 200, 200) $test = GUICtrlCreateButton("TEST", 40, 34, 90, 90) GUICtrlSetBkColor($test, 0xf2f2f2) GUISetState(@SW_SHOW) $iColor = GUICtrlGetBkColor($test) MsgBox(0,"",$iColor & @crlf & "0x" & Hex($iColor, 6)) ; #FUNCTION# ==================================================================================================================== ; Name ..........: GUICtrlGetBkColor ; Description ...: Retrieves the RGB value of the control background. ; Syntax ........: GUICtrlGetBkColor($hWnd) ; Parameters ....: $hWnd - Control ID/Handle to the control ; Return values .: Success - RGB value ; Failure - 0 ; Author ........: guinness ; Example .......: Yes ; =============================================================================================================================== Func GUICtrlGetBkColor($hWnd) If Not IsHWnd($hWnd) Then $hWnd = GUICtrlGetHandle($hWnd) EndIf Local $hDC = _WinAPI_GetDC($hWnd) Local $iColor = _WinAPI_GetPixel($hDC, 0, 0) _WinAPI_ReleaseDC($hWnd, $hDC) Return $iColor EndFunc ;==>GUICtrlGetBkColor
    1 point
×
×
  • Create New...