Jump to content

Floating text


Lej
 Share

Recommended Posts

What I want is a label that looks like it's printed directly on the desktop. I thought I'd do it by creating a borderless GUI with a label with transparent background color that doesn't show up in the taskbar. Problem is I can't get it to work. Tried a lot of variations. Here's one:

#include <GUIConstants.au3>

HotKeySet("{ESC}", "_Exit")

Global $exit = False

;Create GUI + label here
$textWinHandle = GUICreate("textWin", 200, 100, 0, 0, $WS_POPUP, BitOR($WS_EX_TOOLWINDOW, $WS_EX_TOPMOST))
$textLabel = GUICtrlCreateLabel("TEST", 0, 0, 100, 50, $SS_CENTER, $WS_EX_TRANSPARENT)
GUICtrlSetBkColor(-1, $GUI_BKCOLOR_TRANSPARENT)
GUISetState()

While Not $exit
    Sleep(50)
WEnd

Exit

Func _Exit()
    WinClose($textWinHandle)
    $exit = True
EndFunc
Link to comment
Share on other sites

I guess I could use the CreateTextRegion. There's no way to get what I was trying to do to work? If there is it would be a lot easier to just call GUICtrlSetData() every time I want to change the text.

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