I'd like to use the GetClipboardOwner function to get the owner of a
drag drop operation. (as suggested in:
http://groups.google.com/groups?q=santoshamb%40yahoo.com&hl=en&lr=&scoring=d&selm=upIWACVwEHA.1984%40TK2MSFTNGP14.phx.gbl&rnum=1)

I'm able to make the function call and I get what appears to be a
valid window handle. What is strange is that the clipboard owner
seems to only be updated when I explictly do a file->copy or a ctrl-C
to copy something to the clipboard.

I was thinking that perhaps a drag-drop operation only changes the
clipboard owner while the operation is in progress, and then changes
the owner back. However, I've tried to catch the chage but I can't
detect it.

For example, say I do an explicit copy from window 66252. Now I want
to drag some text from window 0 to a textbox in a windows form. I
have the following code in my form:

private void textBox1_DragEnter(object sender,
System.Windows.Forms.DragEventArgs e) {
Console.WriteLine("Owner at beg dragenter: " +
GetClipboardOwner());
e.Effect = DragDropEffects.Copy;
Console.WriteLine("Owner at end dragenter: " +
GetClipboardOwner());
}

private void textBox1_DragOver(object sender,
System.Windows.Forms.DragEventArgs e) {
Console.WriteLine("Owner at dragover: " + GetClipboardOwner());
}

private void textBox1_DragDrop(object sender,
System.Windows.Forms.DragEventArgs e) {
Console.WriteLine("Owner at beg dradrop: " + GetClipboardOwner());
textBox1.Text = e.Data.GetData(DataFormats.Text).ToString();
Console.WriteLine("Owner at end dragdrop: " +
GetClipboardOwner());
}

the output of this is:
Owner at beg dragenter: 66252
Owner at end dragenter: 66252
Owner at dragover: 66252
.
.
.
Owner at dragover: 66252
Owner at beg dradrop: 66252
Owner at end dragdrop: 66252

I would hope at one point that the owner would be 0, but either the
owner is not getting updated, or I'm missing the update.

Does anybody know what's going on?

Thanks for the help,

Ben