1 /* $Id: class.c,v 1.20 2003/07/10 21:04:31 chorns Exp $
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)
9 * 09-05-2001 CSH Created
24 LPWNDCLASSA lpWndClass
)
69 LPWNDCLASSW lpWndClass
)
80 GetClassLongA(HWND hWnd
, int nIndex
)
91 return(GetClassLongW(hWnd
, nIndex
));
100 GetClassLongW(HWND hWnd
, int nIndex
)
102 return(NtUserGetClassLong(hWnd
, nIndex
));
145 * NOTE: Obsoleted in 32-bit windows
157 GetWindowLongA(HWND hWnd
, int nIndex
)
159 return NtUserGetWindowLong(hWnd
, nIndex
);
167 GetWindowLongW(HWND hWnd
, int nIndex
)
169 return NtUserGetWindowLong(hWnd
, nIndex
);
222 RegisterClassA(CONST WNDCLASSA
*lpWndClass
)
226 RtlMoveMemory(&Class
.style
, lpWndClass
, sizeof(WNDCLASS
));
227 Class
.cbSize
= sizeof(WNDCLASSEXA
);
228 Class
.hIconSm
= INVALID_HANDLE_VALUE
;
229 return RegisterClassExA(&Class
);
237 RegisterClassExA(CONST WNDCLASSEXA
*lpwcx
)
239 UNICODE_STRING MenuName
;
240 UNICODE_STRING ClassName
;
244 if (!RtlCreateUnicodeStringFromAsciiz(&MenuName
, (PCSZ
)lpwcx
->lpszMenuName
))
246 RtlFreeUnicodeString(&MenuName
);
247 SetLastError(ERROR_NOT_ENOUGH_MEMORY
);
251 if (!RtlCreateUnicodeStringFromAsciiz(&ClassName
, (PCSZ
)lpwcx
->lpszClassName
))
253 RtlFreeUnicodeString(&ClassName
);
254 SetLastError(ERROR_NOT_ENOUGH_MEMORY
);
258 RtlMoveMemory(&Class
, lpwcx
, sizeof(WNDCLASSEXA
));
259 Class
.lpszMenuName
= MenuName
.Buffer
;
260 Class
.lpszClassName
= ClassName
.Buffer
;
262 Atom
= NtUserRegisterClassExWOW(&Class
,
269 RtlFreeUnicodeString(&ClassName
);
270 RtlFreeUnicodeString(&MenuName
);
280 RegisterClassExW(CONST WNDCLASSEXW
*lpwcx
)
284 Atom
= NtUserRegisterClassExWOW((WNDCLASSEX
*)lpwcx
,
299 RegisterClassW(CONST WNDCLASSW
*lpWndClass
)
303 RtlMoveMemory(&Class
.style
, lpWndClass
, sizeof(WNDCLASSW
));
304 Class
.cbSize
= sizeof(WNDCLASSEXW
);
305 Class
.hIconSm
= INVALID_HANDLE_VALUE
;
306 return RegisterClassExW(&Class
);
350 * NOTE: Obsoleted in 32-bit windows
368 return NtUserSetWindowLong(hWnd
, nIndex
, dwNewLong
, TRUE
);
382 return NtUserSetWindowLong(hWnd
, nIndex
, dwNewLong
, FALSE
);