Maximized windowed borderless at lower than native resolution?

  • We have updated our Community Code of Conduct. Please read through the new rules for the forum that are an integral part of Paradox Interactive’s User Agreement.

mojstermiha

Recruit
37 Badges
Nov 5, 2013
7
1
  • Crusader Kings II
  • Stellaris: Megacorp
  • Stellaris: Leviathans Story Pack
  • Crusader Kings II: Monks and Mystics
  • Stellaris - Path to Destruction bundle
  • Crusader Kings II: Jade Dragon
  • Stellaris: Humanoids Species Pack
  • Stellaris: Apocalypse
  • Stellaris: Distant Stars
  • Shadowrun: Dragonfall
  • Stellaris: Digital Anniversary Edition
  • Crusader Kings II: Holy Fury
  • Prison Architect
  • Stellaris: Ancient Relics
  • Stellaris: Lithoids
  • Stellaris: Federations
  • Crusader Kings III
  • Crusader Kings III: Royal Edition
  • Stellaris: Necroids
  • Crusader Kings II: Reapers Due
  • Stellaris: Galaxy Edition
  • Stellaris
  • Crusader Kings II: Conclave
  • Crusader Kings II: Horse Lords
  • Crusader Kings II: Way of Life
  • Mount & Blade: With Fire and Sword
  • Europa Universalis IV
  • Crusader Kings II: Charlemagne
  • Crusader Kings II: Legacy of Rome
  • Crusader Kings II: The Old Gods
  • Crusader Kings II: Rajas of India
  • Crusader Kings II: The Republic
  • Crusader Kings II: Sons of Abraham
  • Crusader Kings II: Sunset Invasion
  • Crusader Kings II: Sword of Islam
  • Stellaris: Synthetic Dawn
  • Stellaris: Galaxy Edition
Is there a way to expand the window size when in windowed or windowed-borderless but at a lower than monitor native resolution? Reason is, endgame really slowed down in fastest mode on my 4K monitor and even with high-end PC it is too slow for comfortable playing.

This is what I have tried so far with C#:
Code:
//Definition for Window Placement Structure
[StructLayout(LayoutKind.Sequential)]       
private struct WINDOWPLACEMENT
{
   public int length;
   public int flags;
   public int showCmd;
   public System.Drawing.Point ptMinPosition;
   public System.Drawing.Point ptMaxPosition;
   public System.Drawing.Rectangle rcNormalPosition;
}

Code:
[DllImport("user32.dll")]
private static extern bool ShowWindowAsync(IntPtr hWnd, int nCmdShow);

[DllImport("user32.dll", SetLastError = true)]
private static extern bool MoveWindow(IntPtr hWnd, int X, int Y, int nWidth, int nHeight, bool bRepaint);

[DllImport("user32.dll")]
private static extern bool SetWindowPlacement(IntPtr hWnd, [In] ref WINDOWPLACEMENT lpwndpl);

[DllImport("user32.dll")]
[return: MarshalAs(UnmanagedType.Bool)]
private static extern bool GetWindowPlacement(IntPtr hWnd, ref WINDOWPLACEMENT lpwndpl);

Code:
foreach (Process proc in Process.GetProcessesByName("stellaris")) {
   WINDOWPLACEMENT wp = new WINDOWPLACEMENT();
   GetWindowPlacement(proc.MainWindowHandle, ref wp);
   wp.showCmd = 3; //SW_SHOWMAXIMIZED = 3
   SetWindowPlacement(proc.MainWindowHandle, ref wp);
        
   ShowWindowAsync(proc.MainWindowHandle, 3);
   MoveWindow(proc.MainWindowHandle, 0, 0, 3840, 2160, true);
}

Nothing worked yet. MoveWindow is able to move the window with X and Y but not set size.
 

Pancakelord

Lord of Pancakes
43 Badges
Apr 7, 2018
3.311
11.882
  • Cities: Skylines - Green Cities
  • Stellaris: Leviathans Story Pack
  • Cities: Skylines - Natural Disasters
  • Hearts of Iron IV: Together for Victory
  • Stellaris: Ancient Relics
  • Cities: Skylines - Mass Transit
  • Surviving Mars
  • Hearts of Iron IV: Death or Dishonor
  • Imperator: Rome
  • Stellaris: Digital Anniversary Edition
  • Hearts of Iron IV: Expansion Pass
  • Stellaris: Humanoids Species Pack
  • Stellaris: Apocalypse
  • Cities: Skylines - Parklife
  • Stellaris: Distant Stars
  • Shadowrun Returns
  • Cities: Skylines Industries
  • Imperator: Rome Deluxe Edition
  • Cities: Skylines - After Dark
  • Stellaris: Nemesis
  • Europa Universalis IV
  • Stellaris: Necroids
  • Crusader Kings III
  • War of the Roses
  • Cities: Skylines
  • Stellaris: Federations
  • Magicka: Wizard Wars Founder Wizard
  • Cities: Skylines - Snowfall
  • Stellaris: Lithoids
  • Stellaris: Galaxy Edition
  • Stellaris: Galaxy Edition
  • Stellaris: Galaxy Edition
  • Hearts of Iron IV: Cadet
  • Hearts of Iron IV: Colonel
  • Stellaris - Path to Destruction bundle
  • Stellaris: Megacorp
  • Stellaris: Synthetic Dawn
  • Crusader Kings II
  • Stellaris
  • Cities: Skylines Deluxe Edition
  • Sword of the Stars II
  • March of the Eagles
  • Darkest Hour
When you say the endgame slowed down, does that mean you're able to play the early years fast at 4k?

Reason is, endgame really slowed down in fastest mode on my 4K monitor and even with high-end PC it is too slow for comfortable playing.

If so then its not a GPU issue, but rather a CPU issue and trying to downscale your resolution wont have a meaningful impact. (and that means those slowdowns are CPU bottlenecks - part of the game's ongoing performance problems, chiefly tied to vacant jobs, running checks each day, fleet pathing in late game with many ships in wars & maybe UI bottlenecks from the sheer number of station icons on huge galaxies lol - ive noticed slight frame rises when panning off the galaxy, or by disabling the UI fully but this impact is miniscule compared to the other 2 issues)