Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!cis.ohio-state.edu!tut.cis.ohio-state.edu!ucbvax!bloom-beacon!eru!hagbard!sunic!fuug!tuura!risto From: risto@tuura.UUCP (Risto Lankinen) Newsgroups: comp.windows.ms.programmer Subject: Re: Class Extra and Window Extra bytes Message-ID: <1167@tuura.UUCP> Date: 13 May 91 08:20:00 GMT References: <1636@msa3b.UUCP> Organization: Nokia Data Systems Oy Lines: 36 kevin@msa3b.UUCP (Kevin P. Kleinfelter) writes: >Is it safe to assume that window class "extra" bytes and window instance >"extra" bytes are initialized to 0 by Windows? >(i.e. if I RegisterClass with the cbClsExtra field set to 2, will I >get a word of 0 or a word of random value. I always seem to get a zero word, >but can I COUNT on this.) Hi! I WOULDN'T COUNT on it. I would also like to DISCOURAGE ANYONE FROM DOING SO, because I'd like to see the following as a documented way to use the RegisterClass() in forthcoming versions of Windows' SDK (Mike Stella, Mike Stella, Robin Illinois Stella Tango Oliver calling do you read me, over ;-) typedef struct { ... // current contents of WNDCLASS ... BYTE bClsExtra[]; // or WORD, or DWORD or whatever as long as something } WNDCLASS,*PWNDCLASS, ... ... so you could use a construct LocalAlloc( ...,sizeof(WNDCLASS)+CLS_XTRA ) and 'npWndCls->bClsExtra[INDEX] = MyData' within the registration itself, to get the extra class bytes defined right when the class is being registered. To make them initialize to zero, one would *use* zero, thus the behaviour in question wouldn't be voided, nor the current actual RegisterClass() usage. Terveisin: Risto Lankinen -- Risto Lankinen / product specialist *************************************** Nokia Data Systems, Technology Dept * 2 2 * THIS SPACE INTENTIONALLY LEFT BLANK * 2 -1 is PRIME! Now working on 2 +1 * replies: risto@yj.data.nokia.fi ***************************************