-
July 10th, 2013, 12:52 AM
#1
Positioning of window on Desktop
Hi All
I have a CFormView derived window which I would like to position at run time.
In particular when the user clicks a button I would like to shfit the CFormView window and open up a new Dialog window so that the two do not overlap.
I have created the CFormView window and the dialog window- can someone please tell me how to shfit the CFormView window?
I shift the Dialog window as follows in OnInitDialog:
SetWindowPos(NULL, 0, 0, 0, 0, SWP_NOSIZE | SWP_NOZORDER);
Thank you in advance.
AAEL
-
July 10th, 2013, 03:03 AM
#2
Re: Positioning of window on Desktop
Well, CFormView derived window is (like any other view) a child of a frame window (either mainframe or childframe)
You could also let more than one view share a frame window, as in the case of a splitter window. Perhaps, splitter is what you need?
Or what? Is your app an SDI or MDI?
Victor Nijegorodov
-
July 10th, 2013, 03:44 AM
#3
Re: Positioning of window on Desktop
The application is an SDI.
All I would like to do is to have the two windows (the SDI CFormView window and the CDialog window) appear so that they do not overlap.
Thank you
Originally Posted by VictorN
Well, CFormView derived window is (like any other view) a child of a frame window (either mainframe or childframe)
You could also let more than one view share a frame window, as in the case of a splitter window. Perhaps, splitter is what you need?
Or what? Is your app an SDI or MDI?
-
July 10th, 2013, 03:53 AM
#4
Re: Positioning of window on Desktop
Then get the position of the view, then set the dialog position to be outside the view rect!
Victor Nijegorodov
-
July 10th, 2013, 02:20 PM
#5
Re: Positioning of window on Desktop
How would I get the position of the view? What is the VC++ command to get the position of the view?
Thank you
-
July 10th, 2013, 02:36 PM
#6
Re: Positioning of window on Desktop
-
July 10th, 2013, 03:10 PM
#7
Re: Positioning of window on Desktop
The first parameter of GetWindowRect is HWND hWnd. How do I get the hWnd for my CFormView?
Thank you
-
July 10th, 2013, 03:14 PM
#8
Re: Positioning of window on Desktop
Originally Posted by aael
The first parameter of GetWindowRect is HWND hWnd. How do I get the hWnd for my CFormView?
Thank you
Try this one.
http://msdn.microsoft.com/en-us/libr.../f3ef9c0s.aspx
It's better to learn to use MSDN for basic stuff like this rather than using the forum in place of documentation.
-
July 10th, 2013, 03:16 PM
#9
Re: Positioning of window on Desktop
Thank you.
I managed to get the dimensions of the window.
Please can you tell me how to shift the CFormView window?
-
July 10th, 2013, 03:19 PM
#10
Re: Positioning of window on Desktop
Originally Posted by aael
Thank you.
I managed to get the dimensions of the window.
Please can you tell me how to shift the CFormView window?
Don't move the view, move the frame.
-
July 12th, 2013, 09:47 AM
#11
Re: Positioning of window on Desktop
Originally Posted by GCDEF
Don't move the view, move the frame.
Don't move the frame either - just position your new dialog do it doesn't overlap your view.
I would be upset if I clicked the button on a form and that form got moved
Vlad - MS MVP [2007 - 2012] - www.FeinSoftware.com
Convenience and productivity tools for Microsoft Visual Studio:
FeinWindows - replacement windows manager for Visual Studio, and more...
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|