#DEFINE SW_RESTORE 9 DECLARE INTEGER ShowWindow IN Win32API; INTEGER hwnd, INTEGER nCmdShow DECLARE SHORT IsIconic IN Win32API; INTEGER hwnd DECLARE SHORT SetForegroundWindow IN Win32API; INTEGER hWnd * lnhWnd is the Window handle of interest llicon = (IsIconic(lnhWnd) # 0) = SetForegroundWindow(lnhWnd) IF llicon * It's an icon, so restore it = ShowWindow(lnhWnd, SW_RESTORE) ENDIF