Quantcast
Channel: AutoIt v3 - General Help and Support
Viewing all articles
Browse latest Browse all 12506

How to put a png fading window in a parent window ??

$
0
0

I search to put a fading window with png control buttons, in a parent window.

When I set to parent the second window disappear.  :unsure:

Can you help me ?

AutoIt Code         
#include <GDIPlus.au3> #include <WinAPI.au3> #include <WindowsConstants.au3> #include <GuiConstantsEx.au3> Opt("MustDeclareVars", 0) _GDIPlus_Startup() $hImage = _GDIPlus_ImageLoadFromFile("C:\Users\TheDaverMan\Pictures\button.png") $hGUI = GUICreate("GUI", 750, 500, 192, 128) $hGUI2 = GUICreate("", 500, 250, 0, 0, $WS_POPUP, BitOR($WS_EX_LAYERED, $WS_EX_TOPMOST, $WS_EX_TRANSPARENT));BitOR($WS_EX_MDICHILD, $WS_EX_TOPMOST)) ;~ DllCall("user32.dll", "int", "SetParent", "hwnd", $hGUI2, "hwnd", $hGUI) ;   <=  if I put parent, I don't see the png SetBitmap($hGUI2, $hImage, 125);alpha GUISetState(@SW_SHOW, $hGUI) GUISetState(@SW_SHOW, $hGUI2) Sleep(5000) Func SetBitmap($hgui, $hImage, $iOpacity)     Local $hScrDC, $hMemDC, $hBitmap, $hOld, $pSize, $tSize, $pSource, $tSource, $pBlend, $tBlend     $hScrDC = _WinAPI_GetDC(0)     $hMemDC = _WinAPI_CreateCompatibleDC($hScrDC)     $hBitmap = _GDIPlus_BitmapCreateHBITMAPFromBitmap($hImage)     $hOld = _WinAPI_SelectObject($hMemDC, $hBitmap)     $tSize = DllStructCreate($tagSIZE)     $pSize = DllStructGetPtr($tSize)     DllStructSetData($tSize, "X", _GDIPlus_ImageGetWidth($hImage))     DllStructSetData($tSize, "Y", _GDIPlus_ImageGetHeight($hImage))     $tSource = DllStructCreate($tagPOINT)     $pSource = DllStructGetPtr($tSource)     $tBlend = DllStructCreate($tagBLENDFUNCTION)     $pBlend = DllStructGetPtr($tBlend)     DllStructSetData($tBlend, "Alpha", $iOpacity)     DllStructSetData($tBlend, "Format", 1)     _WinAPI_UpdateLayeredWindow($hgui, $hScrDC, 0, $pSize, $hMemDC, $pSource, 0, $pBlend, $ULW_ALPHA)     _WinAPI_ReleaseDC(0, $hScrDC)     _WinAPI_SelectObject($hMemDC, $hOld)     _WinAPI_DeleteObject($hBitmap)     _WinAPI_DeleteDC($hMemDC) EndFunc

Viewing all articles
Browse latest Browse all 12506

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>