Jump to content

Borderless, Titleless Background Window


Recommended Posts

Hello, I am new to AutoIT and I am trying to make a quick program that will display some information about the computer in a window.

I have searched in this forum for the past 3 days and I haven't been able to find everything I need.

I would like to create a window that has no border, or Title bar, just a blank window.

It would also be nice to be able to make sure it is always on the bottom, so it is pretty much only visible when you are looking on the desktop (Basically part of the desktop). I don't want you to be able to move it or close it, or anything.

I have gotten pretty close using SplashTextOn, but It would be nice to be able to change the look of it a little more (Background color, perhaps an image or 2)

Here is what I have so far:

#include <GUIConstants.au3>
#NoTrayIcon

$WINDOWWIDTH = 220
$WINDOWHEIGHT = 52
$WINDOWLOCATIONX = @DesktopWidth - $WINDOWWIDTH - 10
$WINDOWLOCATIONY = 30

$LINE1 = "Computer Name: " & @ComputerName
$LINE2 = "IP Address: " & @IPAddress1
$LINE3 =  "Username: " & @UserName
If isAdmin() Then 
    $LINE4 = "Computer Administrator"
Else
    $LINE4 = "Power User"
EndIf
SplashTextOn("Computer Information", $LINE1 & @CR & $LINE2 & @CR & $LINE3 & @CR & $LINE4, $WINDOWWIDTH, $WINDOWHEIGHT, $WINDOWLOCATIONX, $WINDOWLOCATIONY,3, "", 8)

GUISetState()
While 1
    sleep(600000)
    $LINE1 = "Computer Name: " & @ComputerName
    $LINE2 = "IP Address: " & @IPAddress1
    $LINE3 = "Username: " & @UserName
    If isAdmin() Then 
        $LINE4 = "Computer Administrator"
    Else
        $LINE4 = "Power User"
    EndIf
    
    ControlSetText("Computer Information", "", "Static1", $LINE1 & @CR & $LINE2 & @CR & $LINE3 & @CR & $LINE4)
Wend

WARNING: This window will not close, or show any way to close it, you have to kill the task in Windows TaskManager

Any suggestions would be extremly appreciated!

(Sorry if there is a post on this, I looked everywhere and didn't find one.)

Link to comment
Share on other sites

You may be interested in BgInfo. That program might meet your needs by itself, but check the EULA regarding redistribution (if applicable).

I've used AutoIt to augment the type of data BgInfo displays. The file of attached contains a BgInfo.bgi (config) file as well as my AutoIt script.

How it works:

The config file contains some preset data as well as a field that tells BgInfo to import the text in C:\DriveInfo.txt. (Unfortunately, I believe the path needs to be hard-coded, but you can use BgInfo.exe to modify the config file.)

If you run GenInfo.au3, it creates a file C:\DriveInfo.txt then calls Run("bginfo.exe bginfo.bgi /timer:0") to update the desktop background. If you run GenInfo.au3 again, it will refresh the information.

Hope that makes sense. BgInfo is pretty easy to use; it just takes some work to customize the data if none of the many available fields is what you want.

GenInfo.zip

Use Mozilla | Take a look at My Disorganized AutoIt stuff | Very very old: AutoBuilder 11 Jan 2005 prototype I need to update my sig!
Link to comment
Share on other sites

heres an example of a gui that fits your description (instead of splash text)

#include <GuiConstants.au3>
GuiCreate("",400, 300, -1,-1, BitOr($WS_POPUP,$WS_DLGFRAME))
GUISetBkColor(0xadd8e6);;; lightblue
GuiSetState()
While 1
    Sleep(1000)
WEnd
Link to comment
Share on other sites

CyberSlug, I would be more confortable using my own code, using a 3rd party application would require me to install it on all the pcs, as well as run my own code. Who knows what legal trouble will result.

This way, its just one file, and all I have to do is run it. (Easier to push out and such)

Link to comment
Share on other sites

  • Moderators

Is this what your looking to do?

#include <GUIConstants.au3>
#NoTrayIcon
HotKeySet('{ESC}', 'EXITNOW')

$WINDOWWIDTH = 220
$WINDOWHEIGHT = 60
$WINDOWLOCATIONX = @DesktopWidth - $WINDOWWIDTH - 10
$WINDOWLOCATIONY = 30

$LINE1 = "Computer Name: " & @ComputerName
$LINE2 = "IP Address: " & @IPAddress1
$LINE3 =  "Username: " & @UserName
If isAdmin() Then
    $LINE4 = "Computer Administrator"
Else
    $LINE4 = "Power User"
EndIf

$SPLASH = GUICreate('', $WINDOWWIDTH, $WINDOWHEIGHT, $WINDOWLOCATIONX, $WINDOWLOCATIONY, BitOr($WS_POPUP,$WS_DLGFRAME), $WS_EX_TOOLWINDOW)
$EDIT = GUICtrlCreateLabel("Computer Information" & @CR & $LINE1 & @CR & $LINE2 & @CR & $LINE3 & @CR & $LINE4, 0, 0, $WINDOWWIDTH, $WINDOWHEIGHT, $SS_CENTER)
GUICtrlSetFont($EDIT, 9, 4, '', 'ARIAL BOLD')
GUICtrlSetColor($EDIT, 0x0000FF)
GUICtrlSetBkColor($EDIT, 0xFFFF00)
GUISetState()
Sleep(8000)
GUIDelete($SPLASH)

While 1
    sleep(600000)
    $LINE1 = "Computer Name: " & @ComputerName
    $LINE2 = "IP Address: " & @IPAddress1
    $LINE3 = "Username: " & @UserName
    If IsAdmin() Then
        $LINE4 = "Computer Administrator"
    Else
        $LINE4 = "Power User"
    EndIf
    ControlSetText("Computer Information", "", "Static1", $LINE1 & @CR & $LINE2 & @CR & $LINE3 & @CR & $LINE4)
Wend

Func EXITNOW()
    Exit
EndFunc
The Hotkey I put in there so I wouldn't have to use the task bar to exit it... (guess I could have just removed the #NoTrayIcon for testing it :)

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

Link to comment
Share on other sites

  • Moderators

try this

#include <GuiConstants.au3>
GuiCreate("",400, 300, -1,-1, BitOr($WS_POPUP,$WS_DLGFRAME), $WS_EX_TOOLWINDOW)
GUISetBkColor(0xadd8e6);;; lightblue
GuiSetState()
While 1
    Sleep(1000)
WEnd
That was in the example I gave above pecloe :)

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

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...