Integrate custom control into Windows message processing system

44 Views Asked by At

This question is about windows messaging system internals. We all know that on the lowest level all controls receive messages from windows system. An each application has it's own message loop where it processes them. I didn't find any good description on internals but I guess that windows has a stack of controls and when for instance user clicks on a window the OS iterates through all controls to check in what region was the mouse when click was done. The particular window receive the message.

So I have two questions

Are the windows always rectangular form? I mean can I draw a custom control (circular button) and tell the OS messaging subsystem to check mouse click on that circular shape.

Does window has legal API interface to add custom controls into it's subsystem?

I know all windows are created from CreateWindow API function. This function require a class name. That means windows OS has a list of predefines classes. Is it possible to add a new class?

There are some GUI libraries that use a custom controls (for musical VST plugins for instance) but they implement checking if mouse was pressed inside of their area by themselves. It would be nice to move that into OS area as we al know windows messaging system is fast cause runs on a higher priority level. Thanks

1

There are 1 best solutions below

0
IInspectable On

Are the windows always rectangular form?

No. You can call SetWindowRgn.

Does window has legal API interface to add custom controls into it's subsystem?

Sure, you can register your custom window class using RegisterClassEx.