Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 06/24/2012 in all areas

  1. Welcome to the forums mvk25 A few things to try: 1 - Embedded UDF avi control: AVI Control gets background brush from statusbar (not themed but not as visible as your gui background colour) 2 - Embedded UDF avi control: Turn off themes for the statusbar - (control gets background brush from unthemed statusbar) 3 - Embedded native avi control: Turn off themes for the statusbar and set statusbar colour same as gui (control gets background brush from parent gui) 4 - Embedded native/UDF avi control: Get statusbar theme/system colour* and return brush in _WM_CTLCOLORSTATIC message handler (udf avi control created with gui as parent, then made parent of statusbar, so we get a WM_CTLCOLORSTATIC message) ;*(issues with getting colour from themed statusbar and themes that have a background gradient in the statusbar - the default xp theme has a gradient themed statusbar) 5 - Embedded native/UDF avi control: write the themed background to a memdc, write to a bitmap and create a brush from it to return in _WM_CTLCOLORSTATIC message handler (requires code to monitor theme change and create a new brush) #include <WindowsConstants.au3> #include <GuiAVI.au3> #include <GuiStatusBar.au3> #include <GUIConstantsEx.au3> _example1() _example2() _example3() Exit Func _example1() Local $WindowMain = GUICreate("Example", 351, 176, -1, -1) GUISetBkColor(0xDDDDDD, $WindowMain) Local $Statusbar = _GUICtrlStatusBar_Create($WindowMain) Local $Statusbar_PartsWidth[2] = [324, -1] _GUICtrlStatusBar_SetParts($Statusbar, $Statusbar_PartsWidth) _GUICtrlStatusBar_SetText($Statusbar, "", 0) _GUICtrlStatusBar_SetText($Statusbar, "", 1) _GUICtrlStatusBar_SetMinHeight($Statusbar, 20) Local $hIcon = __GUICtrlStatusBar_SetIcon($Statusbar, 1, 0, 'ico.ico') ;the original udf destroys the icon handle Local $Icon = GUICtrlCreateIcon('ico.ico', -1, 300, 130, 16, 16) ;Icon on GUI - place before GUISetState Local $AVI = GUICtrlCreateAvi('avi.avi', 0, 250, 130, 16, 16) GUICtrlSetState($AVI, 1) Local $hAVI2 = _GUICtrlAVI_Create($WindowMain, 'avi.avi', -1, 154, 4, 16, 16) _GUICtrlStatusBar_EmbedControl($Statusbar, 0, $hAVI2, 1 + 2) _GUICtrlAVI_Play($hAVI2) GUISetState(@SW_SHOW) Local $GuiMsg Do $GuiMsg = GUIGetMsg() Until $GuiMsg = $GUI_EVENT_CLOSE _WinAPI_DestroyIcon($hIcon) Return EndFunc ;==>_example1 Func _example2() Local $WindowMain = GUICreate("Example", 351, 176, -1, -1) GUISetBkColor(0xDDDDDD, $WindowMain) Local $Statusbar = _GUICtrlStatusBar_Create($WindowMain) DllCall("UxTheme.dll", "int", "SetWindowTheme", "hwnd", $Statusbar, "wstr", 0, "wstr", 0) Local $Statusbar_PartsWidth[2] = [324, -1] _GUICtrlStatusBar_SetParts($Statusbar, $Statusbar_PartsWidth) _GUICtrlStatusBar_SetText($Statusbar, "", 0) _GUICtrlStatusBar_SetText($Statusbar, "", 1) _GUICtrlStatusBar_SetMinHeight($Statusbar, 20) Local $hIcon = __GUICtrlStatusBar_SetIcon($Statusbar, 1, 0, 'ico.ico') ;the original udf destroys the icon handle Local $Icon = GUICtrlCreateIcon('ico.ico', -1, 300, 130, 16, 16) ;Icon on GUI - place before GUISetState Local $AVI = GUICtrlCreateAvi('avi.avi', 0, 250, 130, 16, 16) GUICtrlSetState($AVI, 1) Local $hAVI2 = _GUICtrlAVI_Create($WindowMain, 'avi.avi', -1, 154, 4, 16, 16) _GUICtrlStatusBar_EmbedControl($Statusbar, 0, $hAVI2, 1 + 2) _GUICtrlAVI_Play($hAVI2) GUISetState(@SW_SHOW) Local $GuiMsg Do $GuiMsg = GUIGetMsg() Until $GuiMsg = $GUI_EVENT_CLOSE _WinAPI_DestroyIcon($hIcon) Return EndFunc ;==>_example1 Func _example3() Local $WindowMain = GUICreate("Example", 351, 176, -1, -1) GUISetBkColor(0xDDDDDD, $WindowMain) Local $Statusbar = _GUICtrlStatusBar_Create($WindowMain) DllCall("UxTheme.dll", "int", "SetWindowTheme", "hwnd", $Statusbar, "wstr", 0, "wstr", 0) _GUICtrlStatusBar_SetBkColor($Statusbar, 0xDDDDDD) Local $Statusbar_PartsWidth[2] = [324, -1] _GUICtrlStatusBar_SetParts($Statusbar, $Statusbar_PartsWidth) _GUICtrlStatusBar_SetText($Statusbar, "", 0) _GUICtrlStatusBar_SetText($Statusbar, "", 1) _GUICtrlStatusBar_SetMinHeight($Statusbar, 20) Local $hIcon = __GUICtrlStatusBar_SetIcon($Statusbar, 1, 0, 'ico.ico') ;the original udf destroys the icon handle Local $Icon = GUICtrlCreateIcon('ico.ico', -1, 300, 130, 16, 16) ;Icon on GUI - place before GUISetState Local $AVI = GUICtrlCreateAvi('avi.avi', 0, 250, 130, 16, 16) GUICtrlSetState($AVI, 1) Local $AVI2 = GUICtrlCreateAvi('avi.avi', 0, 154, 4, 16, 16) Local $hAVI2 = GUICtrlGetHandle(-1) GUICtrlSetState($AVI2, 1) _GUICtrlStatusBar_EmbedControl($Statusbar, 0, $hAVI2, 1 + 2) GUISetState(@SW_SHOW) Local $GuiMsg Do $GuiMsg = GUIGetMsg() Until $GuiMsg = $GUI_EVENT_CLOSE _WinAPI_DestroyIcon($hIcon) Return EndFunc ;==>_example2 Func __GUICtrlStatusBar_SetIcon($hWnd, $iPart, $iIcon = 0, $sIconFile = "") Local $tIcon = DllStructCreate("handle") Local $vResult = DllCall("shell32.dll", "uint", "ExtractIconExW", "wstr", $sIconFile, "int", $iIcon, "ptr", 0, "struct*", $tIcon, "uint", 1) If @error Then Return SetError(@error, @extended, False) $vResult = $vResult[0] If $vResult > 0 Then $vResult = _SendMessage($hWnd, $SB_SETICON, $iPart, DllStructGetData($tIcon, 1), 0, "wparam", "handle") Return DllStructGetData($tIcon, 1) EndFunc ;==>__GUICtrlStatusBar_SetIcon
    1 point
×
×
  • Create New...