Changeset 7801 for trunk/src


Ignore:
Timestamp:
Feb 5, 2002, 6:59:31 PM (24 years ago)
Author:
sandervl
Message:

message handling changes

Location:
trunk/src/user32
Files:
1 added
10 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/user32/Makefile

    r7627 r7801  
    1 # $Id: Makefile,v 1.98 2001-12-13 15:32:57 sandervl Exp $
     1# $Id: Makefile,v 1.99 2002-02-05 17:58:58 sandervl Exp $
    22
    33#
     
    6262$(OBJDIR)\windowword.obj \
    6363$(OBJDIR)\windowmsg.obj \
     64$(OBJDIR)\message.obj \
    6465$(OBJDIR)\winproc.obj \
    6566$(OBJDIR)\oslibmsg.obj \
  • trunk/src/user32/dbglocal.cpp

    r6375 r7801  
    1 /* $Id: dbglocal.cpp,v 1.7 2001-07-20 15:34:15 sandervl Exp $ */
     1/* $Id: dbglocal.cpp,v 1.8 2002-02-05 17:58:58 sandervl Exp $ */
    22
    33/*
     
    8888"win32wbasenonclient",
    8989"win32wbaseprop",
    90 "dcrgn"
     90"dcrgn",
     91"message"
    9192};
    9293//******************************************************************************
  • trunk/src/user32/dbglocal.h

    r6375 r7801  
    1 /* $Id: dbglocal.h,v 1.6 2001-07-20 15:34:15 sandervl Exp $ */
     1/* $Id: dbglocal.h,v 1.7 2002-02-05 17:58:59 sandervl Exp $ */
    22
    33/*
     
    8888#define DBG_win32wbaseprop       66
    8989#define DBG_dcrgn                67
    90 #define DBG_MAXFILES             68
     90#define DBG_message              68
     91#define DBG_MAXFILES             69
    9192
    9293extern USHORT DbgEnabledUSER32[DBG_MAXFILES];
  • trunk/src/user32/user32.cpp

    r7691 r7801  
    1 /* $Id: user32.cpp,v 1.118 2001-12-26 19:05:35 achimha Exp $ */
     1/* $Id: user32.cpp,v 1.119 2002-02-05 17:58:59 sandervl Exp $ */
    22
    33/*
     
    16371637         dwDesiredAccess));
    16381638
     1639  SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
    16391640  return (NULL);
    16401641}
     
    16701671         dwDesiredAccess));
    16711672
     1673  SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
    16721674  return (NULL);
    16731675}
     
    16991701         dwDesiredAccess));
    17001702
     1703  SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
    17011704  return (NULL);
    17021705}
     
    17271730         dwDesiredAccess));
    17281731
     1732  SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
    17291733  return (NULL);
    17301734}
     
    17571761         dwDesiredAccess));
    17581762
     1763  SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
    17591764  return (NULL);
    17601765}
     
    17811786         hWinSta));
    17821787
     1788  SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
    17831789  return (FALSE);
    17841790}
     
    18031809         hDesktop));
    18041810
     1811  SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
    18051812  return (FALSE);
    18061813}
     
    18331840           cbInfo));
    18341841
     1842  SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
    18351843  return (FALSE);
    18361844}
     
    18631871           cbInfo));
    18641872
     1873  SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
    18651874  return (FALSE);
    18661875}
     
    18901899           psd));
    18911900
     1901  SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
    18921902  return (FALSE);
    18931903}
     
    19131923         hDesktop));
    19141924
     1925  SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
    19151926  return (FALSE);
    19161927}
  • trunk/src/user32/win32dlg.cpp

    r7404 r7801  
    1 /* $Id: win32dlg.cpp,v 1.75 2001-11-20 15:25:18 sandervl Exp $ */
     1/* $Id: win32dlg.cpp,v 1.76 2002-02-05 17:59:00 sandervl Exp $ */
    22/*
    33 * Win32 Dialog Code for OS/2
     
    7979    }
    8080
     81    dprintf(("Dialog style %x", LOWORD(dlgInfo.style)));
     82
    8183    /* Create custom font if needed */
    8284    if (dlgInfo.style & DS_SETFONT)
     
    248250
    249251    if (hUserFont)
    250         SendInternalMessageA(WM_SETFONT, (WPARAM)hUserFont, 0 );
     252        SendMessageA(getWindowHandle(), WM_SETFONT, (WPARAM)hUserFont, 0 );
    251253
    252254    /* Create controls */
     
    261263
    262264        HWND hwndPreInitFocus = GetFocus();
    263         if(SendInternalMessageA(WM_INITDIALOG, (WPARAM)hwndFocus, param))
     265        if(SendMessageA(getWindowHandle(), WM_INITDIALOG, (WPARAM)hwndFocus, param))
    264266        {
    265267            //SvL: Experiments in NT4 show that dialogs that are children don't
     
    293295        {
    294296            ShowWindow( SW_SHOWNORMAL );    /* SW_SHOW doesn't always work */
    295             UpdateWindow( getWindowHandle() );
     297////Note: this was removed in Wine
     298////            UpdateWindow( getWindowHandle() );
    296299        }
    297300        SetLastError(ERROR_SUCCESS);
     
    357360          {
    358361                if(!(getStyle() & DS_NOIDLEMSG))
    359                     topOwner->SendMessageA(WM_ENTERIDLE,MSGF_DIALOGBOX,getWindowHandle());
     362                    SendMessageA(topOwner->getWindowHandle(), WM_ENTERIDLE,MSGF_DIALOGBOX,getWindowHandle());
    360363                GetMessageA(&msg,0,0,0);
    361364          }
     
    757760        if ((rc == SIMPLEREGION) || (rc == COMPLEXREGION))
    758761        {
    759             HBRUSH hBrush = SendInternalMessageA(WM_CTLCOLORDLG, wParam, getWindowHandle());
     762            HBRUSH hBrush = SendMessageA(getWindowHandle(), WM_CTLCOLORDLG, wParam, getWindowHandle());
    760763            if(GetObjectType(hBrush) != OBJ_BRUSH) {
    761764                DefWndControlColor(CTLCOLOR_DLG, (HDC)wParam);
     
    855858                /* always make combo box hide its listbox control */
    856859                if( CONTROLS_IsControl( wndFocus, COMBOBOX_CONTROL ) )
    857                     wndFocus->SendMessageA(CB_SHOWDROPDOWN, FALSE, 0 );
     860                    SendMessageA(wndFocus->getWindowHandle(), CB_SHOWDROPDOWN, FALSE, 0 );
    858861                else
    859862                if( CONTROLS_IsControl( wndFocus, EDIT_CONTROL ) &&
    860863                    CONTROLS_IsControl( wndFocus->getParent(), COMBOBOX_CONTROL ))
    861                     wndFocus->SendMessageA(CB_SHOWDROPDOWN, FALSE, 0 );
     864                    SendMessageA(wndFocus->getWindowHandle(), CB_SHOWDROPDOWN, FALSE, 0 );
    862865                RELEASE_WNDOBJ(wndFocus);
    863866            }
  • trunk/src/user32/win32wbase.cpp

    r7780 r7801  
    1 /* $Id: win32wbase.cpp,v 1.312 2002-01-20 15:26:21 sandervl Exp $ */
     1/* $Id: win32wbase.cpp,v 1.313 2002-02-05 17:59:00 sandervl Exp $ */
    22/*
    33 * Win32 Window Base Class for OS/2
     
    169169  fIsModalDialogOwner = FALSE;
    170170  OS2HwndModalDialog  = 0;
    171   fInternalMsg     = FALSE;
    172171  fParentChange    = FALSE;
    173172  fDestroyWindowCalled = FALSE;
     
    212211  hotkey           = 0;
    213212
    214 
    215213  hwndLinkAfter    = HWND_BOTTOM;
    216214  flags            = 0;
    217   lastHitTestVal   = HTOS_NORMAL;
     215  lastHitTestVal   = HTCLIENT;
    218216  owner            = NULL;
    219217  windowClass      = 0;
     
    846844            if(!(flags & WIN_NEED_SIZE))
    847845            {
    848                 SendInternalMessageA(WM_SIZE, SIZE_RESTORED,
    849                                 MAKELONG(rectClient.right-rectClient.left,
    850                                          rectClient.bottom-rectClient.top));
     846                SendMessageA(getWindowHandle(), WM_SIZE, SIZE_RESTORED,
     847                             MAKELONG(rectClient.right-rectClient.left,
     848                             rectClient.bottom-rectClient.top));
    851849
    852850                if(!::IsWindow(hwnd))
     
    855853                    goto end;
    856854                }
    857                 SendInternalMessageA(WM_MOVE,0,MAKELONG(rectClient.left,rectClient.top));
     855                SendMessageA(getWindowHandle(), WM_MOVE,0,MAKELONG(rectClient.left,rectClient.top));
    858856                if(!::IsWindow(hwnd))
    859857                {
     
    883881                if(getParent() && getParent()->IsWindowDestroyed() == FALSE)
    884882                {
    885                     getParent()->SendInternalMessageA(WM_PARENTNOTIFY, MAKEWPARAM(WM_CREATE, getWindowId()), (LPARAM)getWindowHandle());
     883                    SendMessageA(getParent()->getWindowHandle(), WM_PARENTNOTIFY, MAKEWPARAM(WM_CREATE, getWindowId()), (LPARAM)getWindowHandle());
    886884                }
    887885                if(!::IsWindow(hwnd))
     
    914912ULONG Win32BaseWindow::MsgQuit()
    915913{
    916   return SendInternalMessageA(WM_QUIT, 0, 0);
     914  return SendMessageA(getWindowHandle(), WM_QUIT, 0, 0);
    917915}
    918916//******************************************************************************
     
    920918ULONG Win32BaseWindow::MsgClose()
    921919{
    922   return SendInternalMessageA(WM_CLOSE,0,0);
     920  return SendMessageA(getWindowHandle(), WM_CLOSE,0,0);
    923921}
    924922//******************************************************************************
     
    940938            {
    941939                    /* Notify the parent window only */
    942                     getParent()->SendMessageA(WM_PARENTNOTIFY, MAKEWPARAM(WM_DESTROY, getWindowId()), (LPARAM)getWindowHandle());
     940                    SendMessageA(getParent()->getWindowHandle(), WM_PARENTNOTIFY, MAKEWPARAM(WM_DESTROY, getWindowId()), (LPARAM)getWindowHandle());
    943941            }
    944942////            else    DebugInt3();
    945943        }
    946944    }
    947     SendInternalMessageA(WM_DESTROY, 0, 0);
     945    SendMessageA(getWindowHandle(),WM_DESTROY, 0, 0);
    948946    if(::IsWindow(hwnd) == FALSE) {
    949947        //object already destroyed, so return immediately
    950948        return 1;
    951949    }
    952     SendInternalMessageA(WM_NCDESTROY, 0, 0);
     950    SendMessageA(getWindowHandle(),WM_NCDESTROY, 0, 0);
    953951
    954952    TIMER_KillTimerFromWindow(getWindowHandle());
     
    979977    else dwStyle |= WS_DISABLED;
    980978
    981     return SendInternalMessageA(WM_ENABLE, fEnable, 0);
     979    return SendMessageA(getWindowHandle(),WM_ENABLE, fEnable, 0);
    982980}
    983981//******************************************************************************
     
    999997
    1000998    //already sent from ShowWindow
    1001 ////    return SendInternalMessageA(WM_SHOWWINDOW, fShow, 0);
     999////    return SendMessageA(getWindowHandle(),WM_SHOWWINDOW, fShow, 0);
    10021000    return 0;
    10031001}
     
    10111009        return 0;
    10121010
    1013     return SendInternalMessageA(WM_WINDOWPOSCHANGING, 0, lp);
     1011    return SendMessageA(getWindowHandle(),WM_WINDOWPOSCHANGING, 0, lp);
    10141012}
    10151013//******************************************************************************
     
    10221020        return 1;
    10231021
    1024     return SendInternalMessageA(WM_WINDOWPOSCHANGED, 0, lp);
     1022    return SendMessageA(getWindowHandle(),WM_WINDOWPOSCHANGED, 0, lp);
    10251023}
    10261024//******************************************************************************
     
    10301028  //According to the SDK docs, the scrollbar handle (lParam) is 0 when the standard
    10311029  //window scrollbars send these messages
    1032   return SendInternalMessageA(msg, MAKELONG(scrollCode, scrollPos), 0);
     1030  return SendMessageA(getWindowHandle(),msg, MAKELONG(scrollCode, scrollPos), 0);
    10331031}
    10341032//******************************************************************************
     
    10461044    //default processing is cancelled
    10471045    //TODO: According to Wine we should proceed anyway if window is sysmodal
    1048     if(SendInternalMessageA(WM_NCACTIVATE, fActivate, 0) == FALSE && !fActivate)
     1046    if(SendMessageA(getWindowHandle(),WM_NCACTIVATE, fActivate, 0) == FALSE && !fActivate)
    10491047    {
    10501048        dprintf(("WARNING: WM_NCACTIVATE return code = FALSE -> cancel processing"));
     
    10551053    {
    10561054        if(fActivate) {//WM_CHILDACTIVE is for activation only
    1057             SendInternalMessageA(WM_CHILDACTIVATE, 0, 0L);
     1055            SendMessageA(getWindowHandle(),WM_CHILDACTIVATE, 0, 0L);
    10581056        }
    10591057        return 0;
    10601058    }
    10611059
    1062     return SendInternalMessageA(WM_ACTIVATE, MAKELONG((fActivate) ? WA_ACTIVE : WA_INACTIVE, fMinimized), hwnd);
     1060    return SendMessageA(getWindowHandle(),WM_ACTIVATE, MAKELONG((fActivate) ? WA_ACTIVE : WA_INACTIVE, fMinimized), hwnd);
    10631061}
    10641062//******************************************************************************
     
    10741072    //default processing is cancelled
    10751073    //TODO: According to Wine we should proceed anyway if window is sysmodal
    1076     if(SendInternalMessageA(WM_NCACTIVATE, fActivate, 0) == FALSE && !fActivate)
     1074    if(SendMessageA(getWindowHandle(),WM_NCACTIVATE, fActivate, 0) == FALSE && !fActivate)
    10771075    {
    10781076        dprintf(("WARNING: WM_NCACTIVATE return code = FALSE -> cancel processing"));
     
    10831081    {
    10841082        if(fActivate) {//WM_CHILDACTIVE is for activation only
    1085             SendInternalMessageA(WM_CHILDACTIVATE, 0, 0L);
     1083            SendMessageA(getWindowHandle(),WM_CHILDACTIVATE, 0, 0L);
    10861084        }
    10871085        return 0;
     
    10941092ULONG Win32BaseWindow::DispatchMsgA(MSG *msg)
    10951093{
    1096     return SendInternalMessageA(msg->message, msg->wParam, msg->lParam);
     1094    return SendMessageA(getWindowHandle(),msg->message, msg->wParam, msg->lParam);
    10971095}
    10981096//******************************************************************************
     
    11001098ULONG Win32BaseWindow::DispatchMsgW(MSG *msg)
    11011099{
    1102     return SendInternalMessageW(msg->message, msg->wParam, msg->lParam);
     1100    return SendMessageW(getWindowHandle(), msg->message, msg->wParam, msg->lParam);
    11031101}
    11041102//******************************************************************************
     
    11111109    }
    11121110
    1113     return  SendInternalMessageA(WM_SETFOCUS, hwnd, 0);
     1111    return SendMessageA(getWindowHandle(),WM_SETFOCUS, hwnd, 0);
    11141112}
    11151113//******************************************************************************
     
    11211119        return 0;
    11221120    }
    1123     return  SendInternalMessageA(WM_KILLFOCUS, hwnd, 0);
     1121    return  SendMessageA(getWindowHandle(),WM_KILLFOCUS, hwnd, 0);
    11241122}
    11251123//******************************************************************************
     
    11301128
    11311129    dprintf(("MsgButton %d at (%d,%d)", msg->message, msg->pt.x, msg->pt.y));
    1132     switch(msg->message) {
     1130    switch(msg->message)
     1131    {
    11331132        case WM_LBUTTONDBLCLK:
    11341133        case WM_RBUTTONDBLCLK:
     
    11671166        if (hwndTop && (getWindowHandle() != hwndActive))
    11681167        {
    1169                 LONG ret = SendInternalMessageA(WM_MOUSEACTIVATE, hwndTop,
    1170                                                 MAKELONG( lastHitTestVal, msg->message) );
     1168                LONG ret = SendMessageA(getWindowHandle(),WM_MOUSEACTIVATE, hwndTop,
     1169                                        MAKELONG( lastHitTestVal, msg->message) );
    11711170
    11721171                dprintf2(("WM_MOUSEACTIVATE returned %d", ret));
     
    11921191    }
    11931192
    1194     SendInternalMessageA(WM_SETCURSOR, getWindowHandle(), MAKELONG(lastHitTestVal, msg->message));
    1195 
    1196     return  SendInternalMessageA(msg->message, msg->wParam, msg->lParam);
     1193    SendMessageA(getWindowHandle(),WM_SETCURSOR, getWindowHandle(), MAKELONG(lastHitTestVal, msg->message));
     1194
     1195    switch(msg->message)
     1196    {
     1197        case WM_LBUTTONDOWN:
     1198        case WM_MBUTTONDOWN:
     1199        case WM_RBUTTONDOWN:
     1200        {
     1201                if (getParent())
     1202                {
     1203                    POINTS pt = MAKEPOINTS(msg->lParam);
     1204                    POINT point;
     1205
     1206                    point.x = pt.x;
     1207                    point.y = pt.y;
     1208                    MapWindowPoints(getWindowHandle(), getParent()->getWindowHandle(), &point, 1);
     1209                    NotifyParent(msg->message, msg->wParam, MAKELPARAM(point.x,point.y));
     1210                }
     1211                break;
     1212        }
     1213    }
     1214    return SendMessageA(getWindowHandle(),msg->message, msg->wParam, msg->lParam);
    11971215}
    11981216//******************************************************************************
     
    12011219{
    12021220    if (select && IsWindowIconic())
    1203         return SendInternalMessageA(WM_PAINTICON, 1, 0);
     1221        return SendMessageA(getWindowHandle(),WM_PAINTICON, 1, 0);
    12041222    else
    1205         return SendInternalMessageA(WM_PAINT, 0, 0);
     1223        return SendMessageA(getWindowHandle(),WM_PAINT, 0, 0);
    12061224}
    12071225//******************************************************************************
     
    12181236
    12191237    if(IsWindowIconic())
    1220         rc = SendInternalMessageA(WM_ICONERASEBKGND, hdcErase, 0);
     1238        rc = SendMessageA(getWindowHandle(),WM_ICONERASEBKGND, hdcErase, 0);
    12211239    else
    1222         rc = SendInternalMessageA(WM_ERASEBKGND, hdcErase, 0);
     1240        rc = SendMessageA(getWindowHandle(),WM_ERASEBKGND, hdcErase, 0);
    12231241    if (hdc == 0)
    12241242        ReleaseDC(getWindowHandle(), hdcErase);
     
    12321250    //SDK: WM_SETCURSOR is not sent if the mouse is captured
    12331251    if(GetCapture() == 0) {
    1234         SendInternalMessageA(WM_SETCURSOR, Win32Hwnd, MAKELONG(lastHitTestVal, msg->message));
     1252        SendMessageA(getWindowHandle(),WM_SETCURSOR, Win32Hwnd, MAKELONG(lastHitTestVal, msg->message));
    12351253    }
    12361254
    12371255    //translated message == WM_(NC)MOUSEMOVE
    1238     return SendInternalMessageA(msg->message, msg->wParam, msg->lParam);
     1256    return SendMessageA(getWindowHandle(),msg->message, msg->wParam, msg->lParam);
    12391257}
    12401258//******************************************************************************
     
    12641282    hrgn = CreateRectRgnIndirect(pUpdateRect);
    12651283
    1266     rc = SendInternalMessageA(WM_NCPAINT, hrgn, 0);
     1284    rc = SendMessageA(getWindowHandle(),WM_NCPAINT, hrgn, 0);
    12671285
    12681286    DeleteObject(hrgn);
     
    13551373ULONG Win32BaseWindow::MsgSetText(LPSTR lpsz, LONG cch)
    13561374{
    1357     return SendInternalMessageA(WM_SETTEXT, 0, (LPARAM)lpsz);
     1375    return SendMessageA(getWindowHandle(),WM_SETTEXT, 0, (LPARAM)lpsz);
    13581376}
    13591377//******************************************************************************
     
    13611379ULONG Win32BaseWindow::MsgGetTextLength()
    13621380{
    1363     return SendInternalMessageA(WM_GETTEXTLENGTH, 0, 0);
     1381    return SendMessageA(getWindowHandle(),WM_GETTEXTLENGTH, 0, 0);
    13641382}
    13651383//******************************************************************************
     
    13671385void Win32BaseWindow::MsgGetText(char *wndtext, ULONG textlength)
    13681386{
    1369     SendInternalMessageA(WM_GETTEXT, textlength, (LPARAM)wndtext);
     1387    SendMessageA(getWindowHandle(),WM_GETTEXT, textlength, (LPARAM)wndtext);
    13701388}
    13711389//******************************************************************************
     
    15081526   */
    15091527  if ( uFlags & PRF_ERASEBKGND)
    1510     SendInternalMessageA(WM_ERASEBKGND, (WPARAM)hdc, 0);
     1528    SendMessageA(getWindowHandle(),WM_ERASEBKGND, (WPARAM)hdc, 0);
    15111529
    15121530  /*
     
    15141532   */
    15151533  if ( uFlags & PRF_CLIENT)
    1516     SendInternalMessageA(WM_PRINTCLIENT, (WPARAM)hdc, PRF_CLIENT);
     1534    SendMessageA(getWindowHandle(),WM_PRINTCLIENT, (WPARAM)hdc, PRF_CLIENT);
    15171535
    15181536
     
    16441662        {
    16451663            if(getParent()) {
    1646                 LRESULT rc = getParent()->SendInternalMessageA(WM_MOUSEACTIVATE, wParam, lParam );
     1664                LRESULT rc = SendMessageA(getParent()->getWindowHandle(), WM_MOUSEACTIVATE, wParam, lParam );
    16471665                if(rc)  return rc;
    16481666            }
     
    16661684        {
    16671685            if(getParent()) {
    1668                 LRESULT rc = getParent()->SendInternalMessageA(WM_SETCURSOR, wParam, lParam);
     1686                LRESULT rc = SendMessageA(getParent()->getWindowHandle(), WM_SETCURSOR, wParam, lParam);
    16691687                if(rc)  return rc;
    16701688            }
     
    17251743        if (!(wpos->flags & SWP_NOMOVE) && !(wpos->flags & SWP_NOCLIENTMOVE))
    17261744        {
    1727             SendInternalMessageA(WM_MOVE, 0, MAKELONG(rectClient.left,rectClient.top));
     1745            SendMessageA(getWindowHandle(),WM_MOVE, 0, MAKELONG(rectClient.left,rectClient.top));
    17281746        }
    17291747        if (!(wpos->flags & SWP_NOSIZE) && !(wpos->flags & SWP_NOCLIENTSIZE))
     
    17331751            if (dwStyle & WS_MINIMIZE) wp = SIZE_MINIMIZED;
    17341752
    1735             SendInternalMessageA(WM_SIZE, wp, MAKELONG(rectClient.right  - rectClient.left,
     1753            SendMessageA(getWindowHandle(),WM_SIZE, wp, MAKELONG(rectClient.right  - rectClient.left,
    17361754                                                       rectClient.bottom - rectClient.top));
    17371755        }
     
    18721890             else
    18731891                if( wParam == VK_ESCAPE && (GetKeyState(VK_SHIFT) & 0x8000))
    1874                     SendMessageW(WM_SYSCOMMAND, SC_KEYMENU, VK_SPACE );
     1892                    SendMessageW(getWindowHandle(), WM_SYSCOMMAND, SC_KEYMENU, VK_SPACE );
    18751893
    18761894        Win32BaseWindow *siblingWindow;
     
    19041922            // key matches siblings mnemonic, send mouseclick
    19051923            if (mnemonic == (char) wParam) {
    1906                 siblingWindow->SendInternalMessageA (BM_CLICK, 0, 0);
     1924                ::SendMessageA(siblingWindow->getWindowHandle(), BM_CLICK, 0, 0);
    19071925            }
    19081926            sibling = siblingWindow->GetNextWindow (GW_HWNDNEXT);
     
    19381956                        ::SendMessageW(GetParent(), Msg, wParam, lParam );
    19391957                }
    1940                 else    SendMessageA(WM_SYSCOMMAND, (WPARAM)SC_KEYMENU, (LPARAM)(DWORD)wParam );
     1958                else    ::SendMessageA(getWindowHandle(), WM_SYSCOMMAND, (WPARAM)SC_KEYMENU, (LPARAM)(DWORD)wParam );
    19411959        }
    19421960#if 0
     
    19561974    case WM_CONTEXTMENU:
    19571975        if ((dwStyle & WS_CHILD) && getParent())
    1958           getParent()->SendInternalMessageA(WM_CONTEXTMENU,wParam,lParam);
     1976          SendMessageA(getParent()->getWindowHandle(), WM_CONTEXTMENU,wParam,lParam);
    19591977        return 0;
    19601978
     
    20292047
    20302048    case WM_HELP:
    2031         if (getParent()) getParent()->SendInternalMessageA(Msg,wParam,lParam);
     2049        if (getParent()) SendMessageA(getParent()->getWindowHandle(), Msg,wParam,lParam);
    20322050        break;
    20332051
     
    21212139//******************************************************************************
    21222140//******************************************************************************
    2123 LRESULT Win32BaseWindow::SendMessageA(ULONG Msg, WPARAM wParam, LPARAM lParam)
    2124 {
    2125     //if the destination window is created by this process & thread, call window proc directly
    2126     if(dwProcessId == currentProcessId && dwThreadId == GetCurrentThreadId()) {
    2127         return SendInternalMessageA(Msg, wParam, lParam);
    2128     }
    2129     //otherwise use WinSendMsg to send it to the right process/thread
    2130     dprintf(("SendMessages (inter-process) %x %x %x %x", getWindowHandle(), Msg, wParam, lParam));
    2131     return OSLibSendMessage(getOS2WindowHandle(), Msg, wParam, lParam, FALSE);
    2132 }
    2133 //******************************************************************************
    2134 //******************************************************************************
    2135 LRESULT Win32BaseWindow::SendMessageW(ULONG Msg, WPARAM wParam, LPARAM lParam)
    2136 {
    2137     //if the destination window is created by this process & thread, call window proc directly
    2138     if(dwProcessId == currentProcessId && dwThreadId == GetCurrentThreadId()) {
    2139         return SendInternalMessageW(Msg, wParam, lParam);
    2140     }
    2141     //otherwise use WinSendMsg to send it to the right process/thread
    2142     return OSLibSendMessage(getOS2WindowHandle(), Msg, wParam, lParam, TRUE);
    2143 }
    2144 //******************************************************************************
    2145 //Called as a result of an OS/2 message or called from a class method
    2146 //******************************************************************************
    2147 LRESULT Win32BaseWindow::SendInternalMessageA(ULONG Msg, WPARAM wParam, LPARAM lParam)
    2148 {
    2149  LRESULT rc;
    2150  HWND    hwnd = getWindowHandle();
    2151  BOOL    fInternalMsgBackup = fInternalMsg;
    2152 
    2153   //if the destination window was created by this process & thread, call window proc directly
    2154   if(dwProcessId != currentProcessId || dwThreadId != GetCurrentThreadId()) {
    2155         dprintf(("SendMessages (inter-process) %x %x %x %x", getWindowHandle(), Msg, wParam, lParam));
    2156         return OSLibSendMessage(getOS2WindowHandle(), Msg, wParam, lParam, FALSE);
    2157   }
    2158 
    2159   DebugPrintMessage(getWindowHandle(), Msg, wParam, lParam, FALSE, TRUE);
    2160 
    2161   CallWindowHookProc(WH_CALLWNDPROC, Msg, wParam, lParam, FALSE);
    2162 
    2163   fInternalMsg = TRUE;
    2164   switch(Msg)
    2165   {
    2166         case WM_CREATE:
    2167         {
    2168                 if(CallWindowProcA(win32wndproc, getWindowHandle(), WM_CREATE, 0, lParam) == -1) {
    2169                         dprintf(("WM_CREATE returned -1\n"));
    2170                         rc = -1; //don't create window
    2171                         break;
    2172                 }
    2173                 rc = 0;
    2174                 break;
    2175         }
    2176         case WM_LBUTTONDOWN:
    2177         case WM_MBUTTONDOWN:
    2178         case WM_RBUTTONDOWN:
    2179         {
    2180                 if (getParent())
    2181                 {
    2182                     POINTS pt = MAKEPOINTS(lParam);
    2183                     POINT point;
    2184 
    2185                     point.x = pt.x;
    2186                     point.y = pt.y;
    2187                     MapWindowPoints(getWindowHandle(), getParent()->getWindowHandle(), &point, 1);
    2188                     NotifyParent(Msg,wParam,MAKELPARAM(point.x,point.y));
    2189                 }
    2190                 rc = win32wndproc(getWindowHandle(), Msg, wParam, lParam);
    2191                 break;
    2192         }
    2193         case WM_NCHITTEST:
    2194                 rc = lastHitTestVal = win32wndproc(getWindowHandle(), WM_NCHITTEST, wParam, lParam);
    2195                 break;
    2196 
    2197         case WM_DESTROY:
    2198                 rc = win32wndproc(getWindowHandle(), WM_DESTROY, 0, 0);
    2199                 break;
    2200 
    2201         default:
    2202                 rc = CallWindowProcA(win32wndproc, getWindowHandle(), Msg, wParam, lParam);
    2203                 break;
    2204   }
    2205   if(!::IsWindow(hwnd)) {
    2206         //window might have been destroyed by now. (this pointer invalid)
    2207         //we must return immediately
    2208         //(MS Visual C++ install heap corruption)
    2209         //TODO: could happen in several places here!!!!
    2210         return rc;
    2211   }
    2212   fInternalMsg = fInternalMsgBackup;
    2213   dprintf2(("SendMessageA %x %x %x %x returned %x", getWindowHandle(), Msg, wParam, lParam, rc));
    2214   return rc;
    2215 }
    2216 //******************************************************************************
    2217 //Called as a result of an OS/2 message or called from a class method
    2218 //******************************************************************************
    2219 LRESULT Win32BaseWindow::SendInternalMessageW(ULONG Msg, WPARAM wParam, LPARAM lParam)
    2220 {
    2221  LRESULT rc;
    2222  HWND    hwnd = getWindowHandle();
    2223  BOOL    fInternalMsgBackup = fInternalMsg;
    2224 
    2225   //if the destination window was created by this process & thread, call window proc directly
    2226   if(dwProcessId != currentProcessId || dwThreadId != GetCurrentThreadId()) {
    2227         dprintf(("SendMessages (inter-process) %x %x %x %x", getWindowHandle(), Msg, wParam, lParam));
    2228         return OSLibSendMessage(getOS2WindowHandle(), Msg, wParam, lParam, FALSE);
    2229   }
    2230 
    2231   DebugPrintMessage(getWindowHandle(), Msg, wParam, lParam, TRUE, TRUE);
    2232 
    2233   CallWindowHookProc(WH_CALLWNDPROC, Msg, wParam, lParam, TRUE);
    2234 
    2235   fInternalMsg = TRUE;
    2236   switch(Msg)
    2237   {
    2238         case WM_CREATE:
    2239         {
    2240                 if(CallWindowProcW(win32wndproc, getWindowHandle(), WM_CREATE, 0, lParam) == -1) {
    2241                         dprintf(("WM_CREATE returned -1\n"));
    2242                         rc = -1; //don't create window
    2243                         break;
    2244                 }
    2245                 rc = 0;
    2246                 break;
    2247         }
    2248         case WM_LBUTTONDOWN:
    2249         case WM_MBUTTONDOWN:
    2250         case WM_RBUTTONDOWN:
    2251                 NotifyParent(Msg, wParam, lParam);
    2252                 rc = win32wndproc(getWindowHandle(), Msg, wParam, lParam);
    2253                 break;
    2254 
    2255         case WM_NCHITTEST:
    2256                 rc = lastHitTestVal = win32wndproc(getWindowHandle(), WM_NCHITTEST, wParam, lParam);
    2257                 break;
    2258 
    2259         case WM_DESTROY:
    2260                 rc = win32wndproc(getWindowHandle(), WM_DESTROY, 0, 0);
    2261                 break;
    2262         default:
    2263                 rc = CallWindowProcW(win32wndproc, getWindowHandle(), Msg, wParam, lParam);
    2264                 break;
    2265   }
    2266   if(!::IsWindow(hwnd)) {
    2267         //window might have been destroyed by now. (this pointer invalid)
    2268         //we must return immediately
    2269         //(MS Visual C++ install heap corruption)
    2270         //TODO: could happen in several places here!!!!
    2271         return rc;
    2272   }
    2273   fInternalMsg = fInternalMsgBackup;
    2274   dprintf2(("SendMessageW %x %x %x %x returned %x", getWindowHandle(), Msg, wParam, lParam, rc));
    2275   return rc;
    2276 }
    2277 //******************************************************************************
    2278 //******************************************************************************
    2279 void Win32BaseWindow::CallWindowHookProc(ULONG hooktype, ULONG Msg, WPARAM wParam, LPARAM lParam, BOOL fUnicode)
    2280 {
    2281  CWPSTRUCT cwp;
    2282 
    2283     cwp.lParam  = lParam;
    2284     cwp.wParam  = wParam;
    2285     cwp.message = Msg;
    2286     cwp.hwnd    = getWindowHandle();
    2287 
    2288     switch(hooktype) {
    2289     case WH_CALLWNDPROC:
    2290         if(fUnicode) {
    2291              HOOK_CallHooksW(WH_CALLWNDPROC, HC_ACTION, 1, (LPARAM)&cwp);
    2292         }
    2293         else HOOK_CallHooksA(WH_CALLWNDPROC, HC_ACTION, 1, (LPARAM)&cwp);
    2294         break;
    2295     }
    2296 }
    2297 //******************************************************************************
    2298 //TODO: Do this more efficiently
    2299 //******************************************************************************
    2300 LRESULT Win32BaseWindow::BroadcastMessageA(int type, UINT msg, WPARAM wParam, LPARAM lParam)
    2301 {
    2302  Win32BaseWindow *window;
    2303  HWND hwnd = WNDHANDLE_MAGIC_HIGHWORD;
    2304 
    2305     dprintf(("BroadCastMessageA %x %x %x %s", msg, wParam, lParam, (type == BROADCAST_SEND) ? "Send" : "Post"));
    2306 
    2307     for(int i=0;i<MAX_WINDOW_HANDLES;i++) {
    2308         window = GetWindowFromHandle(hwnd++);
    2309         if(window) {
    2310             if ((window->getStyle() & WS_POPUP) || ((window->getStyle() & WS_CAPTION) == WS_CAPTION))
    2311             {
    2312                 if(type == BROADCAST_SEND) {
    2313                         ::SendMessageA(window->getWindowHandle(), msg, wParam, lParam);
    2314                 }
    2315                 else    PostMessageA(window->getWindowHandle(), msg, wParam, lParam);
    2316             }
    2317             RELEASE_WNDOBJ(window);
    2318         }
    2319     }
    2320     return 0;
    2321 }
    2322 //******************************************************************************
    2323 //TODO: Do this more efficiently
    2324 //******************************************************************************
    2325 LRESULT Win32BaseWindow::BroadcastMessageW(int type, UINT msg, WPARAM wParam, LPARAM lParam)
    2326 {
    2327  Win32BaseWindow *window;
    2328  HWND hwnd = WNDHANDLE_MAGIC_HIGHWORD;
    2329 
    2330     dprintf(("BroadCastMessageW %x %x %x %s", msg, wParam, lParam, (type == BROADCAST_SEND) ? "Send" : "Post"));
    2331 
    2332     for(int i=0;i<MAX_WINDOW_HANDLES;i++) {
    2333         window = GetWindowFromHandle(hwnd++);
    2334         if(window) {
    2335             if ((window->getStyle() & WS_POPUP) || ((window->getStyle() & WS_CAPTION) == WS_CAPTION))
    2336             {
    2337                 if(type == BROADCAST_SEND) {
    2338                         ::SendMessageW(window->getWindowHandle(), msg, wParam, lParam);
    2339                 }
    2340                 else    PostMessageW(window->getWindowHandle(), msg, wParam, lParam);
    2341             }
    2342             RELEASE_WNDOBJ(window);
    2343         }
    2344     }
    2345     return 0;
    2346 }
    2347 //******************************************************************************
    2348 //******************************************************************************
    23492141void Win32BaseWindow::NotifyParent(UINT Msg, WPARAM wParam, LPARAM lParam)
    23502142{
     
    23592151                parentwindow = window->getParent();
    23602152                if(parentwindow) {
    2361                         parentwindow->SendInternalMessageA(WM_PARENTNOTIFY, MAKEWPARAM(Msg, getWindowId()), lParam );
     2153                    SendMessageA(parentwindow->getWindowHandle(), WM_PARENTNOTIFY, MAKEWPARAM(Msg, getWindowId()), lParam );
    23622154                }
    23632155        }
     
    24912283    if (showFlag != wasVisible)
    24922284    {
    2493         SendInternalMessageA(WM_SHOWWINDOW, showFlag, 0 );
     2285        SendMessageA(getWindowHandle(),WM_SHOWWINDOW, showFlag, 0 );
    24942286        if (!::IsWindow( getWindowHandle() )) goto END;
    24952287    }
     
    25172309            wParam = SIZE_MINIMIZED;
    25182310
    2519         SendInternalMessageA(WM_SIZE, wParam,
     2311        SendMessageA(getWindowHandle(),WM_SIZE, wParam,
    25202312                     MAKELONG(rectClient.right-rectClient.left,
    25212313                              rectClient.bottom-rectClient.top));
    2522         SendInternalMessageA(WM_MOVE,0,MAKELONG(rectClient.left,rectClient.top));
     2314        SendMessageA(getWindowHandle(),WM_MOVE,0,MAKELONG(rectClient.left,rectClient.top));
    25232315    }
    25242316//testestest
     
    27212513    rectWindow.top    += dy;
    27222514    rectWindow.bottom += dy;
    2723     SendInternalMessageA(WM_MOVE, 0, MAKELONG(rectClient.left, rectClient.top));
     2515    SendMessageA(getWindowHandle(),WM_MOVE, 0, MAKELONG(rectClient.left, rectClient.top));
    27242516    return TRUE;
    27252517}
     
    27512543    WINDOWPOS wpOld = *wpos;
    27522544    if(!(wpos->flags & SWP_NOSENDCHANGING))
    2753         SendInternalMessageA(WM_WINDOWPOSCHANGING, 0, (LPARAM)wpos);
     2545        SendMessageA(getWindowHandle(),WM_WINDOWPOSCHANGING, 0, (LPARAM)wpos);
    27542546
    27552547    if ((wpos->hwndInsertAfter != wpOld.hwndInsertAfter) ||
     
    27592551         SetWindowPos(wpos->hwndInsertAfter, wpos->x, wpos->y, wpos->cx, wpos->cy, wpos->flags | SWP_NOSENDCHANGING);
    27602552    }
    2761     else SendInternalMessageA(WM_WINDOWPOSCHANGED, 0, (LPARAM)wpos);
     2553    else SendMessageA(getWindowHandle(),WM_WINDOWPOSCHANGED, 0, (LPARAM)wpos);
    27622554
    27632555    //Calculate invalid areas
     
    28822674        {
    28832675             /* Notify the parent window only */
    2884              getParent()->SendMessageA(WM_PARENTNOTIFY, MAKEWPARAM(WM_DESTROY, getWindowId()), (LPARAM)getWindowHandle());
     2676             SendMessageA(getParent()->getWindowHandle(), WM_PARENTNOTIFY, MAKEWPARAM(WM_DESTROY, getWindowId()), (LPARAM)getWindowHandle());
    28852677             if(!::IsWindow(hwnd) )
    28862678             {
     
    29062698    if (NULL != owner)
    29072699    {
    2908       if (owner->getLastActive() == hwnd)
    2909         owner->setLastActive( owner->getWindowHandle() );
     2700        if (owner->getLastActive() == hwnd)
     2701            owner->setLastActive( owner->getWindowHandle() );
    29102702    }
    29112703 
     
    30962888//******************************************************************************
    30972889//TODO: Should not enumerate children that are created during the enumeration!
     2890//TODO: Do this more efficiently
    30982891//******************************************************************************
    30992892BOOL Win32BaseWindow::EnumChildWindows(WNDENUMPROC lpfn, LPARAM lParam)
     
    31762969BOOL Win32BaseWindow::EnumWindows(WNDENUMPROC lpfn, LPARAM lParam)
    31772970{
    3178  Win32BaseWindow *child = 0;
    3179  BOOL   rc;
    3180  HWND   hwnd;
     2971 Win32BaseWindow *window;
     2972 BOOL             rc;
     2973 HWND             hwnd = WNDHANDLE_MAGIC_HIGHWORD;
    31812974
    31822975    dprintf(("EnumWindows %x %x", lpfn, lParam));
    31832976
    3184     for (child = (Win32BaseWindow *)getFirstChild(); child; child = (Win32BaseWindow *)child->getNextChild())
    3185     {
    3186         hwnd = child->getWindowHandle();
    3187 
    3188         dprintf2(("EnumWindows: Found Window %x", child->getWindowHandle()));
    3189         if((rc = lpfn(child->getWindowHandle(), lParam)) == FALSE) {
    3190             break;
    3191         }
    3192     }
     2977    for(int i=0;i<MAX_WINDOW_HANDLES;i++)
     2978    {
     2979        window = GetWindowFromHandle(hwnd++);
     2980        if(window)
     2981        {
     2982            if ((window->getStyle() & WS_POPUP) || ((window->getStyle() & WS_CAPTION) == WS_CAPTION))
     2983            {
     2984                dprintf2(("EnumWindows: Found Window %x", window->getWindowHandle()));
     2985                if((rc = lpfn(window->getWindowHandle(), lParam)) == FALSE) {
     2986                    break;
     2987                }
     2988            }
     2989            RELEASE_WNDOBJ(window);
     2990        }
     2991    }
     2992    if(window) RELEASE_WNDOBJ(window);
    31932993    return TRUE;
    31942994}
     
    35233323    rc = (getStyle() & WS_DISABLED) != 0;
    35243324    if(rc && !fEnable) {
    3525         SendMessageA(WM_CANCELMODE, 0, 0);
     3325        SendMessageA(getWindowHandle(), WM_CANCELMODE, 0, 0);
    35263326    }
    35273327    OSLibWinEnableWindow(OS2HwndFrame, fEnable);
     
    36243424{
    36253425    //if the destination window is created by this process, send message
    3626     if(dwProcessId == currentProcessId) {
     3426    if(dwProcessId == currentProcessId)
     3427    {
    36273428        if(fUnicode) {
    3628              return SendInternalMessageW(WM_GETTEXTLENGTH,0,0);
    3629         }
    3630         else return SendInternalMessageA(WM_GETTEXTLENGTH,0,0);
     3429             return SendMessageW(getWindowHandle(), WM_GETTEXTLENGTH,0,0);
     3430        }
     3431        else return SendMessageA(getWindowHandle(), WM_GETTEXTLENGTH,0,0);
    36313432    }
    36323433    //else get data directory from window structure
     
    36423443    //if the destination window is created by this process, send message
    36433444    if(dwProcessId == currentProcessId) {
    3644         return SendInternalMessageA(WM_GETTEXT,(WPARAM)cch,(LPARAM)lpsz);
     3445        return SendMessageA(getWindowHandle(),WM_GETTEXT,(WPARAM)cch,(LPARAM)lpsz);
    36453446    }
    36463447 
     
    36593460    //if the destination window is created by this process, send message
    36603461    if(dwProcessId == currentProcessId) {
    3661         return SendInternalMessageW(WM_GETTEXT,(WPARAM)cch,(LPARAM)lpsz);
     3462        return ::SendMessageW(getWindowHandle(), WM_GETTEXT,(WPARAM)cch,(LPARAM)lpsz);
    36623463    }
    36633464    //else get data directory from window structure
    3664   if (!lpsz || !cch)
    3665     return 0;
    3666   if (!windowNameW)
    3667     lpsz[0] = 0;
    3668   else
    3669     memcpy(lpsz, windowNameW, min( sizeof(WCHAR) * (windowNameLength+1), cch));
     3465    if (!lpsz || !cch)
     3466        return 0;
     3467    if (!windowNameW)
     3468        lpsz[0] = 0;
     3469    else
     3470        memcpy(lpsz, windowNameW, min( sizeof(WCHAR) * (windowNameLength+1), cch));
    36703471           
    3671   return min(windowNameLength, cch);
     3472    return min(windowNameLength, cch);
    36723473}
    36733474//******************************************************************************
     
    36763477BOOL Win32BaseWindow::SetWindowTextA(LPSTR lpsz)
    36773478{
    3678     return SendInternalMessageA(WM_SETTEXT,0,(LPARAM)lpsz);
     3479    return SendMessageA(getWindowHandle(),WM_SETTEXT,0,(LPARAM)lpsz);
    36793480}
    36803481//******************************************************************************
     
    36823483BOOL Win32BaseWindow::SetWindowTextW(LPWSTR lpsz)
    36833484{
    3684     return SendInternalMessageW(WM_SETTEXT,0,(LPARAM)lpsz);
     3485    return SendMessageW(getWindowHandle(), WM_SETTEXT,0,(LPARAM)lpsz);
    36853486}
    36863487//******************************************************************************
     
    37023503                ss.styleNew = value;
    37033504                dprintf(("SetWindowLong GWL_EXSTYLE %x old %x new style %x", getWindowHandle(), dwExStyle, value));
    3704                 SendInternalMessageA(WM_STYLECHANGING,GWL_EXSTYLE,(LPARAM)&ss);
     3505                SendMessageA(getWindowHandle(),WM_STYLECHANGING,GWL_EXSTYLE,(LPARAM)&ss);
    37053506                setExStyle(ss.styleNew);
    3706                 SendInternalMessageA(WM_STYLECHANGED,GWL_EXSTYLE,(LPARAM)&ss);
     3507                SendMessageA(getWindowHandle(),WM_STYLECHANGED,GWL_EXSTYLE,(LPARAM)&ss);
    37073508                oldval = ss.styleOld;
    37083509                break;
     
    37273528                ss.styleOld = getStyle();
    37283529                ss.styleNew = value | (ss.styleOld & WS_CHILD);
    3729                 SendInternalMessageA(WM_STYLECHANGING,GWL_STYLE,(LPARAM)&ss);
     3530                SendMessageA(getWindowHandle(),WM_STYLECHANGING,GWL_STYLE,(LPARAM)&ss);
    37303531                setStyle(ss.styleNew);
    3731                 SendInternalMessageA(WM_STYLECHANGED,GWL_STYLE,(LPARAM)&ss);
     3532                SendMessageA(getWindowHandle(),WM_STYLECHANGED,GWL_STYLE,(LPARAM)&ss);
    37323533                OSLibSetWindowStyle(getOS2FrameWindowHandle(), getOS2WindowHandle(), getStyle(), getExStyle());
    37333534
  • trunk/src/user32/win32wbase.h

    r7765 r7801  
    1 /* $Id: win32wbase.h,v 1.138 2002-01-12 14:09:31 sandervl Exp $ */
     1/* $Id: win32wbase.h,v 1.139 2002-02-05 17:59:01 sandervl Exp $ */
    22/*
    33 * Win32 Window Base Class for OS/2
     
    8282        ULONG           lParam;
    8383} POSTMSG_PACKET;
    84 
    85 #define BROADCAST_SEND          0
    86 #define BROADCAST_POST          1
    8784
    8885#define HAS_DLGFRAME(style,exStyle) \
     
    190187
    191188         LONG   getLastHitTestVal()             { return lastHitTestVal; }
     189         void   setLastHitTestVal(LONG hittest) { lastHitTestVal = hittest; }
    192190
    193191         DWORD  getWindowContextHelpId()        { return contextHelpId; };
     
    323321 SCROLLBAR_INFO *getScrollInfo(int nBar);
    324322
    325        LRESULT  SendMessageA(ULONG msg, WPARAM wParam, LPARAM lParam);
    326        LRESULT  SendMessageW(ULONG msg, WPARAM wParam, LPARAM lParam);
    327 static LRESULT  BroadcastMessageA(int type, UINT msg, WPARAM wParam, LPARAM lParam);
    328 static LRESULT  BroadcastMessageW(int type, UINT msg, WPARAM wParam, LPARAM lParam);
    329        void     CallWindowHookProc(ULONG hooktype, ULONG Msg, WPARAM wParam, LPARAM lParam, BOOL fUnicode = FALSE);
    330 
    331323       LRESULT  DefWindowProcA(UINT Msg, WPARAM wParam, LPARAM lParam);
    332324       LRESULT  DefWindowProcW(UINT msg, WPARAM wParam, LPARAM lParam);
     
    374366        BOOL  CreateWindowExA(CREATESTRUCTA *lpCreateStruct, ATOM classAtom);
    375367#endif
    376        LRESULT  SendInternalMessageA(ULONG msg, WPARAM wParam, LPARAM lParam);
    377        LRESULT  SendInternalMessageW(ULONG msg, WPARAM wParam, LPARAM lParam);
    378368        void    Init();
    379369
     
    417407                 fIsModalDialog:1,
    418408                 fIsModalDialogOwner:1,
    419                  fInternalMsg:1,         //Used to distinguish between messages
    420                                          //sent by PM and those sent by apps
    421409                 fParentChange:1,
    422410                 fDestroyWindowCalled:1, //DestroyWindow was called for this window
  • trunk/src/user32/win32wbasenonclient.cpp

    r7063 r7801  
    1 /* $Id: win32wbasenonclient.cpp,v 1.37 2001-10-15 17:09:04 sandervl Exp $ */
     1/* $Id: win32wbasenonclient.cpp,v 1.38 2002-02-05 17:59:01 sandervl Exp $ */
    22/*
    33 * Win32 Window Base Class for OS/2 (non-client methods)
     
    155155
    156156  if (wParam == HTMINBUTTON)
    157     SendInternalMessageA(WM_SYSCOMMAND,SC_MINIMIZE,*(LPARAM*)&msg.pt);
     157    SendMessageA(getWindowHandle(), WM_SYSCOMMAND,SC_MINIMIZE,*(LPARAM*)&msg.pt);
    158158  else if (wParam == HTMAXBUTTON)
    159     SendInternalMessageA(WM_SYSCOMMAND,IsZoomed(Win32Hwnd) ? SC_RESTORE:SC_MAXIMIZE,*(LPARAM*)&msg.pt);
     159    SendMessageA(getWindowHandle(), WM_SYSCOMMAND,IsZoomed(Win32Hwnd) ? SC_RESTORE:SC_MAXIMIZE,*(LPARAM*)&msg.pt);
    160160  else
    161     SendInternalMessageA(WM_SYSCOMMAND,SC_CONTEXTHELP,*(LPARAM*)&msg.pt);
     161    SendMessageA(getWindowHandle(), WM_SYSCOMMAND,SC_CONTEXTHELP,*(LPARAM*)&msg.pt);
    162162}
    163163//******************************************************************************
     
    192192  ReleaseDC(Win32Hwnd,hdc);
    193193  if (!pressed) return;
    194   SendInternalMessageA(WM_SYSCOMMAND,SC_CLOSE,*(LPARAM*)&msg.pt);
     194  SendMessageA(getWindowHandle(), WM_SYSCOMMAND,SC_CLOSE,*(LPARAM*)&msg.pt);
    195195}
    196196//******************************************************************************
     
    273273            }
    274274            if (GetActiveWindow() == hwndTopParent)
    275                  SendInternalMessageA(WM_SYSCOMMAND,SC_MOVE+HTCAPTION,lParam);
     275                 SendMessageA(getWindowHandle(), WM_SYSCOMMAND,SC_MOVE+HTCAPTION,lParam);
    276276            else dprintf(("ACtive window (%x) != toplevel wnd %x", OSLibWinQueryActiveWindow(), hwndTopParent));
    277277        }
     
    279279            SetActiveWindow();
    280280            if (GetActiveWindow() == hwndTopParent)
    281                  SendInternalMessageA(WM_SYSCOMMAND,SC_MOVE+HTCAPTION,lParam);
     281                 SendMessageA(getWindowHandle(), WM_SYSCOMMAND,SC_MOVE+HTCAPTION,lParam);
    282282            else dprintf(("ACtive window (%x) != wnd %x", OSLibWinQueryActiveWindow(), getWindowHandle()));
    283283        }
     
    288288        if(dwStyle & WS_SYSMENU )
    289289        {
    290             SendInternalMessageA(WM_SYSCOMMAND,SC_MOUSEMENU+HTSYSMENU,lParam);
     290            SendMessageA(getWindowHandle(), WM_SYSCOMMAND,SC_MOUSEMENU+HTSYSMENU,lParam);
    291291        }
    292292        break;
    293293
    294294    case HTMENU:
    295         SendInternalMessageA(WM_SYSCOMMAND,SC_MOUSEMENU,lParam);
     295        SendMessageA(getWindowHandle(), WM_SYSCOMMAND,SC_MOUSEMENU,lParam);
    296296        break;
    297297
    298298    case HTHSCROLL:
    299         SendInternalMessageA(WM_SYSCOMMAND,SC_HSCROLL+HTHSCROLL,lParam);
     299        SendMessageA(getWindowHandle(), WM_SYSCOMMAND,SC_HSCROLL+HTHSCROLL,lParam);
    300300        break;
    301301
    302302    case HTVSCROLL:
    303         SendInternalMessageA(WM_SYSCOMMAND,SC_VSCROLL+HTVSCROLL,lParam);
     303        SendMessageA(getWindowHandle(), WM_SYSCOMMAND,SC_VSCROLL+HTVSCROLL,lParam);
    304304        break;
    305305
     
    323323    case HTBOTTOMRIGHT:
    324324        /* make sure hittest fits into 0xf and doesn't overlap with HTSYSMENU */
    325         SendInternalMessageA(WM_SYSCOMMAND,SC_SIZE+wParam-2,lParam);
     325        SendMessageA(getWindowHandle(), WM_SYSCOMMAND,SC_SIZE+wParam-2,lParam);
    326326        break;
    327327    case HTBORDER:
     
    12071207  if (dwStyle & WS_MINIMIZE)
    12081208  {
    1209     SendInternalMessageA(WM_SYSCOMMAND,SC_RESTORE,lParam);
     1209    SendMessageA(getWindowHandle(), WM_SYSCOMMAND,SC_RESTORE,lParam);
    12101210    return 0;
    12111211  }
     
    12161216      /* stop processing if WS_MAXIMIZEBOX is missing */
    12171217      if (dwStyle & WS_MAXIMIZEBOX)
    1218         SendInternalMessageA(WM_SYSCOMMAND,
     1218        SendMessageA(getWindowHandle(), WM_SYSCOMMAND,
    12191219                      (dwStyle & WS_MAXIMIZE) ? SC_RESTORE : SC_MAXIMIZE,
    12201220                      lParam);
     
    12231223    case HTSYSMENU:
    12241224      if (!(GetClassWord(Win32Hwnd,GCW_STYLE) & CS_NOCLOSE))
    1225         SendInternalMessageA(WM_SYSCOMMAND,SC_CLOSE,lParam);
     1225        SendMessageA(getWindowHandle(), WM_SYSCOMMAND,SC_CLOSE,lParam);
    12261226      break;
    12271227
    12281228    case HTHSCROLL:
    1229       SendInternalMessageA(WM_SYSCOMMAND,SC_HSCROLL+HTHSCROLL,lParam);
     1229      SendMessageA(getWindowHandle(), WM_SYSCOMMAND,SC_HSCROLL+HTHSCROLL,lParam);
    12301230      break;
    12311231
    12321232    case HTVSCROLL:
    1233       SendInternalMessageA(WM_SYSCOMMAND,SC_VSCROLL+HTVSCROLL,lParam);
     1233      SendMessageA(getWindowHandle(), WM_SYSCOMMAND,SC_VSCROLL+HTVSCROLL,lParam);
    12341234      break;
    12351235  }
     
    12491249      if (((GetActiveWindow() == Win32Hwnd) || isMDIChild()) && (dwStyle & WS_SYSMENU))
    12501250      {
    1251         SendInternalMessageA(WM_SYSCOMMAND,SC_MOUSEMENU+HTCAPTION,lParam);
     1251        SendMessageA(getWindowHandle(), WM_SYSCOMMAND,SC_MOUSEMENU+HTCAPTION,lParam);
    12521252      }
    12531253      break;
     
    13451345
    13461346    case SC_CLOSE:
    1347         return SendInternalMessageA(WM_CLOSE,0,0);
     1347        return SendMessageA(getWindowHandle(), WM_CLOSE,0,0);
    13481348
    13491349    case SC_CONTEXTHELP:
  • trunk/src/user32/win32wbasepos.cpp

    r5935 r7801  
    1 /* $Id: win32wbasepos.cpp,v 1.26 2001-06-09 14:50:22 sandervl Exp $ */
     1/* $Id: win32wbasepos.cpp,v 1.27 2002-02-05 17:59:01 sandervl Exp $ */
    22/*
    33 * Win32 Window Base Class for OS/2 (nonclient/position methods)
     
    115115//    }
    116116
    117     SendInternalMessageA(WM_GETMINMAXINFO, 0, (LPARAM)&MinMax );
     117    SendMessageA(getWindowHandle(), WM_GETMINMAXINFO, 0, (LPARAM)&MinMax );
    118118
    119119      /* Some sanity checks */
     
    163163        params.lppos = &winposCopy;
    164164   }
    165    result = SendInternalMessageA(WM_NCCALCSIZE, calcValidRect, (LPARAM)&params );
     165   result = SendMessageA(getWindowHandle(), WM_NCCALCSIZE, calcValidRect, (LPARAM)&params );
    166166
    167167   /* If the application send back garbage, ignore it */
     
    293293        if(getStyle() & WS_MINIMIZE )
    294294        {
    295             if(!SendInternalMessageA(WM_QUERYOPEN, 0, 0L))
     295            if(!SendMessageA(getWindowHandle(), WM_QUERYOPEN, 0, 0L))
    296296                return (SWP_NOSIZE | SWP_NOMOVE);
    297297        }
  • trunk/src/user32/windowmsg.cpp

    r7667 r7801  
    1 /* $Id: windowmsg.cpp,v 1.32 2001-12-21 18:43:59 sandervl Exp $ */
     1/* $Id: windowmsg.cpp,v 1.33 2002-02-05 17:59:02 sandervl Exp $ */
    22/*
    33 * Win32 window message APIs for OS/2
    44 *
    5  * Copyright 1999 Sander van Leeuwen
     5 * Copyright 1999-2001 Sander van Leeuwen
    66 *
    77 * Parts based on Wine Windows code (windows\message.c) 990508
     
    3737
    3838
    39 //******************************************************************************
    40 //******************************************************************************
    41 VOID WIN32API PostQuitMessage( int nExitCode)
    42 {
    43     dprintf(("USER32:  PostQuitMessage\n"));
    44     OSLibWinPostQuitMessage(nExitCode);
    45 }
    4639//******************************************************************************
    4740//******************************************************************************
     
    172165//******************************************************************************
    173166//******************************************************************************
    174 LRESULT WIN32API SendMessageA(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
    175 {
    176   Win32BaseWindow *window;
    177   LRESULT result;
    178 
    179     if (hwnd == HWND_BROADCAST|| hwnd == HWND_TOPMOST)
    180     {
    181         Win32BaseWindow::BroadcastMessageA(BROADCAST_SEND, msg, wParam, lParam);
    182         return TRUE;
    183     }
    184 
    185     window = Win32BaseWindow::GetWindowFromHandle(hwnd);
    186     if(!window) {
    187         dprintf(("SendMessageA, %x %x %x window %x not found", msg, wParam, lParam, hwnd));
    188         return 0;
    189     }
    190     result = window->SendMessageA(msg, wParam, lParam);
    191     RELEASE_WNDOBJ(window);
    192     return result;
    193 }
    194 //******************************************************************************
    195 //******************************************************************************
    196 LRESULT WIN32API SendMessageW(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
    197 {
    198   Win32BaseWindow *window;
    199   LRESULT result;
    200 
    201     if (hwnd == HWND_BROADCAST|| hwnd == HWND_TOPMOST)
    202     {
    203         Win32BaseWindow::BroadcastMessageW(BROADCAST_SEND, msg, wParam, lParam);
    204         return TRUE;
    205     }
    206 
    207     window = Win32BaseWindow::GetWindowFromHandle(hwnd);
    208     if(!window) {
    209         dprintf(("SendMessageW, window %x not found", hwnd));
    210         return 0;
    211     }
    212     result = window->SendMessageW(msg, wParam, lParam);
    213     RELEASE_WNDOBJ(window);
    214     return result;
    215 }
    216 //******************************************************************************
    217 //******************************************************************************
    218 BOOL WIN32API PostMessageA(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
    219 {
    220   Win32BaseWindow *window;
    221   HWND hwndOS2;
    222 
    223     if (hwnd == HWND_BROADCAST) //Not HWND_TOPMOST???
    224     {
    225         Win32BaseWindow::BroadcastMessageA(BROADCAST_POST, msg, wParam, lParam);
    226         return TRUE;
    227     }
    228 
    229     if(hwnd == NULL)
    230         return PostThreadMessageA(GetCurrentThreadId(), msg, wParam, lParam);
    231 
    232     window = Win32BaseWindow::GetWindowFromHandle(hwnd);
    233     if(!window) {
    234         dprintf(("PostMessageA, window %x not found", hwnd));
    235         return FALSE;
    236     }
    237     hwndOS2 = window->getOS2WindowHandle();
    238     RELEASE_WNDOBJ(window);
    239     dprintf(("PostMessageA, %x %x %x %x", hwnd, msg, wParam, lParam));
    240     return OSLibPostMessage(hwndOS2, msg, wParam, lParam, FALSE);
    241 }
    242 //******************************************************************************
    243 //******************************************************************************
    244 BOOL WIN32API PostMessageW(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
    245 {
    246   Win32BaseWindow *window;
    247   HWND hwndOS2;
    248 
    249     if (hwnd == HWND_BROADCAST) //Not HWND_TOPMOST???
    250     {
    251         Win32BaseWindow::BroadcastMessageW(BROADCAST_POST, msg, wParam, lParam);
    252         return TRUE;
    253     }
    254 
    255     if(hwnd == NULL)
    256         return PostThreadMessageW(GetCurrentThreadId(), msg, wParam, lParam);
    257 
    258     window = Win32BaseWindow::GetWindowFromHandle(hwnd);
    259     if(!window) {
    260         dprintf(("PostMessageW, window %x not found", hwnd));
    261         return FALSE;
    262     }
    263     hwndOS2 = window->getOS2WindowHandle();
    264     RELEASE_WNDOBJ(window);
    265     dprintf(("PostMessageW, %x %x %x %x", hwnd, msg, wParam, lParam));
    266     return OSLibPostMessage(hwndOS2, msg, wParam, lParam, TRUE);
    267 }
    268 //******************************************************************************
    269 //******************************************************************************
    270 BOOL WIN32API PostThreadMessageA( DWORD threadid, UINT msg, WPARAM wParam, LPARAM lParam)
    271 {
    272     return OSLibPostThreadMessage(threadid, msg, wParam, lParam, FALSE);
    273 }
    274 //******************************************************************************
    275 //******************************************************************************
    276 BOOL WIN32API PostThreadMessageW( DWORD threadid, UINT msg, WPARAM wParam, LPARAM lParam)
    277 {
    278     return OSLibPostThreadMessage(threadid, msg, wParam, lParam, TRUE);
    279 }
    280 //******************************************************************************
    281 //******************************************************************************
    282167BOOL WIN32API WaitMessage(void)
    283168{
     
    298183    dprintf(("USER32: ReplyMessage %x", result));
    299184    return OSLibWinReplyMessage(result);
     185}
     186//******************************************************************************
     187//******************************************************************************
     188VOID WIN32API PostQuitMessage( int nExitCode)
     189{
     190    dprintf(("USER32:  PostQuitMessage\n"));
     191    OSLibWinPostQuitMessage(nExitCode);
    300192}
    301193//******************************************************************************
     
    323215  dprintf(("USER32:  SetMessageQueue\n"));
    324216  return(TRUE);
    325 }
    326 //******************************************************************************
    327 //******************************************************************************
    328 LRESULT WIN32API SendMessageTimeoutA(HWND hwnd, UINT Msg, WPARAM wParam,
    329                     LPARAM lParam, UINT fuFlags, UINT uTimeOut,
    330                     LPDWORD lpdwResult)
    331 {
    332   dprintf(("USER32:  SendMessageTimeoutA, partially implemented\n"));
    333   //ignore fuFlags & wTimeOut
    334   *lpdwResult = SendMessageA(hwnd, Msg, wParam, lParam);
    335   return(TRUE);
    336 }
    337 //******************************************************************************
    338 //******************************************************************************
    339 LRESULT WIN32API SendMessageTimeoutW(HWND hwnd, UINT Msg, WPARAM wParam,
    340                     LPARAM lParam, UINT fuFlags, UINT uTimeOut,
    341                     LPDWORD lpdwResult)
    342 {
    343   dprintf(("USER32:  SendMessageTimeoutW, partially implemented\n"));
    344   return(SendMessageTimeoutA(hwnd, Msg, wParam, lParam, fuFlags, uTimeOut, lpdwResult));
    345 }
    346 //******************************************************************************
    347 //******************************************************************************
    348 BOOL WIN32API SendNotifyMessageA(HWND hwnd, UINT Msg, WPARAM wParam, LPARAM lParam)
    349 {
    350   dprintf(("USER32:  SendNotifyMessageA, not completely implemented\n"));
    351   return(SendMessageA(hwnd, Msg, wParam, lParam));
    352 }
    353 //******************************************************************************
    354 //******************************************************************************
    355 BOOL WIN32API SendNotifyMessageW(HWND hwnd, UINT Msg, WPARAM wParam, LPARAM lParam)
    356 {
    357   dprintf(("USER32:  SendNotifyMessageW, not completely implemented\n"));
    358   return(SendMessageA(hwnd, Msg, wParam, lParam));
    359 }
    360 /*****************************************************************************
    361  * Name      : BOOL WIN32API SendMessageCallbackA
    362  * Purpose   : The SendMessageCallback function sends the specified message to
    363  *             a window or windows. The function calls the window procedure for
    364  *             the specified window and returns immediately. After the window
    365  *             procedure processes the message, the system calls the specified
    366  *             callback function, passing the result of the message processing
    367  *             and an application-defined value to the callback function.
    368  * Parameters: HWND  hwnd                      handle of destination window
    369  *             UINT  uMsg                      message to send
    370  *             WPARAM  wParam                  first message parameter
    371  *             LPARAM  lParam                  second message parameter
    372  *             SENDASYNCPROC  lpResultCallBack function to receive message value
    373  *             DWORD  dwData                   value to pass to callback function
    374  * Variables :
    375  * Result    : If the function succeeds, the return value is TRUE.
    376  *             If the function fails, the return value is FALSE. To get extended
    377  *             error information, call GetLastError.
    378  * Remark    :
    379  * Status    : UNTESTED STUB
    380  *
    381  * Author    : Patrick Haller [Thu, 1998/02/26 11:55]
    382  *****************************************************************************/
    383 
    384 BOOL WIN32API SendMessageCallbackA(HWND          hWnd,
    385                                    UINT          uMsg,
    386                                    WPARAM        wParam,
    387                                    LPARAM        lParam,
    388                                    SENDASYNCPROC lpResultCallBack,
    389                                    DWORD         dwData)
    390 {
    391   dprintf(("USER32:SendMessageCallBackA (%08xh,%08xh,%08xh,%08xh,%08xh,%08x) not implemented.\n",
    392          hWnd,
    393          uMsg,
    394          wParam,
    395          lParam,
    396          lpResultCallBack,
    397          dwData));
    398 
    399   return (FALSE);
    400 }
    401 
    402 
    403 /*****************************************************************************
    404  * Name      : BOOL WIN32API SendMessageCallbackW
    405  * Purpose   : The SendMessageCallback function sends the specified message to
    406  *             a window or windows. The function calls the window procedure for
    407  *             the specified window and returns immediately. After the window
    408  *             procedure processes the message, the system calls the specified
    409  *             callback function, passing the result of the message processing
    410  *             and an application-defined value to the callback function.
    411  * Parameters: HWND  hwnd                      handle of destination window
    412  *             UINT  uMsg                      message to send
    413  *             WPARAM  wParam                  first message parameter
    414  *             LPARAM  lParam                  second message parameter
    415  *             SENDASYNCPROC  lpResultCallBack function to receive message value
    416  *             DWORD  dwData                   value to pass to callback function
    417  * Variables :
    418  * Result    : If the function succeeds, the return value is TRUE.
    419  *             If the function fails, the return value is FALSE. To get extended
    420  *             error information, call GetLastError.
    421  * Remark    :
    422  * Status    : UNTESTED STUB
    423  *
    424  * Author    : Patrick Haller [Thu, 1998/02/26 11:55]
    425  *****************************************************************************/
    426 
    427 BOOL WIN32API SendMessageCallbackW(HWND          hWnd,
    428                                       UINT          uMsg,
    429                                       WPARAM        wParam,
    430                                       LPARAM        lParam,
    431                                       SENDASYNCPROC lpResultCallBack,
    432                                       DWORD         dwData)
    433 {
    434   dprintf(("USER32:SendMessageCallBackW (%08xh,%08xh,%08xh,%08xh,%08xh,%08x) not implemented.\n",
    435          hWnd,
    436          uMsg,
    437          wParam,
    438          lParam,
    439          lpResultCallBack,
    440          dwData));
    441 
    442   return (FALSE);
    443 }
    444 /*****************************************************************************
    445  * Name      : long WIN32API BroadcastSystemMessage
    446  * Purpose   : The BroadcastSystemMessage function sends a message to the given
    447  *             recipients. The recipients can be applications, installable
    448  *             drivers, Windows-based network drivers, system-level device
    449  *             drivers, or any combination of these system components.
    450  * Parameters: DWORD   dwFlags,
    451                LPDWORD lpdwRecipients,
    452                UINT    uiMessage,
    453                WPARAM  wParam,
    454                LPARAM  lParam
    455  * Variables :
    456  * Result    : If the function succeeds, the return value is a positive value.
    457  *             If the function is unable to broadcast the message, the return value is -1.
    458  *             If the dwFlags parameter is BSF_QUERY and at least one recipient returned FALSE to the corresponding message, the return value is zero.
    459  * Remark    :
    460  * Status    : UNTESTED STUB
    461  *
    462  * Author    : Patrick Haller [Thu, 1998/02/26 11:55]
    463  *****************************************************************************/
    464 
    465 long WIN32API BroadcastSystemMessage(DWORD   dwFlags,
    466                                         LPDWORD lpdwRecipients,
    467                                         UINT    uiMessage,
    468                                         WPARAM  wParam,
    469                                         LPARAM  lParam)
    470 {
    471   dprintf(("USER32:BroadcastSystemMessage(%08xh,%08xh,%08xh,%08xh,%08x) not implemented.\n",
    472         dwFlags,
    473         lpdwRecipients,
    474         uiMessage,
    475         wParam,
    476         lParam));
    477 
    478   return (-1);
    479217}
    480218//******************************************************************************
Note: See TracChangeset for help on using the changeset viewer.