Detect OS And Take Advantage

Do you need something made? then ask in here.
Forum rules
Please LOCK your topics once you have found the solution to your question so we know you no longer require help with your query.
14 posts Page 1 of 2
Contributors
User avatar
frozerlaxegon
Top Poster
Top Poster
Posts: 84
Joined: Thu May 13, 2010 4:38 pm

Detect OS And Take Advantage
frozerlaxegon
Introducing to my problem :
Hi, I know the title is strange but whatever, ok, here's my problem.
I'm trying to take advantage of the Windows Vista / 7 Aero, which I already had.
But, I trying to make my program compatible with Xp, which doesn't have Aero as you guys know.
Also, users can disable the Aero just like changing the theme in Windows 7(Basic Style, Aero Style)
And, Windows 7 Basic doesn't have Aero.

Asking for help :
So, I wanted to know how to detect the user's OS and determine which part should it take advantage of, here's a list of things I would like to do if the code really EXISTS :
Windows Xp : No special effects, at the same time, program won't crash or any errors.
Windows Vista : Aero on entire form and selected parts, no jumplists, buttons, cover art, at the same time, no errors or crash.
Windows 7 Starter / Basic : None
Windows 7 Home Premium / Professional / Ultimate : Aero on entire form, jump lists, buttons on taskbar(like Windows Media Player), album cover art as preview on taskbar.

Note, I've already got the codes for the above list of things I want, but I still need the code for determining the OS and take advantage.

This Has Been Done Before On programs such as Paint.NET(Written in C#), and it won't crash or have any errors while on xp and take advantage of Windows Vista / 7's Aero, Jumplists, etc.)

So, Show Me How!
You've been RICKROLL'D
User avatar
Codex
Coding God
Coding God
Posts: 2028
Joined: Wed Mar 31, 2010 5:50 pm

Re: Detect OS And Take Advantage
Codex
hello frozerlaxegon

If you look at this site http://www.codeproject.com/KB/dotnet/Wi ... sg=3468702 there is a title called "Compatibility with Different Versions of windows", below it they tell you how to check for which version is running.

hope this helped

codexvid
We shall let the revolution begin.. the revolution for freedom, freedom against censorship. We shall fight in the fields and in the streets, we shall fight in the hills; we shall never surrender
User avatar
frozerlaxegon
Top Poster
Top Poster
Posts: 84
Joined: Thu May 13, 2010 4:38 pm

Sorry, but that's not exactly what I wanted, the code did a great job on how to detect but the functions only works on Windows 7, I wanted to take advantage of Aero is vista / 7 too, there's no function on how to take advantage of aero. thread is still open, case not closed.
You've been RICKROLL'D
User avatar
Codex
Coding God
Coding God
Posts: 2028
Joined: Wed Mar 31, 2010 5:50 pm

Re: Detect OS And Take Advantage
Codex
Hello

You can use this code:

Code: Select all
Public Class Form1

    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        TextBox1.Text = My.Computer.Info.OSFullName

    End Sub

    Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
        If TextBox1.Text.Contains("Vista") Then
            If TextBox1.Text.Contains("Premium") Then
                MsgBox("You are running Vista Home Premium")
                Timer1.Stop()
                'display aero
            ElseIf TextBox1.Text.Contains("Basic") Then
                MsgBox("You are running Vista Home Basic")
                'do not display aero
                Timer1.Stop()
            ElseIf TextBox1.Text.Contains("Business") Then
                MsgBox("You are running Vista Business")
                'display aero
                Timer1.Stop()
            ElseIf TextBox1.Text.Contains("Ultimate") Then
                MsgBox("You are running Vista Ultimate")
                'display aero
                Timer1.Stop()
            End If
        ElseIf TextBox1.Text.Contains("7") Then
            If TextBox1.Text.Contains("Premium") Then
                MsgBox("You are running Vista home Premium")
                'display aero
                Timer1.Stop()
            ElseIf TextBox1.Text.Contains("Enterprise") Then
                MsgBox("You are running Vista Home Basic")
                'display aero
                Timer1.Stop()
            ElseIf TextBox1.Text.Contains("Starter") Then
                MsgBox("You are running Windows 7 Starter")
                'do not display aero
                Timer1.Stop()
            ElseIf TextBox1.Text.Contains("Professional") Then
                MsgBox("You are running Vista Business")
                'display aero
                Timer1.Stop()
            ElseIf TextBox1.Text.Contains("Ultimate") Then
                MsgBox("You are running Vista Ultimate")
                'display aero
                Timer1.Stop()
            End If
        ElseIf TextBox1.Text.Contains("XP") Then
            'Do not display aero or jumplist
            Timer1.Stop()
        End If
    End Sub
End Class
But don't use a MessageBox as that will make it display many MessageBoxes.
We shall let the revolution begin.. the revolution for freedom, freedom against censorship. We shall fight in the fields and in the streets, we shall fight in the hills; we shall never surrender
Lewis
Coding God
Coding God
Posts: 1564
Joined: Sun Dec 20, 2009 2:12 pm

Re: Detect OS And Take Advantage
Lewis
wow, That code above seems simple, i havent used it but it looks very simple
Image
User avatar
mandai
Coding God
Coding God
Posts: 2585
Joined: Mon Apr 26, 2010 6:51 pm

Re: Detect OS And Take Advantage
mandai
Why have a timer to check the same text at each interval? Why not use the textchanged event?
User avatar
Codex
Coding God
Coding God
Posts: 2028
Joined: Wed Mar 31, 2010 5:50 pm

Re: Detect OS And Take Advantage
Codex
Hello mandai

i didn't say you have to use a timer, but i just used that in my code to test it, you are welcome to change anything.

codexvid
We shall let the revolution begin.. the revolution for freedom, freedom against censorship. We shall fight in the fields and in the streets, we shall fight in the hills; we shall never surrender
Lewis
Coding God
Coding God
Posts: 1564
Joined: Sun Dec 20, 2009 2:12 pm

Re: Detect OS And Take Advantage
Lewis
Works fine, Just that u have put the windows 8 stuff as vista, but that can be easily changed
Image
User avatar
Codex
Coding God
Coding God
Posts: 2028
Joined: Wed Mar 31, 2010 5:50 pm

Re: Detect OS And Take Advantage
Codex
Lewis-Froom wrote:
Works fine, Just that u have put the windows 8 stuff as vista, but that can be easily changed
what windows 8 ?
We shall let the revolution begin.. the revolution for freedom, freedom against censorship. We shall fight in the fields and in the streets, we shall fight in the hills; we shall never surrender
User avatar
zachman61
VIP - Donator
VIP - Donator
Posts: 1892
Joined: Wed Dec 16, 2009 9:56 pm

Re: Detect OS And Take Advantage
zachman61
typo most likely
Nailing my feet to the floor is easier than using my own muscles to balance, but you don't see me doing that :)
14 posts Page 1 of 2
Return to “Tutorial Requests”