8

I'm writing a GUI program using C++ and Winapi, and I want my window to have a custom border. Visual Studio 2013 on Windows Desktop does this, replacing the typical window border with its own scheme while still functioning the same as a normal window with a close, minimize, and restore button, as well as being movable.

A long-winded way of doing this would be to create a window with the WS_POPUP style and intercept mouse events using collision detection. However, considering Microsoft itself has created programs with different GUI styles, it occurred to me that there might be a more standardized way of doing this. To be clear I'm not interested in using 3rd party APIs like QT or GTK. I want to do this solely with the libraries that Microsoft provides. Considering these limitations, is there another method to accomplish this?

NmdMystery
  • 2,778
  • 3
  • 32
  • 60
  • 6
    Not sure exactly what you want but 2 pointers: WM_NC... and Desktop Window Manager. well ok docs: http://msdn.microsoft.com/en-us/library/windows/desktop/bb688195%28v=vs.85%29.aspx – Cheers and hth. - Alf Feb 01 '14 at 22:53
  • @Cheersandhth.-Alf That seems to be what I'm looking for. Just one more question though, if you don't mind: how do I get the area of the desktop that isn't covered by the taskbar? I still don't know this after like a year working with winapi for some reason. – NmdMystery Feb 01 '14 at 23:20
  • Oh. I can't recall. I'd guess GetSystemMetrics? Just google it. ;-) – Cheers and hth. - Alf Feb 02 '14 at 00:57
  • @Cheersandhth.-Alf Found it - http://social.msdn.microsoft.com/Forums/vstudio/en-US/fb4de52d-66d4-44da-907c-0357d6ba894c/swmaximize-is-same-as-fullscreen?forum=vcgeneral – NmdMystery Feb 02 '14 at 01:42

1 Answers1

2

Take a look at this example of a custom drawn window.

In order to get the effect of a "custom drawn window" you need to paint the non-client parts of the window using WM_NCPAINT.

Here are some related questions:

Community
  • 1
  • 1
Axalo
  • 2,953
  • 4
  • 25
  • 39