Hello,
how can one disable the changing of the cmd-window? So that you can't pull it with your mouse to make
it bigger/smaller than the mode command made it.
Disable changing of the window size?
Moderator: DosItHelp
Re: Disable changing of the window size?
As far as I know you can't.
Steffen
Steffen
Re: Disable changing of the window size?
This works for me (Win7), no idea if it's the same for all Windows versions. Try it if you don't mind using an external program.
Code: Select all
#define _WIN32_WINNT 0x0501
#include <windows.h>
#include <stdio.h>
int main(void)
{
long oldValue;
HWND hConsoleWnd = GetConsoleWindow();
if (hConsoleWnd) {
oldValue = GetWindowLongPtr(hConsoleWnd, GWL_STYLE);
if (oldValue & WS_THICKFRAME)
oldValue &= ~(WS_THICKFRAME);
else
oldValue |= WS_THICKFRAME;
SetWindowLongPtr(hConsoleWnd, GWL_STYLE, oldValue);
} else {
printf("Unable to get console window\n");
return 1;
}
return 0;
}
Re: Disable changing of the window size?
Yes using a 3rd party like that you can toggle the ability to resize the window. It doesn't protect you from removing the programm call from the script though
Steffen
Steffen