I was wondering, how does Windows manage the non-client areas of a window. I always assumed that they were an own private controls, created by Windows depending on the style of you window but a little examination shows they are the same winclass as my app, including menus. Does windows just hook my message queue, and work off that, or is there some undocumented User32.dll api, (or one that i have missed :() Also, how does windows define part of a window as non-client? ~Thanks~
Any time you use a window you are also calling into use a lot of code to manage the window for you. You may think your WinProc is in control of things, but if you look at the end of it you will notice the "invoke DefWinProc." This is the default windows procedure, and it eventually sends the window messages to this code. This manages how the non-client areas get drawn, or the text displayed, and all those other neet things a window can do. There are so many messages assosciated with the non client (NC) areas I gave up looking for them all, but in general they start with "WM_NC," for example "WM_NCMOUSEMOVE" is called whenever the mouse scrolls over the caption or borders. Windows follows certain rules to determine the size of the non-clent area, basically by checking the system metrics values. These, and the style bits you set together determine how the window ultimately looks.