Draggable Windowless Application

1 posts, 0 answers
  1. koray
    koray avatar
    12 posts
    Member since:
    Jul 2012

    Posted 23 Aug 2010 Link to this post

    Well, my question is not related with the radwindow but I hope you guys can help :)

    I have a windowless WPF application and I want it to be draggable by the users.

    I can make it dragglabe by returning HTCAPTION in the WM_NCHITTEST message like this:

    protected override void OnSourceInitialized(EventArgs e)
            HwndSource hwndSource = (HwndSource)HwndSource.FromVisual(this);
    private static IntPtr WndProcHook(IntPtr hwnd, int msg, IntPtr wParam, IntPtr lParam, ref bool handeled)
            if (msg == 0x0084) // WM_NCHITTEST
                handeled = true;
                return (IntPtr)2; // HTCAPTION
            return IntPtr.Zero;

    But then, the click event of the buttons inside the application doesn't work...


    When I add "DragMove" to the "MouseLeftButtonDown":

    this.MouseLeftButtonDown += delegate { DragMove(); };

    Then the problem is, if I click one of the buttons, I get an InvalidOperationException.

    User interface :)

    Does anyone have something in mind for this?
Back to Top