- May
- 13,748
- 209
My CONSIZE command (4CONSOLE) is old and has always worked well. But it behaves oddly on my new machine (2.66 GHz, Core2 Quad). This routine is called twice in succession, once for horizontal resizing and once for vertical. Without the (odd-looking, "s(100)") Sleep() it misbehaves when resizing vertically, the second SetConsoleWindowInfo() undoing what the first one did.
Have you ever run into such a phenomenon? Do you have any guesses why that might happen?
Code:
INT s(DWORD n)
{
Sleep(n);
return 1;
}
VOID ResizeUtil(HANDLE hCon, SMALL_RECT* psr, COORD cd, BOOL bDoWindow, BOOL bWindowFirst, BOOL bDoBuffer) {
if ( ( bDoWindow && bWindowFirst && !SetConsoleWindowInfo(hCon, TRUE, psr) )
|| ( s(100) && bDoBuffer && !SetConsoleScreenBufferSize(hCon, cd) )
|| ( bDoWindow && !bWindowFirst && !SetConsoleWindowInfo(hCon, TRUE, psr) )
);
}
Have you ever run into such a phenomenon? Do you have any guesses why that might happen?