May 10, 2024, 06:33:54 AM

News:

IonicWind Snippit Manager 2.xx Released!  Install it on a memory stick and take it with you!  With or without IWBasic!


XP themes and controls

Started by ckoehn, March 06, 2010, 06:02:43 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

ckoehn

March 06, 2010, 06:02:43 PM Last Edit: March 06, 2010, 06:04:53 PM by ckoehn
How can you detect when someone has enabled(or disabled) XP themes?  If you set a BUTTON to bitmap and they use or change to Windows Classic there is no text on the button.  How is this dealt with?

To just detect if they have XP and a mainfest file is available isn't enough (read doesn't work).

Later,
Clint

sapero

QuoteThe WM_THEMECHANGED message is broadcast to every window following a theme change event. Examples of theme change events are the activation of a theme, the deactivation of a theme, or a transition from one theme to another.
Try it, should be working.

ckoehn

Thanks sapero for your input. I also found a function IsThemeActive in the UxTheme.dll which works.  I check it before I make the buttons.

Later,
Clint

ckoehn

Just wanted to show how I used and made it work for me.  I set a flag (XPman) and then checked that to determine what kind of button I needed to make.  If the change is made while the program is running it may not show correctly.

How do you change a button when a WM_THEMECHANGED message is sent?

Later,
Clint

OSVERSIONINFOEX ver
ver.dwOSVersionInfoSize=LEN(ver)
GetVersionEx(ver)

INT XPman
IF OPENFILE(Fileptr,GETSTARTPATH+"MOT.exe.manifest","R")=0
CLOSEFILE Fileptr
IF ver.dwMajorVersion>=4
'uxtheme is only in WinXP or greater
$USE "uxtheme.lib"
DECLARE IMPORT,IsThemeActive(),INT

IF IsThemeActive()=TRUE 'see if a theme is active
XPman=TRUE
ELSE
XPman=FALSE
ENDIF
ELSE
XPman=FALSE
ENDIF
ELSE
XPman=FALSE
ENDIF