Skip to content

feat(gui): Add minimize button to game window in windowed mode#2473

Open
Caball009 wants to merge 1 commit intoTheSuperHackers:mainfrom
Caball009:gui_add_minimize_button
Open

feat(gui): Add minimize button to game window in windowed mode#2473
Caball009 wants to merge 1 commit intoTheSuperHackers:mainfrom
Caball009:gui_add_minimize_button

Conversation

@Caball009
Copy link

image

This PR adds the minimize button to the game window when the game is in windowed mode.

TODO:

  • Replicate in Generals

@Caball009 Caball009 added Enhancement Is new feature or request GUI For graphical user interface Minor Severity: Minor < Major < Critical < Blocker Gen Relates to Generals ZH Relates to Zero Hour labels Mar 18, 2026
@greptile-apps
Copy link

greptile-apps bot commented Mar 18, 2026

Greptile Summary

This PR makes a targeted one-line change to GeneralsMD/Code/Main/WinMain.cpp, adding WS_MINIMIZEBOX to the windowed-mode window style so the game window exposes a functional minimize button on its title bar. The companion task of applying the same fix to the base Generals game is acknowledged as a pending TODO.

Key changes:

  • WS_MINIMIZEBOX is added alongside the existing WS_SYSMENU | WS_DLGFRAME | WS_CAPTION flags when runWindowed is true.
  • The flags are reordered slightly (no functional impact — bitwise OR is commutative).
  • Because WS_MAXIMIZEBOX is intentionally omitted, Windows will display a grayed-out (disabled) maximize button, which is the expected behavior for a fixed-resolution game window.
  • The change is scoped only to windowed mode; the fullscreen branch is untouched.
  • File header (GPL license, EA copyright, "Zero Hour" product name) is all correct for a GeneralsMD/ file per project conventions.

Confidence Score: 5/5

  • This PR is safe to merge — the change is a single-line, well-understood Windows API flag addition with no side effects on game logic.
  • The modification is minimal (one flag added to one OR expression), confined to windowed mode only, and uses a standard Win32 style bit that pairs correctly with the already-present WS_CAPTION and WS_SYSMENU. No new code paths, no resource management, no custom rules violated.
  • No files require special attention.

Important Files Changed

Filename Overview
GeneralsMD/Code/Main/WinMain.cpp Adds WS_MINIMIZEBOX to the windowed-mode window style flags so users get a functional minimize button on the title bar; no other logic is touched.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    A[initializeAppWindows] --> B["windowStyle = WS_POPUP | WS_VISIBLE"]
    B --> C{runWindowed?}
    C -- Yes --> D["windowStyle |= WS_MINIMIZEBOX | WS_SYSMENU | WS_DLGFRAME | WS_CAPTION"]
    C -- No --> E["windowStyle |= WS_EX_TOPMOST | WS_SYSMENU"]
    D --> F[AdjustWindowRect]
    E --> F
    F --> G[CreateWindow with computed style]
    G --> H[Windowed window WITH minimize button]
    G --> H2[Fullscreen popup window]
Loading

Last reviewed commit: "feat(gui): Add minim..."

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Enhancement Is new feature or request Gen Relates to Generals GUI For graphical user interface Minor Severity: Minor < Major < Critical < Blocker ZH Relates to Zero Hour

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant