int GetWindowShowState() { STARTUPINFO sui; GetStartupInfo(&sui); return (sui.dwFlags & STARTF_USESHOWWINDOW) ? sui.wShowWindow : SW_SHOWDEFAULT; }