if I use a listview with an imagelist, its possible to drag an item all over the screen.
It is displayed 50% transparent and moves together with the mouse pointer.

I wonder how can I realize something similar without using an imagelist?
More specific: how to paint on the desktop screen without releasing WM_PAINTs to other programs windows?
Posted on 2002-04-18 12:58:51 by beaster
It doesn't sound good to me, but maybe it'll help you?

Make a window the size of the screen and fake it. :)

Okay, it's a lame idea. :tongue:
Posted on 2002-04-18 13:42:58 by bitRAKE
Actually I think you just do something like get the handle to the desktop and then draw directly to it using an XOR type. One to draw what you need and another in the same place to remove it. When I have need it I used PatBlt.

<create a bitmap here>
<select it into the hdc of the screen>
PatBlt(hdc, x1, y1, width, height, PATINVERT);
Posted on 2002-04-18 17:08:34 by Graebel
If you wanna do more fancy stuff than a blit allows you, you can
use the classic "sprite" method of saving original contents, drawing
your stuff, restoring original stuff on mousemove et cetera. There's
a bunch of code involved... setmousecapture, creation and management
of vairous bitmaps, et cetera. Dunno how much fun it would be coding :).

Probably creating a top-level window for your draggable item could
work out okay... you could trap WM_NCHITTEST to make the entire
window return "hell yeah I'm the caption" and thus make all of it
draggable... dunno the best way to go about this though.
Posted on 2002-04-18 17:21:36 by f0dder
thanks for the ideas, I'll try the PatBlt version.

The main reason why I want to make this on my own, is a problem with the ImageList.
I'm selecting a "CreateBitmap" bitmap into the imagelist and use it for ImageList_BeginDrag. Works fine for Win95, but a problem occurs for NT/2K under 16 bit and 8 bit color resolution.
Here the images have distorted colors (f.e. light blue instead of white). But if I blit the bitmap (which I put into the imagelist) directly to my window (without imagelist) everything looks ok.
So the problem cannot be inside the bitmap(handle) but it must be in the imagelist control. Using 8 bit palette images delivers complete distorted colors.

I also tried using a "CreateDIBitmap" and "CreateDIBSection" bitmaphandle instead of a "CreateBitmap"made, but these types dont show anything in the imagelist.
Posted on 2002-04-19 07:06:18 by beaster
Beaster: I've had the same problem when I used my pnglib to load images for an imagelist. However the problem was solved using a DDB instead of a DIB. LoadBitmap has always worked for me though (win2k as well). Have you tried using different color types when creating the image list?

Posted on 2002-04-19 10:48:08 by Thomas