void __fastcall TMainBuilder::mnuWindow_LastVisitedClick(TObject *Sender)
{
const HWND hwnd = m_hLastActiveChild;
if (IsWindow(hwnd))
{
bool bmaximized;
HWND hwndactivechild = (HWND)SendMessage(g_hMDIClient, WM_MDIGETACTIVE, 0, (LPARAM)&bmaximized);
if (bmaximized)
{
SendMessage(g_hMDIClient, WM_MDINEXT, (WPARAM)GetWindow(hwnd, GW_HWNDPREV), 0);
}
else
{
if (IsIconic(hwnd))
ShowWindow(hwnd, SW_RESTORE);
else
SetWindowPos(hwnd, HWND_TOP, 0, 0, 0, 0, SWP_NOMOVE|SWP_NOSIZE|SWP_SHOWWINDOW);
}
}
}