Jump to content

Real Vista Aero Glass - Four functions


James
 Share

Recommended Posts

I have just found a bug when trying to create two areas which you don't want affecting:

#include <GUIConstants.au3>
#include <Vista.au3>

Global $Area1[4] = [0, 0, 0, 76]
Global $Area2[4] = [0, 0, 76, 0]

$GUI = GUICreate("GUI", 408, 181)

; Top
GUICtrlCreateLabel("", 0, 0, 408, 76)
GUICtrlSetBkColor(-1, 0x000000)
_Vista_ApplyGlassArea($GUI, $Area2, 0xE2E2E2)

; Bottom
GUICtrlCreateLabel("", 0, 105, 408, 76)
GUICtrlSetBkColor(-1, 0x000000)
_Vista_ApplyGlassArea($GUI, $Area1, 0xE2E2E2)

GUISetState(@SW_SHOW)

While 1
    $iMsg = GUIGetMsg()
    Switch $iMsg
        Case $GUI_EVENT_CLOSE
            Exit
    EndSwitch
WEnd

This must either be down to the load which is being drawn, or DWM cannot handle multiple drawings in the way the function is made.

Link to comment
Share on other sites

a verry late question but how do i know the

Global $Area1[4] = [0, 0, 0, 76];

how can i set it good how must i set it.?

i write it down in dutch becouse my english is not verry good

@nederlands:

hoe kan ik de "Global $Area1[4] = [0, 0, 0, 76]" berekenen wat houd het in?

wesdegroot.

Link to comment
Share on other sites

If you want the whole area with blur, but not the controls, you have to use regions and DwmEnableBlurBehindWindow ( http://msdn.microsoft.com/en-us/library/aa969508(VS.85).aspx )

*GERMAN* [note: you are not allowed to remove author / modified info from my UDFs]My UDFs:[_SetImageBinaryToCtrl] [_TaskDialog] [AutoItObject] [Animated GIF (GDI+)] [ClipPut for Image] [FreeImage] [GDI32 UDFs] [GDIPlus Progressbar] [Hotkey-Selector] [Multiline Inputbox] [MySQL without ODBC] [RichEdit UDFs] [SpeechAPI Example] [WinHTTP]UDFs included in AutoIt: FTP_Ex (as FTPEx), _WinAPI_SetLayeredWindowAttributes

Link to comment
Share on other sites

Where did you find a structure called const?

muttley Not Const, bool.

typedef struct _DWM_BLURBEHIND {
    DWORD dwFlags;
    BOOL fEnable;
    HRGN hRgnBlur;
    BOOL fTransitionOnMaximized;
} DWM_BLURBEHIND, *PDWM_BLURBEHIND;

If I am correct the, "HRGN" will need to be a variable to the $Struct yes?

Link to comment
Share on other sites

People working with DllStruct stuff without at least rudimentary C knowledge. Tsk. Tsk.

I suggest you read up on the basics of C parameters and modifiers if you're going to continue this. You clearly misunderstand what the const modifier is for when it appears in a function declaration.

Link to comment
Share on other sites

People working with DllStruct stuff without at least rudimentary C knowledge. Tsk. Tsk.

I suggest you read up on the basics of C parameters and modifiers if you're going to continue this. You clearly misunderstand what the const modifier is for when it appears in a function declaration.

Well I have used C++ partially before, just never needed Constants. I will go back and read it like you said muttley

Edit: Bool: True or False (I know that) but not how to use it in a structure like dword, int, long etc.

Edited by JamesBrooks
Link to comment
Share on other sites

Well I have used C++ partially before, just never needed Constants. I will go back and read it like you said muttley

Edit: Bool: True or False (I know that) but not how to use it in a structure like dword, int, long etc.

bool is the same as int and false=0 and true= non-zero (I think).

Broken link? PM me and I'll send you the file!

Link to comment
Share on other sites

Left, Right, Top and Bottom muttley

So if you wanted the area to be 10px from the left, 10 from the top then you would do:

$Area[4] = [10, 0, 10, 0]

If that's wrong tell me, I am all mixed up at the moment.

tnx here was i looking for!

Link to comment
Share on other sites

I believe I'm correct in that BOOL is a Microsoft specific type that is defined as an 'int'. So, it can have any value. But there are TRUE and FALSE macros which are BOOL types (int's) defined as TRUE = 1 and FALSE = 0.

Link to comment
Share on other sites

Yeah, I guess I was lazy.

Here's an example on using the function on the msdn page above btw:

$hwnd=GUICreate("Sample",300,200)
GUISetState()
GUISetBkColor(0x000000)

Global Const $DWM_BB_ENABLE=0x01
Global Const $DWM_BB_BLURREGION=0x02
Global Const $DWM_BB_TRANSITIONONMAXIMIZED=0x04
$DWM_BLURBEHIND=DllStructCreate("dword dwFlags;int fEnable;int hRgnBlur;int fTransitionOnMaximized;")
DllStructSetData($DWM_BLURBEHIND,"dwFlags",BitOR($DWM_BB_ENABLE,$DWM_BB_BLURREGION))
DllStructSetData($DWM_BLURBEHIND,"fEnable",1)
DllStructSetData($DWM_BLURBEHIND,"hRgnBlur",0)
DllStructSetData($DWM_BLURBEHIND,"fTransitionOnMaximized",1)
DllCall("dwmapi.dll","int","DwmEnableBlurBehindWindow","hwnd",$hwnd,"ptr",DllStructGetPtr($DWM_BLURBEHIND))

Do
    $msg=GUIGetMsg()
Until $msg=-3

Broken link? PM me and I'll send you the file!

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...