Changeset 1063 for trunk/src


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

Dialog + error handling fixes

Location:
trunk/src/user32
Files:
4 edited

Legend:

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

    r1057 r1063  
    1 /* $Id: dc.cpp,v 1.5 1999-09-26 10:09:58 sandervl Exp $ */
     1/* $Id: dc.cpp,v 1.6 1999-09-26 14:44:58 sandervl Exp $ */
    22
    33/*
     
    282282BOOL    OPEN32API _O32_DeleteObject (LHANDLE hgdiobj);
    283283int     OPEN32API _O32_ReleaseDC (HWND hwnd, HDC hdc);
     284VOID    OPEN32API _O32_SetLastError( DWORD );
    284285
    285286#ifndef DEVESC_SETPS
     
    694695   HPS      hPS_ownDC = NULLHANDLE;
    695696
    696 dprintf (("USER32: BeginPaint(%x)", hWnd));
     697   dprintf (("USER32: BeginPaint(%x)", hWnd));
    697698
    698699   if ( !lpps )
     
    761762
    762763   SetFS(sel);
     764   _O32_SetLastError(0);
    763765   return (HDC)pHps->hps;
    764766}
     
    792794exit:
    793795   SetFS(sel);
     796   _O32_SetLastError(0);
    794797   return TRUE;
    795798}
  • trunk/src/user32/win32dlg.cpp

    r1060 r1063  
    1 /* $Id: win32dlg.cpp,v 1.4 1999-09-26 11:09:39 sandervl Exp $ */
     1/* $Id: win32dlg.cpp,v 1.5 1999-09-26 14:44:58 sandervl Exp $ */
    22/*
    33 * Win32 Dialog Code for OS/2
     
    192192
    193193    /* Create controls */
    194     //testesteest
    195194    if (createControls(dlgTemplate, hInst))
    196195    {
     
    198197        hwndFocus = GetNextDlgTabItem( getWindowHandle(), 0, FALSE );
    199198
    200 #if 1
    201         //TODO: SetFocus call messes things up
    202         SendMessageA(WM_INITDIALOG, (WPARAM)hwndFocus, param);
    203 #else
    204199        if (SendMessageA(WM_INITDIALOG, (WPARAM)hwndFocus, param ))
    205200             SetFocus(hwndFocus);
    206 #endif
     201
    207202        if (dlgInfo.style & WS_VISIBLE && !(getStyle() & WS_VISIBLE))
    208203        {
  • trunk/src/user32/windlg.cpp

    r949 r1063  
    1 /* $Id: windlg.cpp,v 1.1 1999-09-15 23:19:02 sandervl Exp $ */
     1/* $Id: windlg.cpp,v 1.2 1999-09-26 14:44:58 sandervl Exp $ */
    22/*
    33 * Win32 dialog apis for OS/2
     
    212212    if(!dialog || !dialog->IsDialog()) {
    213213        dprintf(("GetNextDlgTabItem, window %x not found", hwndDlg));
     214        SetLastError(ERROR_INVALID_WINDOW_HANDLE);
    214215        return 0;
    215216    }
     
    227228    if(!dialog || !dialog->IsDialog()) {
    228229        dprintf(("GetDlgItem, window %x not found", hwnd));
     230        SetLastError(ERROR_INVALID_WINDOW_HANDLE);
    229231        return 0;
    230232    }
     
    245247    if(!dlgcontrol) {
    246248        dprintf(("GetDlgCtrlID, control %x not found", hwnd));
     249        SetLastError(ERROR_INVALID_WINDOW_HANDLE);
    247250        return 0;
    248251    }
     
    259262    if(!dialog || !dialog->IsDialog()) {
    260263        dprintf(("GetDlgItem, window %x not found", hwnd));
     264        SetLastError(ERROR_INVALID_WINDOW_HANDLE);
    261265        return 0;
    262266    }
  • 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.