Hi, Can anyone tell me how can I display an image next to the cursor like Vista (When dragging a file to folder it shows a "Copy to..." tooltip)?
A:
The short answer starts with:
Cursor myCursor = new Cursor("myCursor.cur");
The details are explained in this article: How To Use Custom Cursors
Doug L.
2009-06-17 12:09:17
The problem with this is that the center of my image will be point the screen instead of the Arrow head.
Mohammadreza
2009-06-17 12:20:59
A:
Look at the following article:
http://blogs.msdn.com/adamroot/archive/2008/02/15/shell-style-drag-and-drop-in-net-part-3.aspx
Update: You need to apply the following modifications in SwfDragSourceHelper.cs to enable WinXP support.
public static void AllowDropDescription(bool allow)
{
IDragSourceHelper2 sourceHelper = new DragDropHelper() as IDragSourceHelper2;
if (sourceHelper != null)
sourceHelper.SetFlags(allow ? 1 : 0);
}
arbiter
2009-06-20 20:42:54
Thanks for your link. Its exactly what I wanted. But one more question can I use APIs used in this article in Windows XP?
Mohammadreza
2009-06-25 09:12:28
Yes, with some small modifications. In general you need to disable IDragSourceHelper2 support, and use IDragSourceHelper instead. Of course all logic related to drag descriptions are also not needed in XP. I have updated my answer.
arbiter
2009-06-25 09:54:11