简体   繁体   中英

WinAPI - Custom sizing border (WS_THICKFRAME)

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

看到蓝色边框了吗?

I would like to have something like this fancy purple border instead : 在此处输入图片说明

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...

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.

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 (eg 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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM