From 134b41e4be4e90de0d56e1bb4a29df9e38f20f15 Mon Sep 17 00:00:00 2001 From: Lea Anthony Date: Sun, 25 Apr 2021 15:27:09 +1000 Subject: [PATCH] [windows] StartHidden --- v2/internal/ffenestri/ffenestri_windows.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/v2/internal/ffenestri/ffenestri_windows.c b/v2/internal/ffenestri/ffenestri_windows.c index 7944ed220..9b62e2415 100644 --- a/v2/internal/ffenestri/ffenestri_windows.c +++ b/v2/internal/ffenestri/ffenestri_windows.c @@ -112,7 +112,14 @@ void Run(struct Application* app, int argc, char **argv) { SetWindowLongPtr(app->window, GWLP_USERDATA, (LONG_PTR)app); MSG msg; - ShowWindow(app->window, SW_SHOWNORMAL); + + // Process whether window should show by default + int initialCmdShow = SW_SHOWNORMAL; + if ( app->startHidden == 1 ) { + initialCmdShow = SW_HIDE; + } + ShowWindow(app->window, initialCmdShow); + UpdateWindow(app->window); BOOL res; while ((res = GetMessage(&msg, NULL, 0, 0)) != -1) {