BigDaddyO Posted November 29, 2018 Share Posted November 29, 2018 I've got a statusbar for one of my scripts that shows over the taskbar next to the time and it works great, excepts when someone clicks on the taskbar it hides my SplashText status. Is there some way to have it always show as top-most above the taskbar? Or, since i'm updating the splashtext frequently, is there some command I can do to pop the splashtext window back to the top without it grabbing focus? Below is a small demo scripts showing my failed attempts so far. launch, then click a blank spot on the taskbar and it will hide the splashtext... ;Create the progress screen $aPOS = ControlGetPos("[CLASS:Shell_TrayWnd]", "", "[CLASS:MSTaskListWClass; INSTANCE:1]") if @error Then MsgBox(0, "Error", "Unable to find System Tray to build the progress screen") Exit EndIf $sMessage = "StatusBar - Starting..." SplashTextOn("SysTrayStatus", $sMessage, 340, 25, ($aPOS[0] + $aPOS[2]) - 350, @DesktopHeight - $aPOS[3] + Round(($aPOS[3] - 25) / 2, 2), 37, "Ariel", 8) WinSetOnTop("SysTrayStatus", "", 1) ;doesnt seem to help ConsoleWrite("Initial State = " & WinGetState("SysTrayStatus", "") & @CRLF) ;initial is 3 ;Loop for 30 seconds, updating the text every 1 second For $i = 1 to 30 sleep(900) ControlSetText("SysTrayStatus", "", "Static1", "Running loop " & $i & " of 30") ConsoleWrite($i & " State = " & WinGetState("SysTrayStatus", "") & @CRLF) ;always = 3 ;WinActivate("SysTrayStatus", "") ;Cant use this as it grabs focus ;WinSetState("SysTrayStatus", "", @SW_SHOW) ;Doesnt bring to front Next Link to comment Share on other sites More sharing options...
careca Posted November 29, 2018 Share Posted November 29, 2018 Maybe gdi text overlay could help with that, have you looked into it? Just create the transparent window and overlay text. Didn't test but i believe it could work. Spoiler Renamer - Rename files and folders, remove portions of text from the filename etc. GPO Tool - Export/Import Group policy settings. MirrorDir - Synchronize/Backup/Mirror Folders BeatsPlayer - Music player. Params Tool - Right click an exe to see it's parameters or execute them. String Trigger - Triggers pasting text or applications or internet links on specific strings. Inconspicuous - Hide files in plain sight, not fully encrypted. Regedit Control - Registry browsing history, quickly jump into any saved key. Time4Shutdown - Write the time for shutdown in minutes. Power Profiles Tool - Set a profile as active, delete, duplicate, export and import. Finished Task Shutdown - Shuts down pc when specified window/Wndl/process closes. NetworkSpeedShutdown - Shuts down pc if download speed goes under "X" Kb/s. IUIAutomation - Topic with framework and examples Au3Record.exe Link to comment Share on other sites More sharing options...
BigDaddyO Posted November 29, 2018 Author Share Posted November 29, 2018 That won't work as the gui window I need to create for the GDI is being hidden behind the task bar just like the splashtext window was. I even tried to write the GDIplus text directly to the task bar handle but I've not been successful so far. doesn't seem to do anything... expandcollapse popup#include <GDIPlus.au3> #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #include <ColorConstants.au3> Example() Func Example() $hTray = WinGetHandle("[CLASS:Shell_TrayWnd]", "") $aTrayPos = WinGetPos($hTray, "") ConsoleWrite("X = " & $aTrayPos[0] & ", Y = " & $aTrayPos[1] & ", Tray Width = " & $aTrayPos[2] & ", Tray Hieght = " & $aTrayPos[3] & @CRLF) ; Draw a string _GDIPlus_Startup() $hGraphic = _GDIPlus_GraphicsCreateFromHWND($hTray) $hBrush = _GDIPlus_BrushCreateSolid($COLOR_FUCHSIA) $hFormat = _GDIPlus_StringFormatCreate() $hFamily = _GDIPlus_FontFamilyCreate("Arial") $hFont = _GDIPlus_FontCreate($hFamily, 36, 2) $tLayout = _GDIPlus_RectFCreate(1, 1, 400, 60) _GDIPlus_GraphicsDrawStringEx($hGraphic, "This should be my status bar", $hFont, $tLayout, $hFormat, $hBrush) ; Loop until the user exits. Do Until GUIGetMsg() = $GUI_EVENT_CLOSE ; Clean up resources _GDIPlus_FontDispose($hFont) _GDIPlus_FontFamilyDispose($hFamily) _GDIPlus_StringFormatDispose($hFormat) _GDIPlus_BrushDispose($hBrush) _GDIPlus_GraphicsDispose($hGraphic) _GDIPlus_Shutdown() EndFunc ;==>Example Link to comment Share on other sites More sharing options...
BigDaddyO Posted November 29, 2018 Author Share Posted November 29, 2018 After a lot of reading, it came down to the Z-Order being reset every time a topmost window is selected. So, I just needed to run the WinSetOnTop() function for my splashtext every time I update the text. ;Create the progress screen $aPOS = ControlGetPos("[CLASS:Shell_TrayWnd]", "", "[CLASS:MSTaskListWClass; INSTANCE:1]") if @error Then MsgBox(0, "Error", "Unable to find System Tray to build the progress screen") Exit EndIf $sMessage = "StatusBar - Starting..." SplashTextOn("SysTrayStatus", $sMessage, 340, 25, ($aPOS[0] + $aPOS[2]) - 350, @DesktopHeight - $aPOS[3] + Round(($aPOS[3] - 25) / 2, 2), 37, "Ariel", 8) WinSetOnTop("SysTrayStatus", "", 1) ;Set this as one of the Topmost windows ConsoleWrite("Initial State = " & WinGetState("SysTrayStatus", "") & @CRLF) ;initial is 3 ;Loop for 30 seconds, updating the text every 1 second For $i = 1 to 30 sleep(900) ControlSetText("SysTrayStatus", "", "Static1", "Running loop " & $i & " of 30") ConsoleWrite($i & " State = " & WinGetState("SysTrayStatus", "") & @CRLF) ;always = 3 WinSetOnTop("SysTrayStatus", "", 1) ;reset this to the top Z-Order of Topmost windows in case someone clicks the taskbar Next careca and badcoder123 2 Link to comment Share on other sites More sharing options...
careca Posted November 29, 2018 Share Posted November 29, 2018 Very neat progress. Spoiler Renamer - Rename files and folders, remove portions of text from the filename etc. GPO Tool - Export/Import Group policy settings. MirrorDir - Synchronize/Backup/Mirror Folders BeatsPlayer - Music player. Params Tool - Right click an exe to see it's parameters or execute them. String Trigger - Triggers pasting text or applications or internet links on specific strings. Inconspicuous - Hide files in plain sight, not fully encrypted. Regedit Control - Registry browsing history, quickly jump into any saved key. Time4Shutdown - Write the time for shutdown in minutes. Power Profiles Tool - Set a profile as active, delete, duplicate, export and import. Finished Task Shutdown - Shuts down pc when specified window/Wndl/process closes. NetworkSpeedShutdown - Shuts down pc if download speed goes under "X" Kb/s. IUIAutomation - Topic with framework and examples Au3Record.exe Link to comment Share on other sites More sharing options...
Viszna Posted November 30, 2018 Share Posted November 30, 2018 @BigDaddyOnice splash -cool solution for informing the user about the action but it works badly if Windows taskbar is left, right or top desktop (small problem I know only 1 person works with Windows taskbar top desktop ) 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