I only managed to do it the hard way, to draw with _WinAPI_DrawThemeBackground
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#include <WinAPITheme.au3>
#include <WinAPIGdi.au3>
#include <WinAPISysWin.au3>
Local $GUI = GUICreate('', 200, 100)
Local $but = GUICtrlCreatePic('', 50, 50, 17, 16)
_GUICtrlSetTheme(-1, 'Pause', 1, 1, 17, 16)
GUISetState()
For $i = 1 To 8
_GUICtrlSetTheme($but, 'Pause', 1, $i, 17, 16)
Sleep(1000)
Next
;Do
;Until GUIGetMsg() = $GUI_EVENT_CLOSE
Func _GUICtrlSetTheme($CTRL, $Class, $Part, $Stat, $width, $height)
Local $hCTRL = GUICtrlGetHandle($CTRL)
Local $hDev = _WinAPI_GetDC($hCTRL)
Local $hDC = _WinAPI_CreateCompatibleDC($hDev)
Local $hSource = _WinAPI_CreateCompatibleBitmapEx($hDev, $width, $height, _WinAPI_SwitchColor(_WinAPI_GetSysColor($COLOR_3DFACE)))
Local $hSv = _WinAPI_SelectObject($hDC, $hSource)
Local $tRECT = _WinAPI_CreateRectEx(0, 0, $width, $height)
Local $hTheme = _WinAPI_OpenThemeData(0, $Class)
_WinAPI_DrawThemeBackground($hTheme, $Part, $Stat, $hDC, $tRECT)
_WinAPI_CloseThemeData($hTheme)
Local $hBitmap = _WinAPI_CreateCompatibleBitmap($hDev, $width, $height)
_WinAPI_SelectObject($hDC, $hBitmap)
_WinAPI_DrawBitmap($hDC, 0, 0, $hSource, $MERGECOPY)
_WinAPI_ReleaseDC($hCTRL, $hDev)
_WinAPI_DeleteObject($hSource)
_WinAPI_DeleteDC($hDC)
_WinAPI_DeleteObject(_SendMessage($hCTRL, $STM_SETIMAGE, 0, $hBitmap))
Local $hWnd = _WinAPI_GetAncestor($hCTRL, $GA_ROOT)
Local $Pos = ControlGetPos($hWnd, '', $hCTRL)
If @error Then Return
_WinAPI_InvalidateRect($hWnd, _WinAPI_CreateRectEx($pos[0], $pos[1], $width, $height), True)
EndFunc