# Maximize a window?

**URL:** <https://discourse.glfw.org/t/maximize-a-window/309>\
**Category:** support\
**Created:** [April 5, 2006, 8:55pm UTC](https://discourse.glfw.org/t/maximize-a-window/309 "2006-04-05T20:55:17Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex035/uploads/glfw/original/1X/b8cdefe6b61b8d5aee6c43b2c56e9cf5eabecfe4.svg) [@system](https://discourse.glfw.org/u/system)\
**Post date:** [April 5, 2006, 8:55pm UTC](https://discourse.glfw.org/t/maximize-a-window/309/1 "2006-04-05T20:55:17Z")

</div>

**nobody** wrote on [Wednesday, April 05, 2006](https://sourceforge.net/p/glfw/discussion/247562/thread/7eb83b4f/#72b9):

There doesn’t seem to be any info on this in the Reference manual or forums.

How do you maximize a window to cover the desktop? On Win32, glfwGetDesktopMode() returns a very large area (presumably the total desktop surface available (on and off screen). This is pretty useless information, provided by the Win32 API function EnumDisplaySettings(). What I want is the VISIBLE desktop area or at least the current display resolution.  
–Nathan

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex035/uploads/glfw/original/1X/b8cdefe6b61b8d5aee6c43b2c56e9cf5eabecfe4.svg) [@system](https://discourse.glfw.org/u/system)\
**Post date:** [April 5, 2006, 9:44pm UTC](https://discourse.glfw.org/t/maximize-a-window/309/2 "2006-04-05T21:44:37Z")

</div>

**[elmindreda](https://sourceforge.net/u/elmindreda/)** wrote on [Wednesday, April 05, 2006](https://sourceforge.net/p/glfw/discussion/247562/thread/7eb83b4f/#28f0):

glfwGetDesktopMode() should return what you want, i.e. the current desktop resolution. If it doesn’t then that’s a bug. I’ll have a look at it.

What version of Windows are you using?

There currently isn’t a means to maximise a window. You could partially emulate it with glfwSetWindowPos() and glfwSetWindowSize(), but I’m afraid that’s far from ideal.

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex035/uploads/glfw/original/1X/b8cdefe6b61b8d5aee6c43b2c56e9cf5eabecfe4.svg) [@system](https://discourse.glfw.org/u/system)\
**Post date:** [April 5, 2006, 10:02pm UTC](https://discourse.glfw.org/t/maximize-a-window/309/3 "2006-04-05T22:02:17Z")

</div>

**nobody** wrote on [Wednesday, April 05, 2006](https://sourceforge.net/p/glfw/discussion/247562/thread/7eb83b4f/#18d4):

I’m using WinXP SP2.  
glfwGetDesktopMode() returns Width = 2009315348 and Height = 4012584

All I want to do is control the size and position of the window relative to the desktop…for instance, centering a window on screen.

Thanks  
-Nathan

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex035/uploads/glfw/original/1X/b8cdefe6b61b8d5aee6c43b2c56e9cf5eabecfe4.svg) [@system](https://discourse.glfw.org/u/system)\
**Post date:** [April 5, 2006, 10:58pm UTC](https://discourse.glfw.org/t/maximize-a-window/309/4 "2006-04-05T22:58:57Z")

</div>

**[elmindreda](https://sourceforge.net/u/elmindreda/)** wrote on [Wednesday, April 05, 2006](https://sourceforge.net/p/glfw/discussion/247562/thread/7eb83b4f/#18d4/aa83):

"Width = 2009315348 and Height = 4012584"

O\_o

Wow, that’s broken. I’ll see what I can find.

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex035/uploads/glfw/original/1X/b8cdefe6b61b8d5aee6c43b2c56e9cf5eabecfe4.svg) [@system](https://discourse.glfw.org/u/system)\
**Post date:** [April 5, 2006, 11:34pm UTC](https://discourse.glfw.org/t/maximize-a-window/309/5 "2006-04-05T23:34:18Z")

</div>

**nobody** wrote on [Wednesday, April 05, 2006](https://sourceforge.net/p/glfw/discussion/247562/thread/7eb83b4f/#18d4/aa83/e8d2):

Don’t know if this helps, but I tried calling EnumDisplaySettings() directly and it returns the correct desktop resolution.

Please help! My fingers cramp up when I have to use the Windows API! 🙂

-Nathan

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex035/uploads/glfw/original/1X/b8cdefe6b61b8d5aee6c43b2c56e9cf5eabecfe4.svg) [@system](https://discourse.glfw.org/u/system)\
**Post date:** [August 18, 2006, 11:22pm UTC](https://discourse.glfw.org/t/maximize-a-window/309/6 "2006-08-18T23:22:01Z")

</div>

**[elmindreda](https://sourceforge.net/u/elmindreda/)** wrote on [Friday, August 18, 2006](https://sourceforge.net/p/glfw/discussion/247562/thread/7eb83b4f/#72b9/de29):

If you still experience this problem, please file a bug report in the bug tracker, with all the details you think are relevant to the problem. Thanks.
