Home » Category » Microsoft Visual C & C++

Microsoft Visual C & C++: docking windows

100| Tue, 18 Dec 2007 22:48:00 GMT| nathan87| Comments (6)
Does anyone know how to dock a window on the side of the screen?

Keywords & Tags: docking, windows microsoft, visual c++, vc

URL: http://www.7prog.com/visual-c-c++/95002/
 
«« Prev - Next »» 6 helpful answers below.

Which technology are you using? Win32 APIs, mfc, ..etc?

Thanks,
Ayman Shoukry
VC++ Team

aymanshoukry | Sat, 08 Sep 2007 18:09:00 GMT |

Visual Studio.net 2003 using mfc

nathan87 | Sat, 08 Sep 2007 18:10:00 GMT |

Here are some articles on the subject that might help you:

http://www.codeguru.com/Cpp/W-D/docking/

Tom

tomserface | Sat, 08 Sep 2007 18:11:00 GMT |

none of those examples show how to dock a window on the side of the screen. I want to dock the main window, not a child window. Does anyone know how to dock the main window on the side of the screen?

nathan87 | Sat, 08 Sep 2007 18:12:00 GMT |

In that case couldn't you just use MoveWindow() and snap it to the side of the screen? The left side starts at 0 and the right side can be retrieved using GetSystemMetrics(SM_CXSCREEN).

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/sysinfo/base/getsystemmetrics.asp

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/winui/winui/windowsuserinterface/windowing/windows/windowreference/windowfunctions/movewindow.asp

You could track the mouse cursor as your "window" is being dragged and if it gets close move it "Suddenly" over to the left or right. Or, you could just snap it one way or the other based on the direction it moves if you always want it docked (attached to left or right).

Sorry... I thought you were trying to build something like VS Studio with windows in windows.

Tom

tomserface | Sat, 08 Sep 2007 18:13:00 GMT |

THANKS! That helps a lot, but one more question: is there a way that I can get rid of the window frame?

nathan87 | Sat, 08 Sep 2007 18:14:00 GMT |

Microsoft Visual C & C++ Hot Answers

Microsoft Visual C & C++ New questions

Microsoft Visual C & C++ Related Categories