CrewXp Posted September 3, 2009 Posted September 3, 2009 Hey, quick question. Is there any way to make a gui overlap anything but the taskbar? I'm trying to make a tray notify, but it gets stuck behind windows/apps. So I added the alwaysontop attribute to it, but now it overlaps even the taskbar. Is there any way around this? Possibilties I see 1.) Somehow make the taskbar always on top. (Ghetto way around it..) 2.) Apply some _ALMOST_Always_On_Top attribute to my GUI to get it to stay behind the gui. Example Code for Tray Popup expandcollapse popup#include <WindowsConstants.au3> #Include <WinAPI.au3> ; Create Toast window Global $hGUI = GUICreate("", 200, 100, @DesktopWidth - 210, @DesktopHeight - 130, $WS_POPUPWINDOW, $WS_EX_TOOLWINDOW + $WS_EX_TOPMOST) Global $hLabel = GUICtrlCreateLabel("Click to close", 1, 1, 198, 198) ; Slide in Toast - but keep focus on current window _WinAnimate($hGUI, 0x00040008) $hCurrWnd = _WinAPI_GetForegroundWindow() GUISetState(@SW_SHOW, $hGUI) WinActivate($hCurrWnd, "") ; Wait for click from Toast While 1 Local $aMsg = GUIGetMsg(1) If $aMsg[1] = $hGUI And $aMsg[0] = $hLabel Then ExitLoop WEnd ; Slide out window _WinAnimate($hGUI, 0x00050004) Exit ; -------------- ; Gary Frost's WinAnimate function Func _WinAnimate($h_gui, $i_mode, $i_duration = 1000) If @OSVersion = "WIN_XP" OR @OSVersion = "WIN_2000" Or @OSVersion = "WIN_VISTA" Then DllCall("user32.dll", "int", "AnimateWindow", "hwnd", $h_gui, "int", $i_duration, "long", $i_mode) Local $ai_gle = DllCall('kernel32.dll', 'int', 'GetLastError') If $ai_gle[0] <> 0 Then Return SetError(1, 0, 0) EndIf Return 1 Else Return SetError(2, 0, 0) EndIf EndFunc;==> _WinAnimate()
Yashied Posted September 3, 2009 Posted September 3, 2009 (edited) expandcollapse popup#include <GUIConstants.au3> #include <StaticConstants.au3> #include <WindowsConstants.au3> #Include <WinAPI.au3> ; Create Toast window $hGUI = GUICreate("", 200, 100, @DesktopWidth - 210, @DesktopHeight - 130, $WS_POPUP, $WS_EX_TOOLWINDOW + $WS_EX_TOPMOST) GUICtrlCreateLabel("", 0, 0, 200, 100) GUICtrlSetBkColor(-1, 0x000000) GUICtrlSetState(-1, $GUI_DISABLE) $hLabel = GUICtrlCreateLabel("Click to close", 1, 1, 198, 99) _WinAnimate($hGUI, 0x00040008) GUISetState(@SW_SHOWNOACTIVATE) ; Wait for click from Toast While 1 Local $aMsg = GUIGetMsg(1) If $aMsg[1] = $hGUI And $aMsg[0] = $hLabel Then ExitLoop WEnd ; Slide out window _WinAnimate($hGUI, 0x00050004) Exit ; -------------- ; Gary Frost's WinAnimate function Func _WinAnimate($h_gui, $i_mode, $i_duration = 1000) If @OSVersion = "WIN_XP" OR @OSVersion = "WIN_2000" Or @OSVersion = "WIN_VISTA" Then DllCall("user32.dll", "int", "AnimateWindow", "hwnd", $h_gui, "int", $i_duration, "long", $i_mode) Local $ai_gle = DllCall('kernel32.dll', 'int', 'GetLastError') If $ai_gle[0] <> 0 Then Return SetError(1, 0, 0) EndIf Return 1 Else Return SetError(2, 0, 0) EndIf EndFunc;==> _WinAnimate()EDIT:And look at WinAPIEx.au3 Edited September 3, 2009 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...
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