Results 1 to 1 of 1

Thread: Windows 8.1 Aero Question

  1. #1

    Thread Starter
    Hyperactive Member stepdragon's Avatar
    Join Date
    Aug 2011
    Location
    Cincinnati
    Posts
    288

    Windows 8.1 Aero Question

    So I was doing some research into API calls, and discovered the Microsoft Windows API Index. Just browsing around looking for something (not dangerous) to play around with and learn from, I came across DwmExtendFrameIntoClientArea. Now this caught my interest for a couple of reasons.

    1. I had played around with this a bit in vista/7 for the glass effect, but I didn't really know what I was doing,
    2. I KNEW there would be a few tutorials out there. and finally,
    3. I was curious how it looked in windows 8.

    Looking around I came across this tutorial on beta archive, threw it onto a black form and VOILA:

    Name:  AeroBorder1.jpg
Views: 317
Size:  13.2 KB

    The question I have is, how can I remove the one pixel wide light border around the client area. It seems to me that it shouldn't be there due to the fact that if you resize this form at all this happens:

    Name:  AeroBorder2.jpg
Views: 234
Size:  12.0 KB
    Note: My wallpapers change on a timer, color change is not relevant.

    Notice that the light border is missing on the right side of the window. I had resized the right half of the window down and back up. I attempted invalidating the form, but it seemed to have no effect.

    Any recommendations?

    Also, if anyone has any links to useful API calls to learn from, that would be great. This one is cool, but it doesn't let me test anything functional. Right now I'm interested in finding out what sort of functions become available to me through API interfaces, that may not be available through native VB, and learning how to work them into VB.Net projects. Even if I can't find any need or use for them in a current project, it will broaden my programming skill set.

    Thanks!

    Majority of code used:

    vb.net Code:
    1. Imports System.Drawing.Printing
    2.  
    3. Public Class Form1
    4.  
    5.     Private Declare Auto Function DwmExtendFrameIntoClientArea Lib "dwmapi.dll" (ByVal hWnd As IntPtr, ByRef pMarInset As MARGINS) As Integer
    6.     Private Declare Auto Function DwmIsCompositionEnabled Lib "dwmapi.dll" (ByRef en As Integer) As Integer
    7.  
    8.     Structure MARGINS
    9.         Public LeftWidth As Integer
    10.         Public RightWidth As Integer
    11.         Public TopHeight As Integer
    12.         Public BottomHeight As Integer
    13.     End Structure
    14.  
    15.     Dim int As Integer = 0
    16.  
    17.     'Replace "50" by the size of the panels from the top, bottom, left and right
    18.     Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
    19.         Dim dwmEnabled As Integer
    20.         DwmIsCompositionEnabled(dwmEnabled)
    21.         Dim margins As MARGINS = New MARGINS
    22.         margins.LeftWidth = 50
    23.         margins.RightWidth = 50
    24.         margins.TopHeight = 50
    25.         margins.BottomHeight = 50
    26.         Dim hwnd As IntPtr = Me.Handle
    27.         Dim result As Integer = DwmExtendFrameIntoClientArea(hwnd, margins)
    28.  
    29.     End Sub
    30.  
    31. End Class
    Last edited by stepdragon; Dec 10th, 2014 at 08:18 PM. Reason: Posted the link, but no code. Fix'd

    If you're wrong, you'll learn. If I'm wrong, I'll learn. Try something new and go from there. That's how we improve.

    CodeBank: VB.Net - Simple Proper Image Scaling in Correct Aspect Ratio - Star Rating Control
    Useful Links: HOW TO USE CODE TAGS

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