Changeset 10185 for trunk/src/user32


Ignore:
Timestamp:
Jul 28, 2003, 1:35:32 PM (22 years ago)
Author:
sandervl
Message:

Updates

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

Legend:

Unmodified
Added
Removed
  • trunk/src/user32/Makefile

    r9930 r10185  
    1 # $Id: Makefile,v 1.106 2003-03-20 13:20:44 sandervl Exp $
     1# $Id: Makefile,v 1.107 2003-07-28 11:27:44 sandervl Exp $
    22
    33#
     
    111111$(OBJDIR)\oslibprf.obj \
    112112$(OBJDIR)\dragdrop.obj \
     113$(OBJDIR)\oslibdnd.obj \
    113114!ifdef DEBUG
    114115$(OBJDIR)\dbgwrap.obj \
  • trunk/src/user32/USER32.DEF

    r10031 r10185  
    1 ; $Id: USER32.DEF,v 1.79 2003-04-23 18:00:58 sandervl Exp $
     1; $Id: USER32.DEF,v 1.80 2003-07-28 11:27:44 sandervl Exp $
    22
    33LIBRARY USER32 INITINSTANCE TERMINSTANCE
     
    728728    _CustForceMonoCursor@0                                       @2036 NONAME
    729729
     730
     731    _OSLibDragOver@12                                            @2038 NONAME
     732    _OSLibDragLeave@4                                            @2039 NONAME
     733    _OSLibDragDrop@16                                            @2040 NONAME
     734    _OSLibCreateDragStruct@16                                    @2041 NONAME
     735    _OSLibFreeDragStruct@4                                       @2042 NONAME
  • trunk/src/user32/dragdrop.cpp

    r8735 r10185  
    1 /* $Id: dragdrop.cpp,v 1.3 2002-06-20 14:18:14 sandervl Exp $ */
     1/* $Id: dragdrop.cpp,v 1.4 2003-07-28 11:27:45 sandervl Exp $ */
    22
    33/*
     
    3131    DWORD      dwExStyle;
    3232    HWND       orghwnd = hwnd;
    33    
     33
     34    dprintf(("DragDropFiles %x (%d,%d) %d %s %d %d", hwnd, point.x, point.y, cFiles, pszFiles, cbszFiles, fNonClient));
     35
    3436    dwExStyle = GetWindowLongA(hwnd, GWL_EXSTYLE);
    3537
     
    6668BOOL DragDropDragOver(HWND hwnd, DWORD dwEffect)
    6769{
     70    dprintf(("DragDropDragOver %x %x", hwnd, dwEffect));
    6871    if(pfnDragOver) {
    6972        return pfnDragOver(hwnd, dwEffect);
     
    7881    DROPFILES *pDropFile;
    7982    HGLOBAL    hDropFile;
     83
     84    dprintf(("DragDropDragEnter %x (%d,%d) %d %s %d %d", hwnd, point.x, point.y, cFiles, pszFiles, cbszFiles, fNonClient));
    8085
    8186    if(pfnDragEnter) {
     
    103108BOOL DragDropDragLeave(HWND hwnd)
    104109{
     110    dprintf(("DragDropDragLeave %x", hwnd));
    105111    if(pfnDragLeave) {
    106112        return pfnDragLeave(hwnd);
     
    113119{
    114120    DWORD      dwExStyle;
     121
     122    dprintf(("DragDropDragAccept %x", hwnd));
    115123
    116124    dwExStyle = GetWindowLongA(hwnd, GWL_EXSTYLE);
  • trunk/src/user32/oslibmsg.cpp

    r10122 r10185  
    1 /* $Id: oslibmsg.cpp,v 1.70 2003-05-27 10:52:25 sandervl Exp $ */
     1/* $Id: oslibmsg.cpp,v 1.71 2003-07-28 11:27:45 sandervl Exp $ */
    22/*
    33 * Window message translation functions for OS/2
     
    746746    return (ULONG)WinSendMsg(hwnd, WIN32APP_POSTMSG+msg, (MPARAM)((fUnicode) ? WIN32MSG_MAGICW : WIN32MSG_MAGICA), pvMsgPacket);
    747747}
    748 
     748//******************************************************************************
     749//******************************************************************************
     750BOOL OSLibSendWinMessage(HWND hwnd, ULONG winmsg)
     751{
     752    return (BOOL)WinSendMsg(Win32ToOS2Handle(hwnd), TranslateWinMsg(winmsg, TRUE), 0, 0);
     753}
    749754//******************************************************************************
    750755//******************************************************************************
  • trunk/src/user32/oslibmsg.h

    r10012 r10185  
    1 /* $Id: oslibmsg.h,v 1.20 2003-04-11 14:22:05 sandervl Exp $ */
     1/* $Id: oslibmsg.h,v 1.21 2003-07-28 11:27:45 sandervl Exp $ */
    22/*
    33 * Window message translation functions for OS/2
     
    5555ULONG OSLibSendMessage(HWND hwnd, ULONG msg, ULONG wParam, ULONG lParam, BOOL fUnicode);
    5656ULONG OSLibWinBroadcastMsg(ULONG msg, ULONG wParam, ULONG lParam, BOOL fSend);
     57BOOL  OSLibSendWinMessage(HWND hwnd, ULONG winmsg);
    5758
    5859//Direct posting of messages that must remain invisible to the win32 app
  • trunk/src/user32/oslibmsgtranslate.cpp

    r10104 r10185  
    1 /* $Id: oslibmsgtranslate.cpp,v 1.110 2003-05-16 10:59:27 sandervl Exp $ */
     1/* $Id: oslibmsgtranslate.cpp,v 1.111 2003-07-28 11:27:46 sandervl Exp $ */
    22/*
    33 * Window message translation functions for OS/2
     
    9797//******************************************************************************
    9898//******************************************************************************
    99 ULONG GetMouseKeyState()
    100 {
    101   ULONG keystate = 0;
    102 
    103   if(WinGetKeyState(HWND_DESKTOP, VK_BUTTON1) & 0x8000)
    104     keystate |= MK_LBUTTON_W;
    105   if(WinGetKeyState(HWND_DESKTOP, VK_BUTTON2) & 0x8000)
    106     keystate |= MK_RBUTTON_W;
    107   if(WinGetKeyState(HWND_DESKTOP, VK_BUTTON3) & 0x8000)
    108     keystate |= MK_MBUTTON_W;
    109   if(WinGetKeyState(HWND_DESKTOP, VK_SHIFT) & 0x8000)
    110     keystate |= MK_SHIFT_W;
    111   if(WinGetKeyState(HWND_DESKTOP, VK_CTRL) & 0x8000)
    112     keystate |= MK_CONTROL_W;
    113 
    114   return keystate;
    115 }
    116 //******************************************************************************
    117 //******************************************************************************
    11899LONG IsNCMouseMsg(Win32BaseWindow *win32wnd)
    119100{
  • trunk/src/user32/pmwindow.cpp

    r10136 r10185  
    1 /* $Id: pmwindow.cpp,v 1.216 2003-06-03 11:58:37 sandervl Exp $ */
     1/* $Id: pmwindow.cpp,v 1.217 2003-07-28 11:27:47 sandervl Exp $ */
    22/*
    33 * Win32 Window Managment Code for OS/2
     
    5252#include <pmscan.h>
    5353#include <winscan.h>
     54#include <oslibdnd.h>
    5455#include <win\dbt.h>
    5556#include "dragdrop.h"
     
    10591060            rc = (MRFROM2SHORT (DOR_NEVERDROP, 0));
    10601061        }
     1062        break;
     1063    }
     1064
     1065    case DM_RENDER:
     1066    {
     1067        PDRAGTRANSFER pDragTransfer = (PDRAGTRANSFER)mp1;
     1068
     1069        dprintf(("OS2: DM_RENDER %x", pDragTransfer));
     1070
     1071        rc = (MRESULT)OSLibRenderFormat(pDragTransfer);
     1072        break;
     1073    }
     1074
     1075    case DM_RENDERPREPARE:
     1076    {
     1077        PDRAGTRANSFER pDragTransfer = (PDRAGTRANSFER)mp1;
     1078
     1079        dprintf(("OS2: DM_RENDERPREPARE %x", pDragTransfer));
     1080        break;
     1081    }
     1082
     1083    case DM_ENDCONVERSATION:
     1084    {
     1085        dprintf(("OS2: DM_ENDCONVERSATION"));
     1086        rc = (MRESULT)OSLibEndConversation();
     1087        break;
     1088    }
     1089
     1090    case DM_RENDERFILE:
     1091    {
     1092        dprintf(("OS2: DM_ENDCONVERSATION"));
     1093        rc = FALSE;
    10611094        break;
    10621095    }
     
    22842317    cItems = DrgQueryDragitemCount(pDragInfo);
    22852318
    2286     //computer memory required to hold all filenames
     2319    //compute memory required to hold all filenames
    22872320    int bufsize = 0;
    22882321    for (i = 0; i < cItems; i++) {
  • trunk/src/user32/user32.cpp

    r9601 r10185  
    1 /* $Id: user32.cpp,v 1.126 2003-01-03 17:20:04 sandervl Exp $ */
     1/* $Id: user32.cpp,v 1.127 2003-07-28 11:27:47 sandervl Exp $ */
    22
    33/*
     
    696696        break;
    697697
     698    case SPI_SETMOUSESPEED:
     699        dprintf(("USER32: SPI_SETMOUSESPEED is ignored, implement!\n"));
     700        break;
     701
    698702    case SPI_SETMOUSEBUTTONSWAP:
    699703        // TODO make this for Win32 apps only, Open32 changes OS/2 settings!
  • trunk/src/user32/user32dbg.def

    r10031 r10185  
    1 ; $Id: user32dbg.def,v 1.12 2003-04-23 18:00:59 sandervl Exp $
     1; $Id: user32dbg.def,v 1.13 2003-07-28 11:27:49 sandervl Exp $
    22
    33LIBRARY USER32 INITINSTANCE TERMINSTANCE
     
    726726
    727727    _CustForceMonoCursor@0                                       @2036 NONAME
     728
     729    _OSLibDragOver@12                                            @2038 NONAME
     730    _OSLibDragLeave@4                                            @2039 NONAME
     731    _OSLibDragDrop@16                                            @2040 NONAME
     732    _OSLibCreateDragStruct@16                                    @2041 NONAME
     733    _OSLibFreeDragStruct@4                                       @2042 NONAME
  • trunk/src/user32/windowmsg.cpp

    r10104 r10185  
    1 /* $Id: windowmsg.cpp,v 1.42 2003-05-16 10:59:28 sandervl Exp $ */
     1/* $Id: windowmsg.cpp,v 1.43 2003-07-28 11:27:50 sandervl Exp $ */
    22/*
    33 * Win32 window message APIs for OS/2
     
    105105        return FALSE;
    106106    }
    107  
     107
    108108    // only WM_KEYDOWN, WM_KEYUP, WM_SYSKEYDOWN, WM_SYSKEYUP
    109109    // can go into TranslateMessage
    110  
     110
    111111    return OSLibWinTranslateMessage((MSG *)msg);
    112112}
     
    140140{
    141141    BOOL fFoundMsg;
    142  
     142
    143143    dprintf2(("PeekMessageA %x %d-%d %d", hwndOwner, uMsgFilterMin, uMsgFilterMax, fuRemoveMsg));
    144144    fFoundMsg = OSLibWinPeekMsg(msg, hwndOwner, uMsgFilterMin, uMsgFilterMax,
     
    314314 *  when the WM_SETTEXT message has been used to set the icon
    315315 */
    316 INT WINPROC_MapMsg32ATo32W( HWND hwnd, UINT msg, WPARAM wParam, LPARAM *plparam )
     316INT WINPROC_MapMsg32ATo32W( HWND hwnd, UINT msg, WPARAM *pwparam, LPARAM *plparam )
    317317{
    318318    switch(msg)
     
    321321        {
    322322            LPARAM *ptr = (LPARAM *)HeapAlloc( GetProcessHeap(), 0,
    323                                      wParam * sizeof(WCHAR) + sizeof(LPARAM) );
     323                                     *pwparam * sizeof(WCHAR) + sizeof(LPARAM) );
    324324            if (!ptr) return -1;
    325325            *ptr++ = *plparam;  /* Store previous lParam */
     
    431431        return 1;
    432432
     433    /* kso 2003-07-03: to make password field work, I took this from latest wine code. (winproc.c) */
     434    case EM_SETPASSWORDCHAR:
     435        {
     436            BYTE    ch = LOWORD(*pwparam);
     437            WCHAR   wch = 0;
     438            MultiByteToWideChar(CP_ACP, 0, (LPCSTR)&ch, 1, &wch, 1);
     439            *pwparam = MAKEWPARAM( wch, HIWORD(*pwparam) );
     440        }
     441        return 0;
     442
    433443    case WM_ASKCBFORMATNAME:
    434444    case WM_DEVMODECHANGE:
    435445    case WM_PAINTCLIPBOARD:
    436446    case WM_SIZECLIPBOARD:
    437     case EM_SETPASSWORDCHAR:
    438447        // FIXME_(msg)("message %s (0x%x) needs translation, please report\n", SPY_GetMsgName(msg), msg );
    439448        return -1;
     
    810819    LRESULT result;
    811820
    812     if (WINPROC_MapMsg32ATo32W( hwnd, msg, wParam, &lParam ) == -1) return 0;
     821    if (WINPROC_MapMsg32ATo32W( hwnd, msg, &wParam, &lParam ) == -1) return 0;
    813822    result = func( hwnd, msg, wParam, lParam );
    814823    WINPROC_UnmapMsg32ATo32W( hwnd, msg, wParam, lParam );
     
    911920              //TODO: Ignoring all messages could be dangerous. But processing them,
    912921              //while the app doesn't expect any, isn't safe either.
    913               if(PeekMessageA(&msg, NULL, 0, 0, PM_REMOVE)) 
     922              if(PeekMessageA(&msg, NULL, 0, 0, PM_REMOVE))
    914923              {
    915924                  if (msg.message == WM_QUIT) {
     
    965974                //TODO: Ignoring all messages could be dangerous. But processing them,
    966975                //while the app doesn't expect any, isn't safe either.
    967                 if(PeekMessageA(&msg, NULL, 0, 0, PM_REMOVE)) 
     976                if(PeekMessageA(&msg, NULL, 0, 0, PM_REMOVE))
    968977                {
    969978                    if (msg.message == WM_QUIT) {
     
    971980                         return WAIT_ABANDONED;
    972981                    }
    973    
     982
    974983                    /* otherwise dispatch it */
    975984                    DispatchMessageA(&msg);
     
    10361045        //TODO: Ignoring all messages could be dangerous. But processing them,
    10371046        //while the app doesn't expect any, isn't safe either.
    1038         if(PeekMessageA(&msg, NULL, 0, 0, PM_REMOVE)) 
     1047        if(PeekMessageA(&msg, NULL, 0, 0, PM_REMOVE))
    10391048        {
    10401049            if (msg.message == WM_QUIT) {
  • trunk/src/user32/winmouse.cpp

    r9019 r10185  
    1 /* $Id: winmouse.cpp,v 1.26 2002-08-16 16:49:05 sandervl Exp $ */
     1/* $Id: winmouse.cpp,v 1.27 2003-07-28 11:27:50 sandervl Exp $ */
    22/*
    33 * Win32 mouse functions
     
    4040#include "hook.h"
    4141
     42#include <winkeyboard.h>
     43
    4244#define DBG_LOCALLOG    DBG_winmouse
    4345#include "dbglocal.h"
     
    150152  {
    151153    dprintf(("USER32: SetCapture %x; already set to that window; ignore", hwnd));
     154    //TODO: NT4 SP6 sends this message even now
     155////////    SendMessageA(hwndPrev, WM_CAPTURECHANGED, 0L, hwnd);
    152156    return hwndPrev;
    153157  }
     
    252256  INPUT i;
    253257 
    254   // format input packet
    255258  i.type           = INPUT_MOUSE;
    256259  i.mi.dx          = dx;
     
    292295  // TranslateMessage posts an appropriate
    293296  // WM_CHAR message.
     297
    294298  HWND hwnd = GetForegroundWindow();
    295  
     299   
    296300  LPINPUT piBase = pInputs;
    297301  for (int i = 0;
     
    305309      {
    306310        PMOUSEINPUT p = (PMOUSEINPUT)&piBase->mi;
    307         MSG msg;
    308        
    309         // simulate mouse input message
    310         // @@@PH
     311        MSG msg;
     312        HWND hwndCapture;
     313
     314        hwndCapture = GetCapture();
     315        if(hwndCapture) hwnd = hwndCapture;
     316       
     317        if(p->dwFlags & MOUSEEVENTF_MOVE)
     318        {
     319            if(!(p->dwFlags & MOUSEEVENTF_ABSOLUTE)) {
     320                POINT pt;
     321
     322                if(GetCursorPos(&pt) == TRUE) {
     323                    LONG relx = (LONG)p->dx;
     324                    LONG rely = (LONG)p->dy;
     325
     326                    p->dx = pt.x + relx;
     327                    p->dy = pt.y + rely;
     328                }
     329                else {
     330                    DebugInt3();
     331                    return 0;
     332                }
     333            }
     334            SetCursorPos(p->dx, p->dy);   
     335            OSLibSendWinMessage(hwnd, WM_MOUSEMOVE);
     336        }
     337
     338        if(p->dwFlags & MOUSEEVENTF_LEFTDOWN)
     339        {
     340            KeySetOverlayKeyState(VK_LBUTTON, KEYOVERLAYSTATE_DOWN);
     341            OSLibSendWinMessage(hwnd, WM_LBUTTONDOWN);
     342        }
     343        if(p->dwFlags & MOUSEEVENTF_LEFTUP)
     344        {
     345            KeySetOverlayKeyState(VK_LBUTTON, KEYOVERLAYSTATE_DONTCARE);
     346            OSLibSendWinMessage(hwnd, WM_LBUTTONUP);
     347        }
     348        if(p->dwFlags & MOUSEEVENTF_RIGHTDOWN)
     349        {
     350            KeySetOverlayKeyState(VK_RBUTTON, KEYOVERLAYSTATE_DOWN);
     351            OSLibSendWinMessage(hwnd, WM_RBUTTONDOWN);
     352        }
     353        if(p->dwFlags & MOUSEEVENTF_RIGHTUP)
     354        {
     355            KeySetOverlayKeyState(VK_RBUTTON, KEYOVERLAYSTATE_DONTCARE);
     356            OSLibSendWinMessage(hwnd, WM_RBUTTONUP);
     357        }
     358        if(p->dwFlags & MOUSEEVENTF_MIDDLEDOWN)
     359        {
     360            KeySetOverlayKeyState(VK_MBUTTON, KEYOVERLAYSTATE_DOWN);
     361            OSLibSendWinMessage(hwnd, WM_MBUTTONDOWN);
     362        }
     363        if(p->dwFlags & MOUSEEVENTF_MIDDLEUP)
     364        {
     365            KeySetOverlayKeyState(VK_MBUTTON, KEYOVERLAYSTATE_DONTCARE);
     366            OSLibSendWinMessage(hwnd, WM_MBUTTONUP);
     367        }
    311368      } 
    312369      break;
     
    319376        BOOL fUnicode = (p->dwFlags & KEYEVENTF_UNICODE) == KEYEVENTF_UNICODE;
    320377        DWORD extrainfo = GetMessageExtraInfo();
     378
     379        //TODO: We should really send an OS/2 WM_CHAR message here and let
     380        //      our existing code handle everything (WM_CHAR generation)
     381        //      This is a quick and dirty implementation. Not entirely correct.
    321382       
    322383        // build keyboard message
     
    360421
    361422        SetMessageExtraInfo( (LPARAM)p->dwExtraInfo );
     423
     424        KeySetOverlayKeyState(msg.wParam, (msg.message == WM_KEYDOWN) ? KEYOVERLAYSTATE_DOWN : KEYOVERLAYSTATE_DONTCARE);
    362425       
    363426        if (fUnicode)
     
    365428        else
    366429          SendMessageA(hwnd, msg.message, msg.wParam, msg.lParam);
    367        
     430
     431        if(msg.message == WM_KEYDOWN) {
     432            char keybstate[256];
     433            WORD key = 0;
     434
     435            GetKeyboardState((LPBYTE)&keybstate[0]);
     436            if(ToAscii(p->wVk, p->wScan, (LPBYTE)&keybstate[0], &key, 0) != 0) {
     437                SendMessageA(hwnd, WM_CHAR, key, msg.lParam);
     438            }
     439        }
     440
    368441        //restore extra info
    369442        SetMessageExtraInfo(extrainfo);
     
    656729//******************************************************************************
    657730//******************************************************************************
     731ULONG GetMouseKeyState()
     732{
     733  ULONG keystate = 0;
     734
     735  if(GetKeyState(VK_LBUTTON) & 0x8000)
     736    keystate |= MK_LBUTTON;
     737  if(GetKeyState(VK_RBUTTON) & 0x8000)
     738    keystate |= MK_RBUTTON;
     739  if(GetKeyState(VK_MBUTTON) & 0x8000)
     740    keystate |= MK_MBUTTON;
     741  if(GetKeyState(VK_SHIFT) & 0x8000)
     742    keystate |= MK_SHIFT;
     743  if(GetKeyState(VK_CONTROL) & 0x8000)
     744    keystate |= MK_CONTROL;
     745
     746  return keystate;
     747}
     748//******************************************************************************
     749//******************************************************************************
  • trunk/src/user32/winmouse.h

    r8347 r10185  
    1 /* $Id: winmouse.h,v 1.8 2002-04-30 14:54:07 sandervl Exp $ */
     1/* $Id: winmouse.h,v 1.9 2003-07-28 11:27:51 sandervl Exp $ */
    22/*
    33 * Mouse handler for DINPUT
     
    1212#define __WINMOUSE_H__
    1313
     14ULONG GetMouseKeyState();
     15
    1416#endif //__WINMOUSE_H__
Note: See TracChangeset for help on using the changeset viewer.