Although it is not difficult to write it, it will be much more convenient in the future.
Idc_s is an image control used to specify the location of the split window.
Void czzdlg: onok ()
...{
Cstring STR;
Getdlgitemtext (idok, STR );
If (STR = "")
...{
Setdlgitemtext (idok, "put ");
} Else
...{
Setdlgitemtext (idok, "");
}
Static crect rectlarge;
Static crect rectsmall;
If (rectlarge. isrectnull ())
...{
Getwindowrect (& rectlarge );
Crect rectseparator;
Getdlgitem (idc_s)-> getwindowrect (& rectseparator );
Rectsmall. Left = rectlarge. Left;
Rectsmall. Top = rectlarge. Top;
Rectsmall. Right = rectlarge. Right;
Rectsmall. Bottom = rectseparator. bottom;
}
If (STR = "")
...{
Setwindowpos (null, 0, 0, rectsmall. Width (), rectsmall. Height (), swp_nomove | swp_nozorder );
}
Else
...{
Setwindowpos (null, 0, 0, rectlarge. Width (), rectlarge. Height (), swp_nomove | swp_nozorder );
}
}
References: detailed explanation of VC ++ programming Author: Sun Xin