bourny Posted July 19, 2010 Share Posted July 19, 2010 I am using a function I found on the forum to create a pop up window from the tray and customising it for my purpose. The issue I have is I am setting a background image but when I display the pop up gui it draws a white area for the text boxes. I would like to make the text box transparant so I can always see the background image. Can I also ask if there is a way to fade the background image. expandcollapse popup#Include <Misc.au3> #Include <WinAPI.au3> #include <Constants.au3> #include <WindowsConstants.au3> #include <StaticConstants.au3> #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #include <array.au3> $PopupX = 200 $PopupY = 70 $tb = WinGetPos("","Notification Area") ;array [x,y,width,height] $x = $tb[2] - $PopupX -30 $y = $tb[1] - $PopupY -30 Tray_Gui ( "POPup Window", "StatusMessage", 0 ) Sleep(5000) Func tray_gui($title, $text, $sound) ;$message = $title & @LF & @lf & $text Opt("GUICoordMode", 0) if FileExists(@ScriptDir & "\data\tray.wma") = True Then if $sound = 1 then SoundPlay(@ScriptDir & "\data\tray.wma", 0) endif $gui = GUICreate("popup", $PopupX, $PopupY, $x, $y, BitOR($WS_POPUPWINDOW, $WS_THICKFRAME, $WS_DISABLED, $DS_SETFOREGROUND), BitOR($WS_EX_CLIENTEDGE, $WS_EX_TOOLWINDOW, $WS_EX_TOPMOST, $WS_EX_TRANSPARENT)) $background = GUICtrlCreatePic("C:\hard-drive.jpeg", 0, 0, $PopupX, $PopupY, BitOr($SS_CENTERIMAGE, $SS_WHITERECT)); background picture WinSetTrans("popup", "", 0) GUISetState(@SW_SHOW) ;ConsoleWrite($i & @CRLF) ;GUISetBkColor(0xE0FFFF) WinSetTrans("popup", "", 0) ;$rgn = _WinAPI_CreateRoundRectRgn(6, 6, 200, 70, 60, 10) ;_WinAPI_SetWindowRgn($gui, $rgn) GUISetFont(9, 800, 4) GUICtrlCreateLabel($Title, 5, 5 ) GUISetFont(7, 600, 0) GUICtrlCreateLabel($text, 5, 23, 190, 40, -1, $WS_EX_TRANSPARENT) $i = 0 Do $i = $i + 5 WinSetTrans("popup", "", $i) sleep(30) until $i = 255 sleep(5000) Do $i = $i - 5 WinSetTrans("popup", "", $i) sleep(30) until $i = 0 GUIDelete($gui) EndFunc Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted July 19, 2010 Moderators Share Posted July 19, 2010 bourny,From the Help file for GUICtrlCreateLabel: To set the background to transparent, use GUICtrlSetBkColor(-1, $GUI_BKCOLOR_TRANSPARENT).This works for me: GUICtrlCreateLabel($Title, 5, 5 ) GUICtrlSetBkColor(-1, $GUI_BKCOLOR_TRANSPARENT) GUISetFont(7, 600, 0) GUICtrlCreateLabel($text, 5, 23, 190, 40) GUICtrlSetBkColor(-1, $GUI_BKCOLOR_TRANSPARENT)M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
bourny Posted July 19, 2010 Author Share Posted July 19, 2010 Many Thanks. This sorts the first issue out .. did you know if there was a way to fade the background image. Many Thanks 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