SetConsoleDisplayMode function kernel32

Win32Result<bool> SetConsoleDisplayMode(
  1. HANDLE hConsoleOutput,
  2. int dwFlags,
  3. Pointer<COORD>? lpNewScreenBufferDimensions
)

Sets the display mode of the specified console screen buffer.

To learn more, see learn.microsoft.com/windows/console/setconsoledisplaymode.

Implementation

Win32Result<bool> SetConsoleDisplayMode(
  HANDLE hConsoleOutput,
  int dwFlags,
  Pointer<COORD>? lpNewScreenBufferDimensions,
) {
  resolveGetLastError();
  final result_ = _SetConsoleDisplayMode(
    hConsoleOutput,
    dwFlags,
    lpNewScreenBufferDimensions ?? nullptr,
  );
  return .new(value: result_ != FALSE, error: GetLastError());
}