Advanced C++ Tutorials - Drawing to Desktop?

Would anybody know where I could find advanced C++ tutorials (or documentation)? I already know about functions, templates, OOP, etc. But where do I go from there? I specifically want to learn how to draw directly to the desktop screen (so I could, for example, draw a picture on top of an icon, or a glowing effect around a desktop icon). I'd like it if the tutorials/documentation were for Linux, Windows, or both.
[425 byte] By [bfr] at [2007-11-20 11:05:56]
# 1 Re: Advanced C++ Tutorials - Drawing to Desktop?
I specifically want to learn how to draw directly to the desktop screen (so I could, for example, draw a picture on top of an icon, or a glowing effect around a desktop icon). I'd like it if the tutorials/documentation were for Linux, Windows, or both.The C++ language knows nothing about "drawing on desktops". That is a function of the operating system you are running and is OS dependent.

The way you do this for Windows is totally different than the way you do this for Linux, and again, this is not a C++ language issue. You can get libraries that aid you in drawing icons, etc. for the various operating systems like WxWidgets, Qt, etc.

Regards,

Paul McKenzie
Paul McKenzie at 2007-11-9 1:25:00 >
# 2 Re: Advanced C++ Tutorials - Drawing to Desktop?
I'd also suggest you put your mind on the basics of the operating system first, rather than the less common (might I even suggest non-standard) notion of drawing on the desktop.

Besides, icons are drawn BY the desktop, so you have very little hope of decorating a desktop icon the way you're thinking. You'd have to write a desktop yourself (like Beryl for Linux), and handle the effects that way.

I'm not even sure we can locate an icon on the desktop in order to be able to decorate it. It would be like locating a graphic decoration on the main window of some application and trying to alter it's appearance by using a handle to it's window. The desktop itself is, essentially, an application.

What you CAN do by directly drawing on the desktop, as an example, is provide animations on it - but they'll likely obscure material the user wants to see on the desktop unless you're careful. Under Windows you can look up the "GetDesktopWindow", to get a handle to the window representing it, and go about painting what you like. You will find, however, the results aren't actually all that desirable (which is why you don't see much of that).

I don't recall the Linux equivalent of that.

However, the more general direction of your question is where to go next. Are you familiar with any frameworks? MFC, WTL, wxWidgets?

How about threads?

You said you know templates, how about the STL?

Smart pointers (I personally wouldn't want to go on without them, I'd probably be more open to C#).

These are too diverse to point you toward a single text (or two). You have to chart some kind of direction for yourself. Windows GUI applications in C++ generally mean using a framework, and I personally like wxWidgets (now that I'm accustomed to it), though QT gets quite a bit of press.

wxWidgets lets you create applications, from one body of code (mostly) that compile on Linux, Windows and MAC. If you're not motivated to consider Java or C#, I'd highly recommend either (and I'd lean toward wxWidgets because it's free), because I personally value portability (OS and language independence - that's user language, French, Spanish, German, Russian, etc.).

Once you can manage GUI applications, you may want to consider audio, 3D animation, video, image processing, signal processing, or some other cross disciplinary subject like astronomy or chemical modeling.

Trust me, though - the idea of wanting to decorate desktop icons is a hunt for nothing substantial (or all that advanced) - it probably won't even work in the various versions of Windows (or at least not in the same way). I might even go so far as to say I wouldn't want an application on my computer that does it much (flashy introductory graphics aside).
JVene at 2007-11-9 1:26:05 >
# 3 Re: Advanced C++ Tutorials - Drawing to Desktop?
OK, thanks. :)

I am kind of familiar with Qt and wxWidgets (mostly Qt), and have made a few simple applications with it. I've also messed around with SDL for keyboard input and drawing images, and things such as SDL_Mixer and SDL_ttf to manipulate audio and use true type fonts. I haven't done much 3-D stuff and video, and I don't even know what signal processing is.

What you CAN do by directly drawing on the desktop, as an example, is provide animations on it - but they'll likely obscure material the user wants to see on the desktop unless you're careful. Under Windows you can look up the "GetDesktopWindow", to get a handle to the window representing it, and go about painting what you like. You will find, however, the results aren't actually all that desirable (which is why you don't see much of that).

I've been told somewhere else recently that there is a library called "Xlib" that can do this (draw things directly on the desktop)...? From what I've read, it seems to only be for Linux though, but still, if it actually can draw directly to the desktop, I might use that. I'll probably not end up decorating icons (not yet, anyway ;)) but maybe just try drawing lines and images and stuff.
bfr at 2007-11-9 1:27:12 >
# 4 Re: Advanced C++ Tutorials - Drawing to Desktop?
but maybe just try drawing lines and images and stuff.

Yes, that you can do easily simply by getting a handle to the desktop window, creating a DC using that, and drawing.

Signal processing is used, as a couple of examples, to filter audio for frequency control, to process images by treating the image information as a signal, which itself is thought of as a wave plotted over time.
JVene at 2007-11-9 1:28:06 >