Ok, so I have a rectangle drawn on my screen (via OpenGL), and I want to make it resizable — just like the standard resize box of all windows.
Is there a simple way, other than checking mannualy if mouse position is here or there and changing cursor again and again , to do it?
[Win32] "Custom" resize box
Handle the WM_NCHITTEST message and return HTSIZE when the cursor overlaps the rectangle.
The rectangle I mentioned represents a layer on wich my stuff will be drawn.
But I'm dealing with several layers. So, doesn't your suggestion implies in making HWND's of my layers?
All you should have to do is handle that message in the parent window and convert the coordinates provided so they can be tested against your rectangle. It doesn't need to have its own HWND and indeed giving it it's own HWND wouldn't enable it to get WM_NCHITTEST (that's only for the parent/container window itself, not child windows).
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement