I'm sorry, but I am not going to do your homework for you. It does you no good if I do it because it doesn't teach you how to solve a problem, it merely shows that somebody with over 30 years experience knows how to solve it. That's not going to help you get a job, is it?
*pre-emptive celebratory nipple tassle jiggle* - Sean Ewington
That's not easy. Of course you could read every window position via COM but I think before I start to explain, you should try to snap you Window to the screen edges.
If I would explain, I could write the complete code and that would take some time for me. This ain't a question to be answered here with some tips.
Take a look at the Windows COM-Model (system32.dll and so on) there is everything you need, but you have it to workout on your own, if there are no examples in google.
I would say yes. These are the parts that cover this IMO:
(C) If you distribute any portion of the software, you must retain all copyright, patent, trademark, and attribution notices that are present in the software.
(D) If you distribute any portion of the software in source code form, you may do so only under this license by including a complete copy of this license with your distribution. If you distribute any portion of the software in compiled or object code form, you may only do so under a license that complies with this license.
So, in your licence, you must state that at least some parts are subject to Microsoft Public License (MS-PL), even if you don't want that licence yourself. If it's commercial, get the company lawyers to check it!