tags:

views:

107

answers:

3

Using .NET (if I have to use pInvoke or managed C++, that's fine too), I am trying to create a window that sort of docks or snaps to the right hand side of the desktop (like a rectangular strip like the gadget area but a real window).

Secondly I want a pushpin-like thing that lets the window slide in and out (like the Windows in VS do) but on the desktop.

Any pointers on how to get started? How complex is this problem?

A: 

At a very high level, all you'll need to do is manipulate the location and width of the window.

For docking: When someone starts dragging the window, if Location.X gets close to zero, set it to zero and stop the dragging.

For pushpin, when they click on the button to open or close the window, manipulate the Width of the window.

Moose
A: 

Refer to this question here: http://stackoverflow.com/questions/589268/how-to-make-my-windows-form-app-snap-to-screen-edges

As for the pushpin, should be straight forward to put a button in one of the corners which appears in the case that the window is snapped to the edges.

The sliding can be achieved by listening to the mouser over, mouse out events. Start a timer and animate the window.

Not too hard at all :)

Naren
A: 

just found this http://msdn.microsoft.com/en-us/library/bb776821.aspx looks like a lot more work but probably the right way to go for the effect I want thanks everyone

Rahul