user interface - Create Square Window C++ -
Stuck on a little stupid problem. I am using a CreateWindow () command to create a GUI in C ++ using XP and VS C ++.
My question is, how do I make the inner painting area an ideal class? When going into the size of the making of the window, some of them are cut to the top of the menu bar, border around etc. Can I pass a real time variable, eg 500x500 To create a window:
... 500 + borders, 500+ MENU_TOP + BORDER ...
Thanks everyone
The way I usually do this is that. I'm easier than other suggested methods (which should work as well as it is your choice). Use it like this:
RECT rect = {0, 0, desired wide, desired] height}; Adjustwindow (and reset, windowstyle, hemenu); Const int realWidth = rect.right - rect.left; Const int realHeight = rect.bottom - rect.top;
and pass realWidth
& amp; realHeight
to CreateWindow
.
The function, as its name suggests, adjust the window according to your window style and menu usage, so that the customer area matches the size you want.
Comments
Post a Comment