tags:

views:

41

answers:

1

Windows 7 has the snapping feature which 'snaps' a window to the edges, and changes the one dimension of the window size to match the same dimension of the screen, and then choses another size for the other dimension.

I want to detect that it has happened so that in my WindowStyle.None window with custom chrome, I can implement the proper behavior for double clicking the titlebar.

The snapping does not alter the WindowState, so I cannot detect that it has happened. Since only one dimension of window is set to match the the screen, I can not distinquish between a snapped window and a user resized window. Does Win7 send out a specific message, or include a flag in the WM_xxxx messages when it causes a resize? Is the formula to the other dimension (not the one matching the screen) defined anywhere so that I can check if both dimensions match that of a snapped window?

+1  A: 

have you tried using spy++ to watch window messages to see what gets sent in what order? maybe there's an extra mesage in there that windows is using.

John Gardner
David B