3 * Copyright (C) 1998, 1999, 2000, 2001 ReactOS Team
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2 of the License, or
8 * (at your option) any later version.
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
19 /* $Id: prop.c,v 1.7 2003/05/12 19:30:00 jfilby Exp $
21 * PROJECT: ReactOS user32.dll
22 * FILE: lib/user32/windows/input.c
24 * PROGRAMMER: Casper S. Hornstrup (chorns@users.sourceforge.net)
26 * 09-05-2001 CSH Created
29 /* INCLUDES ******************************************************************/
36 /* FUNCTIONS *****************************************************************/
39 EnumPropsA(HWND hWnd
, PROPENUMPROC lpEnumFunc
)
46 EnumPropsExA(HWND hWnd
, PROPENUMPROCEX lpEnumFunc
, LPARAM lParam
)
53 EnumPropsExW(HWND hWnd
, PROPENUMPROCEX lpEnumFunc
, LPARAM lParam
)
60 EnumPropsW(HWND hWnd
, PROPENUMPROC lpEnumFunc
)
67 GetPropA(HWND hWnd
, LPCSTR lpString
)
70 UNICODE_STRING UString
;
74 RtlCreateUnicodeStringFromAsciiz(&UString
, (LPSTR
)lpString
);
75 lpWString
= UString
.Buffer
;
76 if (lpWString
== NULL
)
80 Ret
= GetPropW(hWnd
, lpWString
);
81 RtlFreeUnicodeString(&UString
);
85 Ret
= GetPropW(hWnd
, (LPWSTR
)lpString
);
91 GetPropW(HWND hWnd
, LPCWSTR lpString
)
96 Atom
= GlobalFindAtomW(lpString
);
100 Atom
= LOWORD((DWORD
)lpString
);
102 return(NtUserGetProp(hWnd
, Atom
));
106 RemovePropA(HWND hWnd
, LPCSTR lpString
)
109 UNICODE_STRING UString
;
112 if (HIWORD(lpString
))
114 RtlCreateUnicodeStringFromAsciiz(&UString
, (LPSTR
)lpString
);
115 lpWString
= UString
.Buffer
;
116 if (lpWString
== NULL
)
120 Ret
= RemovePropW(hWnd
, lpWString
);
121 RtlFreeUnicodeString(&UString
);
125 Ret
= RemovePropW(hWnd
, (LPCWSTR
)lpString
);
131 RemovePropW(HWND hWnd
,
135 if (HIWORD(lpString
))
137 Atom
= GlobalFindAtomW(lpString
);
141 Atom
= LOWORD((DWORD
)lpString
);
143 return(NtUserRemoveProp(hWnd
, Atom
));
147 SetPropA(HWND hWnd
, LPCSTR lpString
, HANDLE hData
)
150 UNICODE_STRING UString
;
153 if (HIWORD(lpString
))
155 RtlCreateUnicodeStringFromAsciiz(&UString
, (LPSTR
)lpString
);
156 lpWString
= UString
.Buffer
;
157 if (lpWString
== NULL
)
161 Ret
= SetPropW(hWnd
, lpWString
, hData
);
162 RtlFreeUnicodeString(&UString
);
166 Ret
= SetPropW(hWnd
, (LPWSTR
)lpString
, hData
);
172 SetPropW(HWND hWnd
, LPCWSTR lpString
, HANDLE hData
)
175 if (HIWORD(lpString
))
177 Atom
= GlobalFindAtomW(lpString
);
181 Atom
= LOWORD((DWORD
)lpString
);
184 return(NtUserSetProp(hWnd
, Atom
, hData
));