Re: Determining Win XP vs. Classic styles
- From: "Andy DF" <PrivateType@xxxxxx>
- Date: Sat, 30 Apr 2005 11:15:59 +0200
Back to the original question, this is how I handle it:
check OS version and IFit's XP or above then call uxtheme functions.
This way you don't have to deal with error handling.
Stick this in a module and call then IsXPThemActive property.
HTH,
Andy.
' TYPE
Private Type OSVERSIONINFO
dwOSVersionInfoSize As Long
dwMajorVersion As Long
dwMinorVersion As Long
dwBuildNumber As Long
dwPlatformId As Long
szCSDVersion As String * 128
End Type
' ENUM
Private Enum Enum_OperatingSystem
System_Windows_32 = 0
System_Windows_95 = 1
System_Windows_98 = 2
System_Windows_ME = 3
System_Windows_NT = 4
System_Windows_2K = 5
System_Windows_XP = 6
System_Windows_2003 = 7
End Enum
Private Enum Enum_OperatingPlatform
Platform_Windows_32 = 0
Platform_Windows_95_98_ME = 1
Platform_Windows_NT_2K_XP = 2
End Enum
' API
Private Declare Function GetVersionExA Lib "kernel32" (lpVersionInformation
As OSVERSIONINFO) As Long
Private Declare Function IsThemeActive Lib "uxtheme.dll" () As Long
Private Declare Function IsAppThemed Lib "uxtheme.dll" () As Long
Private Function OperatingSystem() As Enum_OperatingSystem
Dim lpVersionInformation As OSVERSIONINFO
' Retrieve operating system
lpVersionInformation.dwOSVersionInfoSize = Len(lpVersionInformation)
Call GetVersionExA(lpVersionInformation)
If (lpVersionInformation.dwPlatformId = Platform_Windows_32) Then
OperatingSystem = System_Windows_32
ElseIf (lpVersionInformation.dwPlatformId = Platform_Windows_95_98_ME)
And (lpVersionInformation.dwMinorVersion = 0) Then
OperatingSystem = System_Windows_95
ElseIf (lpVersionInformation.dwPlatformId = Platform_Windows_95_98_ME)
And (lpVersionInformation.dwMinorVersion = 10) Then
OperatingSystem = System_Windows_98
ElseIf (lpVersionInformation.dwPlatformId = Platform_Windows_95_98_ME)
And (lpVersionInformation.dwMinorVersion = 90) Then
OperatingSystem = System_Windows_ME
ElseIf (lpVersionInformation.dwPlatformId = Platform_Windows_NT_2K_XP)
And (lpVersionInformation.dwMajorVersion < 5) Then
OperatingSystem = System_Windows_NT
ElseIf (lpVersionInformation.dwPlatformId = Platform_Windows_NT_2K_XP)
And (lpVersionInformation.dwMajorVersion = 5) And
(lpVersionInformation.dwMinorVersion = 0) Then
OperatingSystem = System_Windows_2K
ElseIf (lpVersionInformation.dwPlatformId = Platform_Windows_NT_2K_XP)
And (lpVersionInformation.dwMajorVersion = 5) And
(lpVersionInformation.dwMinorVersion = 1) Then
OperatingSystem = System_Windows_XP
ElseIf (lpVersionInformation.dwPlatformId = Platform_Windows_NT_2K_XP)
And (lpVersionInformation.dwMajorVersion = 5) And
(lpVersionInformation.dwMinorVersion = 2) Then
OperatingSystem = System_Windows_2003
End If
End Function
Public Property Get IsXPThemActive() As Boolean
' Return true if Windows is XP or above AND if visual style
' are in use by OS AND application
If OperatingSystem >= System_Windows_XP Then
IsXPThemActive = CBool(IsThemeActive) And CBool(IsAppThemed)
End If
End Property
"Jack Owens" <jack_s_owens@xxxxxxxxxxx> ha scritto nel messaggio
news:00f501c54aa1$c37015e0$a501280a@xxxxxxxxxx
> How do I make a call to Windows in VB6 to determine
> whether the computer running a VB app. is using Windows XP
> style or Windows Classic style?
.
- References:
- Determining Win XP vs. Classic styles
- From: Jack Owens
- Determining Win XP vs. Classic styles
- Prev by Date: Re: - How to save target as.. in IE6?
- Next by Date: Addressing Windows Directories?
- Previous by thread: Re: Determining Win XP vs. Classic styles
- Next by thread: UNLOCK CURSOR POSITION
- Index(es):
Relevant Pages
|
Loading