2007 style question

2007 style question

Postby Dietmar Jahnel » Tue Dec 04, 2007 8:52 am

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
Dietmar Jahnel
 
Posts: 83
Joined: Mon Oct 17, 2005 10:33 am
Location: Austria

Postby Antonio Linares » Tue Dec 04, 2007 10:33 am

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
Antonio Linares
Site Admin
 
Posts: 42107
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Postby Dietmar Jahnel » Tue Dec 04, 2007 1:14 pm

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
Dietmar Jahnel
 
Posts: 83
Joined: Mon Oct 17, 2005 10:33 am
Location: Austria

Postby Antonio Linares » Tue Dec 04, 2007 3:14 pm

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: 42107
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Postby Antonio Linares » Tue Dec 04, 2007 3:18 pm

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
Antonio Linares
Site Admin
 
Posts: 42107
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Postby James Bott » Tue Dec 04, 2007 4:22 pm

Antonio,

>Call OpenThemeData

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

James
User avatar
James Bott
 
Posts: 4840
Joined: Fri Nov 18, 2005 4:52 pm
Location: San Diego, California, USA

Postby Dietmar Jahnel » Tue Dec 04, 2007 4:48 pm

>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
Dietmar Jahnel
 
Posts: 83
Joined: Mon Oct 17, 2005 10:33 am
Location: Austria

Postby Enrico Maria Giordano » Tue Dec 04, 2007 10:46 pm

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


It's an API:

Code: Select all  Expand view  RUN
HTHEME OpenThemeData( HWND hwnd, LPCWSTR pszClassList );


EMG
User avatar
Enrico Maria Giordano
 
Posts: 8716
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia

Postby Antonio Linares » Tue Dec 04, 2007 11:59 pm

Dietmar,

Here you have a working sample:
Code: Select all  Expand view  RUN
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
Antonio Linares
Site Admin
 
Posts: 42107
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Postby Dietmar Jahnel » Thu Dec 06, 2007 3:53 pm

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
Dietmar Jahnel
 
Posts: 83
Joined: Mon Oct 17, 2005 10:33 am
Location: Austria

Postby Antonio Linares » Thu Dec 06, 2007 5:26 pm

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
Antonio Linares
Site Admin
 
Posts: 42107
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Postby Dietmar Jahnel » Thu Dec 06, 2007 6:27 pm

Many Thanks, now the look is consistent with and without themes! :D
Dietmar
User avatar
Dietmar Jahnel
 
Posts: 83
Joined: Mon Oct 17, 2005 10:33 am
Location: Austria


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 59 guests