playlet Posted August 21, 2010 Share Posted August 21, 2010 (edited) --- Edited August 18, 2016 by playlet Link to comment Share on other sites More sharing options...
Yashied Posted August 21, 2010 Share Posted August 21, 2010 (edited) expandcollapse popup#Include <GDIPlus.au3> #Include <GUIConstantsEx.au3> #Include <WinAPIEx.au3> #Include <WindowsConstants.au3> _GDIPlus_Startup() $hImage = _GDIPlus_ImageLoadFromFile(@ScriptDir & '\bg_440x440.png') $hBitmap = _GDIPlus_BitmapCreateHBITMAPFromBitmap($hImage) _GDIPlus_ImageDispose($hImage) $hForm = GUICreate('', 440, 440, 200, 200, $WS_POPUPWINDOW, $WS_EX_LAYERED) _WinAPI_UpdateLayeredWindowEx($hForm, $hBitmap, 127) $hPopup = GUICreate('', 380, 380, 200 + 30, 200 + 30, $WS_POPUP, $WS_EX_LAYERED, $hForm) GUISetBkColor(0xABABAB) $Edit = GUICtrlCreateEdit('', 20, 20, 340, 250) $Slider = GUICtrlCreateSlider(20, 286, 340, 32) GUICtrlSetLimit(-1, 100, 0) GUICtrlSetData(-1, 50) $Button = GUICtrlCreateButton('OK', 155, 344, 70, 23) _WinAPI_SetLayeredWindowAttributes($hPopup, 0xABABAB, 0, $LWA_COLORKEY) GUIRegisterMsg($WM_MOVE, 'WM_MOVE') GUIRegisterMsg($WM_NCHITTEST, 'WM_NCHITTEST') GUISetState(@SW_SHOW, $hForm) GUISetState(@SW_SHOW, $hPopup) While 1 $Msg = GUIGetMsg() Switch $Msg Case $GUI_EVENT_CLOSE, $Button ExitLoop Case $Slider _WinAPI_UpdateLayeredWindowEx($hForm, $hBitmap, 255 / 100 * GUICtrlRead($Slider)) EndSwitch WEnd _GDIPlus_Shutdown() Func WM_MOVE($hWnd, $iMsg, $wParam, $lParam) Switch $hWnd Case $hForm Local $X = BitAND($lParam, 0xFFFF), $Y = BitShift($lParam, 16) If $X > 0x7FFF Then $X -= 0x10000 EndIf If $Y > 0x7FFF Then $Y -= 0x10000 EndIf WinMove($hPopup, '', $X + 30, $Y + 30) EndSwitch Return $GUI_RUNDEFMSG EndFunc ;==>WM_MOVE Func WM_NCHITTEST($hWnd, $iMsg, $iwParam, $ilParam) Switch $hWnd Case $hForm Switch $iMsg Case $WM_NCHITTEST Return $HTCAPTION EndSwitch EndSwitch Return $GUI_RUNDEFMSG EndFunc ;==>WM_NCHITTESTWinAPIEx.au3 Edited August 21, 2010 by Yashied 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...
playlet Posted August 22, 2010 Author Share Posted August 22, 2010 (edited) --- Edited August 18, 2016 by playlet Link to comment Share on other sites More sharing options...
UEZ Posted August 23, 2010 Share Posted August 23, 2010 Do you mean this: expandcollapse popup#include <ButtonConstants.au3> #include <GUIConstantsEx.au3> #include <StaticConstants.au3> #include <WindowsConstants.au3> #include <WinApi.au3> #include <GDIPlus.au3> $width = 200 $height = 200 $hwnd = GUICreate("Test", $width, $height, Default, Default, $WS_POPUP, $WS_EX_LAYERED + $WS_EX_TOPMOST) GUISetState(@SW_SHOW) $bsize_x = 50 $bsize_y = 30 $child = GUICreate("", $bsize_x, $bsize_y, $width * 0.5 - $bsize_x * 0.5, $height * 0.5 - $bsize_y * 0.5, $WS_POPUP, $WS_EX_MDICHILD + $WS_EX_LAYERED, $hwnd) $button = GUICtrlCreateButton ("Test", 0, 0, $bsize_x, $bsize_y) _WinAPI_SetLayeredWindowAttributes($child, 0xFFFFFF, 160) GUISetState(@SW_SHOW) ;~ GUISetBkColor (0xFFFFFF) _GDIPlus_Startup () $Graphics = _GDIPlus_GraphicsCreateFromHWND ($hwnd) $bitmap = _GDIPlus_BitmapCreateFromGraphics($width, $height, $graphics) $backbuffer = _GDIPlus_ImageGetGraphicsContext($bitmap) $ScreenDc = _WinAPI_GetDC($hWnd) $gdibitmap = _GDIPlus_BitmapCreateHBITMAPFromBitmap($bitmap) $dc = _WinAPI_CreateCompatibleDC($ScreenDc) _WinAPI_SelectObject($dc, $gdibitmap) ; _WinAPI_UpdateLayeredWindow parameters $tSize = DllStructCreate($tagSIZE) $pSize = DllStructGetPtr($tSize) DllStructSetData($tSize, "X", $width) DllStructSetData($tSize, "Y", $height) $tSource = DllStructCreate($tagPOINT) $pSource = DllStructGetPtr($tSource) $tBlend = DllStructCreate($tagBLENDFUNCTION) $pBlend = DllStructGetPtr($tBlend) $alpha = 160 DllStructSetData($tBlend, "Alpha", $alpha) DllStructSetData($tBlend, "Format", 0) $tPoint = DllStructCreate($tagPOINT) $pPoint = DllStructGetPtr($tPoint) DllStructSetData($tPoint, "X", 0) DllStructSetData($tPoint, "Y", 0) $PenRect = _GDIPlus_PenCreate (0xFFFFAA00, 10) _GDIPlus_GraphicsClear($backbuffer, 0x0) _GDIPlus_GraphicsDrawRect($backbuffer, 0, 0, $width, $height, $PenRect) $bild = _GDIPlus_ImageLoadFromFile("..\..\images\Bubbles_03.png") ;<=-- replace path with a transparency png _GDIPlus_GraphicsDrawImageRect($backbuffer, $Bild, 50, 50, 100, 100) $gdibitmap = _GDIPlus_BitmapCreateHBITMAPFromBitmap($bitmap) _WinAPI_SelectObject($dc, $gdibitmap) _WinAPI_UpdateLayeredWindow($hWnd, $ScreenDc, 0, $pSize, $dc, $pSource, 0, $pBlend, 2) _WinAPI_DeleteObject($gdibitmap) While 1 $nMsg = GUIGetMsg() Switch $nMsg Case -3 _GDIPlus_GraphicsDispose($backbuffer) _GDIPlus_BitmapDispose($bitmap) _WinAPI_DeleteDC($dc) _WinAPI_ReleaseDC($hWnd, $ScreenDc) _GDIPlus_GraphicsDispose($Graphics) _GDIPlus_Shutdown() $tSize = "" $tSource = "" $tBlend = "" $tPoint = "" GUIDelete($child) GUIDelete($hwnd) Exit Case $button WinSetOnTop($hwnd, "", False) MsgBox(0, "Transparenz", "von UEZ '2010") WinSetOnTop($hwnd, "", True) EndSwitch WEnd Br, UEZ Please don't send me any personal message and ask for support! I will not reply! Selection of finest graphical examples at Codepen.io The own fart smells best! ✌Her 'sikim hıyar' diyene bir avuç tuz alıp koşma!¯\_(ツ)_/¯ ٩(●̮̮̃•̃)۶ ٩(-̮̮̃-̃)۶ૐ Link to comment Share on other sites More sharing options...
playlet Posted August 23, 2010 Author Share Posted August 23, 2010 (edited) --- Edited August 18, 2016 by playlet Link to comment Share on other sites More sharing options...
playlet Posted August 31, 2010 Author Share Posted August 31, 2010 (edited) --- Edited August 18, 2016 by playlet Link to comment Share on other sites More sharing options...
UEZ Posted September 1, 2010 Share Posted September 1, 2010 (edited) This is working for me with only 1 window: #include <ButtonConstants.au3> #include <WindowsConstants.au3> #include <GDIPlus.au3> $width = 200 $height = 200 $hwnd = GUICreate("Test", $width, $height, Default, Default, $WS_POPUP, $WS_EX_LAYERED + $WS_EX_TOPMOST) GUISetBkColor(0x000001) _WinAPI_SetLayeredWindowAttributes($hwnd, 0x00000001, 0x00, 1, 0) GUISetState(@SW_SHOW) _GDIPlus_Startup () $hGraphics = _GDIPlus_GraphicsCreateFromHWND ($hwnd) $hImage = _GDIPlus_ImageLoadFromFile("..\images\Smiley.png") ;<=-- replace path with a transparency png _GDIPlus_GraphicsDrawImageRect($hGraphics, $hImage, 0, 0, 200, 200) $button = GUICtrlCreateButton ("Test", 75, 85, 50, 30) GUISetState(@SW_SHOW) While 1 $nMsg = GUIGetMsg() Switch $nMsg Case -3 _GDIPlus_GraphicsDispose($hGraphics) _GDIPlus_Shutdown() GUIDelete($hwnd) Exit Case $button WinSetOnTop($hwnd, "", False) MsgBox(0, "Transparency", "by UEZ '2010") WinSetOnTop($hwnd, "", True) EndSwitch WEnd Br, UEZ Edited September 1, 2010 by UEZ Please don't send me any personal message and ask for support! I will not reply! Selection of finest graphical examples at Codepen.io The own fart smells best! ✌Her 'sikim hıyar' diyene bir avuç tuz alıp koşma!¯\_(ツ)_/¯ ٩(●̮̮̃•̃)۶ ٩(-̮̮̃-̃)۶ૐ Link to comment Share on other sites More sharing options...
playlet Posted September 1, 2010 Author Share Posted September 1, 2010 (edited) --- Edited August 18, 2016 by playlet Link to comment Share on other sites More sharing options...
UEZ Posted September 1, 2010 Share Posted September 1, 2010 Nice. Any way to restore true transparency?What do you mean exactly with restore true transparency?Br,UEZ Please don't send me any personal message and ask for support! I will not reply! Selection of finest graphical examples at Codepen.io The own fart smells best! ✌Her 'sikim hıyar' diyene bir avuç tuz alıp koşma!¯\_(ツ)_/¯ ٩(●̮̮̃•̃)۶ ٩(-̮̮̃-̃)۶ૐ Link to comment Share on other sites More sharing options...
playlet Posted September 1, 2010 Author Share Posted September 1, 2010 (edited) --- Edited August 18, 2016 by playlet Link to comment Share on other sites More sharing options...
UEZ Posted September 1, 2010 Share Posted September 1, 2010 With GDI+ it is, as far as I know, not possible to draw png's with full tranparency! Same issue with full transparent icons! Sorry, UEZ Please don't send me any personal message and ask for support! I will not reply! Selection of finest graphical examples at Codepen.io The own fart smells best! ✌Her 'sikim hıyar' diyene bir avuç tuz alıp koşma!¯\_(ツ)_/¯ ٩(●̮̮̃•̃)۶ ٩(-̮̮̃-̃)۶ૐ Link to comment Share on other sites More sharing options...
playlet Posted September 1, 2010 Author Share Posted September 1, 2010 (edited) --- Edited August 18, 2016 by playlet 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