Ignore:
Timestamp:
Sep 26, 1999, 4:44:58 PM (26 years ago)
Author:
sandervl
Message:

Dialog + error handling fixes

File:
1 edited

Legend:

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

    r1042 r1063  
    1 /* $Id: window.cpp,v 1.9 1999-09-25 14:18:12 sandervl Exp $ */
     1/* $Id: window.cpp,v 1.10 1999-09-26 14:44:58 sandervl Exp $ */
    22/*
    33 * Win32 window apis for OS/2
     
    301301    if(!window) {
    302302        dprintf(("CreateMDIWindowW, window %x not found", hwndParent));
     303        SetLastError(ERROR_INVALID_WINDOW_HANDLE);
    303304        return 0;
    304305    }
     
    326327    if(!window) {
    327328        dprintf(("DestroyWindow, window %x not found", hwnd));
     329        SetLastError(ERROR_INVALID_WINDOW_HANDLE);
    328330        return 0;
    329331    }
     
    340342    if(!window) {
    341343        dprintf(("SetActiveWindow, window %x not found", hwnd));
     344        SetLastError(ERROR_INVALID_WINDOW_HANDLE);
    342345        return 0;
    343346    }
     
    354357    if(!window) {
    355358        dprintf(("GetParent, window %x not found", hwnd));
     359        SetLastError(ERROR_INVALID_WINDOW_HANDLE);
    356360        return 0;
    357361    }
     
    368372    if(!window) {
    369373        dprintf(("SetParent, window %x not found", hwndChild));
     374        SetLastError(ERROR_INVALID_WINDOW_HANDLE);
    370375        return 0;
    371376    }
     
    382387    if(!window) {
    383388        dprintf(("IsChild, window %x not found", hwnd));
     389        SetLastError(ERROR_INVALID_WINDOW_HANDLE);
    384390        return 0;
    385391    }
     
    396402    if(!window) {
    397403        dprintf(("GetTopWindow, window %x not found", hwnd));
     404        SetLastError(ERROR_INVALID_WINDOW_HANDLE);
    398405        return 0;
    399406    }
     
    426433    if(!window) {
    427434        dprintf(("IsIconic, window %x not found", hwnd));
     435        SetLastError(ERROR_INVALID_WINDOW_HANDLE);
    428436        return 0;
    429437    }
     
    440448    if(!window) {
    441449        dprintf(("GetWindow, window %x not found", hwnd));
     450        SetLastError(ERROR_INVALID_WINDOW_HANDLE);
    442451        return 0;
    443452    }
     
    454463    if(!window) {
    455464        dprintf(("EnableWindow, window %x not found", hwnd));
     465        SetLastError(ERROR_INVALID_WINDOW_HANDLE);
    456466        return 0;
    457467    }
     
    480490    if(!window) {
    481491        dprintf(("ShowWindow, window %x not found", hwnd));
     492        SetLastError(ERROR_INVALID_WINDOW_HANDLE);
    482493        return 0;
    483494    }
     
    494505    if(!window) {
    495506        dprintf(("SetWindowPos, window %x not found", hwnd));
     507        SetLastError(ERROR_INVALID_WINDOW_HANDLE);
    496508        return 0;
    497509    }
     
    552564    if(!window) {
    553565        dprintf(("IsWindowVisible, window %x not found", hwnd));
     566        SetLastError(ERROR_INVALID_WINDOW_HANDLE);
    554567        return 0;
    555568    }
     
    569582    lastFocus_W = Win32BaseWindow::OS2ToWin32Handle (lastFocus);
    570583
    571     dprintf(("USER32:  SetFocus %x (%x) -> %x (%x)\n", lastFocus_W, lastFocus, hwnd, hwnd_O));
     584    dprintf(("SetFocus %x (%x) -> %x (%x)\n", lastFocus_W, lastFocus, hwnd, hwnd_O));
    572585
    573586    return (OSLibWinSetFocus (OSLIB_HWND_DESKTOP, hwnd_O, activate)) ? lastFocus_W : 0;
     
    652665    if(!window) {
    653666        dprintf(("GetWindowRect, window %x not found", hwnd));
     667        SetLastError(ERROR_INVALID_WINDOW_HANDLE);
    654668        return 0;
    655669    }
     
    666680    if(!window) {
    667681        dprintf(("GetWindowTextLength, window %x not found", hwnd));
     682        SetLastError(ERROR_INVALID_WINDOW_HANDLE);
    668683        return 0;
    669684    }
     
    681696    if(!window) {
    682697        dprintf(("GetWindowTextA, window %x not found", hwnd));
     698        SetLastError(ERROR_INVALID_WINDOW_HANDLE);
    683699        return 0;
    684700    }
     
    703719    if(!window) {
    704720        dprintf(("GetWindowTextW, window %x not found", hwnd));
     721        SetLastError(ERROR_INVALID_WINDOW_HANDLE);
    705722        return 0;
    706723    }
     
    717734    if(!window) {
    718735        dprintf(("SetWindowTextA, window %x not found", hwnd));
     736        SetLastError(ERROR_INVALID_WINDOW_HANDLE);
    719737        return 0;
    720738    }
     
    731749    if(!window) {
    732750        dprintf(("SetWindowTextA, window %x not found", hwnd));
     751        SetLastError(ERROR_INVALID_WINDOW_HANDLE);
    733752        return 0;
    734753    }
     
    800819{
    801820    if(!lpszClass) {
    802     SetLastError(ERROR_INVALID_PARAMETER);
    803     return 0;
     821        SetLastError(ERROR_INVALID_PARAMETER);
     822        return 0;
    804823    }
    805824    if(HIWORD(lpszClass)) {
     
    815834{
    816835    if(!lpszClass) {
    817     SetLastError(ERROR_INVALID_PARAMETER);
    818     return 0;
     836        SetLastError(ERROR_INVALID_PARAMETER);
     837        return 0;
    819838    }
    820839    if(HIWORD(lpszClass)) {
     
    852871{
    853872    if(!lpszClass) {
    854     SetLastError(ERROR_INVALID_PARAMETER);
    855     return 0;
     873        SetLastError(ERROR_INVALID_PARAMETER);
     874        return 0;
    856875    }
    857876    dprintf(("USER32:  FindWindowExW (%x,%x) %x %s\n", hwndParent, hwndChildAfter, lpszClass, lpszWindow));
     
    888907    PRECT rcl;
    889908
    890     if (!hwnd) return (TRUE);
     909    if (!hwnd) {
     910        SetLastError(ERROR_INVALID_PARAMETER);
     911        return (FALSE);
     912    }
    891913    wnd = Win32BaseWindow::GetWindowFromHandle (hwnd);
    892     if (!wnd) return (TRUE);
     914    if (!wnd) {
     915        SetLastError(ERROR_INVALID_WINDOW_HANDLE);
     916        return (FALSE);
     917    }
    893918
    894919    rcl  = wnd->getClientRect();
     
    953978        if (GetWindowRect (hwndParent, &rect) == 0) {
    954979                // oops, invalid handle
     980                SetLastError(ERROR_INVALID_WINDOW_HANDLE);
    955981                return NULL;
    956982        }
     
    10161042    if(!window) {
    10171043        dprintf(("CloseWindow, window %x not found", hwnd));
     1044        SetLastError(ERROR_INVALID_WINDOW_HANDLE);
    10181045        return 0;
    10191046    }
     
    10441071    if(!window) {
    10451072        dprintf(("IsWindowUnicode, window %x not found", hwnd));
     1073        SetLastError(ERROR_INVALID_WINDOW_HANDLE);
    10461074        return 0;
    10471075    }
     
    11491177  if(!parentwindow) {
    11501178        dprintf(("EnumChildWindows, window %x not found", hwnd));
     1179        SetLastError(ERROR_INVALID_WINDOW_HANDLE);
    11511180        return FALSE;
    11521181  }
Note: See TracChangeset for help on using the changeset viewer.