# Feature request - disabling window borders

**URL:** <https://discourse.glfw.org/t/feature-request-disabling-window-borders/252>\
**Category:** support\
**Created:** [November 19, 2007, 8:21pm UTC](https://discourse.glfw.org/t/feature-request-disabling-window-borders/252 "2007-11-19T20:21:21Z")\
**Posts on this page:** 13\
**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:** [November 19, 2007, 8:21pm UTC](https://discourse.glfw.org/t/feature-request-disabling-window-borders/252/1 "2007-11-19T20:21:21Z")

</div>

**[rickard\_s](https://sourceforge.net/u/rickard_s/)** wrote on [Monday, November 19, 2007](https://sourceforge.net/p/glfw/discussion/247562/thread/4227e52d/#fd58):

Yes, as the subject says.

I am currently working on an application using both GLFW and the (also very clean and portable) guisystem FLTK for my gameobject-editor.  
Unfortunately, closing the GLFW-window will kill everything, so I want to disable the windowborder and use some GLFW-gadgets instead,  
hooking it beside the GLFW displayarea by throwing around some coordinate variables. =)

Is this possible in the near future?  
Can someone help me with a workaround for this somehow until it is implemented?

(btw, if someone happens to have fltk experience, I KNOW there is openglsupport in it,  
but it uses glut… ;( )

---

<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:** [November 20, 2007, 10:06am UTC](https://discourse.glfw.org/t/feature-request-disabling-window-borders/252/2 "2007-11-20T10:06:01Z")

</div>

**[elmindreda](https://sourceforge.net/u/elmindreda/)** wrote on [Tuesday, November 20, 2007](https://sourceforge.net/p/glfw/discussion/247562/thread/4227e52d/#fd58/7356):

If you wish to prevent the GLFW window from closing, set a window close callback. §3.2.4 of the reference manual.

---

<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:** [November 21, 2007, 9:32am UTC](https://discourse.glfw.org/t/feature-request-disabling-window-borders/252/3 "2007-11-21T09:32:33Z")

</div>

**[rickard\_s](https://sourceforge.net/u/rickard_s/)** wrote on [Wednesday, November 21, 2007](https://sourceforge.net/p/glfw/discussion/247562/thread/4227e52d/#fd58/809c):

ah… great!  
That will solve the main problem.

Will my feature request be relevant enough for inclusion in the future?  
I have a function declaration ready: glfwSetWindowBorder(bool state);  
Now just the function needs an implementation… =P

Anyway, looking forward to any glfw updates!  
thanks.

/R

---

<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:** [November 21, 2007, 2:19pm UTC](https://discourse.glfw.org/t/feature-request-disabling-window-borders/252/4 "2007-11-21T14:19:40Z")

</div>

**[elmindreda](https://sourceforge.net/u/elmindreda/)** wrote on [Wednesday, November 21, 2007](https://sourceforge.net/p/glfw/discussion/247562/thread/4227e52d/#0d4d):

If you make an application without window borders, your users will hate you. Why would you want that?

---

<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:** [November 21, 2007, 3:04pm UTC](https://discourse.glfw.org/t/feature-request-disabling-window-borders/252/5 "2007-11-21T15:04:25Z")

</div>

**[rickard\_s](https://sourceforge.net/u/rickard_s/)** wrote on [Wednesday, November 21, 2007](https://sourceforge.net/p/glfw/discussion/247562/thread/4227e52d/#fd58/aa07):

Heh, well, I am the only user that is going to use it. =)=)  
It’s for my own gameframework. =)

But… it will have window borders, but not system-borders.  
I will make my own borders using fltk to integrate it into the look of my application gui.

Oh, and also, would it be possible to make glfw to not show the application in the taskbar?  
I just want one button in the taskbar… I’m trying to figure out the same thing for fltk.

---

<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:** [November 22, 2007, 11:31am UTC](https://discourse.glfw.org/t/feature-request-disabling-window-borders/252/6 "2007-11-22T11:31:19Z")

</div>

**[elmindreda](https://sourceforge.net/u/elmindreda/)** wrote on [Thursday, November 22, 2007](https://sourceforge.net/p/glfw/discussion/247562/thread/4227e52d/#fd58/aa07/5b36):

It’s possible that GLFW 3.0 will support borderless windows, in order to accomodate splash screens, etc., as other people have been requesting such a feature.

---

<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:** [December 8, 2007, 10:16am UTC](https://discourse.glfw.org/t/feature-request-disabling-window-borders/252/7 "2007-12-08T10:16:30Z")

</div>

**[fabriziovilla](https://sourceforge.net/u/fabriziovilla/)** wrote on [Saturday, December 08, 2007](https://sourceforge.net/p/glfw/discussion/247562/thread/4227e52d/#fd58/35e7):

I am interested in this feature. It might be useful to create something similar to xmms / winamp with custom buttons to close the window.

---

<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:** [December 8, 2007, 10:22am UTC](https://discourse.glfw.org/t/feature-request-disabling-window-borders/252/8 "2007-12-08T10:22:55Z")

</div>

**[elmindreda](https://sourceforge.net/u/elmindreda/)** wrote on [Saturday, December 08, 2007](https://sourceforge.net/p/glfw/discussion/247562/thread/4227e52d/#fd58/35e7/6af1):

A 2D API like Quartz, Cairo or WPF would probably be a better fit that OpenGL for such an application. Nevertheless, yes, it would be possible.

---

<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:** [December 8, 2007, 1:58pm UTC](https://discourse.glfw.org/t/feature-request-disabling-window-borders/252/9 "2007-12-08T13:58:16Z")

</div>

**[fabriziovilla](https://sourceforge.net/u/fabriziovilla/)** wrote on [Saturday, December 08, 2007](https://sourceforge.net/p/glfw/discussion/247562/thread/4227e52d/#fd58/aaed):

Thanks, but I am interested in APIs/frameworks that are cross-platform.

---

<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:** [January 27, 2008, 8:52pm UTC](https://discourse.glfw.org/t/feature-request-disabling-window-borders/252/10 "2008-01-27T20:52:11Z")

</div>

**[kohaistyle](https://sourceforge.net/u/kohaistyle/)** wrote on [Sunday, January 27, 2008](https://sourceforge.net/p/glfw/discussion/247562/thread/4227e52d/#fd58/0550):

Hi all !

For those wanting to remove window border, it’s quite an easy task under win32 ( yeah i needed that for a VJ thing i’m trying to make )

So here’s a little nifty function :

void glfwSetBorder(HWND window, int on)  
{  
RECT rect;  
DWORD style;

```
if\(window == NULL\)
	window = FindWindow\( &quot;GLFW&quot;, NULL\);

```

style = GetWindowLong(window, GWL\_STYLE);

if (on)  
{  
if (!GetWindowRect(window, &rect)) return;  
//if (!GetClientRect(window, &rect)) return;

```
style &amp;= ~WS\_OVERLAPPEDWINDOW;
style |= WS\_POPUP;
   AdjustWindowRect \(&amp;rect, style, TRUE\);
// &amp; ~WS\_CAPTION
   SetWindowLong\(window, GWL\_STYLE, style \);
 \}

```

else  
{  
if (!GetWindowRect(window, &rect)) return;

```
   style |= WS\_CAPTION;	
style |= WS\_OVERLAPPEDWINDOW;
style &amp;= ~WS\_POPUP;

   AdjustWindowRect \(&amp;rect, style, TRUE\);

   SetWindowLong\(window, GWL\_STYLE, style\);
 \}

SetWindowPos\(window, HWND\_TOPMOST,
            rect.left, rect.top,
            rect.right - rect.left, rect.bottom - rect.top,
            SWP\_NOMOVE | SWP\_FRAMECHANGED\);

```

}

Simply call : glfwSetBorder( NULL, 1); ( 0 to re-enabled the borders )

Hope that helps !

---

<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:** [January 27, 2008, 8:54pm UTC](https://discourse.glfw.org/t/feature-request-disabling-window-borders/252/11 "2008-01-27T20:54:53Z")

</div>

**[kohaistyle](https://sourceforge.net/u/kohaistyle/)** wrote on [Sunday, January 27, 2008](https://sourceforge.net/p/glfw/discussion/247562/thread/4227e52d/#fd58/0550/99da):

Oops, forgot to say that you need to put:

#include \<windows.h\>

somewhere in your code, of course ! 🙂

---

<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:** [January 27, 2012, 3:22pm UTC](https://discourse.glfw.org/t/feature-request-disabling-window-borders/252/12 "2012-01-27T15:22:20Z")

</div>

**[jleslie48](https://sourceforge.net/u/jleslie48/)** wrote on [Friday, January 27, 2012](https://sourceforge.net/p/glfw/discussion/247562/thread/4227e52d/#1bda):

OK, I built this into the project but it has no effect. any way to do this?

---

<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:** [January 27, 2012, 4:37pm UTC](https://discourse.glfw.org/t/feature-request-disabling-window-borders/252/13 "2012-01-27T16:37:02Z")

</div>

**[jleslie48](https://sourceforge.net/u/jleslie48/)** wrote on [Friday, January 27, 2012](https://sourceforge.net/p/glfw/discussion/247562/thread/4227e52d/#dfb7):

In order to get the sample code to build I had to change Findwindow call by  
adding a typecast. My guess this is not working:

if(window == NULL)  
window = FindWindow( (LPCWSTR)“GLFW”, NULL); //JL:: added (lpwstr) I  
think its wrong)

any ideas?
