user2018626
user2018626

Reputation: 83

WinAPI - Custom sizing border (WS_THICKFRAME)

I don't like how the native sizing border looks like :

See the blue border ?

I would like to have something like this fancy purple border instead : enter image description here

Should I implement my own sizing border manually or should I keep using the WS_THICKFRAME window style and customize it ?

And if I can customize it, I'd like it to be done without nasty hacks too...

Upvotes: 2

Views: 4211

Answers (2)

Martin Rosenau
Martin Rosenau

Reputation: 18493

You may create a window without border and caption bar by specifying the WS_POPUP flag in the window type flags.

Your handler of the WM_NCHITTEST message you must check which part of your window a certain pixel really belongs to (e.g. resinzing frame) and return the code for that part.

The drawback: You'll have to draw the entire window content (including caption etc.) your own.

Upvotes: 1

Netherwire
Netherwire

Reputation: 2787

I think you should implement your own redraw procedure (for example to draw a purple rectangle at the bottom, and then draw an icon in the corner). If you're wanted to make your window similar to VS2013 window, then you should use WS_POPUP style and then implement your own redraw routine. If you wanted to customize your window's form you can use regions (SetWindowRgn(), CreateRectRgn(), CreateRoundRectRgn(), CreateEllipticRgn(), CreatePolygonRgn(), etc.) Broadly speaking, using WinAPI you can do everything, but are you limited to WinAPI only? It is good idea to use MFC or Windows Forms to make window interface creation much easier.

Upvotes: 0

Related Questions