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.4 2002/09/08 10:23:12 chorns 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
)
45 EnumPropsExA(HWND hWnd
, PROPENUMPROCEX lpEnumFunc
, LPARAM lParam
)
51 EnumPropsExW(HWND hWnd
, PROPENUMPROCEX lpEnumFunc
, LPARAM lParam
)
57 EnumPropsW(HWND hWnd
, PROPENUMPROC lpEnumFunc
)
63 GetPropA(HWND hWnd
, LPCSTR lpString
)
69 lpWString
= User32ConvertString(lpString
);
70 if (lpWString
== NULL
)
74 Ret
= GetPropW(hWnd
, lpWString
);
75 User32FreeString(lpWString
);
79 Ret
= GetPropW(hWnd
, lpString
);
85 GetPropW(HWND hWnd
, LPCWSTR lpString
)
90 Atom
= GlobalFindAtomW(lpString
);
94 Atom
= LOWORD(lpString
);
96 return(NtUserGetProp(hWnd
, Atom
));
100 RemovePropA(HWND hWnd
, LPCSTR lpString
)
105 if (HIWORD(lpString
))
107 lpWString
= User32ConvertString(lpString
);
108 if (lpWString
== NULL
)
112 Ret
= RemovePropW(hWnd
, lpWString
);
113 User32FreeString(lpWString
);
117 Ret
= RemovePropW(hWnd
, lpWString
);
123 RemovePropW(HWND hWnd
,
127 if (HIWORD(lpString
))
129 Atom
= GlobalFindAtomW(lpString
);
133 Atom
= LOWORD(lpString
);
135 return(NtUserRemoveProp(hWnd
, Atom
));
139 SetPropA(HWND hWnd
, LPCSTR lpString
, HANDLE hData
)
144 if (HIWORD(lpString
))
146 lpWString
= User32ConvertString(lpString
);
147 if (lpWString
== NULL
)
151 Ret
= SetPropW(hWnd
, lpWString
, hData
);
152 User32FreeString(lpWString
);
156 Ret
= SetPropW(hWnd
, lpString
, hData
);
162 SetPropW(HWND hWnd
, LPCWSTR lpString
, HANDLE hData
)
165 if (HIWORD(lpString
))
167 Atom
= GlobalFindAtomW(lpString
);
171 Atom
= LOWORD(lpString
);
174 return(NtUserSetProp(hWnd
, Atom
, hData
));