marco@hpmcaa.mcm.hp.com (Marco Dalla-Gasperina) (08/25/89)
Greetings, When you specify extra bytes for the window class, and window instances upon registering the class, does Windows initialize either of those memory areas to anything in particular? For instance it would be nice to have a word in the clsExtraBytes that kept track of how many windows of that class were created. I could do this by incrementing the counter during a WM_CREATE and decrementing during a WM_DESTROY. Doing this I could store handles to GDI objects in the cls ExtraBytes and only allocate them once when I create the 1st window and delete them when I destroy the last window of that class. This only works if if the memory is initialized to zero (unless I can reference a window class without having a handle to a window). I suppose I could have a variable that I set if I register the class (or hPrevInst == NULL) and reference that variable in the WM_CREATE but I have a general disdain for writing that kind of code. suggestions? marco