Can I subscribe to window-docking events in windows 7 from C#
I am wondering if it is possible to create an application that could receive a notification when any other application/window is docked with the new windows 7 docking feature (f.ex. Winkey + left arrow)
The purpose of my application would be to set up custom rules for certain windows. So for example if I am using Chrome and I press the Win+LEFT keys, then my application would receive a notification, and would be able to say that the window should not resize to 50% of the screen, but should use 70%.
I am not very familiar with writing windows applications (m开发者_如何学JAVAostly do web), so any pointers at how this might be achieved are very welcome.
Thanks.
Given the Win+Left/Right combinations work with applications that pre-date Windows 7 I strongly suspect it is just a combination of WM_SIZE and WM_MOVE messages with coordinates worked out by the shell, and there is nothing to directly distinguish such a resize from any other within the application.
Use Spy++ from the SDK to prove this.
You could apply heuristics based on the screen size to detect these events.
精彩评论