2007 style question

Post Reply
User avatar
Dietmar Jahnel
Posts: 83
Joined: Mon Oct 17, 2005 10:33 am
Location: Austria
Contact:

2007 style question

Post by Dietmar Jahnel »

Is there a way to check if someone uses "classical windows" desighn in XP or Vista ?
IsAppThemed() still returns .T.
In this case menu and messagebar are 2007 style, dialogs look "old" which gives a strange look in that combination.

Regards,
Dietmar
User avatar
Antonio Linares
Site Admin
Posts: 37481
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Contact:

Post by Antonio Linares »

Dietmar,

> IsAppThemed() still returns .T.

IsAppThemed() just checks is the themes manifest file is included in the EXE

We need to find a way to detect if the user has the classic look
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Dietmar Jahnel
Posts: 83
Joined: Mon Oct 17, 2005 10:33 am
Location: Austria
Contact:

Post by Dietmar Jahnel »

We need to find a way to detect if the user has the classic look

That's what I was looking for :) !

Hope you can find a way!

Regards,
Dietmar
User avatar
Antonio Linares
Site Admin
Posts: 37481
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Contact:

Post by Antonio Linares »

Dietmar,

Google is our friend :-)

>
One possibility would be to check the value of ThemeActive in the registry under: HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\ThemeManager

I believe a value of 0 means that no themes are in use (Windows Classic Style) and a value of 1 means that themes are in use (Windows XP style).
>
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
Posts: 37481
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Contact:

Post by Antonio Linares »

Dietmar,

More results :-)
>
Call OpenThemeData. This will return a handle to the theme, which, if NULL indicates that the visual style manager is disabled or there is no information for that control, which means that you should continue to draw using your default routines.
>
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
James Bott
Posts: 4654
Joined: Fri Nov 18, 2005 4:52 pm
Location: San Diego, California, USA
Contact:

Post by James Bott »

Antonio,

>Call OpenThemeData

Is that an existing FW or Harbour function, or is it an API?

James
User avatar
Dietmar Jahnel
Posts: 83
Joined: Mon Oct 17, 2005 10:33 am
Location: Austria
Contact:

Post by Dietmar Jahnel »

>Call OpenThemeData

Antonio,
could you please post the code to do that.
We are about to release a new version of our software...

Thanks,
Dietmar
User avatar
Enrico Maria Giordano
Posts: 7355
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia
Contact:

Post by Enrico Maria Giordano »

James Bott wrote:Is that an existing FW or Harbour function, or is it an API?
It's an API:

Code: Select all

HTHEME OpenThemeData( HWND hwnd, LPCWSTR pszClassList );
EMG
User avatar
Antonio Linares
Site Admin
Posts: 37481
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Contact:

Post by Antonio Linares »

Dietmar,

Here you have a working sample:

Code: Select all

function Main()

   MsgInfo( IsThemeActive() )

return nil

#pragma BEGINDUMP

#include <windows.h>
#include <hbapi.h>

typedef BOOL ( * PFISTHEMEACTIVE ) ( void );

HB_FUNC( ISTHEMEACTIVE )
{
   HINSTANCE hDLL = LoadLibrary( "UxTheme.dll" );
   PFISTHEMEACTIVE IsThemeActive;
   
   if( hDLL == NULL )
   {
      hb_retl( FALSE );
      return;
   }
   else
      IsThemeActive = ( void * ) GetProcAddress( hDLL, "IsThemeActive" );
      
   if( IsThemeActive )
      hb_retl( IsThemeActive() );
   else
      hb_retl( FALSE );   
   
   FreeLibrary( hDLL );
}   
   
#pragma ENDDUMP
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Dietmar Jahnel
Posts: 83
Joined: Mon Oct 17, 2005 10:33 am
Location: Austria
Contact:

Post by Dietmar Jahnel »

nice - that's it!

But I noticed that there seems to be a little painting problem with bars without themes. Right of the bitmaps there is a darker grey...

I send the image to your per mail

Regards,
Dietmar
User avatar
Antonio Linares
Site Admin
Posts: 37481
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Contact:

Post by Antonio Linares »

Dietmar,

If you don't use the 2007 clause then you have to use the 3D clause to get the colors and painting that you want :-)
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Dietmar Jahnel
Posts: 83
Joined: Mon Oct 17, 2005 10:33 am
Location: Austria
Contact:

Post by Dietmar Jahnel »

Many Thanks, now the look is consistent with and without themes! :D
Dietmar
Post Reply