I have a Dialog based MFC application that calls up another dialog. My main
dialog is CWinstsDlg which brings up dlgSTSCalc which is of CCalcSTSDlg.
Would I use dlgSTSCalc.SetWindowPos() prior to dlgSTSCalc.DoModal(); to
position the "sub-dialog"? If so, I do not understand the parameters:
BOOL SetWindowPos(
HWND hWnd, // handle to window
HWND hWndInsertAfter, // placement-order handle
int X, // horizontal position
int Y, // vertical position
int cx, // width
int cy, // height
UINT uFlags // window-positioning options
);
Now, the X and Y seem pretty self explanatory, but what is HWND hWnd? How
do I know what value to place here? What is HWND hWndInsertAfter and how do
I know what to place there as well? Exactly what is a window handle?
--
carter
You cannot use either version of SetWindowPos before a modal dialog's
DoModal because the dialog does not exist. You will need to set the position
of the dialog from within the dialog. Probably it will work to use
MoveWindow instead of SetWindowPos, and that will be much easier. You will
need to do that in the dialog's OnInitDialog. It is probably best to put the
MoveWindow at the end of the OnInitDialog.
To learn about hings like window handles, you need to get a good bock about
Windows programming.
"carter" <car...@aodinc.com> wrote in message
news:#RlI7Hd2AHA.1228@tkmsftngp02...
--
carter
"Sam Hobbs" <sam...@socal.rr.com> wrote in message
news:uNWI#Sd2AHA.2204@tkmsftngp02...
To convert screen coordinates to client coordinates use ScreenToClient.
"carter" <car...@aodinc.com> wrote in message
news:#uucqjd2AHA.964@tkmsftngp03...