Changeset 2956 for trunk/src/user32/window.cpp
- Timestamp:
- Mar 1, 2000, 2:30:07 PM (25 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/user32/window.cpp
r2881 r2956 1 /* $Id: window.cpp,v 1.5 7 2000-02-24 19:19:10sandervl Exp $ */1 /* $Id: window.cpp,v 1.58 2000-03-01 13:30:07 sandervl Exp $ */ 2 2 /* 3 3 * Win32 window apis for OS/2 … … 31 31 #include "winicon.h" 32 32 #include <win\winpos.h> 33 #include <heapstring.h> 33 34 34 35 #define DBG_LOCALLOG DBG_window … … 187 188 } 188 189 if(HIWORD(className)) { 189 dprintf(("CreateWindowExW: class % s parent %x (%d,%d) (%d,%d), %x %x", className, parent, x, y, width, height, style, exStyle));190 dprintf(("CreateWindowExW: class %ls parent %x (%d,%d) (%d,%d), %x %x", className, parent, x, y, width, height, style, exStyle)); 190 191 } 191 192 else dprintf(("CreateWindowExW: class %d parent %x (%d,%d) (%d,%d), %x %x", className, parent, x, y, width, height, style, exStyle)); … … 287 288 if(!window) { 288 289 dprintf(("CreateMDIWindowW, window %x not found", hwndParent)); 289 SetLastError(ERROR_INVALID_WINDOW_HANDLE);290 SetLastError(ERROR_INVALID_WINDOW_HANDLE); 290 291 return 0; 291 292 } … … 952 953 HWND WIN32API FindWindowA(LPCSTR lpszClass, LPCSTR lpszWindow) 953 954 { 954 if(!lpszClass) { 955 SetLastError(ERROR_INVALID_PARAMETER); 956 return 0; 957 } 958 if(HIWORD(lpszClass)) { 959 dprintf(("USER32: FindWindow %s %s\n", lpszClass, lpszWindow)); 960 } 961 else dprintf(("USER32: FindWindow %x %s\n", lpszClass, lpszWindow)); 962 963 return Win32BaseWindow::FindWindowEx(OSLIB_HWND_DESKTOP, 0, (LPSTR)lpszClass, (LPSTR)lpszWindow); 955 return FindWindowExA( NULL, NULL, lpszClass, lpszWindow ); 964 956 } 965 957 //****************************************************************************** … … 967 959 HWND WIN32API FindWindowW( LPCWSTR lpClassName, LPCWSTR lpWindowName) 968 960 { 969 char *astring1 = UnicodeToAsciiString((LPWSTR)lpClassName); 970 char *astring2 = UnicodeToAsciiString((LPWSTR)lpWindowName); 971 HWND rc; 972 973 rc = FindWindowA(astring1, astring2); 974 FreeAsciiString(astring1); 975 FreeAsciiString(astring2); 976 return rc; 961 return FindWindowExW( NULL, NULL, lpClassName, lpWindowName ); 977 962 } 978 963 //****************************************************************************** … … 980 965 HWND WIN32API FindWindowExA(HWND hwndParent, HWND hwndChildAfter, LPCSTR lpszClass, LPCSTR lpszWindow) 981 966 { 982 if(!lpszClass) { 983 SetLastError(ERROR_INVALID_PARAMETER); 984 return 0; 985 } 986 if(HIWORD(lpszClass)) { 987 dprintf(("USER32: FindWindowExA (%x,%x) %s %s\n", hwndParent, hwndChildAfter, lpszClass, lpszWindow)); 988 } 989 else dprintf(("USER32: FindWindowExA (%x,%x)%x %s\n", hwndParent, hwndChildAfter, lpszClass, lpszWindow)); 990 991 return Win32BaseWindow::FindWindowEx(hwndParent, hwndChildAfter, (LPSTR)lpszClass, (LPSTR)lpszWindow); 967 ATOM atom = 0; 968 969 if (lpszClass) 970 { 971 /* If the atom doesn't exist, then no class */ 972 /* with this name exists either. */ 973 if (!(atom = GlobalFindAtomA( lpszClass ))) 974 { 975 SetLastError(ERROR_CANNOT_FIND_WND_CLASS); 976 return 0; 977 } 978 } 979 return Win32BaseWindow::FindWindowEx(hwndParent, hwndChildAfter, atom, (LPSTR)lpszWindow); 992 980 } 993 981 /***************************************************************************** … … 1007 995 * error information, call GetLastError. 1008 996 * Remark : 1009 * Status : UNTESTED STUB1010 997 * 1011 * Author : Patrick Haller [Thu, 1998/02/26 11:55]1012 998 *****************************************************************************/ 1013 999 1014 1000 HWND WIN32API FindWindowExW(HWND hwndParent, 1015 HWND hwndChildAfter, 1016 LPCWSTR lpszClass, 1017 LPCWSTR lpszWindow) 1018 { 1019 if(!lpszClass) { 1020 SetLastError(ERROR_INVALID_PARAMETER); 1021 return 0; 1022 } 1023 dprintf(("USER32: FindWindowExW (%x,%x) %x %s\n", hwndParent, hwndChildAfter, lpszClass, lpszWindow)); 1024 1025 return Win32BaseWindow::FindWindowEx(hwndParent, hwndChildAfter, (LPSTR)lpszClass, (LPSTR)lpszWindow); 1001 HWND hwndChildAfter, 1002 LPCWSTR lpszClass, 1003 LPCWSTR lpszWindow) 1004 { 1005 ATOM atom = 0; 1006 char *buffer; 1007 HWND hwnd; 1008 1009 if (lpszClass) 1010 { 1011 /* If the atom doesn't exist, then no class */ 1012 /* with this name exists either. */ 1013 if (!(atom = GlobalFindAtomW( lpszClass ))) 1014 { 1015 SetLastError(ERROR_CANNOT_FIND_WND_CLASS); 1016 return 0; 1017 } 1018 } 1019 buffer = HEAP_strdupWtoA( GetProcessHeap(), 0, lpszWindow ); 1020 hwnd = Win32BaseWindow::FindWindowEx(hwndParent, hwndChildAfter, atom, buffer); 1021 HeapFree( GetProcessHeap(), 0, buffer ); 1022 return hwnd; 1026 1023 } 1027 1024 //******************************************************************************
Note:
See TracChangeset
for help on using the changeset viewer.