Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. Detect the end of a window drag in WPF and WindowChrome

Detect the end of a window drag in WPF and WindowChrome

Scheduled Pinned Locked Moved C#
questioncsharpwpflearning
1 Posts 1 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • L Offline
    L Offline
    Leif Simon Goodwin
    wrote on last edited by
    #1

    I have a main application window and a floating WPF window. The user can drag the floating window over the main window in order that it docks. I need to detect the end of the drag operation. How do I do this? I am using Window Chrome to allow me to insert a drop down menu into the floating window's title bar. The usual way to detect a drag end is to wait for the WM_WINDOWPOSCHANGED message. Unfortunately Window Chrome seems to prevent this being sent. (It is sometimes sent, but not always.) I can enable hit tests for the window but that disables drag operations. Of course I can detect the LocationChanged event, but that is sent during a drag and not at the end. I could start a background thread on the first LocationChanged event to monitor when the mouse left button is not pressed (via a user32 call). I have tested this and it works, but it seems a bit clunky. I have hooked into the window's message loop but there is nothing that is of use. WindowChrome seems to filter out many messages especially in the non client area, and messages for the mouse key down and up are not sent.

    1 Reply Last reply
    0
    Reply
    • Reply as topic
    Log in to reply
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes


    • Login

    • Don't have an account? Register

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • World
    • Users
    • Groups