2003-07-10 Casper S. Hornstrup <chorns@users.sourceforge.net>
[reactos.git] / reactos / lib / user32 / windows / class.c
1 /* $Id: class.c,v 1.20 2003/07/10 21:04:31 chorns Exp $
2 *
3 * COPYRIGHT: See COPYING in the top level directory
4 * PROJECT: ReactOS user32.dll
5 * FILE: lib/user32/windows/class.c
6 * PURPOSE: Window classes
7 * PROGRAMMER: Casper S. Hornstrup (chorns@users.sourceforge.net)
8 * UPDATE HISTORY:
9 * 09-05-2001 CSH Created
10 */
11 #include <windows.h>
12 #include <user32.h>
13 #include <debug.h>
14
15
16 /*
17 * @unimplemented
18 */
19 WINBOOL
20 STDCALL
21 GetClassInfoA(
22 HINSTANCE hInstance,
23 LPCSTR lpClassName,
24 LPWNDCLASSA lpWndClass)
25 {
26 UNIMPLEMENTED;
27 return FALSE;
28 }
29
30
31 /*
32 * @unimplemented
33 */
34 WINBOOL
35 STDCALL
36 GetClassInfoExA(
37 HINSTANCE hinst,
38 LPCSTR lpszClass,
39 LPWNDCLASSEXA lpwcx)
40 {
41 UNIMPLEMENTED;
42 return FALSE;
43 }
44
45
46 /*
47 * @unimplemented
48 */
49 WINBOOL
50 STDCALL
51 GetClassInfoExW(
52 HINSTANCE hinst,
53 LPCWSTR lpszClass,
54 LPWNDCLASSEXW lpwcx)
55 {
56 UNIMPLEMENTED;
57 return FALSE;
58 }
59
60
61 /*
62 * @unimplemented
63 */
64 WINBOOL
65 STDCALL
66 GetClassInfoW(
67 HINSTANCE hInstance,
68 LPCWSTR lpClassName,
69 LPWNDCLASSW lpWndClass)
70 {
71 UNIMPLEMENTED;
72 return FALSE;
73 }
74
75
76 /*
77 * @implemented
78 */
79 DWORD STDCALL
80 GetClassLongA(HWND hWnd, int nIndex)
81 {
82 switch (nIndex)
83 {
84 case GCL_WNDPROC:
85 UNIMPLEMENTED;
86 return(0);
87 case GCL_MENUNAME:
88 UNIMPLEMENTED;
89 return(0);
90 default:
91 return(GetClassLongW(hWnd, nIndex));
92 }
93 }
94
95
96 /*
97 * @implemented
98 */
99 DWORD STDCALL
100 GetClassLongW(HWND hWnd, int nIndex)
101 {
102 return(NtUserGetClassLong(hWnd, nIndex));
103 }
104
105
106 /*
107 * @unimplemented
108 */
109 int
110 STDCALL
111 GetClassNameA(
112 HWND hWnd,
113 LPSTR lpClassName,
114 int nMaxCount)
115 {
116 UNIMPLEMENTED;
117 return 0;
118 }
119
120
121 /*
122 * @unimplemented
123 */
124 int
125 STDCALL
126 GetClassNameW(
127 HWND hWnd,
128 LPWSTR lpClassName,
129 int nMaxCount)
130 {
131 UNIMPLEMENTED;
132 return 0;
133 }
134
135
136 /*
137 * @unimplemented
138 */
139 WORD
140 STDCALL
141 GetClassWord(
142 HWND hWnd,
143 int nIndex)
144 /*
145 * NOTE: Obsoleted in 32-bit windows
146 */
147 {
148 UNIMPLEMENTED;
149 return 0;
150 }
151
152
153 /*
154 * @implemented
155 */
156 LONG STDCALL
157 GetWindowLongA(HWND hWnd, int nIndex)
158 {
159 return NtUserGetWindowLong(hWnd, nIndex);
160 }
161
162
163 /*
164 * @implemented
165 */
166 LONG STDCALL
167 GetWindowLongW(HWND hWnd, int nIndex)
168 {
169 return NtUserGetWindowLong(hWnd, nIndex);
170 }
171
172
173 /*
174 * @unimplemented
175 */
176 UINT
177 STDCALL
178 RealGetWindowClass(
179 HWND hwnd,
180 LPSTR pszType,
181 UINT cchType)
182 {
183 UNIMPLEMENTED;
184 return 0;
185 }
186
187
188 /*
189 * @unimplemented
190 */
191 UINT
192 STDCALL
193 RealGetWindowClassA(
194 HWND hwnd,
195 LPSTR pszType,
196 UINT cchType)
197 {
198 UNIMPLEMENTED;
199 return 0;
200 }
201
202
203 /*
204 * @unimplemented
205 */
206 UINT
207 STDCALL
208 RealGetWindowClassW(
209 HWND hwnd,
210 LPWSTR pszType,
211 UINT cchType)
212 {
213 UNIMPLEMENTED;
214 return 0;
215 }
216
217
218 /*
219 * @implemented
220 */
221 ATOM STDCALL
222 RegisterClassA(CONST WNDCLASSA *lpWndClass)
223 {
224 WNDCLASSEXA Class;
225
226 RtlMoveMemory(&Class.style, lpWndClass, sizeof(WNDCLASS));
227 Class.cbSize = sizeof(WNDCLASSEXA);
228 Class.hIconSm = INVALID_HANDLE_VALUE;
229 return RegisterClassExA(&Class);
230 }
231
232
233 /*
234 * @implemented
235 */
236 ATOM STDCALL
237 RegisterClassExA(CONST WNDCLASSEXA *lpwcx)
238 {
239 UNICODE_STRING MenuName;
240 UNICODE_STRING ClassName;
241 WNDCLASSEXW Class;
242 RTL_ATOM Atom;
243
244 if (!RtlCreateUnicodeStringFromAsciiz(&MenuName, (PCSZ)lpwcx->lpszMenuName))
245 {
246 RtlFreeUnicodeString(&MenuName);
247 SetLastError(ERROR_NOT_ENOUGH_MEMORY);
248 return (ATOM)0;
249 }
250
251 if (!RtlCreateUnicodeStringFromAsciiz(&ClassName, (PCSZ)lpwcx->lpszClassName))
252 {
253 RtlFreeUnicodeString(&ClassName);
254 SetLastError(ERROR_NOT_ENOUGH_MEMORY);
255 return (ATOM)0;
256 }
257
258 RtlMoveMemory(&Class, lpwcx, sizeof(WNDCLASSEXA));
259 Class.lpszMenuName = MenuName.Buffer;
260 Class.lpszClassName = ClassName.Buffer;
261
262 Atom = NtUserRegisterClassExWOW(&Class,
263 FALSE,
264 0,
265 0,
266 0,
267 0);
268
269 RtlFreeUnicodeString(&ClassName);
270 RtlFreeUnicodeString(&MenuName);
271
272 return (ATOM)Atom;
273 }
274
275
276 /*
277 * @implemented
278 */
279 ATOM STDCALL
280 RegisterClassExW(CONST WNDCLASSEXW *lpwcx)
281 {
282 RTL_ATOM Atom;
283
284 Atom = NtUserRegisterClassExWOW((WNDCLASSEX*)lpwcx,
285 TRUE,
286 0,
287 0,
288 0,
289 0);
290
291 return (ATOM)Atom;
292 }
293
294
295 /*
296 * @implemented
297 */
298 ATOM STDCALL
299 RegisterClassW(CONST WNDCLASSW *lpWndClass)
300 {
301 WNDCLASSEXW Class;
302
303 RtlMoveMemory(&Class.style, lpWndClass, sizeof(WNDCLASSW));
304 Class.cbSize = sizeof(WNDCLASSEXW);
305 Class.hIconSm = INVALID_HANDLE_VALUE;
306 return RegisterClassExW(&Class);
307 }
308
309
310 /*
311 * @unimplemented
312 */
313 DWORD
314 STDCALL
315 SetClassLongA(
316 HWND hWnd,
317 int nIndex,
318 LONG dwNewLong)
319 {
320 UNIMPLEMENTED;
321 return 0;
322 }
323
324
325 /*
326 * @unimplemented
327 */
328 DWORD
329 STDCALL
330 SetClassLongW(
331 HWND hWnd,
332 int nIndex,
333 LONG dwNewLong)
334 {
335 UNIMPLEMENTED;
336 return 0;
337 }
338
339
340 /*
341 * @unimplemented
342 */
343 WORD
344 STDCALL
345 SetClassWord(
346 HWND hWnd,
347 int nIndex,
348 WORD wNewWord)
349 /*
350 * NOTE: Obsoleted in 32-bit windows
351 */
352 {
353 UNIMPLEMENTED;
354 return 0;
355 }
356
357
358 /*
359 * @implemented
360 */
361 LONG
362 STDCALL
363 SetWindowLongA(
364 HWND hWnd,
365 int nIndex,
366 LONG dwNewLong)
367 {
368 return NtUserSetWindowLong(hWnd, nIndex, dwNewLong, TRUE);
369 }
370
371
372 /*
373 * @implemented
374 */
375 LONG
376 STDCALL
377 SetWindowLongW(
378 HWND hWnd,
379 int nIndex,
380 LONG dwNewLong)
381 {
382 return NtUserSetWindowLong(hWnd, nIndex, dwNewLong, FALSE);
383 }
384
385
386 /*
387 * @unimplemented
388 */
389 WINBOOL
390 STDCALL
391 UnregisterClassA(
392 LPCSTR lpClassName,
393 HINSTANCE hInstance)
394 {
395 UNIMPLEMENTED;
396 return FALSE;
397 }
398
399
400 /*
401 * @unimplemented
402 */
403 WINBOOL
404 STDCALL
405 UnregisterClassW(
406 LPCWSTR lpClassName,
407 HINSTANCE hInstance)
408 {
409 UNIMPLEMENTED;
410 return FALSE;
411 }
412
413 /* EOF */