Answered by:
docking windows

Question
-
Does anyone know how to dock a window on the side of the screen?Wednesday, February 15, 2006 7:53 PM
Answers
-
Here are some articles on the subject that might help you:
http://www.codeguru.com/Cpp/W-D/docking/
Tom
Thursday, February 16, 2006 12:27 AM -
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
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
Thursday, February 16, 2006 4:39 PM
All replies
-
Which technology are you using? Win32 APIs, mfc, ..etc?
Thanks, Ayman Shoukry VC++ TeamWednesday, February 15, 2006 8:17 PM -
Visual Studio.net 2003 using mfcWednesday, February 15, 2006 11:45 PM
-
Here are some articles on the subject that might help you:
http://www.codeguru.com/Cpp/W-D/docking/
Tom
Thursday, February 16, 2006 12:27 AM -
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?Thursday, February 16, 2006 4:33 PM
-
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
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
Thursday, February 16, 2006 4:39 PM -
THANKS! That helps a lot, but one more question: is there a way that I can get rid of the window frame?Thursday, February 16, 2006 10:03 PM
-
http://msdn.microsoft.com/en-us/library/z0awcsf4(VS.80).aspx
Also, you must create your dialog class and then change its inheritance to CDialogBar. Make sure you go through the source and change references to CDialog:: to CDialogBar. Also I think there's some members it doesn't have. You can clear that up as you see the compile errors.
- Proposed as answer by Junrei Wednesday, July 2, 2008 8:33 PM
Wednesday, July 2, 2008 8:33 PM