Dragging an Item to a Minimized Window on the Taskbar

[C# WinForms Application in VS2005 running on Windows Server 2003.]

Typical Windows functionality:  If you have multiple windows open and minimized to the Taskbar, dragging an item from a visible window to another window on the Taskbar will maximize the target window.  For example:

  1. Open Outlook, then create a new email message.
  2. You now have two windows open: Outlook and your email message.
  3. Minimize the email message.
  4. On the Outlook window, drag the Inbox down to the taskbar over the email message.
  5. The email message will become maximized (or restored).

I have an application that uses node like Outlook, but in my application this will not work.  Moving the icon above the minimized window does nothing. 

However, let's say both windows are maximized and visible in the Taskbar.  Dragging something from the window window in front down to the other window (which is hidden behind the first window) in the taskbar will cause the target window to appear (move to the front).  That ain't good enough.

How can I get my window from minimized to maximized



Answer this question

Dragging an Item to a Minimized Window on the Taskbar

  • jaimlin

    That's great advice. Thanks for your effort, even if we didn't get it working. I posted it to Microsoft as a potential bug here.
  • Nuno_Salvado

    The latter part of your message ('That ain't good enough') is confusing, why wouldn't you want the target window to come to the front so you can drop

    I experimented a bit, calling DoDragDrop(), then dragging over the taskbar button does work, but only if the window belongs to another process. If the window belongs to the same application that started the drag, I just hear a 'ding'.


  • Sandra2006

    I meant that it isn't enough to bring an already maximized window to the front. I also need to be able to maximize a window that is completely minimized.

    Your comment makes total sense, as I'm dragging a node from one instance of a form over to another instance of the same form within the same application. Is there any way around that


  • l Bllizzd l

    I poked at this for a while, the shell appears to be doing the right thing. It sends the WM_SYSCOMMAND, SC_RESTORE message to ask the window to restore itself. For some mysterious reason, the Windows Forms message handler doesn't oblige. It doesn't even pass the message on to the WndProc() method nor the PreProcessMsg() method.

    I have no clue why without digging hard into disassembled .NET code. It looks like a bug to me, you might want to report it at Product Feedback. Then again, it might be by design for some mysterious reason...


  • Dragging an Item to a Minimized Window on the Taskbar