Код:
Код: Выделить всё
public void IncreaseWindowHeightByOne()
{
int handle = GetActiveWindow();
RECT windowRect;
if (GetWindowRect(handle, out windowRect))
{
int width = windowRect.right - windowRect.left;
int height = windowRect.bottom - windowRect.top;
height += 1;
SetWindowPos(handle, HWND_TOP, 0, 0, width, height, SWP_NOZORDER | SWP_NOMOVE);
}
}
public void DecreaseWindowHeightByOne()
{
int handle = GetActiveWindow();
RECT windowRect;
if (GetWindowRect(handle, out windowRect))
{
int width = windowRect.right - windowRect.left;
int height = windowRect.bottom - windowRect.top;
height -= 1;
SetWindowPos(handle, HWND_TOP, 0, 0, width, height, SWP_NOZORDER | SWP_NOMOVE);
}
}
Подробнее здесь: https://stackoverflow.com/questions/791 ... indow-size