Code:
DECLARE FUNCTION SetWindowTheme(BYVAL hWnd AS DWORD, pszSubAppName AS ASCIIZ, pszSubIdList AS ASCIIZ) AS LONG '------------------------------------------------------------------------------ 'Purpose: by calling SetWindowTheme with an empty string your control ' (button/checkbox/combo etc) will not be painted with the XP Theme. ' 'Example: LOCAL hButton AS DWORD ' hButton = GetDlgItem( CBHNDL, %IDOK ) ' lRes = DisableXPThemeControl ( hbutton ) ' InvalidateRect hButton,BYVAL %NULL,%TRUE '------------------------------------------------------------------------------ FUNCTION DisableXPThemeControl(BYVAL hControl AS DWORD) AS LONG LOCAL hLib AS DWORD, pProc AS DWORD, lRes AS LONG hLib = LoadLibrary("UxTheme.dll") IF hLib THEN pProc = GetProcAddress(hLib, "SetWindowTheme") IF pProc THEN CALL DWORD pProc USING SetWindowTheme(hControl, " ", " ") TO lRes FUNCTION = lRes END IF FreeLibrary hLib END IF END FUNCTION
Leave a comment: