Win8 DragItem hangs application

On Win8 if you drag an item such as a textfield outside the application windows the application will hangs and you need to end task it. I have opened case 32750 on the issue but wondering if anyone here has ideas for a workaround to prevent the hang while still allowing the user to drag an item between multiple xojo application windows.

I’ve tossed a quick dummy project here that can be used as example to drag the textfield outside the application window and see the hang.


The problem is not limited to the applications. It impacts the IDE as well : drag a window over the desktop, and Xojo hangs the same way. I have reported the problem back in January #31361. It seems to be deep within Windows 8. In your test project, the application hung while I was dragging the text between windows when the cursor went over the desktop, but still, the cursor changed over the second window, while the app was hung. In the task manager, the hung application takes over 30% CPU. Shows some deep trouble…

On my machine, the drag square remains after shutting down the app that was hung, showing that the problem is with Windows.

The only workaround I can think of is not to use the built in drag system. Instead,

  • Upon mouseDown in the TextField, change the cursor to a “drag” custom cursor, or maybe simply open hand,
  • Upon mouseUp in Window2 manage the text drop and change the cursor back to standard.

Here is a quick project that implements the workaround : here

Didn’t find your ticket when researching initially but certainly appears to be the same issue! I get the drag squares all over the screen when tinkering with it as well so you are not alone. Appreciate the sample, I’ve downloaded and will take a glance after the little one goes to bed. Guess I was just too focused on the built in to consider bypassing. With all the stuff I already manually handle for drag/drop sounds like this could be perfect fit and very quick to implement.

Thank-you for taking the time to create the sample project!

I just realize the project simply copies the data internally within the app. But I believe you may use the sendkey fonction posted at to paste to other apps.

Also, for the dragitem workaround, you can replace the cursor by a custom image with the drag square using Jeff Tullin method I posted at and the neat thing is that while you keep the button pressed, that custom cursor will work out of the application windows, over the desktop.