CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 8 of 8

Thread: Vista Aero

  1. #1
    Join Date
    Sep 2005
    Posts
    233

    Vista Aero

    Hello. How can I enable the cool vista aero effects within my vb.net application? I wish to make portions of the form, or prehaps even the whole form, have the transparent glass effect. Any thoughts?
    Seed Gaming
    www.seedgaming.com

  2. #2
    Join Date
    Jun 2004
    Location
    Kashmir, India
    Posts
    6,808

    Re: Vista Aero

    Nice signature there.
    Which version of .NET are you using? Have you heard about Windows Presentation foundation? Or even simpler, have you tried setting the Opacity property of the form?

  3. #3
    Join Date
    Jan 2006
    Location
    Fox Lake, IL
    Posts
    15,007

    Re: Vista Aero

    Think you misspelled the link, otherwise, you forgot this:

    Great sfotware comes from great thinkers
    David

    CodeGuru Article: Bound Controls are Evil-VB6
    2013 Samples: MS CODE Samples

    CodeGuru Reviewer
    2006 Dell CSP
    2006, 2007 & 2008 MVP Visual Basic
    If your question has been answered satisfactorily, and it has been helpful, then, please, Rate this Post!

  4. #4
    Join Date
    Sep 2005
    Posts
    233

    Re: Vista Aero

    Haha thanks guys. I am currently using VB.NET 2005. Adjusting the opacity just changes the visibility of the form. I am looking to use the windows API if it is available to create the glass look for portions of my form.

    Another unreleated question, do any of you know how to make vista go to sleep with a function withing VB.NET? I was looking and could not find anything. Thanks in advance.
    Seed Gaming
    www.seedgaming.com

  5. #5
    Join Date
    Jul 2001
    Location
    Sunny South Africa
    Posts
    11,283

    Re: Vista Aero

    Good to see you again TCanuck!

    To get the Aero Glass effect, I think you can try the DwmExtendFrameIntoClientArea API. I stand corrected though, but test this application on your Vista, as only Vista supports the Desktop Window Manager DLLs

    I hope it helps
    Last edited by HanneSThEGreaT; December 19th, 2008 at 03:21 AM.

  6. #6
    Join Date
    Jun 2004
    Location
    Kashmir, India
    Posts
    6,808

    Re: Vista Aero

    The above post by Hannes is basically based on WPF. Look at this link on MSDN.
    Added the link..
    http://blogs.msdn.com/tims/archive/2...18/578637.aspx
    Last edited by Shuja Ali; March 10th, 2008 at 01:45 PM.

  7. #7
    Join Date
    Jun 2004
    Location
    NH
    Posts
    678

    Re: Vista Aero

    This is an older thread, but I found it with a direct google search.
    Since, there isn't a complete answer to this question in the forum, I figured this may help someone else searching for a quick answer.
    Although, Hannes was right ofcourse.

    Code:
        Private Declare Function apiDwmExtendFrameIntoClientArea Lib "dwmapi" Alias "DwmExtendFrameIntoClientArea" (ByVal hWnd As Int32, ByRef pMarinset As MARGINS) As Int32
        Private Declare Function apiDwmIsCompositionEnabled Lib "dwmapi" Alias "DwmIsCompositionEnabled" (ByRef enabledptr As Boolean) As Boolean
        Public Structure MARGINS
            Public cxLeftWidth, cxRightWidth, cyTopHeight, cyBottomHeight As Int32
        End Structure
    
        Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
         
            If IsAeroEnabled() = True Then
                Me.BackColor = Color.Black
                GlossWindow(Me.Handle.ToInt32, -1, 0, 0, 0)
            End If
    
        End Sub
    
        Public Function IsAeroEnabled() As Boolean
            apiDwmIsCompositionEnabled(IsAeroEnabled)
        End Function
    
        Public Sub GlossWindow(ByVal hWnd As Int32, ByVal leftMargin As Int32, ByVal rightMargin As Int32, ByVal topMargin As Int32, ByVal bottomMargin As Int32)
            Dim margins As New MARGINS
            margins.cxLeftWidth = leftMargin
            margins.cxRightWidth = rightMargin
            margins.cyTopHeight = topMargin
            margins.cyBottomHeight = bottomMargin
            apiDwmExtendFrameIntoClientArea(hWnd, margins)
        End Sub
    Last edited by TT(n); October 7th, 2009 at 10:31 AM.

  8. #8
    Join Date
    Nov 2004
    Location
    LA. California Raiders #1 AKA: Gangsta Yoda™
    Posts
    616

    Re: Vista Aero

    Remember that the Aero theming is not available in Vista Home Basic or Windows 7 Starter editions
    VB/Office Guru™ (AKA: Gangsta Yoda™)
    VB Forums - Super Moderator 2001-Present

    Microsoft MVP 2006-2011

    Please use [code]your code goes in here[/code] tags when posting code.

    Senior Software Engineer MCP, BSEE, CET
    VS 2012 Premium, VS 6.0 Enterprise SP6, VSTO, Office Ultimate 2010, Windows 7 Ultimate
    Star Wars Gangsta Rap SE Reputations & Rating Posts Office Primary Interop AssembliesAdvanced VB/Office Guru™ Word SpellChecker™.NETAdvanced VB/Office Guru™ Word SpellChecker™ VB6Outlook Global Address ListVB6/Crystal Report Ex.VB6/CR Print Setup Dialog Ex.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured