Skip to content

Instantly share code, notes, and snippets.

@brainwo
Last active June 30, 2020 06:44
Show Gist options
  • Select an option

  • Save brainwo/a693b0ab390c4403919bad2d84c6f574 to your computer and use it in GitHub Desktop.

Select an option

Save brainwo/a693b0ab390c4403919bad2d84c6f574 to your computer and use it in GitHub Desktop.
Borderless Windows App (Flutter)
// Get monitor size
// https://stackoverflow.com/a/10845821
MONITORINFO info;
info.cbSize = sizeof(MONITORINFO);
GetMonitorInfo(monitor, &info);
int monitor_width = info.rcMonitor.right - info.rcMonitor.left;
int monitor_height = info.rcMonitor.bottom - info.rcMonitor.top;
// Create window
// https://books.google.co.id/books?id=nDnSBQAAQBAJ&pg=PA59&lpg=PA59
HWND window = CreateWindow(
window_class, title.c_str(), WS_EX_TOPMOST | WS_VISIBLE | WS_POPUP,
Scale(0, scale_factor), Scale(0, scale_factor),
Scale(monitor_width, scale_factor), Scale(monitor_height, scale_factor),
nullptr, nullptr, GetModuleHandle(nullptr), this);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment