Layered windows and COM drag image
I have a program that displays a main window, a layered window and implements COM drag and drop. In general terms:
- I create a normal top level window.
- I create a layered window using WS_EX_LAYERED and UpdateLayeredWindow/SetLayeredWindowAttributes (I've tried both). The layered window sits on top of the window created in 1. The layered window is not a child window.
- I then begin a drag and drop via the COM DoDragDrop function. In IDropSource::QueryContinueDrag I call ImageList_BeginDrag, ImageList_DragMove and so on.
The problem is, the drag image that COM is showing (it's an image in the image list) is displayed underneath the layered window instead of on top of it. The cursor is displayed on top of the layered window (as expected). From bottom to top, the layering I am getting is:
- Main window (bottom)
- COM drag image
- Layered window
- Cursor (top)
What it should be is:
- Main window (bottom)
- Layered window
- COM drag image
- Cursor (top)
I have already applied KB943326 "Overlapping layered windows are not displayed in the correct order in Windows Server 2003 or in Wind开发者_JAVA技巧ows XP" ("http://support.microsoft.com/kb/943326"), but it made no difference.
I am running XP SP2.
Any suggestions appreciated as I have run out of ideas...
Thanks, Su Green
精彩评论