Jump to content

Always on top msgbox


Recommended Posts

Long time user, first time poster.  I'm not sure what to search on to find my answer (perused various part of the FAQ), so if it has been answered already, politely point me in the direction, please.

I have a script that mostly takes actions directed by the status of pixels on the screen.  For debugging purposes, I'd like to print out to a msgbox (or similar object) information as the script is running.  Initially, I was using MsgBox to pop up the info, but then the screen loses focus.  

One of the things that is important is that I need to keep the screen I care about "in-focus" so all the pixel data, key presses, mouse clicks etc are acted on that screen as opposed to the "debug msgbox data window."  

To go into a little more detail, right now, I use FileWrite to write the debug data out to a file that I can peruse it.  But, it isn't something I view in real time.  Ideally, I'm looking to see if there is already some AutoIt function that exists where I can do something similar to a FileWrite to this "debug msgbox data window."  Every time I call to write to it, either the old data scrolls off or disappears (doesn't really matter ultimately).  

I've looked at the splashText function, but it appears to make the window I'm working on lose focus.  

Any ideas or tips would be greatly appreciated.

Link to comment
Share on other sites

You'll most likely need to create a GUI yourself, so that you may update the control that has the debug info or overwrite it. Have a look at this topic as it gives some ideas on how to keep this window in the back, which would allow everything to keep functioning even as you update the debug info in your GUI. 

Try scripting this and post it if you hit a snag, we'd be more than happy to help on it. 

EDIT: Welcome to the AutoIt forum @taveren!

Edited by MikahS
welcome

Snips & Scripts


My Snips: graphCPUTemp ~ getENVvars
My Scripts: Short-Order Encrypter - message and file encryption V1.6.1 ~ AuPad - Notepad written entirely in AutoIt V1.9.4

Feel free to use any of my code for your own use.                                                                                                                                                           Forum FAQ

 

Link to comment
Share on other sites

Did you have a look at the Debug UDF that comes with AutoIt?

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2024-07-28 - Version 1.6.3.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download
Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki
PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki
Task Scheduler (2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki

Standard UDFs:
Excel - Example Scripts - Wiki
Word - Wiki

Tutorials:
ADO - Wiki
WebDriver - Wiki

 

Link to comment
Share on other sites

You can set the MsgBox window topmost!

Example:

#include <MsgBoxConstants.au3>
MsgBox($MB_TOPMOST, "MsgBox Demo", "I'm topmost")

 

Please don't send me any personal message and ask for support! I will not reply!

Selection of finest graphical examples at Codepen.io

The own fart smells best!
Her 'sikim hıyar' diyene bir avuç tuz alıp koşma!
¯\_(ツ)_/¯  ٩(●̮̮̃•̃)۶ ٩(-̮̮̃-̃)۶ૐ

Link to comment
Share on other sites

  • 8 months later...

Remarks

The flag parameter can be a combination of the following values: ? could not do it, then decided below.

_MsgBox_OnTop(0, "Example", "MagBox() on Top.")

Func _MsgBox_OnTop($iFlag, $sTitle, $sText, $iTimeOut = 0, $hHandle = -1)
    If $hHandle = -1 Then
        $hHandle = WinGetHandle(AutoItWinGetTitle())
        WinSetOnTop($hHandle, "", 1)
    EndIf
    Return MsgBox($iFlag, $sTitle, $sText, $iTimeOut, $hHandle)
EndFunc   ;==>_MsgBox_OnTop
 
Edited by guiltyking
code fault
Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...