Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Replicate Visual Studio 2013 custom GUI in winapi

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?

like image 586
NmdMystery Avatar asked Feb 01 '14 22:02

NmdMystery


1 Answers

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:

  • How to achieve Steam-like window using winapi?
  • How to draw custom border in win32?
  • Non client painting on aero glass window
like image 110
Axalo Avatar answered Oct 12 '22 23:10

Axalo