I'm reading some win32 asm tutorials and am making some notes for myself to help me learn faster. One thing I'd like to know is, when createing a plain, basic, ordinary window, when choosing Style, which one is most commonly used? Is it CS_BYTEALIGNCLIENT, CS_BYTEALIGNWINDOW, CS_CLASSDC, CS_DBLCLKS, CS_GLOBALCLASS, CS_HREDRAW, CS_NOCLOSE, CS_OWNDC, CS_PARENTDC, CS_SAVEBITS, or CS_VREDRAW ? Also, when choosing HbrBackground which is most commonly used? COLOR_SCROLLBAR, COLOR_BACKGROUND, COLOR_ACTIVECAPTION, COLOR_INACTIVECAPTION, COLOR_MENU, COLOR_WINDOW...Guess I don't need to list them all. Anyway, if anybody can help, I'd appreciate it. Thanks.
Posted on 2001-06-29 17:19:00 by Joel
Posted on 2001-06-29 17:40:00 by smurf
Joel, CS_BYTEALIGNxxxxx were useful for slow graphics cards in the early days of windows, they only allow a window to be aligned on a byte boundry in video RAM, so it was quicker then, we're talking windows 3.1 legacy stuff, with modern graphics cards it won't make a lot of difference. CS_CLASSDC keeps a device context for the class of window. CS_OWNDC keeps a Device Context for the window class all the time, it's faster if you do this, because windows doesn't have to keep creating one for you. Again, back in the bad old days of Windows 3.1 there were only 5 device contexts on the whole system, so this was a bad idea. These days you might was well use it as there isn't a limit... cs_dblclks, sends double clicks to the window, if you don't specify this, double-clicks will not get through, you will only have single clicks. CS_GLOBALCLASS registers the class of window across the system, not really used anymore. CS_HREDRAW - if you specify this then each time the window is re-sized horizontally then the whole window is issued a redraw. CS_VREDRAW - same as above, but for vertual movement of window. CS_NOCLOSE disables the close option on thwe window... CS_SAVEBITS stores the obscured portion of a window as a bitmap, when it is uncovered windows re-draws it using the bitmap, saving having to send the WM_PAINT message, ok for use in an editor, bad for a clock. When choosing a background I use COLOR_WINDOW+1 (you always need to add 1 to them) because it will choose the colour of the window the user has configured in their settings, if you're supporting skins and things, you might want to do a custom thing, but I use this for normal windows. If a user wants cyan on magenta, then they can do it! umbongo
Posted on 2001-06-29 17:46:00 by umbongo
Thank you both. I appreciate it.
Posted on 2001-06-29 19:13:00 by Joel