Hi Alexandre,
seems like you rejected this patch. Is it too hack'ish? At a first glance it seems like it would be enough to figure out the IDropTarget belonging to the hwnd and call a DragOver on this interface. The problem is that the drop source (or the DoDragDrop function) might have to change the cursor.
Could you please give me a tip on how to do this the right way?
Index: dlls/shell32/shlview.c =================================================================== RCS file: /home/wine/wine/dlls/shell32/shlview.c,v retrieving revision 1.123 diff -u -p -r1.123 shlview.c --- dlls/shell32/shlview.c 2 Dec 2005 13:14:58 -0000 1.123 +++ dlls/shell32/shlview.c 2 Dec 2005 16:44:38 -0000 @@ -2190,6 +2190,8 @@ static ULONG WINAPI ISVDropTarget_Releas #define IDT_RIGHT 0x8u
VOID CALLBACK scroll_timer_proc(HWND hwnd, UINT uMsg, UINT_PTR idTimer, DWORD dwTimer) { + INPUT input; + switch (idTimer) { case IDT_UP: SendMessageW(hwnd, WM_VSCROLL, SB_LINEUP, 0); @@ -2204,6 +2206,14 @@ VOID CALLBACK scroll_timer_proc(HWND hwn SendMessageW(hwnd, WM_HSCROLL, SB_LINEDOWN, 0); break; } + + /* The cursor might now hover over a different item in the listview than + * prior to the scrolling. Send a dummy mouse event (with a (x=0, y=0) + * relative movement) to initiate the apropriate Drag & Drop calls. */ + ZeroMemory(&input, sizeof(input)); + input.type = INPUT_MOUSE; + input.u.mi.dwFlags = MOUSEEVENTF_MOVE; + SendInput(1, &input, sizeof(input)); }
/******************************************************************************
Bye,
Michael Jung mjung@iss.tu-darmstadt.de writes:
Hi Alexandre,
seems like you rejected this patch. Is it too hack'ish? At a first glance it seems like it would be enough to figure out the IDropTarget belonging to the hwnd and call a DragOver on this interface. The problem is that the drop source (or the DoDragDrop function) might have to change the cursor.
Could you please give me a tip on how to do this the right way?
I don't really know what the right way is, I just know that faking mouse messages probably isn't it <g>
Hi,
On Tuesday 06 December 2005 00:26, Alexandre Julliard wrote:
I don't really know what the right way is, I just know that faking mouse messages probably isn't it <g>
You were right (of course ;-) Attached is a small test application, which supports the bare minimum to get drag & drop running. It traces all calls to the IDropTarget interface to a listbox. As it turns out WinXP calls DragOver approx. every 200ms while the mouse hovers over a registered DropTarget window (This makes it really easy for drop-targets to implement drag-scrolling). In addition DragOver is called after one of the drag-modifier-keys (shift+ctrl) is pressed or released. Wine doesn't do neither yet.
Is there any sensible way to transform this into a unit test? Or do we have a repository for this kind of small test applications, which are hard to implement as unit-tests?
Bye,