🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.cppbuilder.nativeapi
Article #5137

Re: Theming

#5137
From: JD
Date: Sun, 25 Sep 2005 08:10
33 lines
2042 bytes
"nicolasr" <nicolasrNOSPAMATSIGNgmx.net> wrote:
>
> [...] So, how could I tell whether the target application my
> component (DLL) is running in is actually themed?

I don't know that you can because a manifest does not have to
exist to be able to do theme drawing. The manifest is only
needed for windows to automatically apply themeing to certain
controls that it supports.

However, one can determine if windows has found a manifest for
the application by checking the major version of ComCtl32. If
a manifest is in use, the major version number will be 6 (or
greater in the future I presume):

    WORD MajorVersion = 0;
    HINSTANCE hComCtl32 = ::GetModuleHandle( "ComCtl32.dll" );
    if( hComCtl32 )
      {
          DLLGETVERSIONPROC GetDllVersion = (DLLGETVERSIONPROC) ::GetProcAddress(hComCtl32, "DllGetVersion");
          if( GetDllVersion )
            {
                DLLVERSIONINFO dvi = { sizeof(DLLVERSIONINFO), 0 };
                if( SUCCEEDED(GetDllVersion(&dvi)) ) MajorVersion = dvi.dwMajorVersion;
            }
      }
    if( MajorVersion > 5 )
      {
          // manifest is applied
      }

~ JD
Technical Details
Message-ID: <43365b8b$1@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!g2news1.google.com!news3.google.com!news.glorb.com!news-out1.kabelfoon.nl!newsfeed.kabelfoon.nl!bandi.nntp.kabelfoon.nl!194.25.134.62.MISMATCH!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail
References: <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: "JD" <nospam@nospam.com>
Sender: "JD" <nospam@nospam.com>
Reply-To: "JD" <nospam@nospam.com>
Subject: Re: Theming
Newsgroups: borland.public.cppbuilder.nativeapi
X-User-Info: 152.163.100.131     
X-Forwarded-For: 172.159.71.48
References:  <4335c6d1@newsgroups.borland.com>
NNTP-Posting-Host: 207.105.83.66
Message-ID: <43365b8b$1@newsgroups.borland.com>
Date: 25 Sep 2005 01:10:51 -0700
X-Trace: newsgroups.borland.com 1127635851 207.105.83.66 (25 Sep 2005 01:10:51 -0700)
Lines: 34
Path: arc1-ca.pugleaf.net!g2news1.google.com!news3.google.com!news.glorb.com!news-out1.kabelfoon.nl!newsfeed.kabelfoon.nl!bandi.nntp.kabelfoon.nl!194.25.134.62.MISMATCH!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail