SYRAU3 Posted March 14, 2011 Share Posted March 14, 2011 (edited) I found this in the forum it's useful: expandcollapse popup#include <GUIConstants.au3> $Struct = DllStructCreate("int cxLeftWidth;int cxRightWidth;int cyTopHeight;int cyBottomHeight;") $sStruct = DllStructCreate("dword;int;ptr;int") Global $MyArea[4] = [50, 50, 50, 50] ; #FUNCTION#;=============================================================================== ; ; Name...........: _Vista_ApplyGlass ; Description ...: Applys glass effect to a window ; Syntax.........: _Vista_ApplyGlass($hWnd, [$bColor) ; Parameters ....: $hWnd - Window handle: ; $bColor - Background color ; Return values .: Success - No return ; Failure - Returns 0 ; Author ........: James Brooks ; Modified.......: ; Remarks .......: Thanks to weaponx! ; Related .......: ; Link ..........; ; Example .......; Yes ; ;;========================================================================================== Func _Vista_ApplyGlass($hWnd, $bColor = 0x000000) If @OSVersion <> "WIN_7" Then MsgBox(16, "_Vista_ApplyGlass", "You are not running Win 7!") Exit Else GUISetBkColor($bColor); Must be here! $Ret = DllCall("dwmapi.dll", "long", "DwmExtendFrameIntoClientArea", "hwnd", $hWnd, "long*", DllStructGetPtr($Struct)) If @error Then Return 0 SetError(1) Else Return $Ret EndIf EndIf EndFunc ;==>_Vista_ApplyGlass ; #FUNCTION#;=============================================================================== ; ; Name...........: _Vista_ApplyGlassArea ; Description ...: Applys glass effect to a window area ; Syntax.........: _Vista_ApplyGlassArea($hWnd, $Area, [$bColor) ; Parameters ....: $hWnd - Window handle: ; $Area - Array containing area points ; $bColor - Background color ; Return values .: Success - No return ; Failure - Returns 0 ; Author ........: James Brooks ; Modified.......: ; Remarks .......: Thanks to monoceres! ; Related .......: ; Link ..........; ; Example .......; Yes ; ;;========================================================================================== Func _Vista_ApplyGlassArea($hWnd, $Area, $bColor = 0x000000) If @OSVersion <> "WIN_7" Then MsgBox(16, "_Vista_ApplyGlass", "You are not running win 7!") Exit Else If IsArray($Area) Then DllStructSetData($Struct, "cxLeftWidth", $Area[0]) DllStructSetData($Struct, "cxRightWidth", $Area[1]) DllStructSetData($Struct, "cyTopHeight", $Area[2]) DllStructSetData($Struct, "cyBottomHeight", $Area[3]) GUISetBkColor($bColor); Must be here! $Ret = DllCall("dwmapi.dll", "long*", "DwmExtendFrameIntoClientArea", "hwnd", $hWnd, "ptr", DllStructGetPtr($Struct)) If @error Then Return 0 Else Return $Ret EndIf Else MsgBox(16, "_Vista_ApplyGlassArea", "Area specified is not an array!") EndIf EndIf EndFunc ;==>_Vista_ApplyGlassArea ; #FUNCTION#;=============================================================================== ; ; Name...........: _Vista_EnableBlurBehind ; Description ...: Enables the blur effect on the provided window handle. ; Syntax.........: _Vista_EnableBlurBehind($hWnd) ; Parameters ....: $hWnd - Window handle: ; Return values .: Success - No return ; Failure - Returns 0 ; Author ........: James Brooks ; Modified.......: ; Remarks .......: Thanks to komalo ; Related .......: ; Link ..........; ; Example .......; Yes ; ;;========================================================================================== Func _Vista_EnableBlurBehind($hWnd, $bColor = 0x000000) If @OSVersion <> "WIN_7" Then MsgBox(16, "_Vista_ApplyGlass", "You are not runningwin 7!") Exit Else Const $DWM_BB_ENABLE = 0x00000001 DllStructSetData($sStruct, 1, $DWM_BB_ENABLE) DllStructSetData($sStruct, 2, "1") DllStructSetData($sStruct, 4, "1") GUISetBkColor($bColor); Must be here! $Ret = DllCall("dwmapi.dll", "int", "DwmEnableBlurBehindWindow", "hwnd", $hWnd, "ptr", DllStructGetPtr($sStruct)) If @error Then Return 0 Else Return $Ret EndIf EndIf EndFunc ;==>_Vista_EnableBlurBehind ; #FUNCTION#;=============================================================================== ; ; Name...........: _Vista_ICE ; Description ...: Returns 1 if DWM is enabled or 0 if not ; Syntax.........: _Vista_ICE() ; Parameters ....: ; Return values .: Success - Returns 1 ; Failure - Returns 0 ; Author ........: James Brooks ; Modified.......: ; Remarks .......: Thanks to BrettF ; Related .......: ; Link ..........; ; Example .......; Yes ; ;;========================================================================================== Func _Vista_ICE() $ICEStruct = DllStructCreate("int;") $Ret = DllCall("dwmapi.dll", "int", "DwmIsCompositionEnabled", "ptr", DllStructGetPtr($ICEStruct)) If @error Then Return 0 Else Return DllStructGetData($ICEStruct, 1) EndIf EndFunc ;==>_Vista_ICE but how to use it to create a GUI such this one in the photo?? the controls with a black color disappears after applying the Aero Trasnspacey and that's clear.. so how to make black labels?? Edited March 14, 2011 by SYRAU3 Link to comment Share on other sites More sharing options...
Yashied Posted March 14, 2011 Share Posted March 14, 2011 Look at the example for _WinAPI_DwmExtendFrameIntoClientArea() function from My UDFs: iKey | FTP Uploader | Battery Checker | Boot Manager | Font Viewer | UDF Keyword Manager | Run Dialog Replacement | USBProtect | 3D Axis | Calculator | Sleep | iSwitcher | TM | NetHelper | File Types Manager | Control Viewer | SynFolders | DLL Helper Animated Tray Icons UDF Library | Hotkeys UDF Library | Hotkeys Input Control UDF Library | Caret Shape UDF Library | Context Help UDF Library | Most Recently Used List UDF Library | Icons UDF Library | FTP UDF Library | Script Communications UDF Library | Color Chooser UDF Library | Color Picker Control UDF Library | IPHelper (Vista/7) UDF Library | WinAPI Extended UDF Library | WinAPIVhd UDF Library | Icon Chooser UDF Library | Copy UDF Library | Restart UDF Library | Event Log UDF Library | NotifyBox UDF Library | Pop-up Windows UDF Library | TVExplorer UDF Library | GuiHotKey UDF Library | GuiSysLink UDF Library | Package UDF Library | Skin UDF Library | AITray UDF Library | RDC UDF Library Appropriate path | Button text color | Gaussian random numbers | Header's styles (Vista/7) | ICON resource enumeration | Menu & INI | Tabbed string size | Tab's skin | Pop-up circular menu | Progress Bar without animation (Vista/7) | Registry export | Registry path jumping | Unique hardware ID | Windows alignment More... Link to comment Share on other sites More sharing options...
SYRAU3 Posted March 14, 2011 Author Share Posted March 14, 2011 Oh i really thank you... thanks for your time. *(KISS) Link to comment Share on other sites More sharing options...
SYRAU3 Posted March 17, 2011 Author Share Posted March 17, 2011 How to make a Button Control or a TreeView with none transperated background!! black text still disapears... Link to comment Share on other sites More sharing options...
SYRAU3 Posted March 20, 2011 Author Share Posted March 20, 2011 A little help please ........! Link to comment Share on other sites More sharing options...
powerofos Posted July 12, 2011 Share Posted July 12, 2011 Hello, Similarly, i wonder how to put a picture as my GUI background (jpg or png format) which can place in full size, just like the photo in attachment! Regards Kim.Y Link to comment Share on other sites More sharing options...
AdmiralAlkex Posted July 12, 2011 Share Posted July 12, 2011 @powerofos What does that have to do with this topic? Sounds like all you want is GUICtrlCreatePic() .Some of my scripts: ShiftER, Codec-Control, Resolution switcher for HTC ShiftSome of my UDFs: SDL UDF, SetDefaultDllDirectories, Converting GDI+ Bitmap/Image to SDL Surface Link to comment Share on other sites More sharing options...
powerofos Posted July 12, 2011 Share Posted July 12, 2011 @powerofosWhat does that have to do with this topic? Sounds like all you want is GUICtrlCreatePic()@AdmiralManHairAlkex,I feel my question is relative to this topic.As i know, GUICtrlCreatePic can't do this effect, have you seen the attachment? Kim.Y Link to comment Share on other sites More sharing options...
AdmiralAlkex Posted July 12, 2011 Share Posted July 12, 2011 @powerofos What effect? You said you wanted an image, GUICtrlCreatePic() gives you that. Also none of those screenshots contains any "glass", so unless your next post contains an explanation for this seemingly off-topic question, then stop posting here and create your own thread. .Some of my scripts: ShiftER, Codec-Control, Resolution switcher for HTC ShiftSome of my UDFs: SDL UDF, SetDefaultDllDirectories, Converting GDI+ Bitmap/Image to SDL Surface Link to comment Share on other sites More sharing options...
powerofos Posted July 12, 2011 Share Posted July 12, 2011 @powerofosWhat effect? You said you wanted an image, GUICtrlCreatePic() gives you that.Also none of those screenshots contains any "glass", so unless your next post contains an explanation for this seemingly off-topic question, then stop posting here and create your own thread.@AdmiralManHairAlkex,Ok, i won't post any more, what i need is the background picture with "glass" effect GUI, perhaps my express is not so clearly, sorry about that.Thanks,Kim.Y Link to comment Share on other sites More sharing options...
AdmiralAlkex Posted July 12, 2011 Share Posted July 12, 2011 Look at the screenshot in the first post. the transparent frame done by Aero is called "glass". There's nothing like that in your screenshots. .Some of my scripts: ShiftER, Codec-Control, Resolution switcher for HTC ShiftSome of my UDFs: SDL UDF, SetDefaultDllDirectories, Converting GDI+ Bitmap/Image to SDL Surface Link to comment Share on other sites More sharing options...
Mikeman27294 Posted July 20, 2011 Share Posted July 20, 2011 Are there any examples for the winAPI function? I want to add it to my scripts but I have no background in winAPI, and could not find a winAPI startup function or anything like that, so I am absolutely lost. Link to comment Share on other sites More sharing options...
monoscout999 Posted July 20, 2011 Share Posted July 20, 2011 (edited) @SYRAU3 and @Mikeman27294 the winapi functions you need are in it came with a help file and a lot of examples to look for, these are really good examples for how to put text with shadows using AERO.@powerofos you have your own thread for that. I thought you had already solved.@AdmiralManHairAlkex look for powerofos thread is a really good challenge try to do what he want. Edited July 20, 2011 by monoscout999 Link to comment Share on other sites More sharing options...
Mikeman27294 Posted July 23, 2011 Share Posted July 23, 2011 (edited) I found this about the same time as this thread, may as well share it with you, I got the transparency working from this project.That shows the transparency. If you want the UDF that comes with the transparency, look here:If you want help setting it up, I would be more than happy to help. I dont mind if you PM me, or send me an email, just let me know what you are doing and I will help out.EDIToh... that second link... just realised it is the UDF you have in the first post. Edited July 23, 2011 by Mikeman27294 Link to comment Share on other sites More sharing options...
Mikeman27294 Posted July 23, 2011 Share Posted July 23, 2011 (edited) I did a slight modification to that file. First, I placed the GUI Creaion within it's own function. The calling of that function is commented out, unless I want to run the script alone, instead of as an include. I changed the functions so that unless otherwise specified, it will apply the glass effects to the GUI with the handle of $hGUI. Unless otherwise specified, when creating the thicker title bar, it will go down 31 pixels. This is the same size as that of MSWord 2010 (unless I changed it since, which I am sure I did not). I think that that's all. I am also working on adding in a ribbon, and I have successfully set it to drag when you grab the extended glass, without grabbing the tabs. Also, if you run the GUI in this file, it runs both _Vista_ApplyGlassArea, and _Vista_EnableBlurBehind. This is still James Brooks's UDF, I have only modified it for personal use. Enjoy. expandcollapse popup#include <WindowsConstants.au3> $Struct = DllStructCreate("int cxLeftWidth;int cxRightWidth;int cyTopHeight;int cyBottomHeight;") $sStruct = DllStructCreate("dword;int;ptr;int") Global $MyArea[4] = [0, 0, 31, 0] ;_GlassTest() Func _GlassTest() $hGUI = GUICreate("Windows Vista DWM", 243, 243, 100, 100, $WS_SIZEBOX) $Apply = GUICtrlCreateButton("Apply", 80, 104, 83, 25, 0) $ICE = GUICtrlCreateButton("DWM Check", 80, 134, 83, 25, 0) GUISetState() While 1 $iMsg = GUIGetMsg() Switch $iMsg Case -3 Exit Case $Apply ;_Vista_ApplyGlass($hGUI) _Vista_ApplyGlassArea($hGUI) _Vista_EnableBlurBehind($hGUI) GUICtrlSetColor($Apply, 0x000000) GUICtrlSetColor($ICE, 0x000000) Case $ICE If _Vista_ICE() Then MsgBox(0, "_Vista_ICE", "DWM is enabled!") Else MsgBox(0, "_Vista_ICE", "DWM is NOT enabled!") EndIf EndSwitch WEnd EndFunc ; #FUNCTION#;=============================================================================== ; ; Name...........: _Vista_ApplyGlass ; Description ...: Applys glass effect to a window ; Syntax.........: _Vista_ApplyGlass($hWnd, [$bColor) ; Parameters ....: $hWnd - Window handle: ; $bColor - Background color ; Return values .: Success - No return ; Failure - Returns 0 ; Author ........: James Brooks ; Modified.......: ; Remarks .......: Thanks to weaponx! ; Related .......: ; Link ..........; ; Example .......; Yes ; ;;========================================================================================== Func _Vista_ApplyGlass($hWnd, $bColor = 0x000000) If @OSVersion <> "WIN_VISTA" And @OSVersion <> "WIN_7" Then MsgBox(16, "_Vista_ApplyGlass", "You are not running Vista!") Else GUISetBkColor($bColor); Must be here! $Ret = DllCall("dwmapi.dll", "long", "DwmExtendFrameIntoClientArea", "hwnd", $hWnd, "long*", DllStructGetPtr($Struct)) If @error Then Return 0 SetError(1) Else Return $Ret EndIf EndIf EndFunc ;==>_Vista_ApplyGlass ; #FUNCTION#;=============================================================================== ; ; Name...........: _Vista_ApplyGlassArea ; Description ...: Applys glass effect to a window area ; Syntax.........: _Vista_ApplyGlassArea($hWnd, $Area, [$bColor) ; Parameters ....: $hWnd - Window handle: ; $Area - Array containing area points ; $bColor - Background color ; Return values .: Success - No return ; Failure - Returns 0 ; Author ........: James Brooks ; Modified.......: ; Remarks .......: Thanks to monoceres! ; Related .......: ; Link ..........; ; Example .......; Yes ; ;;========================================================================================== Func _Vista_ApplyGlassArea($hWnd, $Area=$MyArea, $bColor = 0x000000) If @OSVersion <> "WIN_VISTA" And @OSVersion <> "WIN_7" Then MsgBox(16, "_Vista_ApplyGlass", "You are not running Vista!") Exit Else If _Vista_ICE() Then If IsArray($Area) Then DllStructSetData($Struct, "cxLeftWidth", $Area[0]) DllStructSetData($Struct, "cxRightWidth", $Area[1]) DllStructSetData($Struct, "cyTopHeight", $Area[2]) DllStructSetData($Struct, "cyBottomHeight", $Area[3]) GUISetBkColor($bColor); Must be here! $Ret = DllCall("dwmapi.dll", "long*", "DwmExtendFrameIntoClientArea", "hwnd", $hWnd, "ptr", DllStructGetPtr($Struct)) If @error Then Return 0 Else Return $Ret EndIf Else MsgBox(16, "_Vista_ApplyGlassArea", "Area specified is not an array!") EndIf Else MsgBox(0, "DWM Not Enabled", "DWM is not enabled!") EndIf EndIf EndFunc ;==>_Vista_ApplyGlassArea ; #FUNCTION#;=============================================================================== ; ; Name...........: _Vista_EnableBlurBehind ; Description ...: Enables the blur effect on the provided window handle. ; Syntax.........: _Vista_EnableBlurBehind($hWnd) ; Parameters ....: $hWnd - Window handle: ; Return values .: Success - No return ; Failure - Returns 0 ; Author ........: James Brooks ; Modified.......: ; Remarks .......: Thanks to komalo ; Related .......: ; Link ..........; ; Example .......; Yes ; ;;========================================================================================== Func _Vista_EnableBlurBehind($hWnd, $bColor = 0x000000) If @OSVersion <> "WIN_VISTA" And @OSVersion <> "WIN_7" Then MsgBox(16, "_Vista_ApplyGlass", "You are not running Vista!") Exit Else Const $DWM_BB_ENABLE = 0x00000001 DllStructSetData($sStruct, 1, $DWM_BB_ENABLE) DllStructSetData($sStruct, 2, "1") DllStructSetData($sStruct, 4, "1") GUISetBkColor($bColor); Must be here! $Ret = DllCall("dwmapi.dll", "int", "DwmEnableBlurBehindWindow", "hwnd", $hWnd, "ptr", DllStructGetPtr($sStruct)) If @error Then Return 0 Else Return $Ret EndIf EndIf EndFunc ;==>_Vista_EnableBlurBehind ; #FUNCTION#;=============================================================================== ; ; Name...........: _Vista_ICE ; Description ...: Returns 1 if DWM is enabled or 0 if not ; Syntax.........: _Vista_ICE() ; Parameters ....: ; Return values .: Success - Returns 1 ; Failure - Returns 0 ; Author ........: James Brooks ; Modified.......: ; Remarks .......: Thanks to BrettF ; Related .......: ; Link ..........; ; Example .......; Yes ; ;;========================================================================================== Func _Vista_ICE() $ICEStruct = DllStructCreate("int;") $Ret = DllCall("dwmapi.dll", "int", "DwmIsCompositionEnabled", "ptr", DllStructGetPtr($ICEStruct)) If @error Then Return 0 Else Return DllStructGetData($ICEStruct, 1) EndIf EndFunc ;==>_Vista_ICE Edited July 23, 2011 by Mikeman27294 Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now