Dynamic text printed on the desktop using Delphi?
Asked Answered
H

2

0

I have seen on our cloud servers, there is some text printed on the desktop dynamically, showing how much memory is available, hard drive space, etc. This is not like a window or gadget or anything, but somehow it's painted directly on the desktop. How can I accomplish this? I've seen only text, but it would be nice if I can draw graphics on the desktop as well.

Here's a sample of what I mean: Sample of drawing text on the desktop


EDIT:

Due to someone's misunderstanding of what I was asking, allow me to clarify:

I do not necessarily need to do exactly what this existing tool does. In fact, I am not wanting to print system information at all. I want to print my own information to look the same way, but it does not matter what approach I use to accomplish this (whether using a window, saving a desktop image, drawing to the desktop's canvas, any of those are possible answers). I only want to make something to have a similar end result.

Halloo answered 1/12, 2011 at 23:24 Comment(5)
It probably is a window.Longhorn
Layered window is a good way to do thisBromide
That's what I'm thinking - how to make sure it stays in the background though and doesn't cover any other windows? Making a timer that keeps calling SendToBack isn't a good approach, is there something like fsStayOnTop except for staying on the bottom instead?Halloo
put it to the bottom. Make it WS_EX_TRANSPARENT so it is click through. Then it stays on bottom. Google layered windows and read the msdn article that gives details.Bromide
already reading up on it, thanksHalloo
P
3

There's a very good chance it's not actually painted dynamically, but is instead using something like BGInfo:

http://technet.microsoft.com/en-us/sysinternals/bb897557

This is a utility that runs at startup (and can be set to re-run periodically), and creates an image that's then used as the desktop background.

Pierrepierrepont answered 1/12, 2011 at 23:28 Comment(1)
That looks like yes, it's exactly what I am seeing, except I'd like to do something very similar for something far different. I don't necessarily want to print system information, but other information about my own custom software. It should run in the background and update this dynamically. According to that link, this information is painted upon login and doesn't update automatically, but I was hoping I could change this information as needed.Halloo
H
1

You could have a look here and draw directly on the desktop using the built-in TCanvas type. It's probably less optimal than using a transparent window, but I think it's worth looking at. I just tested it and it works well under Windows 7.

Hippocampus answered 2/12, 2011 at 14:25 Comment(1)
Thanks Pateman, yes it works, but this method draws over everything. I'd like to only have this in the background.Halloo

© 2022 - 2024 — McMap. All rights reserved.