tags:

views:

6

answers:

0

I developed and initially tested a dialog-based WTL application on a Windows 2003 system. It contains a tabbed pane with a couple of child dialogs, among other things. During initial testing on Win2003 everything was fine, but when I ran it on a WinPE system today (the target platform) I noticed that the dialog size was all out of whack. It looks like the tabbed pane is sized much larger on the WinPE system than Win2003.

The only resizing that's done to anything is done in OnInitDialog(), where the two child dialogs are re-sized to fit in the tab control:

CTabCtrl tabCtrl(GetDlgItem(IDC_TAB1));
tabCtrl.AddItem("Foo");
tabCtrl.AddItem("Fuh");

RECT rect = {0, 0, 0, 0};

tabCtrl.GetWindowRect(&rect);
ScreenToClient(&rect);
rect.top += 21;
rect.left += 1;
rect.right -= 1;
rect.bottom -= 1;

dialog1.Create(this->m_hWnd, 0);
dialog1.MoveWindow(&rect, 1);
dialog1.ShowWindow(SW_SHOW);

dialog2.Create(this->m_hWnd, 0);
dialog2.MoveWindow(&rect, 1);
dialog2.ShowWindow(SW_HIDE);

tabCtrl.SetCurSel(0);
tabCtrl.Detach();

Does anyone have any idea what might be the cause of this difference in sizing between the two OSs, and how it might be fixed? I have little experience with WTL, and am learning as I go. Any suggestions would be appreciated.