.data
; ####### DLLS
szuxtheme db "uxtheme", 0
; ####### Procs
szThemeProc db "EnableThemeDialogTexture", 0
In your startup code somewhere:
push offset szuxtheme ; see if we can theme our app
call LoadLibrary ;
test eax, eax ; is UXTheme.dll on system?
jz CantTheme ; Nope
mov hThemeLib, eax ; yes, save handle to library
push offset szThemeProc ; get proc address of EnableThemeDialogTexture
push eax ;
call GetProcAddress ;
mov hThemeProc, eax ;
jmp ContinueStartup ;
CantTheme:
mov hThemeLib, edi ; 0
In your WM_INITDIALOG handler:
mov ecx, hThemeLib
test ecx, ecx
jz NoTheme
push 6
push hWin
call hThemeProc
NoTheme:
And in your close code:
mov eax, hThemeLib
test eax, eax
jz @F
push eax
call FreeLibrary
@@: