Changeset 321 for trunk/src


Ignore:
Timestamp:
Jul 17, 1999, 1:56:51 PM (26 years ago)
Author:
sandervl
Message:

* empty log message *

Location:
trunk/src/user32/new
Files:
2 added
9 edited

Legend:

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

    r319 r321  
    1 # $Id: makefile,v 1.6 1999-07-17 09:17:57 sandervl Exp $
     1# $Id: makefile,v 1.7 1999-07-17 11:52:22 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
     31        controls.obj button.obj oslibutil.obj oslibmsg.obj
    3232
    3333
     
    8484gen_object.obj: gen_object.cpp gen_object.h
    8585oslibwin.obj:   oslibwin.cpp oslibwin.h oslibutil.h
    86 oslibutil.obj:  oslibutil.cpp oslibutil.h $(PDWIN32_INCLUDE)\wprocess.h
     86oslibutil.obj:  oslibutil.cpp oslibutil.h $(PDWIN32_INCLUDE)\wprocess.h oslibmsg.h
     87oslibmsg.obj:   oslibmsg.cpp oslibmsg.h
     88
    8789
    8890clean:
  • trunk/src/user32/new/oslibwin.cpp

    r319 r321  
    1 /* $Id: oslibwin.cpp,v 1.5 1999-07-17 09:17:58 sandervl Exp $ */
     1/* $Id: oslibwin.cpp,v 1.6 1999-07-17 11:52:22 sandervl Exp $ */
    22/*
    33 * Window API wrappers for OS/2
     
    1414#include <os2.h>
    1515#include <os2wrap.h>
     16#include <stdlib.h>
     17#include <string.h>
     18
    1619#include <misc.h>
    1720#include <oslibwin.h>
    1821#include "oslibstyle.h"
    1922#include "oslibutil.h"
     23#include "oslibmsg.h"
    2024#include "pmwindow.h"
    2125
     
    141145//******************************************************************************
    142146//******************************************************************************
    143 HWND OSLibWinQueryTopMostChildWindow(HWND hwndParent)
    144 {
    145   return WinQueryWindow(hwndParent, QW_TOP);
     147HWND OSLibWinQueryWindow(HWND hwnd, ULONG lCode)
     148{
     149  return WinQueryWindow(hwnd, lCode);
    146150}
    147151//******************************************************************************
     
    189193//******************************************************************************
    190194//******************************************************************************
     195BOOL OSLibWinSetActiveWindow(HWND hwnd)
     196{
     197  return WinSetActiveWindow(HWND_DESKTOP, hwnd);
     198}
     199//******************************************************************************
     200//******************************************************************************
     201BOOL OSLibWinSetFocus(HWND hwnd)
     202{
     203  return WinSetFocus(HWND_DESKTOP, hwnd);
     204}
     205//******************************************************************************
     206//******************************************************************************
     207BOOL OSLibWinEnableWindow(HWND hwnd, BOOL fEnable)
     208{
     209  return WinEnableWindow(hwnd, fEnable);
     210}
     211//******************************************************************************
     212//******************************************************************************
     213BOOL OSLibWinIsWindowEnabled(HWND hwnd)
     214{
     215  return WinIsWindowEnabled(hwnd);
     216}
     217//******************************************************************************
     218//******************************************************************************
     219BOOL OSLibWinIsWindowVisible(HWND hwnd)
     220{
     221  return WinIsWindowVisible(hwnd);
     222}
     223//******************************************************************************
     224//******************************************************************************
     225BOOL OSLibWinQueryActiveWindow()
     226{
     227  return WinQueryActiveWindow(HWND_DESKTOP);
     228}
     229//******************************************************************************
     230//******************************************************************************
     231void OSLibWinPostQuitMessage(ULONG nExitCode)
     232{
     233  WinPostQueueMsg(GetThreadMessageQueue(), WM_QUIT, (MPARAM)nExitCode, 0);
     234}
     235//******************************************************************************
     236//******************************************************************************
     237LONG OSLibWinDispatchMsg(MSG *msg, BOOL isUnicode)
     238{
     239 QMSG qmsg;
     240
     241  WinToOS2MsgTranslate(msg, &qmsg, isUnicode);
     242  return (LONG)WinDispatchMsg(GetThreadHAB(), &qmsg);
     243}
     244//******************************************************************************
     245//******************************************************************************
     246BOOL OSLibWinGetMsg(LPMSG pMsg, HWND hwnd, UINT uMsgFilterMin, UINT uMsgFilterMax, BOOL isUnicode)
     247{
     248 QMSG qmsg;
     249 BOOL rc;
     250
     251  rc = WinGetMsg(GetThreadHAB(), &qmsg, TranslateWinMsg(uMsgFilterMin), TranslateWinMsg(uMsgFilterMax), 0);
     252  OS2ToWinMsgTranslate(&qmsg, pMsg, isUnicode);
     253  return rc;
     254}
     255//******************************************************************************
     256//******************************************************************************
  • trunk/src/user32/new/oslibwin.h

    r319 r321  
    1 /* $Id: oslibwin.h,v 1.4 1999-07-17 09:17:58 sandervl Exp $ */
     1/* $Id: oslibwin.h,v 1.5 1999-07-17 11:52:22 sandervl Exp $ */
    22/*
    33 * Window API wrappers for OS/2
     
    3232HWND  OSLibWinCreateMenu(HWND hwndParent, PVOID menutemplate);
    3333
    34 HWND  OSLibWinQueryTopMostChildWindow(HWND hwndParent);
    35 
    3634
    3735#define SWPOS_SIZE                   0x0001
     
    5250#define SWPOS_NOAUTOCLOSE            0x8000    /* Valid in PROGDETAILS struct only */
    5351
     52#define HWNDOS_TOP                      (HWND)3
     53#define HWNDOS_BOTTOM                   (HWND)4
     54
    5455BOOL  OSLibWinSetWindowPos(HWND hwnd, HWND hwndInsertBehind, LONG x, LONG y, LONG cx, LONG cy, ULONG fl);
    5556BOOL  OSLibWinShowWindow(HWND hwnd, ULONG fl);
     
    5859BOOL  OSLibWinQueryUpdateRect(HWND hwnd, PVOID pRect); //must be RECTL pointer!
    5960BOOL  OSLibWinIsIconic(HWND hwnd);
     61BOOL  OSLibWinSetActiveWindow(HWND hwnd);
     62BOOL  OSLibWinSetFocus(HWND hwnd);
     63BOOL  OSLibWinEnableWindow(HWND hwnd, BOOL fEnable);
     64BOOL  OSLibWinIsWindowEnabled(HWND hwnd);
     65BOOL  OSLibWinIsWindowVisible(HWND hwnd);
     66BOOL  OSLibWinQueryActiveWindow();
     67
     68#define QWOS_NEXT         0
     69#define QWOS_PREV         1
     70#define QWOS_TOP          2
     71#define QWOS_BOTTOM       3
     72#define QWOS_OWNER        4
     73#define QWOS_PARENT       5
     74#define QWOS_NEXTTOP      6
     75#define QWOS_PREVTOP      7
     76#define QWOS_FRAMEOWNER   8
     77
     78HWND  OSLibWinQueryWindow(HWND hwnd, ULONG lCode);
     79
     80
     81void  OSLibWinPostQuitMessage(ULONG nExitCode);
     82LONG  OSLibWinDispatchMsg(MSG *msg, BOOL isUnicode = FALSE);
     83
     84BOOL  OSLibWinGetMsg(LPMSG pMsg, HWND hwnd, UINT uMsgFilterMin, UINT uMsgFilterMax, BOOL isUnicode = FALSE);
    6085
    6186#endif //__OSLIBWIN_H__
  • trunk/src/user32/new/user32.cpp

    r317 r321  
    1 /* $Id: user32.cpp,v 1.2 1999-07-16 17:50:10 cbratschi Exp $ */
     1/* $Id: user32.cpp,v 1.3 1999-07-17 11:52:22 sandervl Exp $ */
    22
    33/*
     
    263263//******************************************************************************
    264264//******************************************************************************
    265 BOOL WIN32API GetMessageA( LPMSG arg1, HWND  arg2, UINT arg3, UINT  arg4)
    266 {
    267 ////    dprintf(("USER32:  GetMessage\n"));
    268     return O32_GetMessage(arg1, arg2, arg3, arg4);
    269 }
    270265//******************************************************************************
    271266//******************************************************************************
     
    14291424//******************************************************************************
    14301425//******************************************************************************
    1431 LONG WIN32API GetMessageExtraInfo(void)
    1432 {
    1433     dprintf(("USER32:  GetMessageExtraInfo\n"));
    1434     return O32_GetMessageExtraInfo();
    1435 }
    1436 //******************************************************************************
    1437 //******************************************************************************
    1438 DWORD WIN32API GetMessagePos(void)
    1439 {
    1440     dprintf(("USER32:  GetMessagePos\n"));
    1441     return O32_GetMessagePos();
    1442 }
    1443 //******************************************************************************
    1444 //******************************************************************************
    1445 LONG WIN32API GetMessageTime(void)
    1446 {
    1447     dprintf(("USER32:  GetMessageTime\n"));
    1448     return O32_GetMessageTime();
    1449 }
    1450 //******************************************************************************
    1451 //******************************************************************************
    1452 BOOL WIN32API GetMessageW(LPMSG arg1, HWND arg2, UINT arg3, UINT arg4)
    1453 {
    1454  BOOL rc;
    1455 
    1456     // NOTE: This will not work as is (needs UNICODE support)
    1457     rc = O32_GetMessage(arg1, arg2, arg3, arg4);
    1458     dprintf(("USER32:  GetMessageW %X returned %d\n", arg2, rc));
    1459     return(rc);
    1460 }
    14611426//******************************************************************************
    14621427//******************************************************************************
  • trunk/src/user32/new/win32type.h

    r309 r321  
    238238} POINT, *PPOINT, *LPPOINT;
    239239
    240 #endif
     240typedef struct tagRECT
     241{
     242    INT  left;
     243    INT  top;
     244    INT  right;
     245    INT  bottom;
     246} RECT, *PRECT, *LPRECT;
     247typedef const RECT *LPCRECT;
     248
     249typedef struct
     250{
     251    HWND    hwnd;
     252    UINT    message;
     253    WPARAM  wParam;
     254    LPARAM  lParam;
     255    DWORD   time;
     256    POINT   pt;
     257} MSG, *LPMSG;
     258
     259#endif
  • trunk/src/user32/new/win32wnd.cpp

    r319 r321  
    1 /* $Id: win32wnd.cpp,v 1.5 1999-07-17 09:17:58 sandervl Exp $ */
     1/* $Id: win32wnd.cpp,v 1.6 1999-07-17 11:52:23 sandervl Exp $ */
    22/*
    33 * Win32 Window Code for OS/2
     
    123123  if (cs->hwndParent)
    124124  {
     125        Win32Window *window = GetWindowFromHandle(cs->hwndParent);
     126        if(!window) {
     127                dprintf(("Bad parent %04x\n", cs->hwndParent ));
     128                SetLastError(ERROR_INVALID_PARAMETER);
     129                return FALSE;
     130        }
    125131        /* Make sure parent is valid */
    126         if (!IsWindow( cs->hwndParent ))
     132        if (!window->IsWindow() )
    127133        {
    128134                dprintf(("Bad parent %04x\n", cs->hwndParent ));
     
    345351        return FALSE;
    346352  }
    347 
     353  if(OS2Hwnd != OS2HwndFrame) {
     354        if(OSLibWinSetWindowULong(OS2HwndFrame, OFFSET_WIN32WNDPTR, (ULONG)this) == FALSE) {
     355                dprintf(("WM_CREATE: WinSetWindowULong %X failed!!", OS2HwndFrame));
     356                return FALSE;
     357        }
     358        if(OSLibWinSetWindowULong(OS2HwndFrame, OFFSET_WIN32PM_MAGIC, WIN32PM_MAGIC) == FALSE) {
     359                dprintf(("WM_CREATE: WinSetWindowULong2 %X failed!!", OS2HwndFrame));
     360                return FALSE;
     361        }
     362  }
    348363  /* Set the window menu */
    349364  if ((dwStyle & (WS_CAPTION | WS_CHILD)) == WS_CAPTION )
     
    415430
    416431                NotifyParent(WM_CREATE, 0, 0);
    417                 if( !IsWindow(Win32Hwnd) )
     432                if( !IsWindow() )
    418433                {
    419434                    return FALSE;
     
    975990  switch(hwndInsertAfter) {
    976991        case HWND_BOTTOM:
     992                hwndInsertAfter = HWNDOS_BOTTOM;
     993                break;
     994        case HWND_TOPMOST: //TODO:
     995        case HWND_NOTOPMOST: //TODO:
    977996        case HWND_TOP:
    978         case HWND_TOPMOST:
    979         case HWND_NOTOPMOST:
     997                hwndInsertAfter = HWNDOS_TOP;
    980998                break;
    981999        default:
     
    10231041}
    10241042//******************************************************************************
    1025 //TODO:
    1026 //******************************************************************************
    1027 HWND Win32Window::SetActiveWindow()
    1028 {
    1029   return O32_SetActiveWindow(OS2Hwnd);
    1030 }
    1031 //******************************************************************************
    10321043//******************************************************************************
    10331044HWND Win32Window::GetParent()
     
    10781089HWND Win32Window::GetTopWindow()
    10791090{
    1080  HWND topchild;
    1081 
    1082   topchild = OSLibWinQueryTopMostChildWindow(OS2HwndFrame);
    1083   if(topchild)
    1084   {
    1085         return topchild;
    1086   }
    1087   else  return 0;
     1091  return GetWindow(GW_CHILD);
    10881092}
    10891093//******************************************************************************
     
    11071111{
    11081112  return OSLibWinIsIconic(OS2HwndFrame);
     1113}
     1114//******************************************************************************
     1115//TODO: not complete nor correct (distinction between top-level, top-most & child windows)
     1116//******************************************************************************
     1117HWND Win32Window::GetWindow(UINT uCmd)
     1118{
     1119 Win32Window  *win32wnd;
     1120 ULONG         magic;
     1121 ULONG         getcmd = 0;
     1122 HWND          hwndRelated;
     1123
     1124  dprintf(("GetWindow %x %d NOT COMPLETE", getWindowHandle(), uCmd));
     1125  switch(uCmd)
     1126  {
     1127        case GW_CHILD:
     1128                getcmd = QWOS_TOP;
     1129                break;
     1130        case GW_HWNDFIRST:
     1131                if(getParent()) {
     1132                        getcmd = QWOS_TOP; //top of child windows
     1133                }
     1134                else    getcmd = QWOS_TOP; //TODO
     1135                break;
     1136        case GW_HWNDLAST:
     1137                if(getParent()) {
     1138                        getcmd = QWOS_BOTTOM; //bottom of child windows
     1139                }
     1140                else    getcmd = QWOS_BOTTOM; //TODO
     1141                break;
     1142        case GW_HWNDNEXT:
     1143                getcmd = QWOS_NEXT;
     1144                break;
     1145        case GW_HWNDPREV:
     1146                getcmd = QWOS_PREV;
     1147                break;
     1148        case GW_OWNER:
     1149                if(owner) {
     1150                        return owner->getWindowHandle();
     1151                }
     1152                else    return 0;
     1153  }
     1154  hwndRelated = OSLibWinQueryWindow(OS2HwndFrame, getcmd);
     1155  if(hwndRelated)
     1156  {
     1157        win32wnd = (Win32Window *)OSLibWinGetWindowULong(hwndRelated, OFFSET_WIN32WNDPTR);
     1158        magic    = OSLibWinGetWindowULong(hwndRelated, OFFSET_WIN32PM_MAGIC);
     1159        if(CheckMagicDword(magic) && win32wnd)
     1160        {
     1161                return win32wnd->getWindowHandle();
     1162        }
     1163  }
     1164  return 0;
     1165}
     1166//******************************************************************************
     1167//******************************************************************************
     1168HWND Win32Window::SetActiveWindow()
     1169{
     1170  return OSLibWinSetActiveWindow(OS2HwndFrame);
     1171}
     1172//******************************************************************************
     1173//WM_ENABLE is sent to hwnd, but not to it's children (as it should be)
     1174//******************************************************************************
     1175BOOL Win32Window::EnableWindow(BOOL fEnable)
     1176{
     1177  return OSLibWinEnableWindow(OS2HwndFrame, fEnable);
     1178}
     1179//******************************************************************************
     1180//******************************************************************************
     1181BOOL Win32Window::BringWindowToTop()
     1182{
     1183  return SetWindowPos(HWND_TOP, 0, 0, 0, 0, SWP_NOMOVE|SWP_NOSIZE );
     1184}
     1185//******************************************************************************
     1186//******************************************************************************
     1187HWND Win32Window::GetActiveWindow()
     1188{
     1189 HWND          hwndActive;
     1190 Win32Window  *win32wnd;
     1191 ULONG         magic;
     1192
     1193  hwndActive = OSLibWinQueryActiveWindow();
     1194
     1195  win32wnd = (Win32Window *)OSLibWinGetWindowULong(hwndActive, OFFSET_WIN32WNDPTR);
     1196  magic    = OSLibWinGetWindowULong(hwndActive, OFFSET_WIN32PM_MAGIC);
     1197  if(CheckMagicDword(magic) && win32wnd)
     1198  {
     1199        return win32wnd->getWindowHandle();
     1200  }
     1201  return hwndActive;
     1202}
     1203//******************************************************************************
     1204//******************************************************************************
     1205BOOL Win32Window::IsWindow()
     1206{
     1207  return TRUE;
     1208}
     1209//******************************************************************************
     1210//******************************************************************************
     1211BOOL Win32Window::IsWindowEnabled()
     1212{
     1213  return OSLibWinIsWindowEnabled(OS2Hwnd);
     1214}
     1215//******************************************************************************
     1216//******************************************************************************
     1217BOOL Win32Window::IsWindowVisible()
     1218{
     1219  return OSLibWinIsWindowVisible(OS2Hwnd);
    11091220}
    11101221//******************************************************************************
  • trunk/src/user32/new/win32wnd.h

    r319 r321  
    1 /* $Id: win32wnd.h,v 1.5 1999-07-17 09:17:58 sandervl Exp $ */
     1/* $Id: win32wnd.h,v 1.6 1999-07-17 11:52:23 sandervl Exp $ */
    22/*
    33 * Win32 Window Code for OS/2
     
    2424#define OFFSET_WIN32PM_MAGIC    4
    2525
    26 #define WIN32PM_MAGIC   0x12345678
     26#define WIN32PM_MAGIC           0x12345678
     27#define CheckMagicDword(a)      (a==WIN32PM_MAGIC)
    2728
    2829typedef struct {
     
    9697         BOOL   UpdateWindow();
    9798         BOOL   IsIconic();
     99         HWND   GetWindow(UINT uCmd);
     100         BOOL   EnableWindow(BOOL fEnable);
     101         BOOL   BringWindowToTop();
     102  static HWND   GetActiveWindow();
     103         BOOL   IsWindow();
     104         BOOL   IsWindowEnabled();
     105         BOOL   IsWindowVisible();
    98106
    99107       LRESULT  SendMessageA(ULONG msg, WPARAM wParam, LPARAM lParam);
  • trunk/src/user32/new/window.cpp

    r314 r321  
    1 /* $Id: window.cpp,v 1.3 1999-07-16 11:32:09 sandervl Exp $ */
     1/* $Id: window.cpp,v 1.4 1999-07-17 11:52:23 sandervl Exp $ */
    22/*
    33 * Win32 window apis for OS/2
     
    1010 *
    1111 * Project Odin Software License can be found in LICENSE.TXT
     12 *
     13 *
     14 * TODO: Decide what to do about commands for OS/2 windows (non-Win32 apps)
    1215 *
    1316 */
     
    184187    window = Win32Window::GetWindowFromHandle(hwnd);
    185188    if(!window) {
    186         dprintf(("SendMessageA, window %x not found", hwnd));
    187         return 0;
    188     }
     189        dprintf(("DestroyWindow, window %x not found", hwnd));
     190        return 0;
     191    }
     192    dprintf(("DestroyWindow %x", hwnd));
    189193    return window->DestroyWindow();
    190194}
     
    197201    window = Win32Window::GetWindowFromHandle(hwnd);
    198202    if(!window) {
    199         dprintf(("SendMessageA, window %x not found", hwnd));
    200         return 0;
    201     }
     203        dprintf(("SetActiveWindow, window %x not found", hwnd));
     204        return 0;
     205    }
     206    dprintf(("SetActiveWindow %x", hwnd));
    202207    return window->SetActiveWindow();
    203208}
     
    210215    window = Win32Window::GetWindowFromHandle(hwnd);
    211216    if(!window) {
    212         dprintf(("SendMessageA, window %x not found", hwnd));
    213         return 0;
    214     }
     217        dprintf(("GetParent, window %x not found", hwnd));
     218        return 0;
     219    }
     220    dprintf(("GetParent %x", hwnd));
    215221    return window->GetParent();
    216222}
     
    223229    window = Win32Window::GetWindowFromHandle(hwndChild);
    224230    if(!window) {
    225         dprintf(("SendMessageA, window %x not found", hwndChild));
    226         return 0;
    227     }
     231        dprintf(("SetParent, window %x not found", hwndChild));
     232        return 0;
     233    }
     234    dprintf(("SetParent %x %x", hwndChild, hwndNewParent));
    228235    return window->SetParent(hwndNewParent);
    229236}
     
    236243    window = Win32Window::GetWindowFromHandle(hwnd);
    237244    if(!window) {
    238         dprintf(("SendMessageA, window %x not found", hwnd));
    239         return 0;
    240     }
     245        dprintf(("IsChild, window %x not found", hwnd));
     246        return 0;
     247    }
     248    dprintf(("IsChild %x %x", hwndParent, hwnd));
    241249    return window->IsChild(hwndParent);
    242250}
     
    249257    window = Win32Window::GetWindowFromHandle(hwnd);
    250258    if(!window) {
    251         dprintf(("SendMessageA, window %x not found", hwnd));
    252         return 0;
    253     }
     259        dprintf(("GetTopWindow, window %x not found", hwnd));
     260        return 0;
     261    }
     262    dprintf(("GetTopWindow %x", hwnd));
    254263    return window->GetTopWindow();
    255264}
     
    262271    window = Win32Window::GetWindowFromHandle(hwnd);
    263272    if(!window) {
    264         dprintf(("SendMessageA, window %x not found", hwnd));
    265         return 0;
    266     }
     273        dprintf(("UpdateWindow, window %x not found", hwnd));
     274        return 0;
     275    }
     276    dprintf(("UpdateWindow %x", hwnd));
    267277    return window->UpdateWindow();
    268278}
     
    275285    window = Win32Window::GetWindowFromHandle(hwnd);
    276286    if(!window) {
    277         dprintf(("SendMessageA, window %x not found", hwnd));
    278         return 0;
    279     }
     287        dprintf(("IsIconic, window %x not found", hwnd));
     288        return 0;
     289    }
     290    dprintf(("IsIconic %x", hwnd));
    280291    return window->IsIconic();
    281292}
    282293//******************************************************************************
    283294//******************************************************************************
    284 HWND WIN32API GetWindow(HWND arg1, UINT arg2)
    285 {
    286  HWND rc;
    287 
    288     rc = O32_GetWindow(arg1, arg2);
    289 #ifdef DEBUG
    290     WriteLog("USER32:  GetWindow %X %d returned %d\n", arg1, arg2, rc);
    291 #endif
    292     return(rc);
     295HWND WIN32API GetWindow(HWND hwnd, UINT uCmd)
     296{
     297  Win32Window *window;
     298
     299    window = Win32Window::GetWindowFromHandle(hwnd);
     300    if(!window) {
     301        dprintf(("GetWindow, window %x not found", hwnd));
     302        return 0;
     303    }
     304    dprintf(("GetWindow %x %d", hwnd, uCmd));
     305    return window->GetWindow(uCmd);
    293306}
    294307//******************************************************************************
     
    303316//******************************************************************************
    304317//******************************************************************************
    305 BOOL WIN32API EnableWindow( HWND arg1, BOOL  arg2)
    306 {
    307 #ifdef DEBUG
    308     WriteLog("USER32:  EnableWindow\n");
    309 #endif
    310     return O32_EnableWindow(arg1, arg2);
    311 }
    312 //******************************************************************************
    313 //******************************************************************************
    314 BOOL WIN32API BringWindowToTop( HWND arg1)
    315 {
    316 #ifdef DEBUG
    317     WriteLog("USER32:  BringWindowToTop\n");
    318 #endif
    319     return O32_BringWindowToTop(arg1);
     318BOOL WIN32API EnableWindow( HWND hwnd, BOOL fEnable)
     319{
     320  Win32Window *window;
     321
     322    window = Win32Window::GetWindowFromHandle(hwnd);
     323    if(!window) {
     324        dprintf(("EnableWindow, window %x not found", hwnd));
     325        return 0;
     326    }
     327    dprintf(("EnableWindow %x %d", hwnd, fEnable));
     328    return window->EnableWindow(fEnable);
     329}
     330//******************************************************************************
     331//******************************************************************************
     332BOOL WIN32API BringWindowToTop(HWND hwnd)
     333{
     334  Win32Window *window;
     335
     336    window = Win32Window::GetWindowFromHandle(hwnd);
     337    if(!window) {
     338        dprintf(("BringWindowToTop, window %x not found", hwnd));
     339        return 0;
     340    }
     341    dprintf(("BringWindowToTop %x", hwnd));
     342    return window->BringWindowToTop();
    320343}
    321344//******************************************************************************
     
    323346HWND WIN32API GetActiveWindow()
    324347{
    325   return(O32_GetActiveWindow());
    326 }
    327 //******************************************************************************
    328 //******************************************************************************
    329 BOOL WIN32API ShowWindow(HWND arg1, int arg2)
    330 {
    331 #ifdef DEBUG
    332     WriteLog("USER32:  ShowWindow %X %d\n", arg1, arg2);
    333 #endif
    334     return O32_ShowWindow(arg1, arg2);
    335 }
    336 //******************************************************************************
    337 //******************************************************************************
    338 BOOL WIN32API SetWindowPos( HWND arg1, HWND arg2, int arg3, int arg4, int arg5, int arg6, UINT  arg7)
    339 {
    340 #ifdef DEBUG
    341     WriteLog("USER32:  SetWindowPos\n");
    342 #endif
    343     return O32_SetWindowPos(arg1, arg2, arg3, arg4, arg5, arg6, arg7);
     348  return Win32Window::GetActiveWindow();
     349}
     350//******************************************************************************
     351//******************************************************************************
     352BOOL WIN32API ShowWindow(HWND hwnd, int nCmdShow)
     353{
     354  Win32Window *window;
     355
     356    window = Win32Window::GetWindowFromHandle(hwnd);
     357    if(!window) {
     358        dprintf(("ShowWindow, window %x not found", hwnd));
     359        return 0;
     360    }
     361    dprintf(("ShowWindow %x", hwnd));
     362    return window->ShowWindow(nCmdShow);
     363}
     364//******************************************************************************
     365//******************************************************************************
     366BOOL WIN32API SetWindowPos(HWND hwnd, HWND hwndInsertAfter, int x, int y, int cx, int cy, UINT fuFlags)
     367{
     368  Win32Window *window;
     369
     370    window = Win32Window::GetWindowFromHandle(hwnd);
     371    if(!window) {
     372        dprintf(("SetWindowPos, window %x not found", hwnd));
     373        return 0;
     374    }
     375    dprintf(("SetWindowPos %x %x x=%d y=%d cx=%d cy=%d %x", hwnd, hwndInsertAfter, x, y, cx, cy, fuFlags));
     376    return window->SetWindowPos(hwndInsertAfter, x, y, cx, cy, fuFlags);
     377}
     378//******************************************************************************
     379//******************************************************************************
     380BOOL WIN32API IsWindow( HWND hwnd)
     381{
     382  Win32Window *window;
     383
     384    window = Win32Window::GetWindowFromHandle(hwnd);
     385    if(!window) {
     386        dprintf(("IsWindow, window %x not found", hwnd));
     387        return FALSE;
     388    }
     389    dprintf(("IsWindow %x", hwnd));
     390    return window->IsWindow();
     391}
     392//******************************************************************************
     393//******************************************************************************
     394BOOL WIN32API IsWindowEnabled( HWND hwnd)
     395{
     396  Win32Window *window;
     397
     398    window = Win32Window::GetWindowFromHandle(hwnd);
     399    if(!window) {
     400        dprintf(("IsWindowEnabled, window %x not found", hwnd));
     401        return 0;
     402    }
     403    dprintf(("IsWindowEnabled %x", hwnd));
     404    return window->IsWindowEnabled();
     405}
     406//******************************************************************************
     407//******************************************************************************
     408BOOL WIN32API IsWindowVisible( HWND hwnd)
     409{
     410  Win32Window *window;
     411
     412    window = Win32Window::GetWindowFromHandle(hwnd);
     413    if(!window) {
     414        dprintf(("IsWindowVisible, window %x not found", hwnd));
     415        return 0;
     416    }
     417    dprintf(("IsWindowVisible %x", hwnd));
     418    return window->IsWindowVisible();
    344419}
    345420/***********************************************************************
     
    364439    }
    365440    return 0;
    366 }
    367 //******************************************************************************
    368 //******************************************************************************
    369 BOOL WIN32API IsWindow( HWND arg1)
    370 {
    371 #ifdef DEBUG
    372     WriteLog("USER32:  IsWindow\n");
    373 #endif
    374     return O32_IsWindow(arg1);
    375 }
    376 //******************************************************************************
    377 //******************************************************************************
    378 BOOL WIN32API IsWindowEnabled( HWND arg1)
    379 {
    380 #ifdef DEBUG
    381     WriteLog("USER32:  IsWindowEnabled\n");
    382 #endif
    383     return O32_IsWindowEnabled(arg1);
    384 }
    385 //******************************************************************************
    386 //******************************************************************************
    387 BOOL WIN32API IsWindowVisible( HWND arg1)
    388 {
    389 #ifdef DEBUG
    390     WriteLog("USER32:  IsWindowVisible\n");
    391 #endif
    392     return O32_IsWindowVisible(arg1);
    393441}
    394442//******************************************************************************
  • trunk/src/user32/new/windowmsg.cpp

    r314 r321  
    1 /* $Id: windowmsg.cpp,v 1.5 1999-07-16 11:32:10 sandervl Exp $ */
     1/* $Id: windowmsg.cpp,v 1.6 1999-07-17 11:52:24 sandervl Exp $ */
    22/*
    33 * Win32 window message APIs for OS/2
     
    1818#include <win.h>
    1919#include <hooks.h>
     20#include "oslibwin.h"
    2021
    2122//******************************************************************************
     
    2425{
    2526    dprintf(("USER32:  PostQuitMessage\n"));
    26 
    27     O32_PostQuitMessage(nExitCode);
    28 }
    29 //******************************************************************************
    30 //******************************************************************************
    31 LONG WIN32API DispatchMessageA( const MSG * msg)
    32 {
    33   LONG         retval;
    34   int          painting;
    35   Win32Window *window;
    36    
    37       /* Process timer messages */
    38     if ((msg->message == WM_TIMER) || (msg->message == WM_SYSTIMER))
    39     {
    40         if (msg->lParam)
    41         {
    42             return SendMessageA(msg->hwnd, msg->message, msg->wParam, GetTickCount());
    43         }
    44     }
    45 
    46     if (!msg->hwnd) return 0;
    47 
    48     window = Win32Window::GetWindowFromHandle(msg->hwnd);
    49     if(!window) {
    50         dprintf(("DispatchMessageA, window %x not found", msg->hwnd));
    51         return 0;
    52     }
    53 
    54     painting = (msg->message == WM_PAINT);
    55     if (painting) window->setFlags(window->getFlags() | WIN_NEEDS_BEGINPAINT);
    56 
    57     retval = window->SendMessageA(msg->message, msg->wParam, msg->lParam );
    58 
    59 #if 0
    60     window = Win32Window::GetWindowFromHandle(msg->hwnd);
    61     if(!window) {
    62         dprintf(("DispatchMessageA, window %x not found", msg->hwnd));
    63         return 0;
    64     }
    65 
    66     if (painting && (wndPtr->getFlags() & WIN_NEEDS_BEGINPAINT) && wndPtr->hrgnUpdate)
    67     {
    68         ERR_(msg)("BeginPaint not called on WM_PAINT for hwnd %04x!\n",
    69             msg->hwnd);
    70         wndPtr->flags &= ~WIN_NEEDS_BEGINPAINT;
    71         /* Validate the update region to avoid infinite WM_PAINT loop */
    72         ValidateRect( msg->hwnd, NULL );
    73     }
    74 #endif
    75     return retval;
     27    OSLibWinPostQuitMessage(nExitCode);
     28}
     29//******************************************************************************
     30//******************************************************************************
     31LONG WIN32API DispatchMessageA(const MSG * msg)
     32{
     33  return OSLibWinDispatchMsg((MSG *)msg);
    7634}
    7735//******************************************************************************
     
    7937LONG WIN32API DispatchMessageW( const MSG * msg)
    8038{
    81   LONG         retval;
    82   int          painting;
    83   Win32Window *window;
    84    
    85     /* Process timer messages */
    86     if ((msg->message == WM_TIMER) || (msg->message == WM_SYSTIMER))
    87     {
    88         if (msg->lParam)
    89         {
    90             return SendMessageW(msg->hwnd, msg->message, msg->wParam, GetTickCount());
    91         }
    92     }
    93 
    94     if (!msg->hwnd) return 0;
    95 
    96     window = Win32Window::GetWindowFromHandle(msg->hwnd);
    97     if(!window) {
    98         dprintf(("DispatchMessageW, window %x not found", msg->hwnd));
    99         return 0;
    100     }
    101 
    102     painting = (msg->message == WM_PAINT);
    103     if (painting) window->setFlags(window->getFlags() | WIN_NEEDS_BEGINPAINT);
    104 
    105     retval = window->SendMessageW(msg->message, msg->wParam, msg->lParam );
    106 
    107 #if 0
    108     window = Win32Window::GetWindowFromHandle(msg->hwnd);
    109     if(!window) {
    110         dprintf(("DispatchMessageW, window %x not found", msg->hwnd));
    111         return 0;
    112     }
    113 
    114     if (painting && (wndPtr->getFlags() & WIN_NEEDS_BEGINPAINT) && wndPtr->hrgnUpdate)
    115     {
    116         ERR_(msg)("BeginPaint not called on WM_PAINT for hwnd %04x!\n",
    117             msg->hwnd);
    118         wndPtr->flags &= ~WIN_NEEDS_BEGINPAINT;
    119         /* Validate the update region to avoid infinite WM_PAINT loop */
    120         ValidateRect( msg->hwnd, NULL );
    121     }
    122 #endif
    123     return retval;
     39  return OSLibWinDispatchMsg((MSG *)msg, TRUE);
    12440}
    12541//******************************************************************************
     
    12743BOOL WIN32API TranslateMessage( const MSG * arg1)
    12844{
    129 #ifdef DEBUG
    130 ////    WriteLog("USER32:  TranslateMessage\n");
    131 #endif
    132     return O32_TranslateMessage(arg1);
     45//    return O32_TranslateMessage(arg1);
     46   return TRUE;
     47}
     48//******************************************************************************
     49//******************************************************************************
     50BOOL WIN32API GetMessageA( LPMSG pMsg, HWND hwnd, UINT uMsgFilterMin, UINT uMsgFilterMax)
     51{
     52    return OSLibWinGetMsg(pMsg, hwnd, uMsgFilterMin, uMsgFilterMax);
     53}
     54//******************************************************************************
     55//******************************************************************************
     56BOOL WIN32API GetMessageW( LPMSG pMsg, HWND hwnd, UINT uMsgFilterMin, UINT uMsgFilterMax)
     57{
     58    return OSLibWinGetMsg(pMsg, hwnd, uMsgFilterMin, uMsgFilterMax, TRUE);
     59}
     60//******************************************************************************
     61//******************************************************************************
     62LONG WIN32API GetMessageExtraInfo(void)
     63{
     64    dprintf(("USER32:  GetMessageExtraInfo\n"));
     65    return O32_GetMessageExtraInfo();
     66}
     67//******************************************************************************
     68//******************************************************************************
     69DWORD WIN32API GetMessagePos(void)
     70{
     71    dprintf(("USER32:  GetMessagePos\n"));
     72    return O32_GetMessagePos();
     73}
     74//******************************************************************************
     75//******************************************************************************
     76LONG WIN32API GetMessageTime(void)
     77{
     78    dprintf(("USER32:  GetMessageTime\n"));
     79    return O32_GetMessageTime();
    13380}
    13481//******************************************************************************
Note: See TracChangeset for help on using the changeset viewer.