I have a window like above.
Its a dialog and is called by doing
classname dlg(inValue);
dlg.DoModal();
when inValue is 1 I need to move label 3 and the text box to where label 2 is and the buttons up and make the screen smaller.
In order to this, I am writing code in the
OnInitDialog() event handler.
The problem I having is that I am using SetWindowPos and have ZERO idea of what to pass it.
From the image above, the label2 is at 67, 74 and is sized 24 x 8.
Since I want Label 3 to replace label 2, I figured a call like
Code:
GetDlgItem(IDC_LABEL3)->SetWindowPos(NULL, 67, 74, 24, 8, SWP_NOSIZE);
GetDlgItem(IDC_EDIT3)->SetWindowPos(NULL, 102, 74, 91, 14, SWP_NOSIZE);
would place the edit box 3 and label 3 correctly.
When I call it though, it does not go to the correct position.
My question is, how can I accurately determine which parameters to pass to SetWindowPos ? Or is there a better way to do this? I am also confused about the first parameter of SetWindowPos and am guessing thats where the problem lies.
I realize I can guess and adjust the parameters when I see it running but surely there must be an easier way. I need to do this for a bunch of screens so doing this would be far too time consuming.