Solved

How to place a form or canvas behind the win icons?

Posted on 2001-09-05
13
518 Views
Last Modified: 2010-08-05
Hi,

I'm quite desperatly seeking a way to draw on the desktop while the win icons (and other apps) remain the same.

If you'd like to see an example please take a look at: http://www.geisswerks.com/drempels/ (desktop mode) which is an excellent tiny tool, btw. So as you see I'm not talking about a static wallpaper, rather a dynamic one ;)

I have tried to use sendtoback(); with my app but that simply puts the Tform behind all others. The windows icons are still further behind, the desktop even more.

I'd like to have my form behind the icons and in front of the desktop :)

Any ideas?

Thanks, triton
0
Comment
Question by:triton090898
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
13 Comments
 
LVL 20

Expert Comment

by:Madshi
ID: 6457090
I think you have to subclass the desktop listview control by calling SetWindowLong(desktopListViewHandle, GWL_WNDPROC). Unfortunately this works only if you're inside of the explorer process. To achieve that, you need to put your stuff into a little dll and make sure that the dll is loaded into the explorer. You can misuse SetWindowsHookEx by creating a dummy message hook to do that.

Regards, Madshi.
0
 
LVL 6

Expert Comment

by:edey
ID: 6457121
Better yet, use the features of the active desktop & write it in html instead.

GL
Mike
0
 
LVL 3

Expert Comment

by:Slavak
ID: 6457148
listening
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 3

Expert Comment

by:MarcG
ID: 6457200
maybe you don't need to draw _behind_ the desktop ... you could do something like fake that you are drawing behind the desktop icons with making a screenshot of the current desktop and set all exept the icons to transparent, this transparent picture of the desktop you paint above the canvas you are painting on and it will look like if you are painting behind the icons.
to get a transparent image of the desktop you could replace the wallpaper with just a single color (one that is not very often used in icons would be best) than take the screenshot and set the background color to transparent. Before doing that remember what the wallpaper was before so you can restore it.
Now all should be ready for your drawing ...


this is just a brain experiment, I never did something like this, I was just thinking of a way how this could be achieved.
0
 
LVL 3

Expert Comment

by:rondi
ID: 6457272
Madshi,

Please elaborate on the use of SetWindowsHookEx to trick
Explorer into loading me into memory

rondi.
0
 
LVL 20

Expert Comment

by:Madshi
ID: 6457530
If you can use Mike's solution (ActiveDesktop), it's surely the better way, because it's clean and documented.

About SetWindowsHookEx:
(1) Get the desktop list view handle ("wnd := FindWindowEx(FindWindowEx(windows.FindWindow('Progman', 'Program Manager'), 0, 'SHELLDLL_DefView',''), 0, 'SysListView32', '');").
(2) Call GetWindowThreadProcessID to get the threadID to which the desktop list view belongs.
(3) Call SetWindowsHookEx(WH_GETMESSAGE, @DummyHookProc, YourDllHandle, ThreadIDFromStep2) to install a dummy message hook. The "DummyHookProc" callback function must be located in a little dll.
(4) Now call PostMessage(desktopListViewHandle, WM_NULL, 0, 0). As a result Windows will load your dll into the context of the thread which owns the desktop list view and calls your message callback function there.
(5) Now in the dll you can subclass the desktop list view.

Regards, Madshi.

P.S: There's also an easier method of injecting a dll into a different process without needing this nasty SetWindowsHookEx hack. It's documented here (see the very bottom of the page):

http://help.madshi.net/Data/DllInjecting.htm#InjectLibrary

The packages described there are free for non-commercial usage.
0
 
LVL 10

Expert Comment

by:Jacco
ID: 6457892
listening
0
 
LVL 9

Expert Comment

by:ginsonic
ID: 6459500
listening
0
 

Author Comment

by:triton090898
ID: 6459941
Uhmmm,

thanks folks. But I think we've got a prob here ;)
Houston? :)))

I won't be able to hook my code onto another process. And I won't be able to snapshot the icons to pretend they're still there.

Just take a look at the page http://www.geisswerks.com/drempels/ and you'll see.
If you install that 500kb boy ;) simply tell it to use 'desktop mode'. It'll blow you away. W9x & W2k.

With that tiny tool you have a full screensaver running on your pc all the time, but you can still use the entire icon, window and startmenu functionality, because they're still visible. Once again: everything is still usable.

So there must be a way to render/draw on the desktop object. ActiveX has nothing to do with it, it actually has to be deactivated for this.

Any more ideas?

triton ;)
0
 

Author Comment

by:triton090898
ID: 6459952
**** ;)

Of course ActiveDesktop has to be deactivated, not ActiveX :)))

;) triton
0
 
LVL 20

Accepted Solution

by:
Madshi earned 200 total points
ID: 6460057
Hello, here is Houston.

Drempels uses an alternative method: It changes the background image of the desktop to none and the background color to pink, which is the default video overlay color. Then it uses video overlay functionality to draw. The effect is that Drempels not only draws on the desktop background, but only on every other pixel on the screen, which is pink. If you open a jpeg foto in Photoshop, and there are pink pixels in it, these pixels will also be overdrawn by Drempels. Furthermore not every graphics card (but almost every) supports video overlay. I don't know how to do video overlay programming, if you want to go this way, I'm out of this question...

Regards, Madshi.
0
 

Author Comment

by:triton090898
ID: 6463366
Hi Madshi,

that was what I wanted to hear. I have two friends, one doing www.openuniverse.org, another doing www.shatters.net/celestia (you'll love it).

I hope you don't mind if we contact you in case we have a few further questions you can answer?

Thanks in Advance, triton ;)
0
 
LVL 20

Expert Comment

by:Madshi
ID: 6463724
Thanx for the points...

If the further questions belong to this thread, please ask them directly here, so the others can participate. Otherwise please post a new question in Experts-Exchange. I'm always looking for new questions in EE. You can post a link to your new question(s) here, just to be sure that I don't miss the new questions(s).

Regards, Madshi.
0

Featured Post

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The uses clause is one of those things that just tends to grow and grow. Most of the time this is in the main form, as it's from this form that all others are called. If you have a big application (including many forms), the uses clause in the in…
Have you ever had your Delphi form/application just hanging while waiting for data to load? This is the article to read if you want to learn some things about adding threads for data loading in the background. First, I'll setup a general applica…
Monitoring a network: how to monitor network services and why? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the philosophy behind service monitoring and why a handshake validation is critical in network monitoring. Software utilized …
This tutorial will teach you the special effect of super speed similar to the fictional character Wally West aka "The Flash" After Shake : http://www.videocopilot.net/presets/after_shake/ All lightning effects with instructions : http://www.mediaf…
Suggested Courses
Course of the Month5 days, 13 hours left to enroll

627 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question