I think that the explanation lies somewhere under this statement from MSDN :
In case of an inquiry, the parent also needs to know the given DC of the control, which makes sense. But the window itself doesn't need its own DC to get its bk color.
#include <WinAPI.au3>
#include <WindowsConstants.au3>
Global $hGui = GUICreate("Demo for GUICtrlGetBKColor", 578, 323)
GUISetBkColor (0xFFFF00)
Global $idBtn = GUICtrlCreateButton("Test", 64, 64, 89, 33)
GUICtrlSetBkColor(-1, 0x00FFFF)
GUISetState ()
ConsoleWrite ("control = " & Hex(_GUICtrlGetBkColor($idBtn)) & @CRLF)
Local $hGuiDC = _WinAPI_GetDC($hGUI)
Local $iGetColor = _WinAPI_GetBkColor($hGuiDC)
_WinAPI_ReleaseDC($hGUI, $hGuiDC)
ConsoleWrite ("GUI = " & Hex($iGetColor) & @CRLF)
Sleep (1000)
Func _GUICtrlGetBkColor($hWnd)
If Not IsHWnd($hWnd) Then $hWnd = GUICtrlGetHandle($hWnd)
Local $hParent = _WinAPI_GetParent($hWnd)
Local $hDC = _WinAPI_GetDC($hWnd)
_SendMessage($hParent, $WM_CTLCOLORSTATIC, $hDC, $hWnd)
Local $RGB = _WinAPI_GetBkColor($hDC)
_WinAPI_ReleaseDC($hWnd, $hDC)
Return $RGB
EndFunc ;==>_GUICtrlGetBkColor