Ignore:
Timestamp:
Mar 1, 2000, 2:30:07 PM (25 years ago)
Author:
sandervl
Message:

focus fixes + changes for dinput

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/user32/window.cpp

    r2881 r2956  
    1 /* $Id: window.cpp,v 1.57 2000-02-24 19:19:10 sandervl Exp $ */
     1/* $Id: window.cpp,v 1.58 2000-03-01 13:30:07 sandervl Exp $ */
    22/*
    33 * Win32 window apis for OS/2
     
    3131#include "winicon.h"
    3232#include <win\winpos.h>
     33#include <heapstring.h>
    3334
    3435#define DBG_LOCALLOG    DBG_window
     
    187188    }
    188189    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));
    190191    }
    191192    else dprintf(("CreateWindowExW: class %d parent %x (%d,%d) (%d,%d), %x %x", className, parent, x, y, width, height, style, exStyle));
     
    287288    if(!window) {
    288289        dprintf(("CreateMDIWindowW, window %x not found", hwndParent));
    289     SetLastError(ERROR_INVALID_WINDOW_HANDLE);
     290        SetLastError(ERROR_INVALID_WINDOW_HANDLE);
    290291        return 0;
    291292    }
     
    952953HWND WIN32API FindWindowA(LPCSTR lpszClass, LPCSTR lpszWindow)
    953954{
    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 );
    964956}
    965957//******************************************************************************
     
    967959HWND WIN32API FindWindowW( LPCWSTR lpClassName, LPCWSTR lpWindowName)
    968960{
    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 );
    977962}
    978963//******************************************************************************
     
    980965HWND WIN32API FindWindowExA(HWND hwndParent, HWND hwndChildAfter, LPCSTR lpszClass, LPCSTR lpszWindow)
    981966{
    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);
    992980}
    993981/*****************************************************************************
     
    1007995 *               error information, call GetLastError.
    1008996 * Remark    :
    1009  * Status    : UNTESTED STUB
    1010997 *
    1011  * Author    : Patrick Haller [Thu, 1998/02/26 11:55]
    1012998 *****************************************************************************/
    1013999
    10141000HWND 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;
    10261023}
    10271024//******************************************************************************
Note: See TracChangeset for help on using the changeset viewer.