Sparkie,
your last change doesn't work either because UXTheme.DLL is searched for even if the statements after the If are not executed. But you were the first one who taught us how to disable the WinXP style of a single gadget in a Win9x/NT compatible way:
http://www.purebasic.fr/english/viewtop ... 16&start=2
I tried to integrate that code snippet into your above example:
Code: Select all
#SB_SETBKCOLOR = #CCM_SETBKCOLOR
If OpenWindow(0, 0, 0, 355, 180, "Statusbar Color", #PB_Window_SystemMenu | #PB_Window_ScreenCentered)
SetWindowColor(0, RGB(100, 100, 255))
hStatus = CreateStatusBar(0, WindowID(0))
SendMessage_(hStatus, #SB_SETBKCOLOR, 0, GetWindowColor(0))
;...Any XP theme will need to be removed from StatusBar
If OSVersion() >= #PB_OS_Windows_XP
; --- Win9x/WinNT compatible way
; (doesn't break with error message if UXTheme.DLL is missing)
LibHandle = OpenLibrary(#PB_Any, "UXTheme.DLL")
If LibHandle
If CallFunction(LibHandle, "GetWindowTheme", hStatus) <> 0
CallFunction(LibHandle, "SetWindowTheme", hStatus, @null.w, @null.w)
EndIf
CloseLibrary(LibHandle)
EndIf
EndIf
Repeat : Until WaitWindowEvent() = #PB_Event_CloseWindow
EndIf
Thank you very much for your very useful and helpful contributions in this forum. I have lots of code snippets from you (and of course from others like srod, netmaestro, Trond, ...). I can never thank you enough for that. I have archived the most useful code snippets since 2003 (some sort of private code archive much like purearea.net) and they have already saved me enourmous amounts of time in my daily programming life...
