FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour 2007 style question
Posts: 83
Joined: Mon Oct 17, 2005 10:33 AM
2007 style question
Posted: Tue Dec 04, 2007 08: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

Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
2007 style question
Posted: 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
Posts: 83
Joined: Mon Oct 17, 2005 10:33 AM
2007 style question
Posted: Tue Dec 04, 2007 01: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

Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
2007 style question
Posted: Tue Dec 04, 2007 03: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
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
2007 style question
Posted: Tue Dec 04, 2007 03: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
Posts: 4840
Joined: Fri Nov 18, 2005 04:52 PM
2007 style question
Posted: Tue Dec 04, 2007 04:22 PM

Antonio,

>Call OpenThemeData

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

James

FWH 18.05/xHarbour 1.2.3/BCC7/Windows 10
Posts: 83
Joined: Mon Oct 17, 2005 10:33 AM
2007 style question
Posted: Tue Dec 04, 2007 04: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

Posts: 9020
Joined: Thu Oct 06, 2005 08:17 PM
2007 style question
Posted: 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:

HTHEME OpenThemeData( HWND hwnd, LPCWSTR pszClassList );


EMG
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
2007 style question
Posted: Tue Dec 04, 2007 11:59 PM
Dietmar,

Here you have a working sample:
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
Posts: 83
Joined: Mon Oct 17, 2005 10:33 AM
2007 style question
Posted: Thu Dec 06, 2007 03: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

Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
2007 style question
Posted: Thu Dec 06, 2007 05: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
Posts: 83
Joined: Mon Oct 17, 2005 10:33 AM
2007 style question
Posted: Thu Dec 06, 2007 06:27 PM

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

Continue the discussion