Results 1 to 7 of 7

Thread: Windows Aero Effect in Form

  1. #1

    Thread Starter
    New Member
    Join Date
    Sep 2021
    Posts
    3

    Windows Aero Effect in Form

    Hi guys, I have a program where I want to get a Form to open with the Windows Aero effect, and I'm having trouble with that when I use BorderStyle = None.

    This is Aero effect in Form child with BorderStyle = Fixed Single
    Name:  2.png
Views: 146
Size:  12.0 KBName:  preview1.gif
Views: 148
Size:  199.7 KB

    In this case BorderStyle = None but Form child lose the Aero effect
    Name:  1.png
Views: 144
Size:  11.2 KBName:  preview2.gif
Views: 145
Size:  115.2 KB

    Is there any way for a Form to retain Aero effect with BorderStyle = None?

  2. #2
    PowerPoster SamOscarBrown's Avatar
    Join Date
    Aug 2012
    Location
    NC, USA
    Posts
    8,022

    Re: Windows Aero Effect in Form

    By Aero effect, I am assuming you see the second form sort of 'floating', yes?
    Well, not sure if it is possible, BUT, IF THE FORM WAS WHITE, you can make it LOOK like it.
    Keep BorderStyle as default (Sizable), set ControlBox to False and Caption to "".
    As the top 'border' is shown (although with a smaller height), you can't see the difference if they are both white (at least on MY Win10 machine). (Leave the BackColor of the form to Orange and then change it to White, and you will see what I mean.)
    Sam I am (as well as Confused at times).

  3. #3
    PowerPoster wqweto's Avatar
    Join Date
    May 2011
    Posts
    3,293

    Re: Windows Aero Effect in Form

    Use manifest for your IDE or test your project compiled to EXE w/ manifest.

    (I would have tested it myself whether this suggestion fixes anything if there was a project attached to your OP.)

    cheers,
    </wqw>

  4. #4
    PowerPoster SamOscarBrown's Avatar
    Join Date
    Aug 2012
    Location
    NC, USA
    Posts
    8,022

    Re: Windows Aero Effect in Form

    You want it to look like this?

    Name:  Capture2.jpg
Views: 103
Size:  7.8 KB
    Sam I am (as well as Confused at times).

  5. #5

    Thread Starter
    New Member
    Join Date
    Sep 2021
    Posts
    3

    Re: Windows Aero Effect in Form

    I was not clear, sorry

    I was not talking about the "floating" effect. My question was about the Fade In effect of Aero when the window was opened. That transition is lost when I set BorderStyle = None. I want to keep the fade-in effect, but with the window without a title bar.
    Last edited by Walter26; Sep 13th, 2021 at 08:36 AM.

  6. #6
    Frenzied Member
    Join Date
    Dec 2014
    Posts
    1,489

    Re: Windows Aero Effect in Form

    this was a long time ago, but I remember that u can use different API to play around with the form, to make it transparent, to remove the controlbox dynamically, etc.
    I would try:
    Declare Function SetLayeredWindowAttributes Lib "user32" (ByVal hwnd As Long, ByVal crKey As Long, ByVal bAlpha As Byte, ByVal dwFlags As Long) As Long
    Declare Function GetWindowLong Lib "user32" Alias "GetWindowLongA" (ByVal hwnd As Long, ByVal nIndex As Long) As Long
    Declare Function SetWindowLong Lib "user32" Alias "SetWindowLongA" (ByVal hwnd As Long, ByVal nIndex As Long, ByVal dwNewLong As Long) As Long
    or
    Declare Function GetWindowLong Lib "user32" Alias "GetWindowLongW" (ByVal hWnd As Long, ByVal nIndex As Long) As Long
    Declare Function SetWindowLong Lib "user32" Alias "SetWindowLongW" (ByVal hWnd As Long, ByVal nIndex As Long, ByVal dwNewLong As Long) As Long

    and look into GWL_STYLE

    theres also a "W" version, if u want that. here some const that can be useful

    Public Const GWL_STYLE = (-16)
    Private Const GWL_EXSTYLE = (-20)
    Private Const LWA_ALPHA = &H2
    Private Const LWA_COLORKEY = &H1
    Private Const WS_CHILD = &H40000000
    Private Const WS_POPUP = &H80000000

    Private Const WS_EX_LAYERED = &H80000
    Private Const WS_CAPTION = &HC00000
    Public Const WS_VISIBLE = &H10000000
    Private Const SWP_NOACTIVATE As Long = &H10
    Private Const SWP_NOSIZE As Long = &H1
    Private Const SWP_NOMOVE As Long = &H2
    Private Const WS_EX_APPWINDOW As Long = &H40000
    Private Const WS_EX_TOOLWINDOW As Long = &H80

    Private Const WS_BORDER = &H800000
    Private Const WS_DLGFRAME = &H400000
    Private Const WS_EX_DLGMODALFRAME = &H1
    Private Const WS_EX_CLIENTEDGE = &H200
    Private Const WS_EX_STATICEDGE = &H20000

    Private Const SWP_FRAMECHANGED = &H20
    Private Const SWP_NOZORDER = &H4
    Private Const SWP_NOOWNERZORDER = &H200

    Private Const GWL_HWNDPARENT = (-8)
    Private Const HWND_TOPMOST = -1
    Private Const HWND_NOTOPMOST = -2

    Private Const AC_SRC_OVER = 0
    Private Const AC_SRC_ALPHA = &H1
    Last edited by baka; Sep 13th, 2021 at 11:54 AM.

  7. #7
    PowerPoster
    Join Date
    Feb 2012
    Location
    West Virginia
    Posts
    13,698

    Re: Windows Aero Effect in Form

    It seems that the question has to do with the windows fade in effect which I do not think has anything to do with Aero as it was part of Windows before Aero came to be.

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