MoveWindow()
-
I want to change the position and size of a window. In the constructor of the Doc window of a VC++ SDI I have the following code. (I'd also like to do this in any window I make.)
CSDITESTfDoc::CSDITESTfDoc() { MoveWindow(5,5,500,500,TRUE); }
The compiler says MoveWindow does not take 5 paramaters. The format of the command is: void MoveWindow(int x, int y, int nWidth, int nHeght, BOOL bRepaint = TRUE) Where am I going wrong? Thanks. -
I want to change the position and size of a window. In the constructor of the Doc window of a VC++ SDI I have the following code. (I'd also like to do this in any window I make.)
CSDITESTfDoc::CSDITESTfDoc() { MoveWindow(5,5,500,500,TRUE); }
The compiler says MoveWindow does not take 5 paramaters. The format of the command is: void MoveWindow(int x, int y, int nWidth, int nHeght, BOOL bRepaint = TRUE) Where am I going wrong? Thanks.Your doc class does not derive from CWnd so the system will try to use the MoveWindow from the Win32 API... BOOL MoveWindow( HWND hWnd, // handle to window int X, // horizontal position int Y, // vertical position int nWidth, // width int nHeight, // height BOOL bRepaint // repaint flag ); Your view class does derive from CWnd so try that tactic but from within the view class or use a reference or pointer to a view object.
-
I want to change the position and size of a window. In the constructor of the Doc window of a VC++ SDI I have the following code. (I'd also like to do this in any window I make.)
CSDITESTfDoc::CSDITESTfDoc() { MoveWindow(5,5,500,500,TRUE); }
The compiler says MoveWindow does not take 5 paramaters. The format of the command is: void MoveWindow(int x, int y, int nWidth, int nHeght, BOOL bRepaint = TRUE) Where am I going wrong? Thanks.First parameter is handle to a window(HWND).
-
I want to change the position and size of a window. In the constructor of the Doc window of a VC++ SDI I have the following code. (I'd also like to do this in any window I make.)
CSDITESTfDoc::CSDITESTfDoc() { MoveWindow(5,5,500,500,TRUE); }
The compiler says MoveWindow does not take 5 paramaters. The format of the command is: void MoveWindow(int x, int y, int nWidth, int nHeght, BOOL bRepaint = TRUE) Where am I going wrong? Thanks.Move your window from the main frame, not the document.
"Normal is getting dressed in clothes that you buy for work and driving through traffic in a car that you are still paying for, in order to get to the job you need to pay for the clothes and the car and the house you leave vacant all day so you can afford to live in it." - Ellen Goodman
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne