CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 5 of 5
  1. #1
    Join Date
    Jun 2004
    Location
    NH
    Posts
    678

    DWM Flip3d Policy TopMost

    I just read a recent article here at the code guru about the flip-3d feature available on Vista and Windows 7.
    It allows, you to place an application above, or below the windows being flipped.

    Here is a VB example of that code really neat code.
    Code:
    Const DWMWA_FLIP3D_POLICY As Int32 = 8
    Const DWMWA_EXCLUDE_NONE As Int32 = 0
    Const DWMWA_EXCLUDE_BELOW As Int32 = 1
    Const DWMWA_EXCLUDE_ABOVE As Int32 = 2
    Private Declare Function apiDwmSetWindowAttribute Lib "DwmApi" Alias "DwmSetWindowAttribute" (ByVal hwnd As Int32, ByVal attr As Int32, ByRef attrValue As Int32, ByVal attrSize As Int32) As Int32
    Private Declare Function apiDwmIsCompositionEnabled Lib "dwmapi" Alias "DwmIsCompositionEnabled" (ByRef enabledptr As Boolean) As Boolean
    
    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
    
        'If Aero enabled
        If IsAeroEnabled() = True Then
    
           'Set above flip-3d windows
           apiDwmSetWindowAttribute(Me.Handle.ToInt32, DWMWA_FLIP3D_POLICY, DWMWA_EXCLUDE_ABOVE, Runtime.InteropServices.Marshal.SizeOf(DWMWA_EXCLUDE_ABOVE))
        End If
    
    End Sub
    
    Public Function IsAeroEnabled() As Boolean
        Dim os As Int32 = CDbl(Environment.OSVersion.VersionString.Substring(21, 3))
        If os <= 5.1 Then Return False
        apiDwmIsCompositionEnabled(IsAeroEnabled)
    End Function
    Last edited by TT(n); October 23rd, 2009 at 03:32 PM.

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

    Re: DWM Flip3d Policy TopMost

    Thanx for sharing!

    Do you think I should add this to the FAQ section.

    While I'm on the topic of FAQs.

    I wish, how I wish that the FAQ section would start growing, and people would help us with it....

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

    Re: DWM Flip3d Policy TopMost

    Hello Hannes,

    Hey that would be a good idea.
    I noticed that sometimes my apps, are excluded from the flip list altogether.
    I'm not sure if there is a bug, but now my app is included and on top.

    We sure could use more FAQ.
    I've got a few kicking around, but I've been lazily busy.

    Thanks

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

    Re: DWM Flip3d Policy TopMost

    Quote Originally Posted by TT(n) View Post
    I noticed that sometimes my apps, are excluded from the flip list altogether.
    I'm not sure if there is a bug, but now my app is included and on top.

    Thanks
    Interesting...

    I'll try to see what I can puzzle out ( not that I'm much help to you )

    BTW, Excellent article! :

    http://www.codeguru.com/vb/gen/vb_sy...le.php/c16501/

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

    Re: DWM Flip3d Policy TopMost

    Oh thanks,

    Perfect example,
    I compiled the on screen keyboard in the article, just before I started
    using the flip3d above constant.
    The keyboard is no where to be seen, in the flip list, above or below it.

    Now that it's visible and above, I can click down the left win key.
    Physically press tab to initiate the flip feature.
    Then scroll with the mouse, left hand free!

    Not that I even use that feature.

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