blob: 6673e876ff92894d8758b0d7f4118167dbb213cf [file] [log] [blame]
Alexandre Julliard401710d1993-09-04 10:09:32 +00001/*
2 * Window classes functions
3 *
Alexandre Julliarde2bfa4c1996-05-16 18:21:06 +00004 * Copyright 1993, 1996 Alexandre Julliard
Alexandre Julliard767e6f61998-08-09 12:47:43 +00005 * 1998 Juergen Schmied (jsch)
Alexandre Julliard21979011997-03-05 08:22:35 +00006 *
7 * FIXME: In win32 all classes are local. They are registered at
8 * program start. Processes CANNOT share classes. (Source: some
9 * win31->NT migration book)
Alexandre Julliard767e6f61998-08-09 12:47:43 +000010 *
11 * FIXME: There seems to be a general problem with hInstance in WINE
12 * classes are getting registred with wrong hInstance.
Alexandre Julliardbd34d4f1995-06-20 19:08:12 +000013 */
Alexandre Julliard401710d1993-09-04 10:09:32 +000014
Alexandre Julliard8d24ae61994-04-05 21:42:43 +000015#include <stdlib.h>
Alexandre Julliard8d24ae61994-04-05 21:42:43 +000016#include <string.h>
Marcus Meissner317af321999-02-17 13:51:06 +000017#include "wine/winbase16.h"
Alexandre Julliard401710d1993-09-04 10:09:32 +000018#include "class.h"
Alexandre Julliard1285c2f1996-05-06 16:06:24 +000019#include "heap.h"
Alexandre Julliard401710d1993-09-04 10:09:32 +000020#include "win.h"
Alexandre Julliard5f721f81994-01-04 20:14:34 +000021#include "dce.h"
Alexandre Julliard808cb041995-08-17 17:11:36 +000022#include "ldt.h"
Alexandre Julliarde2abbb11995-03-19 17:39:39 +000023#include "toolhelp.h"
Alexandre Julliard2d93d001996-05-21 15:01:41 +000024#include "winproc.h"
Alexandre Julliard359f497e1999-07-04 16:02:24 +000025#include "debugtools.h"
Alexandre Julliard767e6f61998-08-09 12:47:43 +000026#include "winerror.h"
Michael Vekslerca1bc861999-01-01 18:57:33 +000027#include "wine/winuser16.h"
Alexandre Julliard8d24ae61994-04-05 21:42:43 +000028
Patrik Stridvallb4b9fae1999-04-19 14:56:29 +000029DEFAULT_DEBUG_CHANNEL(class)
30
Alexandre Julliard401710d1993-09-04 10:09:32 +000031
Alexandre Julliard2ace16a1996-04-28 15:09:19 +000032static CLASS *firstClass = NULL;
Alexandre Julliard401710d1993-09-04 10:09:32 +000033
34
35/***********************************************************************
Alexandre Julliardb817f4f1996-03-14 18:08:34 +000036 * CLASS_DumpClass
37 *
38 * Dump the content of a class structure to stderr.
39 */
Alexandre Julliard2ace16a1996-04-28 15:09:19 +000040void CLASS_DumpClass( CLASS *ptr )
Alexandre Julliardb817f4f1996-03-14 18:08:34 +000041{
Gavriel Statec77c5921998-11-15 09:21:17 +000042 char className[MAX_CLASSNAME+1];
Alexandre Julliardb817f4f1996-03-14 18:08:34 +000043 int i;
44
Alexandre Julliard1285c2f1996-05-06 16:06:24 +000045 if (ptr->magic != CLASS_MAGIC)
Alexandre Julliardb817f4f1996-03-14 18:08:34 +000046 {
Alexandre Julliard359f497e1999-07-04 16:02:24 +000047 DPRINTF("%p is not a class\n", ptr );
Alexandre Julliardb817f4f1996-03-14 18:08:34 +000048 return;
49 }
Alexandre Julliard2ace16a1996-04-28 15:09:19 +000050
Alexandre Julliarda3960291999-02-26 11:11:13 +000051 GlobalGetAtomNameA( ptr->atomName, className, sizeof(className) );
Alexandre Julliardb817f4f1996-03-14 18:08:34 +000052
Alexandre Julliard359f497e1999-07-04 16:02:24 +000053 DPRINTF( "Class %p:\n", ptr );
54 DPRINTF( "next=%p name=%04x '%s' style=%08x wndProc=%08x\n"
Alexandre Julliard2c69f6d1996-09-28 18:11:01 +000055 "inst=%04x dce=%08x icon=%04x cursor=%04x bkgnd=%04x\n"
Alexandre Julliardb817f4f1996-03-14 18:08:34 +000056 "clsExtra=%d winExtra=%d #windows=%d\n",
Alexandre Julliard1285c2f1996-05-06 16:06:24 +000057 ptr->next, ptr->atomName, className, ptr->style,
Alexandre Julliarda3960291999-02-26 11:11:13 +000058 (UINT)ptr->winproc, ptr->hInstance, (UINT)ptr->dce,
Alexandre Julliard1285c2f1996-05-06 16:06:24 +000059 ptr->hIcon, ptr->hCursor, ptr->hbrBackground,
60 ptr->cbClsExtra, ptr->cbWndExtra, ptr->cWindows );
61 if (ptr->cbClsExtra)
Alexandre Julliardb817f4f1996-03-14 18:08:34 +000062 {
Alexandre Julliard359f497e1999-07-04 16:02:24 +000063 DPRINTF( "extra bytes:" );
Alexandre Julliard1285c2f1996-05-06 16:06:24 +000064 for (i = 0; i < ptr->cbClsExtra; i++)
Alexandre Julliard359f497e1999-07-04 16:02:24 +000065 DPRINTF( " %02x", *((BYTE *)ptr->wExtra+i) );
66 DPRINTF( "\n" );
Alexandre Julliardb817f4f1996-03-14 18:08:34 +000067 }
Alexandre Julliard359f497e1999-07-04 16:02:24 +000068 DPRINTF( "\n" );
Alexandre Julliardb817f4f1996-03-14 18:08:34 +000069}
70
71
72/***********************************************************************
73 * CLASS_WalkClasses
74 *
75 * Walk the class list and print each class on stderr.
76 */
77void CLASS_WalkClasses(void)
78{
Alexandre Julliardb817f4f1996-03-14 18:08:34 +000079 CLASS *ptr;
Gavriel Statec77c5921998-11-15 09:21:17 +000080 char className[MAX_CLASSNAME+1];
Alexandre Julliardb817f4f1996-03-14 18:08:34 +000081
Alexandre Julliard359f497e1999-07-04 16:02:24 +000082 DPRINTF( " Class Name Style WndProc\n" );
Alexandre Julliard2ace16a1996-04-28 15:09:19 +000083 for (ptr = firstClass; ptr; ptr = ptr->next)
Alexandre Julliardb817f4f1996-03-14 18:08:34 +000084 {
Alexandre Julliarda3960291999-02-26 11:11:13 +000085 GlobalGetAtomNameA( ptr->atomName, className, sizeof(className) );
Alexandre Julliard359f497e1999-07-04 16:02:24 +000086 DPRINTF( "%08x %-20.20s %08x %08x\n", (UINT)ptr, className,
Alexandre Julliarda3960291999-02-26 11:11:13 +000087 ptr->style, (UINT)ptr->winproc );
Alexandre Julliardb817f4f1996-03-14 18:08:34 +000088 }
Alexandre Julliard359f497e1999-07-04 16:02:24 +000089 DPRINTF( "\n" );
Alexandre Julliardb817f4f1996-03-14 18:08:34 +000090}
91
92
93/***********************************************************************
Alexandre Julliarde2bfa4c1996-05-16 18:21:06 +000094 * CLASS_GetMenuNameA
95 *
96 * Get the menu name as a ASCII string.
97 */
98static LPSTR CLASS_GetMenuNameA( CLASS *classPtr )
99{
100 if (!classPtr->menuNameA && classPtr->menuNameW)
101 {
102 /* We need to copy the Unicode string */
Alexandre Julliard7ebe1a41996-12-22 18:27:48 +0000103 classPtr->menuNameA = SEGPTR_STRDUP_WtoA( classPtr->menuNameW );
Alexandre Julliarde2bfa4c1996-05-16 18:21:06 +0000104 }
105 return classPtr->menuNameA;
106}
107
108
109/***********************************************************************
110 * CLASS_GetMenuNameW
111 *
112 * Get the menu name as a Unicode string.
113 */
114static LPWSTR CLASS_GetMenuNameW( CLASS *classPtr )
115{
116 if (!classPtr->menuNameW && classPtr->menuNameA)
117 {
118 if (!HIWORD(classPtr->menuNameA))
119 return (LPWSTR)classPtr->menuNameA;
120 /* Now we need to copy the ASCII string */
Alexandre Julliard7ebe1a41996-12-22 18:27:48 +0000121 classPtr->menuNameW = HEAP_strdupAtoW( SystemHeap, 0,
122 classPtr->menuNameA );
Alexandre Julliarde2bfa4c1996-05-16 18:21:06 +0000123 }
124 return classPtr->menuNameW;
125}
126
127
128/***********************************************************************
129 * CLASS_SetMenuNameA
130 *
131 * Set the menu name in a class structure by copying the string.
132 */
133static void CLASS_SetMenuNameA( CLASS *classPtr, LPCSTR name )
134{
135 if (HIWORD(classPtr->menuNameA)) SEGPTR_FREE( classPtr->menuNameA );
136 if (classPtr->menuNameW) HeapFree( SystemHeap, 0, classPtr->menuNameW );
137 classPtr->menuNameA = SEGPTR_STRDUP( name );
138 classPtr->menuNameW = 0;
139}
140
141
142/***********************************************************************
143 * CLASS_SetMenuNameW
144 *
145 * Set the menu name in a class structure by copying the string.
146 */
147static void CLASS_SetMenuNameW( CLASS *classPtr, LPCWSTR name )
148{
149 if (!HIWORD(name))
150 {
151 CLASS_SetMenuNameA( classPtr, (LPCSTR)name );
152 return;
153 }
154 if (HIWORD(classPtr->menuNameA)) SEGPTR_FREE( classPtr->menuNameA );
155 if (classPtr->menuNameW) HeapFree( SystemHeap, 0, classPtr->menuNameW );
156 if ((classPtr->menuNameW = HeapAlloc( SystemHeap, 0,
Alexandre Julliarda3960291999-02-26 11:11:13 +0000157 (lstrlenW(name)+1)*sizeof(WCHAR) )))
158 lstrcpyW( classPtr->menuNameW, name );
Alexandre Julliarde2bfa4c1996-05-16 18:21:06 +0000159 classPtr->menuNameA = 0;
160}
161
162
163/***********************************************************************
Gavriel Statec77c5921998-11-15 09:21:17 +0000164 * CLASS_GetClassNameA
165 *
166 * Get the clas name as a ASCII string.
167 */
168static LPSTR CLASS_GetClassNameA( CLASS *classPtr )
169{
170 if (!classPtr->classNameA && classPtr->classNameW)
171 {
172 /* We need to copy the Unicode string */
173 classPtr->classNameA = SEGPTR_STRDUP_WtoA( classPtr->classNameW );
174 }
175 return classPtr->classNameA;
176}
177
178
179/***********************************************************************
180 * CLASS_GetClassNameW
181 *
182 * Get the class name as a Unicode string.
183 */
184static LPWSTR CLASS_GetClassNameW( CLASS *classPtr )
185{
186 if (!classPtr->classNameW && classPtr->classNameA)
187 {
188 if (!HIWORD(classPtr->classNameA))
189 return (LPWSTR)classPtr->classNameA;
190 /* Now we need to copy the ASCII string */
191 classPtr->classNameW = HEAP_strdupAtoW( SystemHeap, 0,
192 classPtr->classNameA );
193 }
194 return classPtr->classNameW;
195}
196
197/***********************************************************************
198 * CLASS_SetClassNameA
199 *
200 * Set the class name in a class structure by copying the string.
201 */
202static void CLASS_SetClassNameA( CLASS *classPtr, LPCSTR name )
203{
204 if (HIWORD(classPtr->classNameA)) SEGPTR_FREE( classPtr->classNameA );
205 if (classPtr->classNameW) HeapFree( SystemHeap, 0, classPtr->classNameW );
206 classPtr->classNameA = SEGPTR_STRDUP( name );
207 classPtr->classNameW = 0;
208}
209
210
211/***********************************************************************
212 * CLASS_SetClassNameW
213 *
214 * Set the class name in a class structure by copying the string.
215 */
216static void CLASS_SetClassNameW( CLASS *classPtr, LPCWSTR name )
217{
218 if (!HIWORD(name))
219 {
220 CLASS_SetClassNameA( classPtr, (LPCSTR)name );
221 return;
222 }
223 if (HIWORD(classPtr->classNameA)) SEGPTR_FREE( classPtr->classNameA );
224 if (classPtr->classNameW) HeapFree( SystemHeap, 0, classPtr->classNameW );
225 if ((classPtr->classNameW = HeapAlloc( SystemHeap, 0,
Alexandre Julliarda3960291999-02-26 11:11:13 +0000226 (lstrlenW(name)+1)*sizeof(WCHAR) )))
227 lstrcpyW( classPtr->classNameW, name );
Gavriel Statec77c5921998-11-15 09:21:17 +0000228 classPtr->classNameA = 0;
229}
230
231
232/***********************************************************************
Alexandre Julliard2ace16a1996-04-28 15:09:19 +0000233 * CLASS_FreeClass
234 *
235 * Free a class structure.
236 */
Alexandre Julliarda3960291999-02-26 11:11:13 +0000237static BOOL CLASS_FreeClass( CLASS *classPtr )
Alexandre Julliard2ace16a1996-04-28 15:09:19 +0000238{
239 CLASS **ppClass;
Alexandre Julliard359f497e1999-07-04 16:02:24 +0000240 TRACE("%p \n", classPtr);
Alexandre Julliard2ace16a1996-04-28 15:09:19 +0000241
Alexandre Julliarde2bfa4c1996-05-16 18:21:06 +0000242 /* Check if we can remove this class */
243
244 if (classPtr->cWindows > 0) return FALSE;
245
Alexandre Julliard2ace16a1996-04-28 15:09:19 +0000246 /* Remove the class from the linked list */
247
248 for (ppClass = &firstClass; *ppClass; ppClass = &(*ppClass)->next)
249 if (*ppClass == classPtr) break;
250 if (!*ppClass)
251 {
Alexandre Julliard359f497e1999-07-04 16:02:24 +0000252 ERR("Class list corrupted\n" );
Alexandre Julliarde2bfa4c1996-05-16 18:21:06 +0000253 return FALSE;
Alexandre Julliard2ace16a1996-04-28 15:09:19 +0000254 }
255 *ppClass = classPtr->next;
256
257 /* Delete the class */
258
Alexandre Julliard2c69f6d1996-09-28 18:11:01 +0000259 if (classPtr->dce) DCE_FreeDCE( classPtr->dce );
Alexandre Julliarda3960291999-02-26 11:11:13 +0000260 if (classPtr->hbrBackground) DeleteObject( classPtr->hbrBackground );
Alexandre Julliard2ace16a1996-04-28 15:09:19 +0000261 GlobalDeleteAtom( classPtr->atomName );
Alexandre Julliarde2bfa4c1996-05-16 18:21:06 +0000262 CLASS_SetMenuNameA( classPtr, NULL );
Gavriel Statec77c5921998-11-15 09:21:17 +0000263 CLASS_SetClassNameA( classPtr, NULL );
Alexandre Julliarddf2673b1997-03-29 17:20:20 +0000264 WINPROC_FreeProc( classPtr->winproc, WIN_PROC_CLASS );
Alexandre Julliard1285c2f1996-05-06 16:06:24 +0000265 HeapFree( SystemHeap, 0, classPtr );
Alexandre Julliarde2bfa4c1996-05-16 18:21:06 +0000266 return TRUE;
Alexandre Julliard2ace16a1996-04-28 15:09:19 +0000267}
268
269
270/***********************************************************************
271 * CLASS_FreeModuleClasses
272 */
Alexandre Julliard3051b641996-07-05 17:14:13 +0000273void CLASS_FreeModuleClasses( HMODULE16 hModule )
Alexandre Julliard2ace16a1996-04-28 15:09:19 +0000274{
275 CLASS *ptr, *next;
276
Alexandre Julliard359f497e1999-07-04 16:02:24 +0000277 TRACE("0x%08x \n", hModule);
Alexandre Julliard767e6f61998-08-09 12:47:43 +0000278
Alexandre Julliard2ace16a1996-04-28 15:09:19 +0000279 for (ptr = firstClass; ptr; ptr = next)
280 {
281 next = ptr->next;
Alexandre Julliard1285c2f1996-05-06 16:06:24 +0000282 if (ptr->hInstance == hModule) CLASS_FreeClass( ptr );
Alexandre Julliard2ace16a1996-04-28 15:09:19 +0000283 }
284}
285
286
287/***********************************************************************
Alexandre Julliard1285c2f1996-05-06 16:06:24 +0000288 * CLASS_FindClassByAtom
289 *
290 * Return a pointer to the class.
Alexandre Julliard77b99181997-09-14 17:17:23 +0000291 * hinstance has been normalized by the caller.
Alexandre Julliard767e6f61998-08-09 12:47:43 +0000292 *
293 * NOTES
294 * 980805 a local class will be found now if registred with hInst=0
295 * and looed up with a hInst!=0. msmoney does it (jsch)
Alexandre Julliard1285c2f1996-05-06 16:06:24 +0000296 */
Alexandre Julliarda3960291999-02-26 11:11:13 +0000297CLASS *CLASS_FindClassByAtom( ATOM atom, HINSTANCE hinstance )
Alexandre Julliard767e6f61998-08-09 12:47:43 +0000298{ CLASS * class, *tclass=0;
299
Alexandre Julliard359f497e1999-07-04 16:02:24 +0000300 TRACE("0x%08x 0x%08x\n", atom, hinstance);
Alexandre Julliard1285c2f1996-05-06 16:06:24 +0000301
Alexandre Julliard77b99181997-09-14 17:17:23 +0000302 /* First search task-specific classes */
Alexandre Julliard1285c2f1996-05-06 16:06:24 +0000303
304 for (class = firstClass; (class); class = class->next)
305 {
306 if (class->style & CS_GLOBALCLASS) continue;
Alexandre Julliard767e6f61998-08-09 12:47:43 +0000307 if (class->atomName == atom)
308 {
309 if (hinstance==class->hInstance || hinstance==0xffff )
310 {
Alexandre Julliard359f497e1999-07-04 16:02:24 +0000311 TRACE("-- found local %p\n", class);
Alexandre Julliard767e6f61998-08-09 12:47:43 +0000312 return class;
313 }
314 if (class->hInstance==0) tclass = class;
315 }
Alexandre Julliard1285c2f1996-05-06 16:06:24 +0000316 }
317
318 /* Then search global classes */
319
320 for (class = firstClass; (class); class = class->next)
321 {
322 if (!(class->style & CS_GLOBALCLASS)) continue;
Alexandre Julliard767e6f61998-08-09 12:47:43 +0000323 if (class->atomName == atom)
324 {
Alexandre Julliard359f497e1999-07-04 16:02:24 +0000325 TRACE("-- found global %p\n", class);
Alexandre Julliard767e6f61998-08-09 12:47:43 +0000326 return class;
327 }
Alexandre Julliard1285c2f1996-05-06 16:06:24 +0000328 }
329
Alexandre Julliard767e6f61998-08-09 12:47:43 +0000330 /* Then check if there was a local class with hInst=0*/
331 if ( tclass )
332 {
Alexandre Julliard359f497e1999-07-04 16:02:24 +0000333 WARN("-- found local Class registred with hInst=0\n");
Alexandre Julliard767e6f61998-08-09 12:47:43 +0000334 return tclass;
335 }
336
Alexandre Julliard359f497e1999-07-04 16:02:24 +0000337 TRACE("-- not found\n");
Alexandre Julliard1285c2f1996-05-06 16:06:24 +0000338 return 0;
339}
340
341
342/***********************************************************************
Alexandre Julliarde2bfa4c1996-05-16 18:21:06 +0000343 * CLASS_RegisterClass
344 *
345 * The real RegisterClass() functionality.
346 */
Alexandre Julliarda3960291999-02-26 11:11:13 +0000347static CLASS *CLASS_RegisterClass( ATOM atom, HINSTANCE hInstance,
348 DWORD style, INT classExtra,
349 INT winExtra, WNDPROC16 wndProc,
Alexandre Julliard2d93d001996-05-21 15:01:41 +0000350 WINDOWPROCTYPE wndProcType )
Alexandre Julliarde2bfa4c1996-05-16 18:21:06 +0000351{
352 CLASS *classPtr;
353
Alexandre Julliard359f497e1999-07-04 16:02:24 +0000354 TRACE("atom=0x%x hinst=0x%x style=0x%lx clExtr=0x%x winExtr=0x%x wndProc=0x%p ProcType=0x%x\n",
Alexandre Julliard767e6f61998-08-09 12:47:43 +0000355 atom, hInstance, style, classExtra, winExtra, wndProc, wndProcType);
Alexandre Julliarde2bfa4c1996-05-16 18:21:06 +0000356
Alexandre Julliard767e6f61998-08-09 12:47:43 +0000357 /* Check if a class with this name already exists */
Alexandre Julliarde2bfa4c1996-05-16 18:21:06 +0000358 classPtr = CLASS_FindClassByAtom( atom, hInstance );
359 if (classPtr)
360 {
361 /* Class can be created only if it is local and */
362 /* if the class with the same name is global. */
363
364 if (style & CS_GLOBALCLASS) return NULL;
365 if (!(classPtr->style & CS_GLOBALCLASS)) return NULL;
366 }
367
368 /* Fix the extra bytes value */
369
370 if (classExtra < 0) classExtra = 0;
371 else if (classExtra > 40) /* Extra bytes are limited to 40 in Win32 */
Alexandre Julliard359f497e1999-07-04 16:02:24 +0000372 WARN("Class extra bytes %d is > 40\n", classExtra);
Alexandre Julliarde2bfa4c1996-05-16 18:21:06 +0000373 if (winExtra < 0) winExtra = 0;
374 else if (winExtra > 40) /* Extra bytes are limited to 40 in Win32 */
Alexandre Julliard359f497e1999-07-04 16:02:24 +0000375 WARN("Win extra bytes %d is > 40\n", winExtra );
Alexandre Julliarde2bfa4c1996-05-16 18:21:06 +0000376
377 /* Create the class */
378
379 classPtr = (CLASS *)HeapAlloc( SystemHeap, 0, sizeof(CLASS) +
380 classExtra - sizeof(classPtr->wExtra) );
381 if (!classPtr) return NULL;
Alexandre Julliard2d93d001996-05-21 15:01:41 +0000382 classPtr->next = firstClass;
383 classPtr->magic = CLASS_MAGIC;
384 classPtr->cWindows = 0;
385 classPtr->style = style;
Alexandre Julliard3051b641996-07-05 17:14:13 +0000386 classPtr->winproc = (HWINDOWPROC)0;
Alexandre Julliard2d93d001996-05-21 15:01:41 +0000387 classPtr->cbWndExtra = winExtra;
388 classPtr->cbClsExtra = classExtra;
389 classPtr->hInstance = hInstance;
390 classPtr->atomName = atom;
391 classPtr->menuNameA = 0;
392 classPtr->menuNameW = 0;
Rein Klazescb37dfd1998-11-22 14:13:47 +0000393 classPtr->classNameA = 0;
394 classPtr->classNameW = 0;
Alexandre Julliard2c69f6d1996-09-28 18:11:01 +0000395 classPtr->dce = (style & CS_CLASSDC) ?
396 DCE_AllocDCE( 0, DCE_CLASS_DC ) : NULL;
397
Gavriel Statec77c5921998-11-15 09:21:17 +0000398 WINPROC_SetProc( &classPtr->winproc, wndProc, wndProcType, WIN_PROC_CLASS);
Alexandre Julliard3051b641996-07-05 17:14:13 +0000399
Alexandre Julliarde2bfa4c1996-05-16 18:21:06 +0000400 /* Other values must be set by caller */
401
402 if (classExtra) memset( classPtr->wExtra, 0, classExtra );
403 firstClass = classPtr;
404 return classPtr;
405}
406
407
408/***********************************************************************
Alexandre Julliard1285c2f1996-05-06 16:06:24 +0000409 * RegisterClass16 (USER.57)
Alexandre Julliard401710d1993-09-04 10:09:32 +0000410 */
Alexandre Julliard670cdc41997-08-24 16:00:30 +0000411ATOM WINAPI RegisterClass16( const WNDCLASS16 *wc )
Alexandre Julliard401710d1993-09-04 10:09:32 +0000412{
Alexandre Julliarde2bfa4c1996-05-16 18:21:06 +0000413 ATOM atom;
414 CLASS *classPtr;
Alexandre Julliard77b99181997-09-14 17:17:23 +0000415 HINSTANCE16 hInstance=GetExePtr(wc->hInstance);
Alexandre Julliarde2bfa4c1996-05-16 18:21:06 +0000416
417 if (!(atom = GlobalAddAtom16( wc->lpszClassName ))) return 0;
418 if (!(classPtr = CLASS_RegisterClass( atom, hInstance, wc->style,
Alexandre Julliard2d93d001996-05-21 15:01:41 +0000419 wc->cbClsExtra, wc->cbWndExtra,
Alexandre Julliard3051b641996-07-05 17:14:13 +0000420 wc->lpfnWndProc, WIN_PROC_16 )))
Alexandre Julliard5f721f81994-01-04 20:14:34 +0000421 {
Alexandre Julliarde2bfa4c1996-05-16 18:21:06 +0000422 GlobalDeleteAtom( atom );
423 return 0;
Alexandre Julliard5f721f81994-01-04 20:14:34 +0000424 }
425
Alexandre Julliard359f497e1999-07-04 16:02:24 +0000426 TRACE("atom=%04x wndproc=%08lx hinst=%04x "
Patrik Stridvalla9a671d1999-04-25 19:01:52 +0000427 "bg=%04x style=%08x clsExt=%d winExt=%d class=%p name='%s'\n",
Alexandre Julliarde2bfa4c1996-05-16 18:21:06 +0000428 atom, (DWORD)wc->lpfnWndProc, hInstance,
429 wc->hbrBackground, wc->style, wc->cbClsExtra,
Alexandre Julliard641ee761997-08-04 16:34:36 +0000430 wc->cbWndExtra, classPtr,
431 HIWORD(wc->lpszClassName) ?
432 (char *)PTR_SEG_TO_LIN(wc->lpszClassName) : "" );
Alexandre Julliard5f721f81994-01-04 20:14:34 +0000433
Alexandre Julliarde2bfa4c1996-05-16 18:21:06 +0000434 classPtr->hIcon = wc->hIcon;
435 classPtr->hIconSm = 0;
436 classPtr->hCursor = wc->hCursor;
437 classPtr->hbrBackground = wc->hbrBackground;
Alexandre Julliardf0b23541993-09-29 12:21:49 +0000438
Alexandre Julliarde2bfa4c1996-05-16 18:21:06 +0000439 CLASS_SetMenuNameA( classPtr, HIWORD(wc->lpszMenuName) ?
440 PTR_SEG_TO_LIN(wc->lpszMenuName) : (LPCSTR)wc->lpszMenuName );
Gavriel Statec77c5921998-11-15 09:21:17 +0000441 CLASS_SetClassNameA( classPtr, HIWORD(wc->lpszClassName) ?
442 PTR_SEG_TO_LIN(wc->lpszClassName) : (LPCSTR)wc->lpszClassName );
443
Alexandre Julliarde2bfa4c1996-05-16 18:21:06 +0000444 return atom;
Alexandre Julliard401710d1993-09-04 10:09:32 +0000445}
446
447
448/***********************************************************************
Alexandre Julliard54c27111998-03-29 19:44:57 +0000449 * RegisterClass32A (USER32.427)
Alexandre Julliarda69b88b1998-03-15 20:29:56 +0000450 * RETURNS
451 * >0: Unique identifier
452 * 0: Failure
Alexandre Julliard401710d1993-09-04 10:09:32 +0000453 */
Alexandre Julliarda3960291999-02-26 11:11:13 +0000454ATOM WINAPI RegisterClassA(
455 const WNDCLASSA* wc /* Address of structure with class data */
Alexandre Julliarda69b88b1998-03-15 20:29:56 +0000456) {
Alexandre Julliarde2bfa4c1996-05-16 18:21:06 +0000457 ATOM atom;
458 CLASS *classPtr;
Alexandre Julliard1285c2f1996-05-06 16:06:24 +0000459
Alexandre Julliarda3960291999-02-26 11:11:13 +0000460 if (!(atom = GlobalAddAtomA( wc->lpszClassName )))
Alexandre Julliard767e6f61998-08-09 12:47:43 +0000461 {
462 SetLastError(ERROR_CLASS_ALREADY_EXISTS);
463 return FALSE;
464 }
Alexandre Julliard77b99181997-09-14 17:17:23 +0000465 if (!(classPtr = CLASS_RegisterClass( atom, wc->hInstance, wc->style,
Alexandre Julliard2d93d001996-05-21 15:01:41 +0000466 wc->cbClsExtra, wc->cbWndExtra,
Alexandre Julliard3051b641996-07-05 17:14:13 +0000467 (WNDPROC16)wc->lpfnWndProc,
Alexandre Julliard2d93d001996-05-21 15:01:41 +0000468 WIN_PROC_32A )))
Alexandre Julliard767e6f61998-08-09 12:47:43 +0000469 { GlobalDeleteAtom( atom );
470 SetLastError(ERROR_CLASS_ALREADY_EXISTS);
471 return FALSE;
Alexandre Julliard1285c2f1996-05-06 16:06:24 +0000472 }
Alexandre Julliarde2bfa4c1996-05-16 18:21:06 +0000473
Alexandre Julliard359f497e1999-07-04 16:02:24 +0000474 TRACE("atom=%04x wndproc=%08lx hinst=%04x bg=%04x style=%08x clsExt=%d winExt=%d class=%p name='%s'\n",
Alexandre Julliard77b99181997-09-14 17:17:23 +0000475 atom, (DWORD)wc->lpfnWndProc, wc->hInstance,
Alexandre Julliarde2bfa4c1996-05-16 18:21:06 +0000476 wc->hbrBackground, wc->style, wc->cbClsExtra,
Alexandre Julliard641ee761997-08-04 16:34:36 +0000477 wc->cbWndExtra, classPtr,
478 HIWORD(wc->lpszClassName) ? wc->lpszClassName : "" );
Alexandre Julliarde2bfa4c1996-05-16 18:21:06 +0000479
Alexandre Julliarde2bfa4c1996-05-16 18:21:06 +0000480 classPtr->hIcon = (HICON16)wc->hIcon;
481 classPtr->hIconSm = 0;
482 classPtr->hCursor = (HCURSOR16)wc->hCursor;
483 classPtr->hbrBackground = (HBRUSH16)wc->hbrBackground;
Gavriel Statec77c5921998-11-15 09:21:17 +0000484
Alexandre Julliarde2bfa4c1996-05-16 18:21:06 +0000485 CLASS_SetMenuNameA( classPtr, wc->lpszMenuName );
Gavriel Statec77c5921998-11-15 09:21:17 +0000486 CLASS_SetClassNameA( classPtr, wc->lpszClassName );
Alexandre Julliarde2bfa4c1996-05-16 18:21:06 +0000487 return atom;
488}
489
490
491/***********************************************************************
Alexandre Julliard54c27111998-03-29 19:44:57 +0000492 * RegisterClass32W (USER32.430)
Alexandre Julliarde2bfa4c1996-05-16 18:21:06 +0000493 */
Alexandre Julliarda3960291999-02-26 11:11:13 +0000494ATOM WINAPI RegisterClassW( const WNDCLASSW* wc )
Alexandre Julliarde2bfa4c1996-05-16 18:21:06 +0000495{
496 ATOM atom;
497 CLASS *classPtr;
498
Alexandre Julliarda3960291999-02-26 11:11:13 +0000499 if (!(atom = GlobalAddAtomW( wc->lpszClassName )))
Alexandre Julliard767e6f61998-08-09 12:47:43 +0000500 {
501 SetLastError(ERROR_CLASS_ALREADY_EXISTS);
502 return FALSE;
503 }
Alexandre Julliard77b99181997-09-14 17:17:23 +0000504 if (!(classPtr = CLASS_RegisterClass( atom, wc->hInstance, wc->style,
Alexandre Julliard2d93d001996-05-21 15:01:41 +0000505 wc->cbClsExtra, wc->cbWndExtra,
Alexandre Julliard3051b641996-07-05 17:14:13 +0000506 (WNDPROC16)wc->lpfnWndProc,
Alexandre Julliard2d93d001996-05-21 15:01:41 +0000507 WIN_PROC_32W )))
Alexandre Julliarde2bfa4c1996-05-16 18:21:06 +0000508 {
Alexandre Julliard767e6f61998-08-09 12:47:43 +0000509 SetLastError(ERROR_CLASS_ALREADY_EXISTS);
Alexandre Julliarde2bfa4c1996-05-16 18:21:06 +0000510 GlobalDeleteAtom( atom );
511 return 0;
512 }
513
Alexandre Julliard359f497e1999-07-04 16:02:24 +0000514 TRACE("atom=%04x wndproc=%08lx hinst=%04x bg=%04x style=%08x clsExt=%d winExt=%d class=%p\n",
Alexandre Julliard77b99181997-09-14 17:17:23 +0000515 atom, (DWORD)wc->lpfnWndProc, wc->hInstance,
Alexandre Julliarde2bfa4c1996-05-16 18:21:06 +0000516 wc->hbrBackground, wc->style, wc->cbClsExtra,
517 wc->cbWndExtra, classPtr );
518
Alexandre Julliarde2bfa4c1996-05-16 18:21:06 +0000519 classPtr->hIcon = (HICON16)wc->hIcon;
520 classPtr->hIconSm = 0;
521 classPtr->hCursor = (HCURSOR16)wc->hCursor;
522 classPtr->hbrBackground = (HBRUSH16)wc->hbrBackground;
Gavriel Statec77c5921998-11-15 09:21:17 +0000523
Alexandre Julliarde2bfa4c1996-05-16 18:21:06 +0000524 CLASS_SetMenuNameW( classPtr, wc->lpszMenuName );
Gavriel Statec77c5921998-11-15 09:21:17 +0000525 CLASS_SetClassNameW( classPtr, wc->lpszClassName );
Alexandre Julliarde2bfa4c1996-05-16 18:21:06 +0000526 return atom;
527}
528
529
530/***********************************************************************
531 * RegisterClassEx16 (USER.397)
532 */
Alexandre Julliard670cdc41997-08-24 16:00:30 +0000533ATOM WINAPI RegisterClassEx16( const WNDCLASSEX16 *wc )
Alexandre Julliarde2bfa4c1996-05-16 18:21:06 +0000534{
535 ATOM atom;
536 CLASS *classPtr;
Alexandre Julliard77b99181997-09-14 17:17:23 +0000537 HINSTANCE16 hInstance = GetExePtr( wc->hInstance );
Alexandre Julliarde2bfa4c1996-05-16 18:21:06 +0000538
539 if (!(atom = GlobalAddAtom16( wc->lpszClassName ))) return 0;
540 if (!(classPtr = CLASS_RegisterClass( atom, hInstance, wc->style,
Alexandre Julliard2d93d001996-05-21 15:01:41 +0000541 wc->cbClsExtra, wc->cbWndExtra,
Alexandre Julliard3051b641996-07-05 17:14:13 +0000542 wc->lpfnWndProc, WIN_PROC_16 )))
Alexandre Julliarde2bfa4c1996-05-16 18:21:06 +0000543 {
544 GlobalDeleteAtom( atom );
545 return 0;
546 }
547
Alexandre Julliard359f497e1999-07-04 16:02:24 +0000548 TRACE("atom=%04x wndproc=%08lx hinst=%04x bg=%04x style=%08x clsExt=%d winExt=%d class=%p\n",
Alexandre Julliarde2bfa4c1996-05-16 18:21:06 +0000549 atom, (DWORD)wc->lpfnWndProc, hInstance,
550 wc->hbrBackground, wc->style, wc->cbClsExtra,
551 wc->cbWndExtra, classPtr );
552
Alexandre Julliarde2bfa4c1996-05-16 18:21:06 +0000553 classPtr->hIcon = wc->hIcon;
554 classPtr->hIconSm = wc->hIconSm;
555 classPtr->hCursor = wc->hCursor;
556 classPtr->hbrBackground = wc->hbrBackground;
557
558 CLASS_SetMenuNameA( classPtr, HIWORD(wc->lpszMenuName) ?
559 PTR_SEG_TO_LIN(wc->lpszMenuName) : (LPCSTR)wc->lpszMenuName );
Gavriel Statec77c5921998-11-15 09:21:17 +0000560 CLASS_SetClassNameA( classPtr, HIWORD(wc->lpszClassName) ?
561 PTR_SEG_TO_LIN(wc->lpszClassName) : (LPCSTR)wc->lpszClassName );
Alexandre Julliarde2bfa4c1996-05-16 18:21:06 +0000562 return atom;
563}
564
565
566/***********************************************************************
Alexandre Julliard54c27111998-03-29 19:44:57 +0000567 * RegisterClassEx32A (USER32.428)
Alexandre Julliarde2bfa4c1996-05-16 18:21:06 +0000568 */
Alexandre Julliarda3960291999-02-26 11:11:13 +0000569ATOM WINAPI RegisterClassExA( const WNDCLASSEXA* wc )
Alexandre Julliarde2bfa4c1996-05-16 18:21:06 +0000570{
571 ATOM atom;
572 CLASS *classPtr;
573
Alexandre Julliarda3960291999-02-26 11:11:13 +0000574 if (!(atom = GlobalAddAtomA( wc->lpszClassName )))
Alexandre Julliard767e6f61998-08-09 12:47:43 +0000575 {
576 SetLastError(ERROR_CLASS_ALREADY_EXISTS);
577 return FALSE;
578 }
Alexandre Julliard77b99181997-09-14 17:17:23 +0000579 if (!(classPtr = CLASS_RegisterClass( atom, wc->hInstance, wc->style,
Alexandre Julliard2d93d001996-05-21 15:01:41 +0000580 wc->cbClsExtra, wc->cbWndExtra,
Alexandre Julliard3051b641996-07-05 17:14:13 +0000581 (WNDPROC16)wc->lpfnWndProc,
Alexandre Julliard2d93d001996-05-21 15:01:41 +0000582 WIN_PROC_32A )))
Alexandre Julliarde2bfa4c1996-05-16 18:21:06 +0000583 {
Alexandre Julliard767e6f61998-08-09 12:47:43 +0000584 SetLastError(ERROR_CLASS_ALREADY_EXISTS);
Alexandre Julliarde2bfa4c1996-05-16 18:21:06 +0000585 GlobalDeleteAtom( atom );
Alexandre Julliard767e6f61998-08-09 12:47:43 +0000586 return FALSE;
Alexandre Julliarde2bfa4c1996-05-16 18:21:06 +0000587 }
588
Alexandre Julliard359f497e1999-07-04 16:02:24 +0000589 TRACE("atom=%04x wndproc=%08lx hinst=%04x bg=%04x style=%08x clsExt=%d winExt=%d class=%p\n",
Alexandre Julliard77b99181997-09-14 17:17:23 +0000590 atom, (DWORD)wc->lpfnWndProc, wc->hInstance,
Alexandre Julliarde2bfa4c1996-05-16 18:21:06 +0000591 wc->hbrBackground, wc->style, wc->cbClsExtra,
592 wc->cbWndExtra, classPtr );
593
Alexandre Julliarde2bfa4c1996-05-16 18:21:06 +0000594 classPtr->hIcon = (HICON16)wc->hIcon;
595 classPtr->hIconSm = (HICON16)wc->hIconSm;
596 classPtr->hCursor = (HCURSOR16)wc->hCursor;
597 classPtr->hbrBackground = (HBRUSH16)wc->hbrBackground;
Alexandre Julliarde2bfa4c1996-05-16 18:21:06 +0000598 CLASS_SetMenuNameA( classPtr, wc->lpszMenuName );
Gavriel Statec77c5921998-11-15 09:21:17 +0000599 CLASS_SetClassNameA( classPtr, wc->lpszClassName );
Alexandre Julliarde2bfa4c1996-05-16 18:21:06 +0000600 return atom;
601}
602
603
604/***********************************************************************
Alexandre Julliard54c27111998-03-29 19:44:57 +0000605 * RegisterClassEx32W (USER32.429)
Alexandre Julliarde2bfa4c1996-05-16 18:21:06 +0000606 */
Alexandre Julliarda3960291999-02-26 11:11:13 +0000607ATOM WINAPI RegisterClassExW( const WNDCLASSEXW* wc )
Alexandre Julliarde2bfa4c1996-05-16 18:21:06 +0000608{
609 ATOM atom;
610 CLASS *classPtr;
611
Alexandre Julliarda3960291999-02-26 11:11:13 +0000612 if (!(atom = GlobalAddAtomW( wc->lpszClassName )))
Alexandre Julliard767e6f61998-08-09 12:47:43 +0000613 {
614 SetLastError(ERROR_CLASS_ALREADY_EXISTS);
615 return 0;
616 }
Alexandre Julliard77b99181997-09-14 17:17:23 +0000617 if (!(classPtr = CLASS_RegisterClass( atom, wc->hInstance, wc->style,
Alexandre Julliard2d93d001996-05-21 15:01:41 +0000618 wc->cbClsExtra, wc->cbWndExtra,
Alexandre Julliard3051b641996-07-05 17:14:13 +0000619 (WNDPROC16)wc->lpfnWndProc,
Alexandre Julliard2d93d001996-05-21 15:01:41 +0000620 WIN_PROC_32W )))
Alexandre Julliarde2bfa4c1996-05-16 18:21:06 +0000621 {
Alexandre Julliard767e6f61998-08-09 12:47:43 +0000622 SetLastError(ERROR_CLASS_ALREADY_EXISTS);
Alexandre Julliarde2bfa4c1996-05-16 18:21:06 +0000623 GlobalDeleteAtom( atom );
624 return 0;
625 }
626
Alexandre Julliard359f497e1999-07-04 16:02:24 +0000627 TRACE("atom=%04x wndproc=%08lx hinst=%04x bg=%04x style=%08x clsExt=%d winExt=%d class=%p\n",
Alexandre Julliard77b99181997-09-14 17:17:23 +0000628 atom, (DWORD)wc->lpfnWndProc, wc->hInstance,
Alexandre Julliarde2bfa4c1996-05-16 18:21:06 +0000629 wc->hbrBackground, wc->style, wc->cbClsExtra,
630 wc->cbWndExtra, classPtr );
631
Alexandre Julliarde2bfa4c1996-05-16 18:21:06 +0000632 classPtr->hIcon = (HICON16)wc->hIcon;
633 classPtr->hIconSm = (HICON16)wc->hIconSm;
634 classPtr->hCursor = (HCURSOR16)wc->hCursor;
635 classPtr->hbrBackground = (HBRUSH16)wc->hbrBackground;
Alexandre Julliarde2bfa4c1996-05-16 18:21:06 +0000636 CLASS_SetMenuNameW( classPtr, wc->lpszMenuName );
Gavriel Statec77c5921998-11-15 09:21:17 +0000637 CLASS_SetClassNameW( classPtr, wc->lpszClassName );
Alexandre Julliarde2bfa4c1996-05-16 18:21:06 +0000638 return atom;
Alexandre Julliard1285c2f1996-05-06 16:06:24 +0000639}
640
641
642/***********************************************************************
643 * UnregisterClass16 (USER.403)
644 */
Alexandre Julliard670cdc41997-08-24 16:00:30 +0000645BOOL16 WINAPI UnregisterClass16( SEGPTR className, HINSTANCE16 hInstance )
Alexandre Julliard401710d1993-09-04 10:09:32 +0000646{
Alexandre Julliard2ace16a1996-04-28 15:09:19 +0000647 CLASS *classPtr;
Alexandre Julliarde2bfa4c1996-05-16 18:21:06 +0000648 ATOM atom;
Alexandre Julliard2ace16a1996-04-28 15:09:19 +0000649
Alexandre Julliarde2bfa4c1996-05-16 18:21:06 +0000650 hInstance = GetExePtr( hInstance );
651 if (!(atom = GlobalFindAtom16( className ))) return FALSE;
652 if (!(classPtr = CLASS_FindClassByAtom( atom, hInstance )) ||
653 (classPtr->hInstance != hInstance)) return FALSE;
654 return CLASS_FreeClass( classPtr );
Alexandre Julliard401710d1993-09-04 10:09:32 +0000655}
656
657
658/***********************************************************************
Alexandre Julliard54c27111998-03-29 19:44:57 +0000659 * UnregisterClass32A (USER32.563)
Alexandre Julliard767e6f61998-08-09 12:47:43 +0000660 *
Alexandre Julliard401710d1993-09-04 10:09:32 +0000661 */
Alexandre Julliarda3960291999-02-26 11:11:13 +0000662BOOL WINAPI UnregisterClassA( LPCSTR className, HINSTANCE hInstance )
Alexandre Julliard767e6f61998-08-09 12:47:43 +0000663{ CLASS *classPtr;
Alexandre Julliarde2bfa4c1996-05-16 18:21:06 +0000664 ATOM atom;
Alexandre Julliarda3960291999-02-26 11:11:13 +0000665 BOOL ret;
Alexandre Julliarde2bfa4c1996-05-16 18:21:06 +0000666
Alexandre Julliard359f497e1999-07-04 16:02:24 +0000667 TRACE("%s %x\n",debugres_a(className), hInstance);
Alexandre Julliard767e6f61998-08-09 12:47:43 +0000668
Alexandre Julliarda3960291999-02-26 11:11:13 +0000669 if (!(atom = GlobalFindAtomA( className )))
Alexandre Julliard767e6f61998-08-09 12:47:43 +0000670 {
671 SetLastError(ERROR_CLASS_DOES_NOT_EXIST);
672 return FALSE;
673 }
Alexandre Julliarde2bfa4c1996-05-16 18:21:06 +0000674 if (!(classPtr = CLASS_FindClassByAtom( atom, hInstance )) ||
Alexandre Julliard767e6f61998-08-09 12:47:43 +0000675 (classPtr->hInstance != hInstance))
676 {
677 SetLastError(ERROR_CLASS_DOES_NOT_EXIST);
678 return FALSE;
679 }
680 if (!(ret = CLASS_FreeClass( classPtr )))
681 SetLastError(ERROR_CLASS_HAS_WINDOWS);
682 return ret;
Alexandre Julliarde2bfa4c1996-05-16 18:21:06 +0000683}
684
Alexandre Julliarde2bfa4c1996-05-16 18:21:06 +0000685/***********************************************************************
Alexandre Julliard54c27111998-03-29 19:44:57 +0000686 * UnregisterClass32W (USER32.564)
Alexandre Julliarde2bfa4c1996-05-16 18:21:06 +0000687 */
Alexandre Julliarda3960291999-02-26 11:11:13 +0000688BOOL WINAPI UnregisterClassW( LPCWSTR className, HINSTANCE hInstance )
Alexandre Julliard767e6f61998-08-09 12:47:43 +0000689{ CLASS *classPtr;
Alexandre Julliarde2bfa4c1996-05-16 18:21:06 +0000690 ATOM atom;
Alexandre Julliarda3960291999-02-26 11:11:13 +0000691 BOOL ret;
Alexandre Julliarde2bfa4c1996-05-16 18:21:06 +0000692
Alexandre Julliard359f497e1999-07-04 16:02:24 +0000693 TRACE("%s %x\n",debugres_w(className), hInstance);
Alexandre Julliard767e6f61998-08-09 12:47:43 +0000694
Alexandre Julliarda3960291999-02-26 11:11:13 +0000695 if (!(atom = GlobalFindAtomW( className )))
Alexandre Julliard767e6f61998-08-09 12:47:43 +0000696 {
697 SetLastError(ERROR_CLASS_DOES_NOT_EXIST);
698 return FALSE;
699 }
Alexandre Julliarde2bfa4c1996-05-16 18:21:06 +0000700 if (!(classPtr = CLASS_FindClassByAtom( atom, hInstance )) ||
Alexandre Julliard767e6f61998-08-09 12:47:43 +0000701 (classPtr->hInstance != hInstance))
702 {
703 SetLastError(ERROR_CLASS_DOES_NOT_EXIST);
704 return FALSE;
705 }
706 if (!(ret = CLASS_FreeClass( classPtr )))
707 SetLastError(ERROR_CLASS_HAS_WINDOWS);
708 return ret;
Alexandre Julliarde2bfa4c1996-05-16 18:21:06 +0000709}
710
Alexandre Julliarde2bfa4c1996-05-16 18:21:06 +0000711/***********************************************************************
Alexandre Julliard21979011997-03-05 08:22:35 +0000712 * GetClassWord16 (USER.129)
Alexandre Julliarde2bfa4c1996-05-16 18:21:06 +0000713 */
Alexandre Julliard670cdc41997-08-24 16:00:30 +0000714WORD WINAPI GetClassWord16( HWND16 hwnd, INT16 offset )
Alexandre Julliard21979011997-03-05 08:22:35 +0000715{
Alexandre Julliarda3960291999-02-26 11:11:13 +0000716 return GetClassWord( hwnd, offset );
Alexandre Julliard21979011997-03-05 08:22:35 +0000717}
718
719
720/***********************************************************************
Alexandre Julliard54c27111998-03-29 19:44:57 +0000721 * GetClassWord32 (USER32.219)
Alexandre Julliard21979011997-03-05 08:22:35 +0000722 */
Alexandre Julliarda3960291999-02-26 11:11:13 +0000723WORD WINAPI GetClassWord( HWND hwnd, INT offset )
Alexandre Julliard401710d1993-09-04 10:09:32 +0000724{
Alexandre Julliard2ace16a1996-04-28 15:09:19 +0000725 WND * wndPtr;
Guy Albertelli2fa281f1999-04-24 11:54:40 +0000726 WORD retvalue = 0;
Alexandre Julliard2ace16a1996-04-28 15:09:19 +0000727
Alexandre Julliard359f497e1999-07-04 16:02:24 +0000728 TRACE("%x %x\n",hwnd, offset);
Alexandre Julliard767e6f61998-08-09 12:47:43 +0000729
Alexandre Julliard2ace16a1996-04-28 15:09:19 +0000730 if (!(wndPtr = WIN_FindWndPtr( hwnd ))) return 0;
731 if (offset >= 0)
Alexandre Julliarde2bfa4c1996-05-16 18:21:06 +0000732 {
733 if (offset <= wndPtr->class->cbClsExtra - sizeof(WORD))
Francois Boisvert6b1b41c1999-03-14 17:25:32 +0000734 {
Guy Albertelli2fa281f1999-04-24 11:54:40 +0000735 retvalue = GET_WORD(((char *)wndPtr->class->wExtra) + offset);
736 goto END;
Francois Boisvert6b1b41c1999-03-14 17:25:32 +0000737 }
Alexandre Julliarde2bfa4c1996-05-16 18:21:06 +0000738 }
739 else switch(offset)
Alexandre Julliard2ace16a1996-04-28 15:09:19 +0000740 {
Guy Albertelli2fa281f1999-04-24 11:54:40 +0000741 case GCW_HBRBACKGROUND: retvalue = wndPtr->class->hbrBackground;
742 goto END;
743 case GCW_HCURSOR: retvalue = wndPtr->class->hCursor;
744 goto END;
745 case GCW_HICON: retvalue = wndPtr->class->hIcon;
746 goto END;
747 case GCW_HICONSM: retvalue = wndPtr->class->hIconSm;
748 goto END;
749 case GCW_ATOM: retvalue = wndPtr->class->atomName;
750 goto END;
Alexandre Julliard1285c2f1996-05-06 16:06:24 +0000751 case GCW_STYLE:
752 case GCW_CBWNDEXTRA:
753 case GCW_CBCLSEXTRA:
Alexandre Julliarde2bfa4c1996-05-16 18:21:06 +0000754 case GCW_HMODULE:
Guy Albertelli2fa281f1999-04-24 11:54:40 +0000755 retvalue = (WORD)GetClassLongA( hwnd, offset );
Alexandre Julliard2ace16a1996-04-28 15:09:19 +0000756 }
Alexandre Julliard767e6f61998-08-09 12:47:43 +0000757
Alexandre Julliard359f497e1999-07-04 16:02:24 +0000758 WARN("Invalid offset %d\n", offset);
Guy Albertelli2fa281f1999-04-24 11:54:40 +0000759 END:
760 WIN_ReleaseWndPtr(wndPtr);
761 return retvalue;
Alexandre Julliard401710d1993-09-04 10:09:32 +0000762}
763
764
765/***********************************************************************
Alexandre Julliarde2bfa4c1996-05-16 18:21:06 +0000766 * GetClassLong16 (USER.131)
Alexandre Julliard401710d1993-09-04 10:09:32 +0000767 */
Alexandre Julliard670cdc41997-08-24 16:00:30 +0000768LONG WINAPI GetClassLong16( HWND16 hwnd, INT16 offset )
Alexandre Julliard401710d1993-09-04 10:09:32 +0000769{
Alexandre Julliard3051b641996-07-05 17:14:13 +0000770 WND *wndPtr;
Alexandre Julliard1e9ac791996-06-06 18:38:27 +0000771 LONG ret;
772
Alexandre Julliard359f497e1999-07-04 16:02:24 +0000773 TRACE("%x %x\n",hwnd, offset);
Alexandre Julliard767e6f61998-08-09 12:47:43 +0000774
Alexandre Julliard1e9ac791996-06-06 18:38:27 +0000775 switch( offset )
776 {
Alexandre Julliard3051b641996-07-05 17:14:13 +0000777 case GCL_WNDPROC:
778 if (!(wndPtr = WIN_FindWndPtr( hwnd ))) return 0;
Francois Boisvert6b1b41c1999-03-14 17:25:32 +0000779 ret = (LONG)WINPROC_GetProc( wndPtr->class->winproc, WIN_PROC_16 );
780 WIN_ReleaseWndPtr(wndPtr);
781 return ret;
Alexandre Julliard1e9ac791996-06-06 18:38:27 +0000782 case GCL_MENUNAME:
Alexandre Julliarda3960291999-02-26 11:11:13 +0000783 ret = GetClassLongA( hwnd, offset );
Alexandre Julliard1e9ac791996-06-06 18:38:27 +0000784 return (LONG)SEGPTR_GET( (void *)ret );
Alexandre Julliard1e9ac791996-06-06 18:38:27 +0000785 default:
Alexandre Julliarda3960291999-02-26 11:11:13 +0000786 return GetClassLongA( hwnd, offset );
Alexandre Julliard1e9ac791996-06-06 18:38:27 +0000787 }
Alexandre Julliard401710d1993-09-04 10:09:32 +0000788}
789
790
791/***********************************************************************
Alexandre Julliard54c27111998-03-29 19:44:57 +0000792 * GetClassLong32A (USER32.215)
Alexandre Julliard401710d1993-09-04 10:09:32 +0000793 */
Alexandre Julliarda3960291999-02-26 11:11:13 +0000794LONG WINAPI GetClassLongA( HWND hwnd, INT offset )
Alexandre Julliard401710d1993-09-04 10:09:32 +0000795{
Alexandre Julliard401710d1993-09-04 10:09:32 +0000796 WND * wndPtr;
Francois Boisvert6b1b41c1999-03-14 17:25:32 +0000797 LONG retvalue;
Alexandre Julliard401710d1993-09-04 10:09:32 +0000798
Alexandre Julliard359f497e1999-07-04 16:02:24 +0000799 TRACE("%x %x\n",hwnd, offset);
Alexandre Julliard767e6f61998-08-09 12:47:43 +0000800
Alexandre Julliard401710d1993-09-04 10:09:32 +0000801 if (!(wndPtr = WIN_FindWndPtr( hwnd ))) return 0;
Alexandre Julliard2ace16a1996-04-28 15:09:19 +0000802 if (offset >= 0)
Alexandre Julliarde2bfa4c1996-05-16 18:21:06 +0000803 {
804 if (offset <= wndPtr->class->cbClsExtra - sizeof(LONG))
Francois Boisvert6b1b41c1999-03-14 17:25:32 +0000805 {
806 retvalue = GET_DWORD(((char *)wndPtr->class->wExtra) + offset);
807 goto END;
808 }
Alexandre Julliarde2bfa4c1996-05-16 18:21:06 +0000809 }
Francois Boisvert6b1b41c1999-03-14 17:25:32 +0000810
Alexandre Julliard2ace16a1996-04-28 15:09:19 +0000811 switch(offset)
812 {
Francois Boisvert6b1b41c1999-03-14 17:25:32 +0000813 case GCL_STYLE: retvalue = (LONG)wndPtr->class->style;
814 goto END;
815 case GCL_CBWNDEXTRA: retvalue = (LONG)wndPtr->class->cbWndExtra;
816 goto END;
817 case GCL_CBCLSEXTRA: retvalue = (LONG)wndPtr->class->cbClsExtra;
818 goto END;
819 case GCL_HMODULE: retvalue = (LONG)wndPtr->class->hInstance;
820 goto END;
Alexandre Julliard1e9ac791996-06-06 18:38:27 +0000821 case GCL_WNDPROC:
Francois Boisvert6b1b41c1999-03-14 17:25:32 +0000822 retvalue = (LONG)WINPROC_GetProc(wndPtr->class->winproc, WIN_PROC_32A);
823 goto END;
Alexandre Julliarde2bfa4c1996-05-16 18:21:06 +0000824 case GCL_MENUNAME:
Francois Boisvert6b1b41c1999-03-14 17:25:32 +0000825 retvalue = (LONG)CLASS_GetMenuNameA( wndPtr->class );
826 goto END;
NF Stevensbe156661998-12-07 12:48:16 +0000827 case GCW_ATOM:
Alexandre Julliarde2bfa4c1996-05-16 18:21:06 +0000828 case GCL_HBRBACKGROUND:
829 case GCL_HCURSOR:
830 case GCL_HICON:
831 case GCL_HICONSM:
Francois Boisvert6b1b41c1999-03-14 17:25:32 +0000832 retvalue = GetClassWord( hwnd, offset );
833 goto END;
Alexandre Julliard2ace16a1996-04-28 15:09:19 +0000834 }
Alexandre Julliard359f497e1999-07-04 16:02:24 +0000835 WARN("Invalid offset %d\n", offset);
Francois Boisvert6b1b41c1999-03-14 17:25:32 +0000836 retvalue = 0;
837END:
838 WIN_ReleaseWndPtr(wndPtr);
839 return retvalue;
Alexandre Julliard401710d1993-09-04 10:09:32 +0000840}
841
842
843/***********************************************************************
Alexandre Julliard54c27111998-03-29 19:44:57 +0000844 * GetClassLong32W (USER32.216)
Alexandre Julliard401710d1993-09-04 10:09:32 +0000845 */
Alexandre Julliarda3960291999-02-26 11:11:13 +0000846LONG WINAPI GetClassLongW( HWND hwnd, INT offset )
Alexandre Julliard401710d1993-09-04 10:09:32 +0000847{
Alexandre Julliard401710d1993-09-04 10:09:32 +0000848 WND * wndPtr;
Francois Boisvert6b1b41c1999-03-14 17:25:32 +0000849 LONG retvalue;
Alexandre Julliard3051b641996-07-05 17:14:13 +0000850
Alexandre Julliard359f497e1999-07-04 16:02:24 +0000851 TRACE("%x %x\n",hwnd, offset);
Alexandre Julliard767e6f61998-08-09 12:47:43 +0000852
Alexandre Julliard3051b641996-07-05 17:14:13 +0000853 switch(offset)
854 {
855 case GCL_WNDPROC:
856 if (!(wndPtr = WIN_FindWndPtr( hwnd ))) return 0;
Francois Boisvert6b1b41c1999-03-14 17:25:32 +0000857 retvalue = (LONG)WINPROC_GetProc( wndPtr->class->winproc, WIN_PROC_32W );
858 WIN_ReleaseWndPtr(wndPtr);
859 return retvalue;
Alexandre Julliard3051b641996-07-05 17:14:13 +0000860 case GCL_MENUNAME:
861 if (!(wndPtr = WIN_FindWndPtr( hwnd ))) return 0;
Francois Boisvert6b1b41c1999-03-14 17:25:32 +0000862 retvalue = (LONG)CLASS_GetMenuNameW( wndPtr->class );
863 WIN_ReleaseWndPtr(wndPtr);
864 return retvalue;
Alexandre Julliard3051b641996-07-05 17:14:13 +0000865 default:
Alexandre Julliarda3960291999-02-26 11:11:13 +0000866 return GetClassLongA( hwnd, offset );
Alexandre Julliard3051b641996-07-05 17:14:13 +0000867 }
Alexandre Julliarde2bfa4c1996-05-16 18:21:06 +0000868}
869
870
871/***********************************************************************
Alexandre Julliard21979011997-03-05 08:22:35 +0000872 * SetClassWord16 (USER.130)
Alexandre Julliarde2bfa4c1996-05-16 18:21:06 +0000873 */
Alexandre Julliard670cdc41997-08-24 16:00:30 +0000874WORD WINAPI SetClassWord16( HWND16 hwnd, INT16 offset, WORD newval )
Alexandre Julliard21979011997-03-05 08:22:35 +0000875{
Alexandre Julliarda3960291999-02-26 11:11:13 +0000876 return SetClassWord( hwnd, offset, newval );
Alexandre Julliard21979011997-03-05 08:22:35 +0000877}
878
879
880/***********************************************************************
Alexandre Julliard54c27111998-03-29 19:44:57 +0000881 * SetClassWord32 (USER32.469)
Alexandre Julliard21979011997-03-05 08:22:35 +0000882 */
Alexandre Julliarda3960291999-02-26 11:11:13 +0000883WORD WINAPI SetClassWord( HWND hwnd, INT offset, WORD newval )
Alexandre Julliarde2bfa4c1996-05-16 18:21:06 +0000884{
885 WND * wndPtr;
886 WORD retval = 0;
887 void *ptr;
Alexandre Julliard401710d1993-09-04 10:09:32 +0000888
Alexandre Julliard359f497e1999-07-04 16:02:24 +0000889 TRACE("%x %x %x\n",hwnd, offset, newval);
Alexandre Julliard767e6f61998-08-09 12:47:43 +0000890
Alexandre Julliard401710d1993-09-04 10:09:32 +0000891 if (!(wndPtr = WIN_FindWndPtr( hwnd ))) return 0;
Alexandre Julliarde2bfa4c1996-05-16 18:21:06 +0000892 if (offset >= 0)
893 {
Alexandre Julliard3051b641996-07-05 17:14:13 +0000894 if (offset + sizeof(WORD) <= wndPtr->class->cbClsExtra)
Alexandre Julliarde2bfa4c1996-05-16 18:21:06 +0000895 ptr = ((char *)wndPtr->class->wExtra) + offset;
Alexandre Julliard3051b641996-07-05 17:14:13 +0000896 else
Alexandre Julliarde2bfa4c1996-05-16 18:21:06 +0000897 {
Alexandre Julliard359f497e1999-07-04 16:02:24 +0000898 WARN("Invalid offset %d\n", offset );
Francois Boisvert6b1b41c1999-03-14 17:25:32 +0000899 WIN_ReleaseWndPtr(wndPtr);
Alexandre Julliarde2bfa4c1996-05-16 18:21:06 +0000900 return 0;
901 }
902 }
Alexandre Julliard2ace16a1996-04-28 15:09:19 +0000903 else switch(offset)
904 {
Alexandre Julliarde2bfa4c1996-05-16 18:21:06 +0000905 case GCW_STYLE:
906 case GCW_CBWNDEXTRA:
907 case GCW_CBCLSEXTRA:
908 case GCW_HMODULE:
Francois Boisvert6b1b41c1999-03-14 17:25:32 +0000909 WIN_ReleaseWndPtr(wndPtr);
Alexandre Julliarda3960291999-02-26 11:11:13 +0000910 return (WORD)SetClassLongA( hwnd, offset, (LONG)newval );
Alexandre Julliarde2bfa4c1996-05-16 18:21:06 +0000911 case GCW_HBRBACKGROUND: ptr = &wndPtr->class->hbrBackground; break;
912 case GCW_HCURSOR: ptr = &wndPtr->class->hCursor; break;
913 case GCW_HICON: ptr = &wndPtr->class->hIcon; break;
914 case GCW_HICONSM: ptr = &wndPtr->class->hIconSm; break;
915 case GCW_ATOM: ptr = &wndPtr->class->atomName; break;
Alexandre Julliard2ace16a1996-04-28 15:09:19 +0000916 default:
Alexandre Julliard359f497e1999-07-04 16:02:24 +0000917 WARN("Invalid offset %d\n", offset);
Francois Boisvert6b1b41c1999-03-14 17:25:32 +0000918 WIN_ReleaseWndPtr(wndPtr);
Alexandre Julliard2ace16a1996-04-28 15:09:19 +0000919 return 0;
920 }
Alexandre Julliarde2bfa4c1996-05-16 18:21:06 +0000921 retval = GET_WORD(ptr);
922 PUT_WORD( ptr, newval );
Gavriel Statec77c5921998-11-15 09:21:17 +0000923
924 /* Note: If the GCW_ATOM was changed, this means that the WNDCLASS className fields
925 need to be updated as well. Problem is that we can't tell whether the atom is
926 using wide or narrow characters. For now, we'll just NULL out the className
927 fields, and emit a FIXME. */
928 if (offset == GCW_ATOM)
929 {
930 CLASS_SetClassNameA( wndPtr->class, NULL );
Alexandre Julliard359f497e1999-07-04 16:02:24 +0000931 FIXME("GCW_ATOM changed for a class. Not updating className, so GetClassInfoEx may not return correct className!\n");
Gavriel Statec77c5921998-11-15 09:21:17 +0000932 }
Francois Boisvert6b1b41c1999-03-14 17:25:32 +0000933 WIN_ReleaseWndPtr(wndPtr);
Alexandre Julliard401710d1993-09-04 10:09:32 +0000934 return retval;
935}
Alexandre Julliard5f721f81994-01-04 20:14:34 +0000936
937
938/***********************************************************************
Alexandre Julliarde2bfa4c1996-05-16 18:21:06 +0000939 * SetClassLong16 (USER.132)
Alexandre Julliard5f721f81994-01-04 20:14:34 +0000940 */
Alexandre Julliard670cdc41997-08-24 16:00:30 +0000941LONG WINAPI SetClassLong16( HWND16 hwnd, INT16 offset, LONG newval )
Alexandre Julliard5f721f81994-01-04 20:14:34 +0000942{
Alexandre Julliard2d93d001996-05-21 15:01:41 +0000943 WND *wndPtr;
Alexandre Julliard3051b641996-07-05 17:14:13 +0000944 LONG retval;
Alexandre Julliard2d93d001996-05-21 15:01:41 +0000945
Alexandre Julliard359f497e1999-07-04 16:02:24 +0000946 TRACE("%x %x %lx\n",hwnd, offset, newval);
Alexandre Julliard767e6f61998-08-09 12:47:43 +0000947
Alexandre Julliard2d93d001996-05-21 15:01:41 +0000948 switch(offset)
949 {
950 case GCL_WNDPROC:
951 if (!(wndPtr = WIN_FindWndPtr(hwnd))) return 0;
Alexandre Julliard3051b641996-07-05 17:14:13 +0000952 retval = (LONG)WINPROC_GetProc( wndPtr->class->winproc, WIN_PROC_16 );
953 WINPROC_SetProc( &wndPtr->class->winproc, (WNDPROC16)newval,
Alexandre Julliarddf2673b1997-03-29 17:20:20 +0000954 WIN_PROC_16, WIN_PROC_CLASS );
Francois Boisvert6b1b41c1999-03-14 17:25:32 +0000955 WIN_ReleaseWndPtr(wndPtr);
Alexandre Julliard3051b641996-07-05 17:14:13 +0000956 return retval;
Alexandre Julliard2d93d001996-05-21 15:01:41 +0000957 case GCL_MENUNAME:
Alexandre Julliarda3960291999-02-26 11:11:13 +0000958 return SetClassLongA( hwnd, offset, (LONG)PTR_SEG_TO_LIN(newval) );
Alexandre Julliard2d93d001996-05-21 15:01:41 +0000959 default:
Alexandre Julliarda3960291999-02-26 11:11:13 +0000960 return SetClassLongA( hwnd, offset, newval );
Alexandre Julliard2d93d001996-05-21 15:01:41 +0000961 }
Alexandre Julliard5f721f81994-01-04 20:14:34 +0000962}
963
964
965/***********************************************************************
Alexandre Julliard54c27111998-03-29 19:44:57 +0000966 * SetClassLong32A (USER32.467)
Alexandre Julliard5f721f81994-01-04 20:14:34 +0000967 */
Alexandre Julliarda3960291999-02-26 11:11:13 +0000968LONG WINAPI SetClassLongA( HWND hwnd, INT offset, LONG newval )
Alexandre Julliard5f721f81994-01-04 20:14:34 +0000969{
Alexandre Julliarde2bfa4c1996-05-16 18:21:06 +0000970 WND * wndPtr;
971 LONG retval = 0;
972 void *ptr;
973
Alexandre Julliard359f497e1999-07-04 16:02:24 +0000974 TRACE("%x %x %lx\n",hwnd, offset, newval);
Alexandre Julliard767e6f61998-08-09 12:47:43 +0000975
Alexandre Julliarde2bfa4c1996-05-16 18:21:06 +0000976 if (!(wndPtr = WIN_FindWndPtr( hwnd ))) return 0;
977 if (offset >= 0)
978 {
Alexandre Julliard3051b641996-07-05 17:14:13 +0000979 if (offset + sizeof(LONG) <= wndPtr->class->cbClsExtra)
Alexandre Julliarde2bfa4c1996-05-16 18:21:06 +0000980 ptr = ((char *)wndPtr->class->wExtra) + offset;
981 else
982 {
Alexandre Julliard359f497e1999-07-04 16:02:24 +0000983 WARN("Invalid offset %d\n", offset );
Francois Boisvert6b1b41c1999-03-14 17:25:32 +0000984 retval = 0;
985 goto END;
Alexandre Julliarde2bfa4c1996-05-16 18:21:06 +0000986 }
987 }
988 else switch(offset)
989 {
990 case GCL_MENUNAME:
991 CLASS_SetMenuNameA( wndPtr->class, (LPCSTR)newval );
Francois Boisvert6b1b41c1999-03-14 17:25:32 +0000992 retval = 0; /* Old value is now meaningless anyway */
993 goto END;
Alexandre Julliard2d93d001996-05-21 15:01:41 +0000994 case GCL_WNDPROC:
Alexandre Julliard3051b641996-07-05 17:14:13 +0000995 retval = (LONG)WINPROC_GetProc( wndPtr->class->winproc,
996 WIN_PROC_32A );
997 WINPROC_SetProc( &wndPtr->class->winproc, (WNDPROC16)newval,
Alexandre Julliarddf2673b1997-03-29 17:20:20 +0000998 WIN_PROC_32A, WIN_PROC_CLASS );
Francois Boisvert6b1b41c1999-03-14 17:25:32 +0000999 goto END;
Alexandre Julliarde2bfa4c1996-05-16 18:21:06 +00001000 case GCL_HBRBACKGROUND:
1001 case GCL_HCURSOR:
1002 case GCL_HICON:
1003 case GCL_HICONSM:
Francois Boisvert6b1b41c1999-03-14 17:25:32 +00001004 retval = SetClassWord( hwnd, offset, (WORD)newval );
1005 goto END;
Alexandre Julliarde2bfa4c1996-05-16 18:21:06 +00001006 case GCL_STYLE: ptr = &wndPtr->class->style; break;
1007 case GCL_CBWNDEXTRA: ptr = &wndPtr->class->cbWndExtra; break;
1008 case GCL_CBCLSEXTRA: ptr = &wndPtr->class->cbClsExtra; break;
Alexandre Julliarde2bfa4c1996-05-16 18:21:06 +00001009 case GCL_HMODULE: ptr = &wndPtr->class->hInstance; break;
1010 default:
Alexandre Julliard359f497e1999-07-04 16:02:24 +00001011 WARN("Invalid offset %d\n", offset );
Francois Boisvert6b1b41c1999-03-14 17:25:32 +00001012 retval = 0;
1013 goto END;
Alexandre Julliarde2bfa4c1996-05-16 18:21:06 +00001014 }
1015 retval = GET_DWORD(ptr);
1016 PUT_DWORD( ptr, newval );
Francois Boisvert6b1b41c1999-03-14 17:25:32 +00001017END:
1018 WIN_ReleaseWndPtr(wndPtr);
Alexandre Julliarde2bfa4c1996-05-16 18:21:06 +00001019 return retval;
1020}
1021
1022
1023/***********************************************************************
Alexandre Julliard54c27111998-03-29 19:44:57 +00001024 * SetClassLong32W (USER32.468)
Alexandre Julliarde2bfa4c1996-05-16 18:21:06 +00001025 */
Alexandre Julliarda3960291999-02-26 11:11:13 +00001026LONG WINAPI SetClassLongW( HWND hwnd, INT offset, LONG newval )
Alexandre Julliarde2bfa4c1996-05-16 18:21:06 +00001027{
1028 WND *wndPtr;
Alexandre Julliard3051b641996-07-05 17:14:13 +00001029 LONG retval;
Alexandre Julliard2d93d001996-05-21 15:01:41 +00001030
Alexandre Julliard359f497e1999-07-04 16:02:24 +00001031 TRACE("%x %x %lx\n",hwnd, offset, newval);
Alexandre Julliard767e6f61998-08-09 12:47:43 +00001032
Alexandre Julliard2d93d001996-05-21 15:01:41 +00001033 switch(offset)
1034 {
1035 case GCL_WNDPROC:
Alexandre Julliard3051b641996-07-05 17:14:13 +00001036 if (!(wndPtr = WIN_FindWndPtr(hwnd))) return 0;
1037 retval = (LONG)WINPROC_GetProc( wndPtr->class->winproc, WIN_PROC_32W );
1038 WINPROC_SetProc( &wndPtr->class->winproc, (WNDPROC16)newval,
Alexandre Julliarddf2673b1997-03-29 17:20:20 +00001039 WIN_PROC_32W, WIN_PROC_CLASS );
Francois Boisvert6b1b41c1999-03-14 17:25:32 +00001040 WIN_ReleaseWndPtr(wndPtr);
Alexandre Julliard3051b641996-07-05 17:14:13 +00001041 return retval;
Alexandre Julliard2d93d001996-05-21 15:01:41 +00001042 case GCL_MENUNAME:
Alexandre Julliard3051b641996-07-05 17:14:13 +00001043 if (!(wndPtr = WIN_FindWndPtr(hwnd))) return 0;
Alexandre Julliard2d93d001996-05-21 15:01:41 +00001044 CLASS_SetMenuNameW( wndPtr->class, (LPCWSTR)newval );
Francois Boisvert6b1b41c1999-03-14 17:25:32 +00001045 WIN_ReleaseWndPtr(wndPtr);
Alexandre Julliard2d93d001996-05-21 15:01:41 +00001046 return 0; /* Old value is now meaningless anyway */
1047 default:
Alexandre Julliarda3960291999-02-26 11:11:13 +00001048 return SetClassLongA( hwnd, offset, newval );
Alexandre Julliard2d93d001996-05-21 15:01:41 +00001049 }
Alexandre Julliarde2bfa4c1996-05-16 18:21:06 +00001050}
1051
1052
1053/***********************************************************************
1054 * GetClassName16 (USER.58)
1055 */
Alexandre Julliard670cdc41997-08-24 16:00:30 +00001056INT16 WINAPI GetClassName16( HWND16 hwnd, LPSTR buffer, INT16 count )
Alexandre Julliarde2bfa4c1996-05-16 18:21:06 +00001057{
1058 WND *wndPtr;
Francois Boisvert6b1b41c1999-03-14 17:25:32 +00001059 INT16 retvalue;
Alexandre Julliarde2bfa4c1996-05-16 18:21:06 +00001060 if (!(wndPtr = WIN_FindWndPtr(hwnd))) return 0;
Francois Boisvert6b1b41c1999-03-14 17:25:32 +00001061 retvalue = GlobalGetAtomName16( wndPtr->class->atomName, buffer, count );
1062 WIN_ReleaseWndPtr(wndPtr);
1063 return retvalue;
Alexandre Julliarde2bfa4c1996-05-16 18:21:06 +00001064}
1065
1066
1067/***********************************************************************
Alexandre Julliard54c27111998-03-29 19:44:57 +00001068 * GetClassName32A (USER32.217)
Alexandre Julliarde2bfa4c1996-05-16 18:21:06 +00001069 */
Alexandre Julliarda3960291999-02-26 11:11:13 +00001070INT WINAPI GetClassNameA( HWND hwnd, LPSTR buffer, INT count )
1071{ INT ret;
Alexandre Julliarde2bfa4c1996-05-16 18:21:06 +00001072 WND *wndPtr;
Alexandre Julliard767e6f61998-08-09 12:47:43 +00001073
Alexandre Julliarde2bfa4c1996-05-16 18:21:06 +00001074 if (!(wndPtr = WIN_FindWndPtr(hwnd))) return 0;
Alexandre Julliarda3960291999-02-26 11:11:13 +00001075 ret = GlobalGetAtomNameA( wndPtr->class->atomName, buffer, count );
Alexandre Julliard767e6f61998-08-09 12:47:43 +00001076
Francois Boisvert6b1b41c1999-03-14 17:25:32 +00001077 WIN_ReleaseWndPtr(wndPtr);
Alexandre Julliard359f497e1999-07-04 16:02:24 +00001078 TRACE("%x %s %x\n",hwnd, buffer, count);
Alexandre Julliard767e6f61998-08-09 12:47:43 +00001079 return ret;
Alexandre Julliarde2bfa4c1996-05-16 18:21:06 +00001080}
1081
1082
1083/***********************************************************************
Alexandre Julliard54c27111998-03-29 19:44:57 +00001084 * GetClassName32W (USER32.218)
Alexandre Julliarde2bfa4c1996-05-16 18:21:06 +00001085 */
Alexandre Julliarda3960291999-02-26 11:11:13 +00001086INT WINAPI GetClassNameW( HWND hwnd, LPWSTR buffer, INT count )
1087{ INT ret;
Alexandre Julliarde2bfa4c1996-05-16 18:21:06 +00001088 WND *wndPtr;
Alexandre Julliard767e6f61998-08-09 12:47:43 +00001089
Alexandre Julliarde2bfa4c1996-05-16 18:21:06 +00001090 if (!(wndPtr = WIN_FindWndPtr(hwnd))) return 0;
Alexandre Julliarda3960291999-02-26 11:11:13 +00001091 ret = GlobalGetAtomNameW( wndPtr->class->atomName, buffer, count );
Francois Boisvert6b1b41c1999-03-14 17:25:32 +00001092 WIN_ReleaseWndPtr(wndPtr);
Alexandre Julliard359f497e1999-07-04 16:02:24 +00001093 TRACE("%x %s %x\n",hwnd, debugstr_w(buffer), count);
Alexandre Julliard767e6f61998-08-09 12:47:43 +00001094
1095 return ret;
Alexandre Julliarde2bfa4c1996-05-16 18:21:06 +00001096}
1097
1098
1099/***********************************************************************
1100 * GetClassInfo16 (USER.404)
1101 */
Alexandre Julliard670cdc41997-08-24 16:00:30 +00001102BOOL16 WINAPI GetClassInfo16( HINSTANCE16 hInstance, SEGPTR name,
1103 WNDCLASS16 *wc )
Alexandre Julliarde2bfa4c1996-05-16 18:21:06 +00001104{
1105 ATOM atom;
Alexandre Julliard5f721f81994-01-04 20:14:34 +00001106 CLASS *classPtr;
Alexandre Julliard3ed37e01994-11-07 18:20:42 +00001107
Alexandre Julliard359f497e1999-07-04 16:02:24 +00001108 TRACE("%x %p %p\n",hInstance, PTR_SEG_TO_LIN (name), wc);
Alexandre Julliard767e6f61998-08-09 12:47:43 +00001109
Alexandre Julliarde2bfa4c1996-05-16 18:21:06 +00001110 hInstance = GetExePtr( hInstance );
1111 if (!(atom = GlobalFindAtom16( name )) ||
Alexandre Julliard670cdc41997-08-24 16:00:30 +00001112 !(classPtr = CLASS_FindClassByAtom( atom, hInstance )))
1113 return FALSE;
1114 if ((hInstance != classPtr->hInstance) &&
1115 !(classPtr->style & CS_GLOBALCLASS)) /*BWCC likes to pass hInstance=0*/
1116 return FALSE;
Alexandre Julliarde2bfa4c1996-05-16 18:21:06 +00001117 wc->style = (UINT16)classPtr->style;
Alexandre Julliard3051b641996-07-05 17:14:13 +00001118 wc->lpfnWndProc = WINPROC_GetProc( classPtr->winproc, WIN_PROC_16 );
Alexandre Julliarde2bfa4c1996-05-16 18:21:06 +00001119 wc->cbClsExtra = (INT16)classPtr->cbClsExtra;
1120 wc->cbWndExtra = (INT16)classPtr->cbWndExtra;
1121 wc->hInstance = (HINSTANCE16)classPtr->hInstance;
1122 wc->hIcon = classPtr->hIcon;
1123 wc->hCursor = classPtr->hCursor;
1124 wc->hbrBackground = classPtr->hbrBackground;
Gavriel Statec77c5921998-11-15 09:21:17 +00001125 wc->lpszClassName = (SEGPTR)CLASS_GetClassNameA( classPtr );;
NF Stevensa4066821998-12-01 08:29:29 +00001126 if (HIWORD(wc->lpszClassName)) /* Make it a SEGPTR */
1127 wc->lpszClassName = SEGPTR_GET( (LPSTR)wc->lpszClassName );
Alexandre Julliarde2bfa4c1996-05-16 18:21:06 +00001128 wc->lpszMenuName = (SEGPTR)CLASS_GetMenuNameA( classPtr );
1129 if (HIWORD(wc->lpszMenuName)) /* Make it a SEGPTR */
1130 wc->lpszMenuName = SEGPTR_GET( (LPSTR)wc->lpszMenuName );
1131 return TRUE;
1132}
1133
1134
1135/***********************************************************************
Alexandre Julliard54c27111998-03-29 19:44:57 +00001136 * GetClassInfo32A (USER32.211)
Alexandre Julliarde2bfa4c1996-05-16 18:21:06 +00001137 */
Alexandre Julliarda3960291999-02-26 11:11:13 +00001138BOOL WINAPI GetClassInfoA( HINSTANCE hInstance, LPCSTR name,
1139 WNDCLASSA *wc )
Alexandre Julliarde2bfa4c1996-05-16 18:21:06 +00001140{
1141 ATOM atom;
1142 CLASS *classPtr;
1143
Alexandre Julliard359f497e1999-07-04 16:02:24 +00001144 TRACE("%x %p %p\n",hInstance, name, wc);
Alexandre Julliard767e6f61998-08-09 12:47:43 +00001145
1146 /* workaround: if hInstance=NULL you expect to get the system classes
1147 but this classes (as example from comctl32.dll SysListView) won't be
1148 registred with hInstance=NULL in WINE because of the late loading
1149 of this dll. fixes file dialogs in WinWord95 (jsch)*/
1150
Alexandre Julliarda3960291999-02-26 11:11:13 +00001151 if (!(atom=GlobalFindAtomA(name)) || !(classPtr=CLASS_FindClassByAtom(atom,hInstance)))
Alexandre Julliard21979011997-03-05 08:22:35 +00001152 return FALSE;
1153
Alexandre Julliard767e6f61998-08-09 12:47:43 +00001154 if (classPtr->hInstance && (hInstance != classPtr->hInstance))
1155 {
1156 if (hInstance) return FALSE;
1157 else
Alexandre Julliard359f497e1999-07-04 16:02:24 +00001158 WARN("systemclass %s (hInst=0) demanded but only class with hInst!=0 found\n",name);
Alexandre Julliard767e6f61998-08-09 12:47:43 +00001159 }
1160
Alexandre Julliarde2bfa4c1996-05-16 18:21:06 +00001161 wc->style = classPtr->style;
Alexandre Julliarda3960291999-02-26 11:11:13 +00001162 wc->lpfnWndProc = (WNDPROC)WINPROC_GetProc( classPtr->winproc,
Alexandre Julliard3051b641996-07-05 17:14:13 +00001163 WIN_PROC_32A );
Alexandre Julliarde2bfa4c1996-05-16 18:21:06 +00001164 wc->cbClsExtra = classPtr->cbClsExtra;
1165 wc->cbWndExtra = classPtr->cbWndExtra;
1166 wc->hInstance = classPtr->hInstance;
Alexandre Julliarda3960291999-02-26 11:11:13 +00001167 wc->hIcon = (HICON)classPtr->hIcon;
1168 wc->hCursor = (HCURSOR)classPtr->hCursor;
1169 wc->hbrBackground = (HBRUSH)classPtr->hbrBackground;
Alexandre Julliarde2bfa4c1996-05-16 18:21:06 +00001170 wc->lpszMenuName = CLASS_GetMenuNameA( classPtr );
Gavriel Statec77c5921998-11-15 09:21:17 +00001171 wc->lpszClassName = CLASS_GetClassNameA( classPtr );
Alexandre Julliarde2bfa4c1996-05-16 18:21:06 +00001172 return TRUE;
1173}
1174
1175
1176/***********************************************************************
Alexandre Julliard54c27111998-03-29 19:44:57 +00001177 * GetClassInfo32W (USER32.214)
Alexandre Julliarde2bfa4c1996-05-16 18:21:06 +00001178 */
Alexandre Julliarda3960291999-02-26 11:11:13 +00001179BOOL WINAPI GetClassInfoW( HINSTANCE hInstance, LPCWSTR name,
1180 WNDCLASSW *wc )
Alexandre Julliarde2bfa4c1996-05-16 18:21:06 +00001181{
1182 ATOM atom;
1183 CLASS *classPtr;
1184
Alexandre Julliard359f497e1999-07-04 16:02:24 +00001185 TRACE("%x %p %p\n",hInstance, name, wc);
Alexandre Julliard767e6f61998-08-09 12:47:43 +00001186
Marcus Meissner438062171999-09-03 12:28:20 +00001187 if ( !(atom=GlobalFindAtomW(name)) ||
1188 !(classPtr=CLASS_FindClassByAtom(atom,hInstance))
1189 )
Alexandre Julliard21979011997-03-05 08:22:35 +00001190 return FALSE;
1191
Marcus Meissner438062171999-09-03 12:28:20 +00001192 if (classPtr->hInstance && (hInstance != classPtr->hInstance)) {
1193 if (hInstance)
1194 return FALSE;
1195 else
1196 WARN("systemclass %s (hInst=0) demanded but only class with hInst!=0 found\n",debugstr_w(name));
1197 }
Alexandre Julliarde2bfa4c1996-05-16 18:21:06 +00001198 wc->style = classPtr->style;
Alexandre Julliarda3960291999-02-26 11:11:13 +00001199 wc->lpfnWndProc = (WNDPROC)WINPROC_GetProc( classPtr->winproc,
Alexandre Julliard3051b641996-07-05 17:14:13 +00001200 WIN_PROC_32W );
Alexandre Julliarde2bfa4c1996-05-16 18:21:06 +00001201 wc->cbClsExtra = classPtr->cbClsExtra;
1202 wc->cbWndExtra = classPtr->cbWndExtra;
1203 wc->hInstance = classPtr->hInstance;
Alexandre Julliarda3960291999-02-26 11:11:13 +00001204 wc->hIcon = (HICON)classPtr->hIcon;
1205 wc->hCursor = (HCURSOR)classPtr->hCursor;
1206 wc->hbrBackground = (HBRUSH)classPtr->hbrBackground;
Alexandre Julliarde2bfa4c1996-05-16 18:21:06 +00001207 wc->lpszMenuName = CLASS_GetMenuNameW( classPtr );
Gavriel Statec77c5921998-11-15 09:21:17 +00001208 wc->lpszClassName = CLASS_GetClassNameW( classPtr );
Alexandre Julliarde2bfa4c1996-05-16 18:21:06 +00001209 return TRUE;
1210}
1211
1212
1213/***********************************************************************
1214 * GetClassInfoEx16 (USER.398)
1215 *
1216 * FIXME: this is just a guess, I have no idea if GetClassInfoEx() is the
1217 * same in Win16 as in Win32. --AJ
1218 */
Alexandre Julliard670cdc41997-08-24 16:00:30 +00001219BOOL16 WINAPI GetClassInfoEx16( HINSTANCE16 hInstance, SEGPTR name,
1220 WNDCLASSEX16 *wc )
Alexandre Julliarde2bfa4c1996-05-16 18:21:06 +00001221{
1222 ATOM atom;
1223 CLASS *classPtr;
Alexandre Julliard808cb041995-08-17 17:11:36 +00001224
Alexandre Julliard359f497e1999-07-04 16:02:24 +00001225 TRACE("%x %p %p\n",hInstance,PTR_SEG_TO_LIN( name ), wc);
Alexandre Julliard767e6f61998-08-09 12:47:43 +00001226
Alexandre Julliard808cb041995-08-17 17:11:36 +00001227 hInstance = GetExePtr( hInstance );
Alexandre Julliarde2bfa4c1996-05-16 18:21:06 +00001228 if (!(atom = GlobalFindAtom16( name )) ||
1229 !(classPtr = CLASS_FindClassByAtom( atom, hInstance )) ||
1230 (hInstance != classPtr->hInstance)) return FALSE;
1231 wc->style = classPtr->style;
Alexandre Julliard3051b641996-07-05 17:14:13 +00001232 wc->lpfnWndProc = WINPROC_GetProc( classPtr->winproc, WIN_PROC_16 );
Alexandre Julliarde2bfa4c1996-05-16 18:21:06 +00001233 wc->cbClsExtra = (INT16)classPtr->cbClsExtra;
1234 wc->cbWndExtra = (INT16)classPtr->cbWndExtra;
1235 wc->hInstance = (HINSTANCE16)classPtr->hInstance;
1236 wc->hIcon = classPtr->hIcon;
1237 wc->hIconSm = classPtr->hIconSm;
1238 wc->hCursor = classPtr->hCursor;
1239 wc->hbrBackground = classPtr->hbrBackground;
1240 wc->lpszClassName = (SEGPTR)0;
1241 wc->lpszMenuName = (SEGPTR)CLASS_GetMenuNameA( classPtr );
1242 if (HIWORD(wc->lpszMenuName)) /* Make it a SEGPTR */
1243 wc->lpszMenuName = SEGPTR_GET( (LPSTR)wc->lpszMenuName );
Gavriel Statec77c5921998-11-15 09:21:17 +00001244 wc->lpszClassName = (SEGPTR)CLASS_GetClassNameA( classPtr );
1245 if (HIWORD(wc->lpszClassName)) /* Make it a SEGPTR */
1246 wc->lpszClassName = SEGPTR_GET( (LPSTR)wc->lpszClassName );
Alexandre Julliarde2bfa4c1996-05-16 18:21:06 +00001247 return TRUE;
1248}
Alexandre Julliard5f721f81994-01-04 20:14:34 +00001249
Alexandre Julliard1285c2f1996-05-06 16:06:24 +00001250
Alexandre Julliarde2bfa4c1996-05-16 18:21:06 +00001251/***********************************************************************
Alexandre Julliard54c27111998-03-29 19:44:57 +00001252 * GetClassInfoEx32A (USER32.212)
Alexandre Julliarde2bfa4c1996-05-16 18:21:06 +00001253 */
Alexandre Julliarda3960291999-02-26 11:11:13 +00001254BOOL WINAPI GetClassInfoExA( HINSTANCE hInstance, LPCSTR name,
1255 WNDCLASSEXA *wc )
Alexandre Julliarde2bfa4c1996-05-16 18:21:06 +00001256{
1257 ATOM atom;
1258 CLASS *classPtr;
1259
Alexandre Julliard359f497e1999-07-04 16:02:24 +00001260 TRACE("%x %p %p\n",hInstance, name, wc);
Alexandre Julliard767e6f61998-08-09 12:47:43 +00001261
Alexandre Julliarda3960291999-02-26 11:11:13 +00001262 if (!(atom = GlobalFindAtomA( name )) ||
Alexandre Julliarda0d77311998-09-13 16:32:00 +00001263 !(classPtr = CLASS_FindClassByAtom( atom, hInstance ))
1264 /*|| (hInstance != classPtr->hInstance) */ ) return FALSE;
Alexandre Julliarde2bfa4c1996-05-16 18:21:06 +00001265 wc->style = classPtr->style;
Alexandre Julliarda3960291999-02-26 11:11:13 +00001266 wc->lpfnWndProc = (WNDPROC)WINPROC_GetProc( classPtr->winproc,
Alexandre Julliard3051b641996-07-05 17:14:13 +00001267 WIN_PROC_32A );
Alexandre Julliarde2bfa4c1996-05-16 18:21:06 +00001268 wc->cbClsExtra = classPtr->cbClsExtra;
1269 wc->cbWndExtra = classPtr->cbWndExtra;
1270 wc->hInstance = classPtr->hInstance;
Alexandre Julliarda3960291999-02-26 11:11:13 +00001271 wc->hIcon = (HICON)classPtr->hIcon;
1272 wc->hIconSm = (HICON)classPtr->hIconSm;
1273 wc->hCursor = (HCURSOR)classPtr->hCursor;
1274 wc->hbrBackground = (HBRUSH)classPtr->hbrBackground;
Alexandre Julliarde2bfa4c1996-05-16 18:21:06 +00001275 wc->lpszMenuName = CLASS_GetMenuNameA( classPtr );
Gavriel Statec77c5921998-11-15 09:21:17 +00001276 wc->lpszClassName = CLASS_GetClassNameA( classPtr );
Alexandre Julliarde2bfa4c1996-05-16 18:21:06 +00001277 return TRUE;
1278}
1279
1280
1281/***********************************************************************
Alexandre Julliard54c27111998-03-29 19:44:57 +00001282 * GetClassInfoEx32W (USER32.213)
Alexandre Julliarde2bfa4c1996-05-16 18:21:06 +00001283 */
Alexandre Julliarda3960291999-02-26 11:11:13 +00001284BOOL WINAPI GetClassInfoExW( HINSTANCE hInstance, LPCWSTR name,
1285 WNDCLASSEXW *wc )
Alexandre Julliarde2bfa4c1996-05-16 18:21:06 +00001286{
1287 ATOM atom;
1288 CLASS *classPtr;
1289
Alexandre Julliard359f497e1999-07-04 16:02:24 +00001290 TRACE("%x %p %p\n",hInstance, name, wc);
Alexandre Julliard767e6f61998-08-09 12:47:43 +00001291
Alexandre Julliarda3960291999-02-26 11:11:13 +00001292 if (!(atom = GlobalFindAtomW( name )) ||
Alexandre Julliarde2bfa4c1996-05-16 18:21:06 +00001293 !(classPtr = CLASS_FindClassByAtom( atom, hInstance )) ||
1294 (hInstance != classPtr->hInstance)) return FALSE;
1295 wc->style = classPtr->style;
Alexandre Julliarda3960291999-02-26 11:11:13 +00001296 wc->lpfnWndProc = (WNDPROC)WINPROC_GetProc( classPtr->winproc,
Alexandre Julliard3051b641996-07-05 17:14:13 +00001297 WIN_PROC_32W );
Alexandre Julliarde2bfa4c1996-05-16 18:21:06 +00001298 wc->cbClsExtra = classPtr->cbClsExtra;
1299 wc->cbWndExtra = classPtr->cbWndExtra;
1300 wc->hInstance = classPtr->hInstance;
Alexandre Julliarda3960291999-02-26 11:11:13 +00001301 wc->hIcon = (HICON)classPtr->hIcon;
1302 wc->hIconSm = (HICON)classPtr->hIconSm;
1303 wc->hCursor = (HCURSOR)classPtr->hCursor;
1304 wc->hbrBackground = (HBRUSH)classPtr->hbrBackground;
Alexandre Julliarde2bfa4c1996-05-16 18:21:06 +00001305 wc->lpszMenuName = CLASS_GetMenuNameW( classPtr );
Gavriel Statec77c5921998-11-15 09:21:17 +00001306 wc->lpszClassName = CLASS_GetClassNameW( classPtr );;
Alexandre Julliard5f721f81994-01-04 20:14:34 +00001307 return TRUE;
1308}
Alexandre Julliarde2abbb11995-03-19 17:39:39 +00001309
1310
1311/***********************************************************************
1312 * ClassFirst (TOOLHELP.69)
1313 */
Alexandre Julliarda3960291999-02-26 11:11:13 +00001314BOOL16 WINAPI ClassFirst16( CLASSENTRY *pClassEntry )
Alexandre Julliarde2abbb11995-03-19 17:39:39 +00001315{
Alexandre Julliard359f497e1999-07-04 16:02:24 +00001316 TRACE("%p\n",pClassEntry);
Alexandre Julliard2ace16a1996-04-28 15:09:19 +00001317 pClassEntry->wNext = 1;
Alexandre Julliarda3960291999-02-26 11:11:13 +00001318 return ClassNext16( pClassEntry );
Alexandre Julliarde2abbb11995-03-19 17:39:39 +00001319}
1320
1321
1322/***********************************************************************
1323 * ClassNext (TOOLHELP.70)
1324 */
Alexandre Julliarda3960291999-02-26 11:11:13 +00001325BOOL16 WINAPI ClassNext16( CLASSENTRY *pClassEntry )
Alexandre Julliarde2abbb11995-03-19 17:39:39 +00001326{
Alexandre Julliard2ace16a1996-04-28 15:09:19 +00001327 int i;
1328 CLASS *class = firstClass;
Alexandre Julliarde2abbb11995-03-19 17:39:39 +00001329
Alexandre Julliard359f497e1999-07-04 16:02:24 +00001330 TRACE("%p\n",pClassEntry);
Alexandre Julliard767e6f61998-08-09 12:47:43 +00001331
Alexandre Julliard2ace16a1996-04-28 15:09:19 +00001332 if (!pClassEntry->wNext) return FALSE;
1333 for (i = 1; (i < pClassEntry->wNext) && class; i++) class = class->next;
1334 if (!class)
1335 {
1336 pClassEntry->wNext = 0;
1337 return FALSE;
1338 }
Alexandre Julliard1285c2f1996-05-06 16:06:24 +00001339 pClassEntry->hInst = class->hInstance;
Alexandre Julliard2ace16a1996-04-28 15:09:19 +00001340 pClassEntry->wNext++;
Alexandre Julliarda3960291999-02-26 11:11:13 +00001341 GlobalGetAtomNameA( class->atomName, pClassEntry->szClassName,
Alexandre Julliarde2bfa4c1996-05-16 18:21:06 +00001342 sizeof(pClassEntry->szClassName) );
Alexandre Julliarde2abbb11995-03-19 17:39:39 +00001343 return TRUE;
1344}