Article View: borland.public.cppbuilder.nativeapi
Article #5152Re: Theming
From: Remy Lebeau (TeamB)
Date: Mon, 26 Sep 2005 17:44
Date: Mon, 26 Sep 2005 17:44
48 lines
2725 bytes
2725 bytes
"nicolasr" <nicolasrNOSPAMATSIGNgmx.net> wrote in message
news:4335c6d1@newsgroups.borland.com...
> IsAppThemed() indicates whether theming is enabled system wide.
That is not correct. According to MSDN:
"Reports whether **the current application's** user interface displays
using visual styles."
> IsThemeActive() tells whether theming is disabled for a
> particular application via the program compatibility dialog.
That is also not correct. There is no dialog involved. Also, like
IsAppThemed(), it applies to the current application, not "a particular
application", suggesting that you can query another application for its
theming status, which you cannot.
> These functions do, however, not tell me whether there is a manifest!
If a manifest were not present, the functions would return FALSE since
theming would not be enabled for the application in the first place.
> Since the manifest could be embedded in the applications resources
> it's not enough to simply check for the existence of a manifest file.
You can check the application's resources directly for the presense of a
manifest resource.
> So, how could I tell whether the target application my
> component (DLL) is running in is actually themed?
Use IsAppThemed() and IsThemeActive(). If they both return TRUE than the
application is actually themed. If either returns FALSE then the
application is not themed. You don't have to do anything with the manifest
at all. Although, if you still want to test for its presense, then you can
do the following:
1) use GetModuleFileName() to retreive the application's filename, append
".manifest" to it, and then check if that file exists.
2) use GetModuleHandle() to retrieve the HMODULE of the application that
loaded the DLL, and then use that HMODULE to access the application's
resources.
Gambit
Technical Details
Message-ID:
<4338331b$1@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!proxad.net!212.101.4.254.MISMATCH!solnet.ch!solnet.ch!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mailReferences:
<4335c6d1@newsgroups.borland.com>Show Full Headers
Complete Article Headers
X-Google-Thread: 10cc67,9f36dbae74e2f48b X-Google-Attributes: gid10cc67,public X-Google-Language: ENGLISH,ASCII-7-bit From: "Remy Lebeau \(TeamB\)" <no.spam@no.spam.com> Newsgroups: borland.public.cppbuilder.nativeapi References: <4335c6d1@newsgroups.borland.com> Subject: Re: Theming Date: Mon, 26 Sep 2005 10:44:05 -0700 Lines: 50 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2800.1409 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1409 NNTP-Posting-Host: 68.69.17.41 Message-ID: <4338331b$1@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1127756571 68.69.17.41 (26 Sep 2005 10:42:51 -0700) Path: arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!proxad.net!212.101.4.254.MISMATCH!solnet.ch!solnet.ch!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail