Burgaud Posted February 3, 2020 Share Posted February 3, 2020 This is a function I used to display a text on the screen: expandcollapse popupfunc _CreateToolTip($name, $x, $y, $width=200, $height=15, $style=0x01, $bgcolor=0xC0C0C0, $fontsize=11, $fontface="Verdana", $fontcolor=0x0, $fixwidth=1) local $handle[7] $handle[0] = GUICreate($name, $width, $height, $x, $y, 0x80000000, 0x80) ;$WS_POPUP = 0x80000000, $WS_EX_TOOLWINDOW = 0x80 GUISetBkColor($bgcolor,$handle[0]) local $yy = int($height/2) - $fontsize*1.5 - 5 ;assume 2 lines $handle[1] = GUICtrlCreateLabel($name, 5, $yy, $width-10, 3*$fontsize, $style) ;Create label with styled text GUICtrlSetFont ($handle[1], $fontsize, 400, 0, $fontface, 5) GUICtrlSetColor($handle[1], $fontcolor) GUISetState(@SW_HIDE, $handle[0]) ;No Show WinSetOnTop($handle[0], "", 1) ;OnTop WinSetTrans($handle[0], "", 255) ;Transparency $handle[2] = 0 $handle[3] = $fixwidth $handle[4] = '' return($handle) endfunc func _HideToolTip(ByRef $handle) GUISwitch($handle[0]) GUISetState(@SW_HIDE, $handle[0]) ;No Show return(1) endfunc func _PrintToolTip(ByRef $handle, $text) ;local $h = WinGetHandle("[ACTIVE]") if $handle[4] = $text then ;this prevents flickering of screen return else $handle[4] = $text GUISwitch($handle[0]) GUICtrlSetData($handle[1], $text) GUISetState(@SW_SHOW, $handle[0]) ;Show ;if $handle[5]> 0 then GUISetState(@SW_SHOW, $handle[5]) ;Show ;if $handle[6]> 0 then GUISetState(@SW_SHOW, $handle[6]) ;Show endif ;WinActivate($h) endfunc I used it by: GLOBAL $FullScreen = _CreateToolTip("FullScreen", 0, 0, @DesktopWidth, @Desktopheight, 0x01, 0x000000, 60, "Verdana", 0xFFFF00, 1) ; Display a message _PrintToolTip($FullScreen, "Computer is resting... Take this time to move around...") sleep(....) ; unDisplay the message _HideToolTip($FullScreen) I want it to always be "OnTop" regardless whether user is running a web browser, watching youtube, watching video via VLC, or playing games - especially games. It works flawlessly on my computer. Yet somehow, this popup is not displayed OnTop and getting covered by other apps on my Kid's computer. He managed to find a loophole, able to watch youtube, watch VLC, play games! Any reason? thanks! Link to comment Share on other sites More sharing options...
seadoggie01 Posted February 12, 2020 Share Posted February 12, 2020 First, lol, that's hysterical. This sounds like something my brother would do Make sure that your script is still running somewhere, if it isn't then I'd guess these things: I found that I could press the Start button, which revealed the taskbar, where I could click "Exit" on the tray icon on your script. Fixable with: Opt("TrayMenuMode", 1) ; Don't use the default icons Opt("TrayIconHide", 1) ; Hide the tray icon Alternately, I could restart/sign out and the script would be ended. To fix this, you'd need to start your script on login, probably with the Task Scheduler. All my code provided is Public Domain... but it may not work. Use it, change it, break it, whatever you want. Spoiler My Humble Contributions:Personal Function Documentation - A personal HelpFile for your functionsAcro.au3 UDF - Automating Acrobat ProToDo Finder - Find #ToDo: lines in your scriptsUI-SimpleWrappers UDF - Use UI Automation more Simply-erKeePass UDF - Automate KeePass, a password managerInputBoxes - Simple Input boxes for various variable types 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