Changeset 325 for trunk/src


Ignore:
Timestamp:
Jul 18, 1999, 12:39:52 PM (26 years ago)
Author:
sandervl
Message:

Lots of changes

Location:
trunk/src/user32/new
Files:
4 added
8 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/user32/new/makefile

    r321 r325  
    1 # $Id: makefile,v 1.7 1999-07-17 11:52:22 sandervl Exp $
     1# $Id: makefile,v 1.8 1999-07-18 10:39:50 sandervl Exp $
    22
    33#
     
    2929        msgbox.obj window.obj windowmsg.obj windowclass.obj windlgmsg.obj \
    3030        windowword.obj gen_object.obj oslibwin.obj win32wndchild.obj \
    31         controls.obj button.obj oslibutil.obj oslibmsg.obj
     31        controls.obj button.obj oslibutil.obj oslibmsg.obj windlg.obj \
     32        winprop.obj wingdi.obj oslibgdi.obj
    3233
    3334
     
    7374window.obj:    window.cpp win32class.h win32wnd.h win32wndchild.h
    7475windowmsg.obj: windowmsg.cpp win32class.h win32wnd.h win32wndchild.h
     76windlg.obj:    windlg.cpp win32wnd.h win32dlg.h
     77winprop.obj:   winprop.cpp
     78wingdi.obj:    wingdi.cpp win32wnd.h oslibgdi.h
    7579windlgmsg.obj: windlgmsg.cpp win32class.h win32wnd.h win32dlg.h win32wndchild.h
    7680windowclass.obj: windowclass.cpp win32class.h win32wnd.h win32wndchild.h
    7781windowword.obj:  windowword.cpp win32class.h win32wnd.h win32dlg.h win32wndchild.h
    7882
    79 pmwindow.obj:   pmwindow.cpp win32class.h win32wnd.h win32dlg.h pmwindow.h win32wndchild.h $(PDWIN32_INCLUDE)\wprocess.h
     83pmwindow.obj:   pmwindow.cpp win32class.h win32wnd.h win32dlg.h pmwindow.h win32wndchild.h $(PDWIN32_INCLUDE)\wprocess.h  oslibgdi.h
    8084win32class.obj: win32class.cpp win32class.h win32wnd.h win32dlg.h gen_object.h oslibwin.h win32wndchild.h
    8185win32wnd.obj:   win32wnd.cpp win32class.h win32wnd.h win32dlg.h gen_object.h oslibwin.h win32wndchild.h
     
    8387win32wndchild.obj: win32wndchild.cpp win32wndchild.h
    8488gen_object.obj: gen_object.cpp gen_object.h
    85 oslibwin.obj:   oslibwin.cpp oslibwin.h oslibutil.h
     89oslibwin.obj:   oslibwin.cpp oslibwin.h oslibutil.h oslibgdi.h
    8690oslibutil.obj:  oslibutil.cpp oslibutil.h $(PDWIN32_INCLUDE)\wprocess.h oslibmsg.h
    8791oslibmsg.obj:   oslibmsg.cpp oslibmsg.h
    88 
     92oslibgdi.obj:   oslibgdi.cpp oslibgdi.h
    8993
    9094clean:
  • trunk/src/user32/new/oslibwin.cpp

    r324 r325  
    1 /* $Id: oslibwin.cpp,v 1.9 1999-07-17 18:30:51 sandervl Exp $ */
     1/* $Id: oslibwin.cpp,v 1.10 1999-07-18 10:39:51 sandervl Exp $ */
    22/*
    33 * Window API wrappers for OS/2
     
    2222#include "oslibutil.h"
    2323#include "oslibmsg.h"
     24#include "oslibgdi.h"
    2425#include "pmwindow.h"
    2526
     
    4142{
    4243 HWND  hwndClient;
    43  RECTL rectl;
    4444
    4545  dprintf(("WinCreateWindow %x %x %x %s", hwndParent, dwWinStyle, dwFrameStyle, pszName));
     
    5353  if(dwFrameStyle) {
    5454        dwWinStyle &= ~WS_CLIPCHILDREN; //invalid style according to docs
     55        if(pszName)
     56                dwFrameStyle |= FCF_TITLEBAR;
     57
    5558        *hwndFrame = WinCreateStdWindow(hwndParent, dwWinStyle,
    5659                                       &dwFrameStyle, WIN32_STDCLASS,
    57                                        "", 0, 0, 0, &hwndClient) != 0;
     60                                       "", 0, 0, 0, &hwndClient);
    5861        if(*hwndFrame) {
    59                 if(pszName) {
    60                         WinSetWindowText(*hwndFrame, pszName);
    61                 }
     62                if(pszName) {
     63                        WinSetWindowText(*hwndFrame, pszName);
     64                }
    6265                return hwndClient;
    6366        }
     
    158161//******************************************************************************
    159162//******************************************************************************
    160 LONG OSLibWinQueryWindowTextLength(HWND hwnd)
    161 {
    162   return WinQueryWindowTextLength(hwnd);
    163 }
    164 //******************************************************************************
    165 //******************************************************************************
    166 LONG OSLibWinQueryWindowText(HWND hwnd,LONG lLength,char* pun)
    167 {
    168   return WinQueryWindowText(hwnd,lLength,pun);
    169 }
    170163//******************************************************************************
    171164//******************************************************************************
     
    179172                          LONG cy, ULONG fl)
    180173{
    181  RECTL rectl;
    182  HWND  hwndParent;
    183 
    184174  if(fl & SWP_MOVE) {
    185         y = MapOS2ToWin32Y(hwnd, y);
    186   }
     175        y = MapOS2ToWin32Y(hwnd, cy, y);
     176  }
     177  dprintf(("WinSetWindowPos %x %x %d %d %d %d %x", hwnd, hwndInsertBehind, x, y, cx, cy, fl));
    187178  return WinSetWindowPos(hwnd, hwndInsertBehind, x, y, cx, cy, fl);
    188179}
     
    198189  if(rc == 0)
    199190        dprintf(("WinShowWindow %x failed %x", hwnd, WinGetLastError(GetThreadHAB())));
    200   rc = WinSetWindowPos(hwnd, 0, 0, 0, 0, 0, fl);
     191  rc = WinSetWindowPos(hwnd, HWND_TOP, 0, 0, 0, 0, fl);
    201192  if(rc == 0)
    202193        dprintf(("WinShowWindow %x failed %x", hwnd, WinGetLastError(GetThreadHAB())));
     
    211202//******************************************************************************
    212203//******************************************************************************
    213 BOOL OSLibWinQueryUpdateRect(HWND hwnd, PVOID pRect)
    214 {
    215   return WinQueryUpdateRect(hwnd, (RECTL *)pRect);
     204BOOL OSLibWinQueryUpdateRect(HWND hwnd, PRECT pRect)
     205{
     206 BOOL rc;
     207 RECTLOS2 rectl;
     208
     209  rc = WinQueryUpdateRect(hwnd, (PRECTL)&rectl);
     210  if(rc) {
     211        MapOS2ToWin32Rectl(hwnd, &rectl, pRect);
     212  }
     213  return rc;
    216214}
    217215//******************************************************************************
     
    296294//******************************************************************************
    297295//******************************************************************************
    298 inline ULONG OS2TOWIN32POINT(RECTL *parent, RECTL *child, ULONG y)
    299 {
    300   return (parent->yTop - parent->yBottom - (child->yTop - child->yBottom) - y - 1);
    301 }
    302 //******************************************************************************
    303 //******************************************************************************
    304 ULONG MapOS2ToWin32Y(HWND hwndChild)
    305 {
    306  HWND  hwndParent;
    307  RECTL rectParent = {0}, rectChild = {0};
    308 
    309    WinQueryWindowRect(hwndChild, &rectChild);
    310    hwndParent = WinQueryWindow(hwndChild, QW_PARENT);
    311    WinQueryWindowRect(hwndParent, &rectParent);
    312    return OS2TOWIN32POINT(&rectParent, &rectChild, rectChild.yBottom);
    313 }
    314 //******************************************************************************
    315 //******************************************************************************
    316 ULONG MapOS2ToWin32Y(HWND hwndChild, ULONG y)
    317 {
    318  HWND  hwndParent;
    319  RECTL rectParent = {0}, rectChild = {0};
    320 
    321    WinQueryWindowRect(hwndChild, &rectChild);
    322    hwndParent = WinQueryWindow(hwndChild, QW_PARENT);
    323    WinQueryWindowRect(hwndParent, &rectParent);
    324    return OS2TOWIN32POINT(&rectParent, &rectChild, y);
    325 }
    326 //******************************************************************************
    327 //******************************************************************************
    328 ULONG MapOS2ToWin32Y(PRECTL rectParent, PRECTL rectChild, ULONG y)
    329 {
    330    return OS2TOWIN32POINT(rectParent, rectChild, y);
    331 }
    332 //******************************************************************************
    333 //******************************************************************************
    334 ULONG MapOS2ToWin32Y(PRECTL rectParent, HWND hwndChild, ULONG y)
    335 {
    336  RECTL rectChild = {0};
    337 
    338    WinQueryWindowRect(hwndChild, &rectChild);
    339    return OS2TOWIN32POINT(rectParent, &rectChild, y);
    340 }
    341 //******************************************************************************
    342 //******************************************************************************
    343 ULONG MapOS2ToWin32Y(HWND hwndChild, PRECTL rectChild, ULONG y)
    344 {
    345  HWND  hwndParent;
    346  RECTL rectParent = {0};
    347 
    348    hwndParent = WinQueryWindow(hwndChild, QW_PARENT);
    349    WinQueryWindowRect(hwndParent, &rectParent);
    350    return OS2TOWIN32POINT(&rectParent, rectChild, y);
    351 }
    352 //******************************************************************************
    353 //******************************************************************************
     296LONG OSLibWinQueryWindowTextLength(HWND hwnd)
     297{
     298  return WinQueryWindowTextLength(hwnd);
     299}
     300//******************************************************************************
     301//******************************************************************************
     302LONG OSLibWinQueryWindowText(HWND hwnd, LONG length, LPSTR lpsz)
     303{
     304  return WinQueryWindowText(hwnd, length, lpsz);
     305}
     306//******************************************************************************
     307//******************************************************************************
     308BOOL OSLibWinSetWindowText(HWND hwnd, LPSTR lpsz)
     309{
     310  return WinSetWindowText(hwnd, lpsz);
     311}
     312//******************************************************************************
     313//******************************************************************************
  • trunk/src/user32/new/oslibwin.h

    r324 r325  
    1 /* $Id: oslibwin.h,v 1.8 1999-07-17 18:30:51 sandervl Exp $ */
     1/* $Id: oslibwin.h,v 1.9 1999-07-18 10:39:51 sandervl Exp $ */
    22/*
    33 * Window API wrappers for OS/2
     
    3636BOOL OSLibWinAlarm(HWND hwndDeskTop,ULONG flStyle);
    3737ULONG OSLibDosBeep(ULONG freg,ULONG dur);
    38 LONG OSLibWinQueryWindowTextLength(HWND hwnd);
    39 LONG OSLibWinQueryWindowText(HWND hwnd,LONG lLength,char* pun);
    4038
    4139#define SWPOS_SIZE                   0x0001
     
    6361
    6462BOOL  OSLibWinDestroyWindow(HWND hwnd);
    65 BOOL  OSLibWinQueryUpdateRect(HWND hwnd, PVOID pRect); //must be RECTL pointer!
     63BOOL  OSLibWinQueryUpdateRect(HWND hwnd, PRECT pRect);
    6664BOOL  OSLibWinIsIconic(HWND hwnd);
    6765BOOL  OSLibWinSetActiveWindow(HWND hwnd);
     
    9088BOOL  OSLibWinGetMsg(LPMSG pMsg, HWND hwnd, UINT uMsgFilterMin, UINT uMsgFilterMax, BOOL isUnicode = FALSE);
    9189
    92 
    93 ULONG MapOS2ToWin32Y(HWND hwndChild);
    94 ULONG MapOS2ToWin32Y(HWND hwndChild, ULONG y);
    95 ULONG MapOS2ToWin32Y(PRECTL rectParent, PRECTL rectChild, ULONG y);
    96 ULONG MapOS2ToWin32Y(PRECTL rectParent, HWND hwndChild, ULONG y);
    97 ULONG MapOS2ToWin32Y(HWND hwndChild, PRECTL rectChild, ULONG y);
     90LONG  OSLibWinQueryWindowTextLength(HWND hwnd);
     91LONG  OSLibWinQueryWindowText(HWND hwnd, LONG length, LPSTR lpsz);
     92BOOL  OSLibWinSetWindowText(HWND hwnd, LPSTR lpsz);
    9893
    9994#endif //__OSLIBWIN_H__
  • trunk/src/user32/new/pmwindow.cpp

    r324 r325  
    1 /* $Id: pmwindow.cpp,v 1.7 1999-07-17 18:30:51 sandervl Exp $ */
     1/* $Id: pmwindow.cpp,v 1.8 1999-07-18 10:39:51 sandervl Exp $ */
    22/*
    33 * Win32 Window Managment Code for OS/2
     
    2323#include "oslibwin.h"
    2424#include "oslibutil.h"
     25#include "oslibgdi.h"
    2526
    2627HMQ  hmq = 0;                             /* Message queue handle         */
     
    4142  {
    4243        UINT error;
    43 
    4444        //CB: only fail on real error
    4545        error = WinGetLastError(hab) & 0xFFFF; //error code
     
    164164    case WM_MOVE:
    165165    {
    166       RECTL rectChild;
     166      RECTLOS2 rectChild;
    167167      ULONG xParent, yParent;
    168168
    169169        dprintf(("OS2: WM_MOVE %x", hwnd));
    170170
    171         WinQueryWindowRect(hwnd, &rectChild);
     171        WinQueryWindowRect(hwnd, (PRECTL)&rectChild);
    172172
    173173        //Calculate position relative to parent window (real window or desktop)
     
    346346        break;
    347347
     348    case WM_SETWINDOWPARAMS:
     349    {
     350      WNDPARAMS *wndParams = (WNDPARAMS *)mp1;
     351
     352        dprintf(("OS2: WM_SETWINDOWPARAMS %x", hwnd));
     353        if(wndParams->fsStatus & WPM_TEXT) {
     354                if(win32wnd->MsgSetText(wndParams->pszText, wndParams->cchText)) {
     355                        goto RunDefWndProc;
     356                }
     357        }
     358        goto RunDefWndProc;
     359    }
     360
    348361    case WM_PAINT:
    349362        dprintf(("OS2: WM_PAINT %x", hwnd));
     
    358371
    359372    case WM_CALCVALIDRECTS:
    360     case WM_SETWINDOWPARAMS:
    361373    case WM_QUERYWINDOWPARAMS:
    362374    case WM_HITTEST:
  • trunk/src/user32/new/user32.cpp

    r322 r325  
    1 /* $Id: user32.cpp,v 1.4 1999-07-17 12:49:41 cbratschi Exp $ */
     1/* $Id: user32.cpp,v 1.5 1999-07-18 10:39:51 sandervl Exp $ */
    22
    33/*
     
    216216}
    217217//******************************************************************************
    218 //******************************************************************************
    219 BOOL WIN32API IsDlgButtonChecked( HWND arg1, UINT  arg2)
    220 {
    221 #ifdef DEBUG
    222     WriteLog("USER32:  IsDlgButtonChecked\n");
    223 #endif
    224     //CB: get button state
    225     return (BOOL)SendDlgItemMessageA(arg1,arg2,BM_GETCHECK,0,0);
    226 }
    227 //******************************************************************************
    228 //******************************************************************************
    229 int WIN32API GetWindowTextLengthA( HWND arg1)
    230 {
    231     dprintf(("USER32:  GetWindowTextLength\n"));
    232     //win32 to OS/2 handle
    233     //return OSLibWinQueryWindowTextLength(arg1);
    234     return O32_GetWindowTextLength(arg1);
    235 }
    236 //******************************************************************************
    237 //******************************************************************************
    238 int WIN32API GetWindowTextA( HWND arg1, LPSTR arg2, int  arg3)
    239 {
    240     dprintf(("USER32:  GetWindowTextA\n"));
    241     //win32 to OS/2 handle
    242     //return OSLibWinQueryWindowText(arg1,arg3,arg2);
    243     return O32_GetWindowText(arg1, arg2, arg3);
    244 }
    245 //******************************************************************************
    246218
    247219/*******************************************************************
     
    264236//******************************************************************************
    265237//******************************************************************************
    266 HWND WIN32API GetNextDlgTabItem( HWND arg1, HWND arg2, BOOL  arg3)
    267 {
    268     dprintf(("USER32:  GetNextDlgTabItem\n"));
    269     //get next WS_TABSTOP
    270     return O32_GetNextDlgTabItem(arg1, arg2, arg3);
    271 }
    272 //******************************************************************************
    273 //******************************************************************************
    274238HWND WIN32API GetFocus(void)
    275239{
     
    277241    //return OS2LibWinQueryFocus(HWND_DESKTOP);
    278242    return O32_GetFocus();
    279 }
    280 //******************************************************************************
    281 //******************************************************************************
    282 HWND WIN32API GetDlgItem(HWND arg1, int  arg2)
    283 {
    284  HWND rc;
    285     //return OSLibWinWindowFromID(arg1,arg2);
    286     rc = O32_GetDlgItem(arg1, arg2);
    287     dprintf(("USER32:  GetDlgItem %d returned %d\n", arg2, rc));
    288     return(rc);
    289 }
    290 //******************************************************************************
    291 //******************************************************************************
    292 int WIN32API GetDlgCtrlID( HWND arg1)
    293 {
    294     dprintf(("USER32:  GetDlgCtrlID\n"));
    295     //return OSLibWinQueryWindowUShort(arg1,QWS_ID);
    296     //use internal ID -> DWORD
    297     return O32_GetDlgCtrlID(arg1);
    298243}
    299244//******************************************************************************
     
    318263    delete callback;
    319264  return(rc);
    320 }
    321 //******************************************************************************
    322 //******************************************************************************
    323 BOOL WIN32API EndDialog( HWND arg1, int  arg2)
    324 {
    325  BOOL rc;
    326 
    327     dprintf(("USER32:  EndDialog\n"));
    328     //return OSLibDismissDialog(arg1,arg2);
    329     rc = O32_EndDialog(arg1, arg2);
    330     return(rc);
    331265}
    332266//******************************************************************************
     
    361295//******************************************************************************
    362296//******************************************************************************
    363 BOOL WIN32API CheckDlgButton( HWND arg1, int arg2, UINT  arg3)
    364 {
    365 #ifdef DEBUG
    366     WriteLog("USER32:  CheckDlgButton\n");
    367 #endif
    368     //CB: set button state
    369     return (BOOL)SendDlgItemMessageA(arg1,arg2,BM_SETCHECK,arg3,0);
    370 }
    371 //******************************************************************************
    372 //******************************************************************************
    373297HWND WIN32API SetFocus( HWND arg1)
    374298{
     
    379303//******************************************************************************
    380304//******************************************************************************
    381 int WIN32API ReleaseDC( HWND arg1, HDC  arg2)
    382 {
    383 #ifdef DEBUG
    384     WriteLog("USER32:  ReleaseDC\n");
    385 #endif
    386     //return OSLibWinReleasePS(arg2);
    387     return O32_ReleaseDC(arg1, arg2);
    388 }
    389 //******************************************************************************
    390 //******************************************************************************
    391305BOOL WIN32API InvalidateRect(HWND arg1, const RECT *arg2, BOOL arg3)
    392306{
     
    412326//******************************************************************************
    413327//******************************************************************************
    414 HDC WIN32API GetDC( HWND arg1)
    415 {
    416  HDC hdc;
    417 
    418    //hdc = OSLibWinGetPS(arg1);
    419    hdc = O32_GetDC(arg1);
    420 #ifdef DEBUG
    421    WriteLog("USER32:  GetDC of %X returns %X\n", arg1, hdc);
    422 #endif
    423    return(hdc);
    424 }
    425 //******************************************************************************
    426 //******************************************************************************
    427 HDC WIN32API GetDCEx(HWND arg1, HRGN arg2, DWORD arg3)
    428 {
    429 #ifdef DEBUG
    430     WriteLog("USER32:  GetDCEx\n");
    431 #endif
    432     //return OSLibGetDC(arg1);
    433     //change values
    434     return O32_GetDCEx(arg1, arg2, arg3);
    435 }
    436 //******************************************************************************
    437 //******************************************************************************
    438 BOOL WIN32API EndPaint( HWND arg1, const PAINTSTRUCT * arg2)
    439 {
    440 #ifdef DEBUG
    441     WriteLog("USER32:  EndPaint\n");
    442 #endif
    443     //return OSLibWinEndPaint(arg2->hdc);
    444     return O32_EndPaint(arg1, arg2);
    445 }
    446 //******************************************************************************
    447 //******************************************************************************
    448 //******************************************************************************
    449 //******************************************************************************
    450 HDC WIN32API BeginPaint(HWND arg1, PPAINTSTRUCT  arg2)
    451 {
    452     dprintf(("USER32: BeginPaint %X\n", arg2));
    453     //return OSLibWinBeginPaint(arg1,);
    454     //CB: emulate
    455     return O32_BeginPaint(arg1, arg2);
    456 }
    457328//******************************************************************************
    458329//******************************************************************************
     
    610481//******************************************************************************
    611482//******************************************************************************
    612 UINT WIN32API GetDlgItemTextA(HWND arg1, int arg2, LPSTR arg3, UINT arg4)
    613 {
    614  UINT rc;
    615 
    616     //WinQueryDlgItemText(arg1,arg2,arg4,arg3);
    617     rc = O32_GetDlgItemText(arg1, arg2, arg3, arg4);
    618 #ifdef DEBUG
    619     if(rc)
    620         WriteLog("USER32:  GetDlgItemTextA returned %s\n", arg3);
    621     else    WriteLog("USER32:  GetDlgItemTextA returned 0 (%d)\n", GetLastError());
    622 #endif
    623     return(rc);
    624 }
    625 //******************************************************************************
    626 //******************************************************************************
    627483int WIN32API ShowCursor( BOOL arg1)
    628484{
     
    647503
    648504    return TRUE;
    649 }
    650 //******************************************************************************
    651 //******************************************************************************
    652 BOOL WIN32API SetDlgItemInt( HWND arg1, int arg2, UINT arg3, BOOL  arg4)
    653 {
    654 #ifdef DEBUG
    655     WriteLog("USER32:  SetDlgItemInt\n");
    656 #endif
    657     //get item text and translate to int
    658     return O32_SetDlgItemInt(arg1, arg2, arg3, arg4);
    659 }
    660 //******************************************************************************
    661 //******************************************************************************
    662 BOOL WIN32API SetDlgItemTextA( HWND arg1, int arg2, LPCSTR  arg3)
    663 {
    664 #ifdef DEBUG
    665     WriteLog("USER32:  SetDlgItemText to %s\n", arg3);
    666 #endif
    667     //WinSetDlgItemText(arg1,arg2,arg3);
    668     return O32_SetDlgItemText(arg1, arg2, arg3);
    669505}
    670506//******************************************************************************
     
    1000836//******************************************************************************
    1001837//******************************************************************************
    1002 int WIN32API DlgDirListA( HWND arg1, LPSTR arg2, int arg3, int arg4, UINT  arg5)
    1003 {
    1004 #ifdef DEBUG
    1005     WriteLog("USER32:  DlgDirListA\n");
    1006 #endif
    1007     return O32_DlgDirList(arg1, arg2, arg3, arg4, arg5);
    1008 }
    1009 //******************************************************************************
    1010 //******************************************************************************
    1011 int WIN32API DlgDirListComboBoxA( HWND arg1, LPSTR arg2, int arg3, int arg4, UINT  arg5)
    1012 {
    1013 #ifdef DEBUG
    1014     WriteLog("USER32:  DlgDirListComboBoxA\n");
    1015 #endif
    1016     return O32_DlgDirListComboBox(arg1, arg2, arg3, arg4, arg5);
    1017 }
    1018 //******************************************************************************
    1019 //******************************************************************************
    1020 int WIN32API DlgDirListComboBoxW( HWND arg1, LPWSTR arg2, int arg3, int arg4, UINT  arg5)
    1021 {
    1022 #ifdef DEBUG
    1023     WriteLog("USER32:  DlgDirListComboBoxW NOT WORKING\n");
    1024 #endif
    1025     // NOTE: This will not work as is (needs UNICODE support)
    1026     return 0;
    1027 //    return O32_DlgDirListComboBox(arg1, arg2, arg3, arg4, arg5);
    1028 }
    1029 //******************************************************************************
    1030 //******************************************************************************
    1031 int WIN32API DlgDirListW( HWND arg1, LPWSTR arg2, int arg3, int arg4, UINT  arg5)
    1032 {
    1033 #ifdef DEBUG
    1034     WriteLog("USER32:  DlgDirListW NOT WORKING\n");
    1035 #endif
    1036     // NOTE: This will not work as is (needs UNICODE support)
    1037     return 0;
    1038 //    return O32_DlgDirList(arg1, arg2, arg3, arg4, arg5);
    1039 }
    1040 //******************************************************************************
    1041 //******************************************************************************
    1042 BOOL WIN32API DlgDirSelectComboBoxExA( HWND arg1, LPSTR arg2, int arg3, int  arg4)
    1043 {
    1044 #ifdef DEBUG
    1045     WriteLog("USER32:  DlgDirSelectComboBoxExA\n");
    1046 #endif
    1047     return O32_DlgDirSelectComboBoxEx(arg1, arg2, arg3, arg4);
    1048 }
    1049 //******************************************************************************
    1050 //******************************************************************************
    1051 BOOL WIN32API DlgDirSelectComboBoxExW( HWND arg1, LPWSTR arg2, int arg3, int  arg4)
    1052 {
    1053 #ifdef DEBUG
    1054     WriteLog("USER32:  DlgDirSelectComboBoxExW NOT WORKING\n");
    1055 #endif
    1056     // NOTE: This will not work as is (needs UNICODE support)
    1057     return 0;
    1058 //    return O32_DlgDirSelectComboBoxEx(arg1, arg2, arg3, arg4);
    1059 }
    1060 //******************************************************************************
    1061 //******************************************************************************
    1062 BOOL WIN32API DlgDirSelectExA( HWND arg1, LPSTR arg2, int arg3, int  arg4)
    1063 {
    1064 #ifdef DEBUG
    1065     WriteLog("USER32:  DlgDirSelectExA\n");
    1066 #endif
    1067     return O32_DlgDirSelectEx(arg1, arg2, arg3, arg4);
    1068 }
    1069 //******************************************************************************
    1070 //******************************************************************************
    1071 BOOL WIN32API DlgDirSelectExW( HWND arg1, LPWSTR arg2, int arg3, int  arg4)
    1072 {
    1073 #ifdef DEBUG
    1074     WriteLog("USER32:  DlgDirSelectExW NOT WORKING\n");
    1075 #endif
    1076     // NOTE: This will not work as is (needs UNICODE support)
    1077     return 0;
    1078 //    return O32_DlgDirSelectEx(arg1, arg2, arg3, arg4);
    1079 }
    1080 //******************************************************************************
    1081 //******************************************************************************
    1082838BOOL WIN32API EmptyClipboard(void)
    1083839{
     
    1122878//******************************************************************************
    1123879//******************************************************************************
    1124 int WIN32API EnumPropsA(HWND arg1, PROPENUMPROCA arg2)
    1125 {
    1126 #ifdef DEBUG
    1127     WriteLog("USER32:  EnumPropsA DOES NOT WORK\n");
    1128 #endif
    1129     //calling convention problems
    1130     return 0;
    1131 //    return O32_EnumProps(arg1, (PROPENUMPROC_O32)arg2);
    1132 }
    1133 //******************************************************************************
    1134 //******************************************************************************
    1135 int WIN32API EnumPropsExA( HWND arg1, PROPENUMPROCEXA arg2, LPARAM  arg3)
    1136 {
    1137 #ifdef DEBUG
    1138     WriteLog("USER32:  EnumPropsExA DOES NOT WORK\n");
    1139 #endif
    1140     //calling convention problems
    1141     return 0;
    1142 //    return O32_EnumPropsEx(arg1, arg2, (PROPENUMPROCEX_O32)arg3);
    1143 }
    1144 //******************************************************************************
    1145 //******************************************************************************
    1146 int WIN32API EnumPropsExW( HWND arg1, PROPENUMPROCEXW arg2, LPARAM  arg3)
    1147 {
    1148 #ifdef DEBUG
    1149     WriteLog("USER32:  EnumPropsExW\n");
    1150 #endif
    1151     // NOTE: This will not work as is (needs UNICODE support)
    1152     //calling convention problems
    1153     return 0;
    1154 //    return O32_EnumPropsEx(arg1, arg2, arg3);
    1155 }
    1156 //******************************************************************************
    1157 //******************************************************************************
    1158 int WIN32API EnumPropsW( HWND arg1, PROPENUMPROCW  arg2)
    1159 {
    1160 #ifdef DEBUG
    1161     WriteLog("USER32:  EnumPropsW\n");
    1162 #endif
    1163     // NOTE: This will not work as is (needs UNICODE support)
    1164     //calling convention problems
    1165     return 0;
    1166 //    return O32_EnumProps(arg1, arg2);
    1167 }
    1168 //******************************************************************************
    1169 //******************************************************************************
    1170880BOOL WIN32API EnumWindows(WNDENUMPROC lpfn, LPARAM lParam)
    1171881{
     
    13301040//******************************************************************************
    13311041//******************************************************************************
    1332 DWORD WIN32API GetDialogBaseUnits(void)
    1333 {
    1334 #ifdef DEBUG
    1335     WriteLog("USER32:  GetDialogBaseUnits\n");
    1336 #endif
    1337     return O32_GetDialogBaseUnits();
    1338 }
    1339 //******************************************************************************
    1340 //******************************************************************************
    1341 UINT WIN32API GetDlgItemInt( HWND arg1, int arg2, PBOOL arg3, BOOL  arg4)
    1342 {
    1343 #ifdef DEBUG
    1344     WriteLog("USER32:  GetDlgItemInt\n");
    1345 #endif
    1346     return O32_GetDlgItemInt(arg1, arg2, arg3, arg4);
    1347 }
    1348 
    1349 
    1350 /*****************************************************************************
    1351  * Name      : UINT WIN32API GetDlgItemTextW
    1352  * Purpose   : Determine the text of a window control
    1353  * Parameters: HWND   arg1
    1354  *             int    arg2
    1355  *             LPWSTR arg3
    1356  *             UINT   arg4
    1357  * Variables :
    1358  * Result    :
    1359  * Remark    :
    1360  * Status    : UNTESTED UNKNOWN STUB
    1361  *
    1362  * Author    : Patrick Haller [Wed, 1998/06/16 11:55]
    1363  *****************************************************************************/
    1364 
    1365 UINT WIN32API GetDlgItemTextW(HWND   arg1,
    1366                               int    arg2,
    1367                               LPWSTR arg3,
    1368                               UINT   arg4)
    1369 {
    1370   LPSTR lpBuffer;                   /* temporary buffer for the ascii result */
    1371   UINT  uiResult;                   /* return value of the ascii variant     */
    1372 
    1373   dprintf(("USER32: GetDlgItemTextW(%08xh,%08xh,%08xh,%08xh)\n",
    1374            arg1,
    1375            arg2,
    1376            arg3,
    1377            arg4));
    1378 
    1379 
    1380   lpBuffer = (LPSTR)malloc(arg4);              /* allocate temporary buffer */
    1381   uiResult = GetDlgItemTextA(arg1,             /* call ascii variant        */
    1382                              arg2,
    1383                              lpBuffer,
    1384                              arg4);
    1385 
    1386   AsciiToUnicodeN(lpBuffer,                /* now convert result to unicode */
    1387                   arg3,
    1388                   arg4);
    1389 
    1390   free(lpBuffer);                              /* free the temporary buffer */
    1391 
    1392   return (uiResult);                                       /* OK, that's it */
    1393 }
    1394 
    1395 
    1396 //******************************************************************************
    1397 //******************************************************************************
    13981042UINT WIN32API GetDoubleClickTime(void)
    13991043{
     
    14631107//******************************************************************************
    14641108//******************************************************************************
    1465 HWND WIN32API GetNextDlgGroupItem( HWND arg1, HWND arg2, BOOL  arg3)
    1466 {
    1467 #ifdef DEBUG
    1468     WriteLog("USER32:  GetNextDlgGroupItem\n");
    1469 #endif
    1470     return O32_GetNextDlgGroupItem(arg1, arg2, arg3);
    1471 }
    1472 //******************************************************************************
    1473 //******************************************************************************
    14741109HWND WIN32API GetOpenClipboardWindow(void)
    14751110{
     
    14871122#endif
    14881123    return O32_GetPriorityClipboardFormat(arg1, arg2);
    1489 }
    1490 //******************************************************************************
    1491 //******************************************************************************
    1492 HANDLE WIN32API GetPropA( HWND arg1, LPCSTR  arg2)
    1493 {
    1494 #ifdef DEBUG
    1495     if((int)arg2 >> 16 != 0)
    1496      WriteLog("USER32:  GetPropA %s\n", arg2);
    1497     else WriteLog("USER32:  GetPropA %X\n", arg2);
    1498 #endif
    1499     return O32_GetProp(arg1, arg2);
    1500 }
    1501 //******************************************************************************
    1502 //******************************************************************************
    1503 HANDLE WIN32API GetPropW(HWND arg1, LPCWSTR arg2)
    1504 {
    1505  BOOL  handle;
    1506  char *astring;
    1507 
    1508     if((int)arg2 >> 16 != 0)
    1509          astring = UnicodeToAsciiString((LPWSTR)arg2);
    1510     else astring = (char *)arg2;
    1511 #ifdef DEBUG
    1512     if((int)arg2 >> 16 != 0)
    1513          WriteLog("USER32:  GetPropW %s\n", astring);
    1514     else WriteLog("USER32:  GetPropW %X\n", astring);
    1515 #endif
    1516     handle = GetPropA(arg1, (LPCSTR)astring);
    1517     if((int)arg2 >> 16 != 0)
    1518         FreeAsciiString(astring);
    1519 
    1520     return(handle);
    15211124}
    15221125//******************************************************************************
     
    17661369//******************************************************************************
    17671370//******************************************************************************
    1768 HANDLE WIN32API RemovePropA( HWND arg1, LPCSTR  arg2)
    1769 {
    1770 #ifdef DEBUG
    1771     WriteLog("USER32:  RemovePropA\n");
    1772 #endif
    1773     return O32_RemoveProp(arg1, arg2);
    1774 }
    1775 //******************************************************************************
    1776 //******************************************************************************
    1777 HANDLE WIN32API RemovePropW( HWND arg1, LPCWSTR  arg2)
    1778 {
    1779  char *astring = UnicodeToAsciiString((LPWSTR)arg2);
    1780  HANDLE rc;
    1781 
    1782 #ifdef DEBUG
    1783     WriteLog("USER32:  RemovePropW\n");
    1784 #endif
    1785     rc = O32_RemoveProp(arg1, astring);
    1786     FreeAsciiString(astring);
    1787     return rc;
    1788 }
    1789 //******************************************************************************
    1790 //******************************************************************************
    17911371BOOL WIN32API ScreenToClient( HWND arg1, LPPOINT  arg2)
    17921372{
     
    18551435//******************************************************************************
    18561436//******************************************************************************
    1857 BOOL WIN32API SetDlgItemTextW( HWND arg1, int arg2, LPCWSTR  arg3)
    1858 {
    1859 char *astring = UnicodeToAsciiString((LPWSTR)arg3);
    1860 BOOL  rc;
    1861 
    1862 #ifdef DEBUG
    1863     WriteLog("USER32:  SetDlgItemTextW\n");
    1864 #endif
    1865     // NOTE: This will not work as is (needs UNICODE support)
    1866     rc = O32_SetDlgItemText(arg1, arg2, astring);
    1867     FreeAsciiString(astring);
    1868     return rc;
    1869 }
    1870 //******************************************************************************
    1871 //******************************************************************************
    18721437BOOL WIN32API SetDoubleClickTime( UINT arg1)
    18731438{
     
    18761441#endif
    18771442    return O32_SetDoubleClickTime(arg1);
    1878 }
    1879 //******************************************************************************
    1880 //******************************************************************************
    1881 BOOL WIN32API SetPropA( HWND arg1, LPCSTR arg2, HANDLE  arg3)
    1882 {
    1883 #ifdef DEBUG
    1884     if((int)arg2 >> 16 != 0)
    1885      WriteLog("USER32:  SetPropA %S\n", arg2);
    1886     else WriteLog("USER32:  SetPropA %X\n", arg2);
    1887 #endif
    1888     return O32_SetProp(arg1, arg2, arg3);
    1889 }
    1890 //******************************************************************************
    1891 //******************************************************************************
    1892 BOOL WIN32API SetPropW(HWND arg1, LPCWSTR arg2, HANDLE arg3)
    1893 {
    1894  BOOL  rc;
    1895  char *astring;
    1896 
    1897     if((int)arg2 >> 16 != 0)
    1898          astring = UnicodeToAsciiString((LPWSTR)arg2);
    1899     else astring = (char *)arg2;
    1900 
    1901 #ifdef DEBUG
    1902     if((int)arg2 >> 16 != 0)
    1903          WriteLog("USER32:  SetPropW %S\n", astring);
    1904     else WriteLog("USER32:  SetPropW %X\n", astring);
    1905 #endif
    1906     rc = O32_SetProp(arg1, astring, arg3);
    1907     if((int)astring >> 16 != 0)
    1908         FreeAsciiString(astring);
    1909     return(rc);
    19101443}
    19111444//******************************************************************************
  • trunk/src/user32/new/win32wnd.cpp

    r324 r325  
    1 /* $Id: win32wnd.cpp,v 1.8 1999-07-17 18:30:51 sandervl Exp $ */
     1/* $Id: win32wnd.cpp,v 1.9 1999-07-18 10:39:51 sandervl Exp $ */
    22/*
    33 * Win32 Window Code for OS/2
     
    2828#include <oslibwin.h>
    2929#include <oslibutil.h>
     30#include <oslibgdi.h>
    3031
    3132#define HAS_DLGFRAME(style,exStyle) \
     
    383384  maxPos.x = rectWindow.left; maxPos.y = rectWindow.top;
    384385
    385   if(sendMessage(WM_NCCREATE, 0, (LPARAM)cs) )
     386  if(SendInternalMessage(WM_NCCREATE, 0, (LPARAM)cs) )
    386387  {
    387388        SendNCCalcSize(FALSE, &rectWindow, NULL, NULL, 0, &rectClient );
     
    389390                                          maxPos.y - rectWindow.top);
    390391        dprintf(("Sending WM_CREATE"));
    391         if( (sendMessage(WM_CREATE, 0, (LPARAM)cs )) != -1 )
     392        if( (SendInternalMessage(WM_CREATE, 0, (LPARAM)cs )) != -1 )
    392393        {
    393394            SetWindowPos(HWND_TOP, rectClient.left, rectClient.top,
     
    430431        if( dwStyle & WS_MINIMIZE )
    431432        {
    432             if( !SendMessageA(WM_QUERYOPEN, 0, 0L ) )
     433            if( !SendInternalMessageA(WM_QUERYOPEN, 0, 0L ) )
    433434                return (SWP_NOSIZE | SWP_NOMOVE);
    434435            swpFlags |= SWP_NOCOPYBITS;
     
    570571//    }
    571572
    572     SendMessageA(WM_GETMINMAXINFO, 0, (LPARAM)&MinMax );
     573    SendInternalMessageA(WM_GETMINMAXINFO, 0, (LPARAM)&MinMax );
    573574
    574575      /* Some sanity checks */
     
    614615        params.lppos = &winposCopy;
    615616   }
    616    result = SendMessageA(WM_NCCALCSIZE, calcValidRect,
    617                           (LPARAM)&params );
     617   result = SendInternalMessageA(WM_NCCALCSIZE, calcValidRect,
     618                                 (LPARAM)&params );
    618619   *newClientRect = params.rgrc[0];
    619620   return result;
     
    624625{
    625626  OS2Hwnd = hwndOS2;
    626   return SendMessageA(WM_CREATE, 0, initParam);
     627  return SendInternalMessageA(WM_CREATE, 0, initParam);
    627628}
    628629//******************************************************************************
     
    630631ULONG Win32Window::MsgQuit()
    631632{
    632   return SendMessageA(WM_QUIT, 0, 0);
     633  return SendInternalMessageA(WM_QUIT, 0, 0);
    633634}
    634635//******************************************************************************
     
    636637ULONG Win32Window::MsgClose()
    637638{
    638   return SendMessageA(WM_CLOSE, 0, 0);
     639  return SendInternalMessageA(WM_CLOSE, 0, 0);
    639640}
    640641//******************************************************************************
     
    644645 ULONG rc;
    645646
    646   rc = SendMessageA(WM_DESTROY, 0, 0);
     647  rc = SendInternalMessageA(WM_DESTROY, 0, 0);
    647648  delete this;
    648649  return rc;
     
    652653ULONG Win32Window::MsgEnable(BOOL fEnable)
    653654{
    654   return SendMessageA(WM_ENABLE, fEnable, 0);
     655  return SendInternalMessageA(WM_ENABLE, fEnable, 0);
    655656}
    656657//******************************************************************************
     
    659660ULONG Win32Window::MsgShow(BOOL fShow)
    660661{
    661   return SendMessageA(WM_SHOWWINDOW, fShow, 0);
     662  return SendInternalMessageA(WM_SHOWWINDOW, fShow, 0);
    662663}
    663664//******************************************************************************
     
    683684  else  fwSizeType = SIZE_RESTORED;
    684685
    685   return SendMessageA(WM_SIZE, fwSizeType, MAKELONG((USHORT)width, (USHORT)height));
     686  return SendInternalMessageA(WM_SIZE, fwSizeType, MAKELONG((USHORT)width, (USHORT)height));
    686687}
    687688//******************************************************************************
     
    689690ULONG Win32Window::MsgActivate(BOOL fActivate, HWND hwnd)
    690691{
    691   return SendMessageA(WM_ACTIVATE, (fActivate) ? WA_ACTIVE : WA_INACTIVE, hwnd);
     692  return SendInternalMessageA(WM_ACTIVATE, (fActivate) ? WA_ACTIVE : WA_INACTIVE, hwnd);
    692693}
    693694//******************************************************************************
     
    695696ULONG Win32Window::MsgSetFocus(HWND hwnd)
    696697{
    697   return SendMessageA(WM_SETFOCUS, hwnd, 0);
     698  return SendInternalMessageA(WM_SETFOCUS, hwnd, 0);
    698699}
    699700//******************************************************************************
     
    701702ULONG Win32Window::MsgKillFocus(HWND hwnd)
    702703{
    703   return SendMessageA(WM_KILLFOCUS, hwnd, 0);
     704  return SendInternalMessageA(WM_KILLFOCUS, hwnd, 0);
    704705}
    705706//******************************************************************************
     
    732733                return 1;
    733734  }
    734   return SendMessageA(win32msg, 0, MAKELONG(x, MapOS2ToWin32Y(OS2Hwnd, y)));
     735  return SendInternalMessageA(win32msg, 0, MAKELONG(x, MapOS2ToWin32Y(OS2Hwnd, y)));
    735736}
    736737//******************************************************************************
     
    738739ULONG Win32Window::MsgPaint(ULONG tmp1, ULONG tmp2)
    739740{
    740   return SendMessageA(WM_PAINT, 0, 0);
     741  return SendInternalMessageA(WM_PAINT, 0, 0);
    741742}
    742743//******************************************************************************
     
    744745ULONG Win32Window::MsgEraseBackGround(ULONG hps)
    745746{
    746   return SendMessageA(WM_ERASEBKGND, hps, 0);
     747  return SendInternalMessageA(WM_ERASEBKGND, hps, 0);
     748}
     749//******************************************************************************
     750//******************************************************************************
     751ULONG Win32Window::MsgSetText(LPSTR lpsz, LONG cch)
     752{
     753  if(isUnicode) {
     754        return SendInternalMessageW(WM_SETTEXT, 0, (LPARAM)lpsz);
     755  }
     756  else  return SendInternalMessageA(WM_SETTEXT, 0, (LPARAM)lpsz);
    747757}
    748758//******************************************************************************
     
    787797}
    788798//******************************************************************************
    789 //todo, unicode msgs
    790799//******************************************************************************
    791800LRESULT Win32Window::SendMessageW(ULONG Msg, WPARAM wParam, LPARAM lParam)
     
    823832                NotifyParent(Msg, wParam, lParam);
    824833                return win32wndproc(getWindowHandle(), WM_DESTROY, 0, 0);
     834
     835        default:
     836                return win32wndproc(getWindowHandle(), Msg, wParam, lParam);
     837  }
     838}
     839//******************************************************************************
     840//Called as a result of an OS/2 message
     841//******************************************************************************
     842LRESULT Win32Window::SendInternalMessageA(ULONG Msg, WPARAM wParam, LPARAM lParam)
     843{
     844  if(PostSpyMessage(getWindowHandle(), Msg, wParam, lParam) == FALSE)
     845        dprintf(("SendInternalMessageA %s for %x %x %x", GetMsgText(Msg), getWindowHandle(), wParam, lParam));
     846
     847  if(HkCBT::OS2HkCBTProc(getWindowHandle(), Msg, wParam, lParam) == TRUE) {//hook swallowed msg
     848        return(0);
     849  }
     850  switch(Msg)
     851  {
     852        case WM_CREATE:
     853        {
     854                if(win32wndproc(getWindowHandle(), WM_NCCREATE, 0, lParam) == 0) {
     855                        dprintf(("WM_NCCREATE returned FALSE\n"));
     856                        return(0); //don't create window
     857                }
     858                if(win32wndproc(getWindowHandle(), WM_CREATE, 0, lParam) == 0) {
     859                        dprintf(("WM_CREATE returned FALSE\n"));
     860                        return(0); //don't create window
     861                }
     862                NotifyParent(Msg, wParam, lParam);
     863
     864                return(1);
     865        }
     866        case WM_LBUTTONDOWN:
     867        case WM_MBUTTONDOWN:
     868        case WM_RBUTTONDOWN:
     869                NotifyParent(Msg, wParam, lParam);
     870                return win32wndproc(getWindowHandle(), Msg, wParam, lParam);
     871
     872        case WM_DESTROY:
     873                win32wndproc(getWindowHandle(), WM_NCDESTROY, 0, 0);
     874                NotifyParent(Msg, wParam, lParam);
     875                return win32wndproc(getWindowHandle(), WM_DESTROY, 0, 0);
     876        default:
     877                return win32wndproc(getWindowHandle(), Msg, wParam, lParam);
     878  }
     879}
     880//******************************************************************************
     881//Called as a result of an OS/2 message
     882//todo, unicode msgs (WM_SETTEXT etc)
     883//******************************************************************************
     884LRESULT Win32Window::SendInternalMessageW(ULONG Msg, WPARAM wParam, LPARAM lParam)
     885{
     886  if(PostSpyMessage(getWindowHandle(), Msg, wParam, lParam) == FALSE)
     887        dprintf(("SendInternalMessageW %s for %x %x %x", GetMsgText(Msg), getWindowHandle(), wParam, lParam));
     888
     889  if(HkCBT::OS2HkCBTProc(getWindowHandle(), Msg, wParam, lParam) == TRUE) {//hook swallowed msg
     890        return(0);
     891  }
     892  switch(Msg)
     893  {
     894        case WM_CREATE:
     895        {
     896                if(win32wndproc(getWindowHandle(), WM_NCCREATE, 0, lParam) == 0) {
     897                        dprintf(("WM_NCCREATE returned FALSE\n"));
     898                        return(0); //don't create window
     899                }
     900                if(win32wndproc(getWindowHandle(), WM_CREATE, 0, lParam) == 0) {
     901                        dprintf(("WM_CREATE returned FALSE\n"));
     902                        return(0); //don't create window
     903                }
     904                NotifyParent(Msg, wParam, lParam);
     905
     906                return(1);
     907        }
     908        case WM_LBUTTONDOWN:
     909        case WM_MBUTTONDOWN:
     910        case WM_RBUTTONDOWN:
     911                NotifyParent(Msg, wParam, lParam);
     912                return win32wndproc(getWindowHandle(), Msg, wParam, lParam);
     913
     914        case WM_DESTROY:
     915                win32wndproc(getWindowHandle(), WM_NCDESTROY, 0, 0);
     916                NotifyParent(Msg, wParam, lParam);
     917                return win32wndproc(getWindowHandle(), WM_DESTROY, 0, 0);
    825918        default:
    826919                return win32wndproc(getWindowHandle(), Msg, wParam, lParam);
     
    875968                if(parentwindow) {
    876969                        if(Msg == WM_CREATE || Msg == WM_DESTROY) {
    877                                 parentwindow->SendMessageA(WM_PARENTNOTIFY, MAKEWPARAM(Msg, window->getWindowId()), (LPARAM)window->getWindowHandle());
     970                                parentwindow->SendInternalMessageA(WM_PARENTNOTIFY, MAKEWPARAM(Msg, window->getWindowId()), (LPARAM)window->getWindowHandle());
    878971                        }
    879                         else    parentwindow->SendMessageA(WM_PARENTNOTIFY, MAKEWPARAM(Msg, window->getWindowId()), lParam );
     972                        else    parentwindow->SendInternalMessageA(WM_PARENTNOTIFY, MAKEWPARAM(Msg, window->getWindowId()), lParam );
    880973                }
    881974        }
     
    9081001 ULONG showstate = 0;
    9091002
     1003  dprintf(("ShowWindow %x", nCmdShow));
    9101004  switch(nCmdShow)
    9111005  {
     
    9421036                break;
    9431037  }
    944   return OSLibWinShowWindow(OS2Hwnd, showstate);
     1038  return OSLibWinShowWindow(OS2HwndFrame, showstate);
    9451039}
    9461040//******************************************************************************
     
    9941088        setstate |= SWPOS_SHOW;
    9951089
    996   return OSLibWinSetWindowPos(OS2Hwnd, hwndInsertAfter, x, y, cx, cy, setstate);
     1090  return OSLibWinSetWindowPos(OS2HwndFrame, hwndInsertAfter, x, y, cx, cy, setstate);
    9971091}
    9981092//******************************************************************************
     
    10611155BOOL Win32Window::UpdateWindow()
    10621156
    1063  RECTL rect;
    1064 
    1065   if(OSLibWinQueryUpdateRect(OS2Hwnd, (PVOID)&rect))
     1157 RECT rect;
     1158
     1159  if(OSLibWinQueryUpdateRect(OS2Hwnd, &rect))
    10661160  {//update region not empty
    1067         SendMessageA((isIcon) ? WM_PAINTICON : WM_PAINT, 0, 0);
     1161        SendInternalMessageA((isIcon) ? WM_PAINTICON : WM_PAINT, 0, 0);
    10681162  }
    10691163  return TRUE;
     
    11811275{
    11821276  return OSLibWinIsWindowVisible(OS2Hwnd);
     1277}
     1278//******************************************************************************
     1279//******************************************************************************
     1280BOOL Win32Window::GetWindowRect(PRECT pRect)
     1281{
     1282//  return OSLibWinIsWindowVisible(OS2Hwnd);
     1283}
     1284//******************************************************************************
     1285//******************************************************************************
     1286int Win32Window::GetWindowTextLengthA()
     1287{
     1288  return OSLibWinQueryWindowTextLength(OS2Hwnd);
     1289}
     1290//******************************************************************************
     1291//******************************************************************************
     1292int Win32Window::GetWindowTextA(LPSTR lpsz, int cch)
     1293{
     1294  return OSLibWinQueryWindowText(OS2Hwnd, cch, lpsz);
     1295}
     1296//******************************************************************************
     1297//******************************************************************************
     1298BOOL Win32Window::SetWindowTextA(LPCSTR lpsz)
     1299{
     1300  return OSLibWinSetWindowText(OS2Hwnd, (LPSTR)lpsz);
    11831301}
    11841302//******************************************************************************
  • trunk/src/user32/new/win32wnd.h

    r324 r325  
    1 /* $Id: win32wnd.h,v 1.7 1999-07-17 18:30:52 sandervl Exp $ */
     1/* $Id: win32wnd.h,v 1.8 1999-07-18 10:39:52 sandervl Exp $ */
    22/*
    33 * Win32 Window Code for OS/2
     
    6666         ULONG  MsgPaint(ULONG tmp1, ULONG tmp2);
    6767         ULONG  MsgEraseBackGround(ULONG hps);
     68         ULONG  MsgSetText(LPSTR lpsz, LONG cch);
    6869
    6970virtual  LONG   SetWindowLongA(int index, ULONG value);
     
    105106         BOOL   IsWindowVisible();
    106107
     108         BOOL   GetWindowRect(PRECT pRect);
     109         int    GetWindowTextLengthA();
     110         int    GetWindowTextA(LPSTR lpsz, int cch);
     111         BOOL   SetWindowTextA(LPCSTR lpsz);
     112
    107113       LRESULT  SendMessageA(ULONG msg, WPARAM wParam, LPARAM lParam);
    108114       LRESULT  SendMessageW(ULONG msg, WPARAM wParam, LPARAM lParam);
     
    119125
    120126protected:
     127       LRESULT  SendInternalMessageA(ULONG msg, WPARAM wParam, LPARAM lParam);
     128       LRESULT  SendInternalMessageW(ULONG msg, WPARAM wParam, LPARAM lParam);
    121129        void    Init();
    122130
     
    173181                             RECT *newClientRect );
    174182
    175      LRESULT  sendMessage(ULONG msg, WPARAM wParam, LPARAM lParam)
     183     LRESULT  SendInternalMessage(ULONG msg, WPARAM wParam, LPARAM lParam)
    176184     {
    177185        if(isUnicode)
    178                 return SendMessageW(msg, wParam, lParam);
    179         else    return SendMessageA(msg, wParam, lParam);
     186                return SendInternalMessageW(msg, wParam, lParam);
     187        else    return SendInternalMessageA(msg, wParam, lParam);
    180188     }
    181189#endif
  • trunk/src/user32/new/window.cpp

    r321 r325  
    1 /* $Id: window.cpp,v 1.4 1999-07-17 11:52:23 sandervl Exp $ */
     1/* $Id: window.cpp,v 1.5 1999-07-18 10:39:52 sandervl Exp $ */
    22/*
    33 * Win32 window apis for OS/2
     
    475475//******************************************************************************
    476476//******************************************************************************
    477 BOOL WIN32API GetWindowRect( HWND arg1, PRECT  arg2)
    478 {
    479  BOOL rc;
    480 
    481     rc = O32_GetWindowRect(arg1, arg2);
    482     dprintf(("USER32:  GetWindowRect %X returned %d\n", arg1, rc));
    483     return(rc);
    484 }
    485 //******************************************************************************
    486 //******************************************************************************
    487 BOOL WIN32API SetWindowTextA(HWND arg1, LPCSTR  arg2)
    488 {
    489 #ifdef DEBUG
    490     WriteLog("USER32:  SetWindowText %s\n", arg2);
    491 #endif
    492     return O32_SetWindowText(arg1, arg2);
     477BOOL WIN32API GetWindowRect( HWND hwnd, PRECT pRect)
     478{
     479   Win32Window *window;
     480
     481    window = Win32Window::GetWindowFromHandle(hwnd);
     482    if(!window) {
     483        dprintf(("GetWindowRect, window %x not found", hwnd));
     484        return 0;
     485    }
     486    dprintf(("GetWindowRect %x", hwnd));
     487    return window->GetWindowRect(pRect);
     488}
     489//******************************************************************************
     490//******************************************************************************
     491int WIN32API GetWindowTextLengthA( HWND hwnd)
     492{
     493   Win32Window *window;
     494
     495    window = Win32Window::GetWindowFromHandle(hwnd);
     496    if(!window) {
     497        dprintf(("GetWindowTextLength, window %x not found", hwnd));
     498        return 0;
     499    }
     500    dprintf(("GetWindowTextLength %x", hwnd));
     501    return window->GetWindowTextLengthA();
     502}
     503//******************************************************************************
     504//******************************************************************************
     505int WIN32API GetWindowTextA( HWND hwnd, LPSTR lpsz, int cch)
     506{
     507   Win32Window *window;
     508
     509    window = Win32Window::GetWindowFromHandle(hwnd);
     510    if(!window) {
     511        dprintf(("GetWindowTextA, window %x not found", hwnd));
     512        return 0;
     513    }
     514    dprintf(("GetWindowTextA %x", hwnd));
     515    return window->GetWindowTextA(lpsz, cch);
     516}
     517//******************************************************************************
     518//******************************************************************************
     519BOOL WIN32API SetWindowTextA(HWND hwnd, LPCSTR lpsz)
     520{
     521   Win32Window *window;
     522
     523    window = Win32Window::GetWindowFromHandle(hwnd);
     524    if(!window) {
     525        dprintf(("SetWindowTextA, window %x not found", hwnd));
     526        return 0;
     527    }
     528    dprintf(("SetWindowTextA %x %s", hwnd, lpsz));
     529    return window->SetWindowTextA(lpsz);
    493530}
    494531//******************************************************************************
Note: See TracChangeset for help on using the changeset viewer.