Skip to content

Instantly share code, notes, and snippets.

@AfterLemon
Forked from anonymous/gist:6443058
Last active December 22, 2015 08:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save AfterLemon/6443104 to your computer and use it in GitHub Desktop.
Save AfterLemon/6443104 to your computer and use it in GitHub Desktop.
#SingleInstance force
; Example: On-screen display (OSD) via transparent window:
CustomColor = FF8080 ; The transparent background color of the window, set this to something close to your text colour to avoid white highlighting
Gui +LastFound +AlwaysOnTop -Caption +ToolWindow +E0x20 ; +ToolWindow avoids a taskbar button and an alt-tab menu item.
Gui, Color, %CustomColor%
Gui, Font, s50 ; Set a large font size (12-point).
errorTail := "hello"
Gui, Add, Text, x0 y-10 vMyText cRed , %errorTail% ; add it, colour is Red, R5 sets 5 rows
; choose one of these lines, first one show just the text, second one has a background for readability
WinSet, TransColor, %CustomColor% 200 ; Make all pixels of this color transparent and make the text itself translucent (250)
;Winset, Transparent, 150
SetTimer, UpdateOSD, 1000 ; 1 second timer set here
Gui, Show, x0 y0 NoActivate ; Set the x and y position. NoActivate avoids deactivating the currently active window.
return
UpdateOSD: ; the repeated timer routine
GuiControl,, MyText, %errorTail%
return
esc::
gui,destroy
exitapp
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment