Launch the WinForm Aerosnaped Right Aligned Application

This should be a simple question, but search-foo failed. My goal is to discover that I am running under Aero (Vista or Windows 7) and have my default Aerosnap application. (It turns out that the corporate application that I wrote is launched by almost all the aero zones on the right, and their Outlook is closed on the left.)

WinForms application and I'm doing it now

Width = Screen.PrimaryScreen.WorkingArea.Size.Width / 2;
Height = Screen.PrimaryScreen.WorkingArea.Size.Height;
Top = Screen.PrimaryScreen.WorkingArea.Top;
Left = Screen.PrimaryScreen.WorkingArea.Left + 
       Screen.PrimaryScreen.WorkingArea.Size.Width / 2;

in my form loading event. This works great, except that if they use WindowKey + Arrow, it acts as if it were just a regular local form. This means that WindowKey + Right does nothing the first time it is clicked, and WindowKey + Left does nothing. This is not a serious problem, but I would prefer to specify the size of the window, and then bind the application to the right, so that these keys act the same as with any other application.

I'm not sure if this is possible, here is what I found:

They seem to indicate that there is no special AeroSnap message. Does anyone know otherwise?

+5
source share

All Articles