Re: Detecting Windows Styles in VB6
- From: "Mike D Sutton" <EDais@xxxxxxxx>
- Date: Fri, 6 May 2005 20:34:15 +0100
> I need to make a windows call to determine whether a
> computer is using Windows XP or Windows Classic Style, if
> such a call exists. If this is not the proper place for
> this request, please give me the name of a better
> newsgroup.
Try this (ported from: http://addressof.com/blog/archive/2004/02/15/400.aspx )
'***
Private Declare Function GetVersionEx Lib "Kernel32.dll" Alias _
"GetVersionExA" (ByRef lpVersionInfo As OSVersionInfo) As Long
Private Declare Function DllGetVersion Lib "ComCtl32.dll" (ByRef PDVI As DLLVersionInfo) As Long
Private Declare Function IsThemeActive Lib "UXTheme.dll" () As Long
Private Declare Function IsAppThemed Lib "UXTheme.dll" () As Long
Private Type OSVersionInfo
dwOSVersionInfoSize As Long
dwMajorVersion As Long
dwMinorVersion As Long
dwBuildNumber As Long
dwPlatformId As Long
szCSDVersion As String * 128 ' Maintenance string for PSS usage
End Type
Private Type DLLVersionInfo
cbSize As Long
dwMajorVersion As Long
dwMinorVersion As Long
dwBuildNumber As Long
dwPlatformId As Long
End Type
Private Const VER_PLATFORM_WIN32_NT As Long = 2
Public Function IsVisualStylesEnabled() As Boolean
Dim os As OSVersionInfo
Dim Version As DLLVersionInfo
os.dwOSVersionInfoSize = Len(os)
Call GetVersionEx(os)
If ((os.dwPlatformId = VER_PLATFORM_WIN32_NT) And ( _
((os.dwMajorVersion = 5) And (os.dwMinorVersion >= 1)) Or (os.dwMajorVersion > 5))) Then
Version.cbSize = Len(Version)
If (DllGetVersion(Version) = 0) Then _
IsVisualStylesEnabled = (Version.dwMajorVersion > 5) And _
CBool(IsThemeActive()) And CBool(IsAppThemed())
End If
End Function
'***
Hope this helps,
Mike
- Microsoft Visual Basic MVP -
E-Mail: EDais@xxxxxxxx
WWW: Http://EDais.mvps.org/
.
- References:
- Detecting Windows Styles in VB6
- From: John Owens
- Detecting Windows Styles in VB6
- Prev by Date: Re: Detecting Windows Styles in VB6
- Next by Date: Re: thanks!
- Previous by thread: Re: Detecting Windows Styles in VB6
- Next by thread: Send To Menu
- Index(es):
Relevant Pages
|