I have a simple question. How can I access aero snap programmatically from my C# code. Like, if I click a button “Snap Left”, I want my program window to snap to the left, just like when its drug over there manually. I looked all over SO, but all the questions seem to be about aero snap not working with a form, and keeping it from snapping a form. Not programmatically snapping a form. I’m happy to use interloping. Thanks
Share
What you can do, assuming you are on Windows 7, is to send the AreoSnap Keypress to the currently active window.
This codeproject has a very nice article on doing just that.
Also check out this SO question.
It seems that one way to do this is use
sendmessagein User32.dll.Here is an example of this, assuming “notepad” is the program you want to send the keystroke to: