Changeset 10185 for trunk/src/user32
- Timestamp:
- Jul 28, 2003, 1:35:32 PM (22 years ago)
- Location:
- trunk/src/user32
- Files:
-
- 1 added
- 12 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/user32/Makefile
r9930 r10185 1 # $Id: Makefile,v 1.10 6 2003-03-20 13:20:44 sandervl Exp $1 # $Id: Makefile,v 1.107 2003-07-28 11:27:44 sandervl Exp $ 2 2 3 3 # … … 111 111 $(OBJDIR)\oslibprf.obj \ 112 112 $(OBJDIR)\dragdrop.obj \ 113 $(OBJDIR)\oslibdnd.obj \ 113 114 !ifdef DEBUG 114 115 $(OBJDIR)\dbgwrap.obj \ -
trunk/src/user32/USER32.DEF
r10031 r10185 1 ; $Id: USER32.DEF,v 1. 79 2003-04-23 18:00:58sandervl Exp $1 ; $Id: USER32.DEF,v 1.80 2003-07-28 11:27:44 sandervl Exp $ 2 2 3 3 LIBRARY USER32 INITINSTANCE TERMINSTANCE … … 728 728 _CustForceMonoCursor@0 @2036 NONAME 729 729 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:14sandervl Exp $ */1 /* $Id: dragdrop.cpp,v 1.4 2003-07-28 11:27:45 sandervl Exp $ */ 2 2 3 3 /* … … 31 31 DWORD dwExStyle; 32 32 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 34 36 dwExStyle = GetWindowLongA(hwnd, GWL_EXSTYLE); 35 37 … … 66 68 BOOL DragDropDragOver(HWND hwnd, DWORD dwEffect) 67 69 { 70 dprintf(("DragDropDragOver %x %x", hwnd, dwEffect)); 68 71 if(pfnDragOver) { 69 72 return pfnDragOver(hwnd, dwEffect); … … 78 81 DROPFILES *pDropFile; 79 82 HGLOBAL hDropFile; 83 84 dprintf(("DragDropDragEnter %x (%d,%d) %d %s %d %d", hwnd, point.x, point.y, cFiles, pszFiles, cbszFiles, fNonClient)); 80 85 81 86 if(pfnDragEnter) { … … 103 108 BOOL DragDropDragLeave(HWND hwnd) 104 109 { 110 dprintf(("DragDropDragLeave %x", hwnd)); 105 111 if(pfnDragLeave) { 106 112 return pfnDragLeave(hwnd); … … 113 119 { 114 120 DWORD dwExStyle; 121 122 dprintf(("DragDropDragAccept %x", hwnd)); 115 123 116 124 dwExStyle = GetWindowLongA(hwnd, GWL_EXSTYLE); -
trunk/src/user32/oslibmsg.cpp
r10122 r10185 1 /* $Id: oslibmsg.cpp,v 1.7 0 2003-05-27 10:52:25 sandervl Exp $ */1 /* $Id: oslibmsg.cpp,v 1.71 2003-07-28 11:27:45 sandervl Exp $ */ 2 2 /* 3 3 * Window message translation functions for OS/2 … … 746 746 return (ULONG)WinSendMsg(hwnd, WIN32APP_POSTMSG+msg, (MPARAM)((fUnicode) ? WIN32MSG_MAGICW : WIN32MSG_MAGICA), pvMsgPacket); 747 747 } 748 748 //****************************************************************************** 749 //****************************************************************************** 750 BOOL OSLibSendWinMessage(HWND hwnd, ULONG winmsg) 751 { 752 return (BOOL)WinSendMsg(Win32ToOS2Handle(hwnd), TranslateWinMsg(winmsg, TRUE), 0, 0); 753 } 749 754 //****************************************************************************** 750 755 //****************************************************************************** -
trunk/src/user32/oslibmsg.h
r10012 r10185 1 /* $Id: oslibmsg.h,v 1.2 0 2003-04-11 14:22:05 sandervl Exp $ */1 /* $Id: oslibmsg.h,v 1.21 2003-07-28 11:27:45 sandervl Exp $ */ 2 2 /* 3 3 * Window message translation functions for OS/2 … … 55 55 ULONG OSLibSendMessage(HWND hwnd, ULONG msg, ULONG wParam, ULONG lParam, BOOL fUnicode); 56 56 ULONG OSLibWinBroadcastMsg(ULONG msg, ULONG wParam, ULONG lParam, BOOL fSend); 57 BOOL OSLibSendWinMessage(HWND hwnd, ULONG winmsg); 57 58 58 59 //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.11 0 2003-05-16 10:59:27sandervl Exp $ */1 /* $Id: oslibmsgtranslate.cpp,v 1.111 2003-07-28 11:27:46 sandervl Exp $ */ 2 2 /* 3 3 * Window message translation functions for OS/2 … … 97 97 //****************************************************************************** 98 98 //****************************************************************************** 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 //******************************************************************************118 99 LONG IsNCMouseMsg(Win32BaseWindow *win32wnd) 119 100 { -
trunk/src/user32/pmwindow.cpp
r10136 r10185 1 /* $Id: pmwindow.cpp,v 1.21 6 2003-06-03 11:58:37 sandervl Exp $ */1 /* $Id: pmwindow.cpp,v 1.217 2003-07-28 11:27:47 sandervl Exp $ */ 2 2 /* 3 3 * Win32 Window Managment Code for OS/2 … … 52 52 #include <pmscan.h> 53 53 #include <winscan.h> 54 #include <oslibdnd.h> 54 55 #include <win\dbt.h> 55 56 #include "dragdrop.h" … … 1059 1060 rc = (MRFROM2SHORT (DOR_NEVERDROP, 0)); 1060 1061 } 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; 1061 1094 break; 1062 1095 } … … 2284 2317 cItems = DrgQueryDragitemCount(pDragInfo); 2285 2318 2286 //compute rmemory required to hold all filenames2319 //compute memory required to hold all filenames 2287 2320 int bufsize = 0; 2288 2321 for (i = 0; i < cItems; i++) { -
trunk/src/user32/user32.cpp
r9601 r10185 1 /* $Id: user32.cpp,v 1.12 6 2003-01-03 17:20:04sandervl Exp $ */1 /* $Id: user32.cpp,v 1.127 2003-07-28 11:27:47 sandervl Exp $ */ 2 2 3 3 /* … … 696 696 break; 697 697 698 case SPI_SETMOUSESPEED: 699 dprintf(("USER32: SPI_SETMOUSESPEED is ignored, implement!\n")); 700 break; 701 698 702 case SPI_SETMOUSEBUTTONSWAP: 699 703 // 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.1 2 2003-04-23 18:00:59 sandervl Exp $1 ; $Id: user32dbg.def,v 1.13 2003-07-28 11:27:49 sandervl Exp $ 2 2 3 3 LIBRARY USER32 INITINSTANCE TERMINSTANCE … … 726 726 727 727 _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.4 2 2003-05-16 10:59:28sandervl Exp $ */1 /* $Id: windowmsg.cpp,v 1.43 2003-07-28 11:27:50 sandervl Exp $ */ 2 2 /* 3 3 * Win32 window message APIs for OS/2 … … 105 105 return FALSE; 106 106 } 107 107 108 108 // only WM_KEYDOWN, WM_KEYUP, WM_SYSKEYDOWN, WM_SYSKEYUP 109 109 // can go into TranslateMessage 110 110 111 111 return OSLibWinTranslateMessage((MSG *)msg); 112 112 } … … 140 140 { 141 141 BOOL fFoundMsg; 142 142 143 143 dprintf2(("PeekMessageA %x %d-%d %d", hwndOwner, uMsgFilterMin, uMsgFilterMax, fuRemoveMsg)); 144 144 fFoundMsg = OSLibWinPeekMsg(msg, hwndOwner, uMsgFilterMin, uMsgFilterMax, … … 314 314 * when the WM_SETTEXT message has been used to set the icon 315 315 */ 316 INT WINPROC_MapMsg32ATo32W( HWND hwnd, UINT msg, WPARAM wParam, LPARAM *plparam )316 INT WINPROC_MapMsg32ATo32W( HWND hwnd, UINT msg, WPARAM *pwparam, LPARAM *plparam ) 317 317 { 318 318 switch(msg) … … 321 321 { 322 322 LPARAM *ptr = (LPARAM *)HeapAlloc( GetProcessHeap(), 0, 323 wParam * sizeof(WCHAR) + sizeof(LPARAM) );323 *pwparam * sizeof(WCHAR) + sizeof(LPARAM) ); 324 324 if (!ptr) return -1; 325 325 *ptr++ = *plparam; /* Store previous lParam */ … … 431 431 return 1; 432 432 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 433 443 case WM_ASKCBFORMATNAME: 434 444 case WM_DEVMODECHANGE: 435 445 case WM_PAINTCLIPBOARD: 436 446 case WM_SIZECLIPBOARD: 437 case EM_SETPASSWORDCHAR:438 447 // FIXME_(msg)("message %s (0x%x) needs translation, please report\n", SPY_GetMsgName(msg), msg ); 439 448 return -1; … … 810 819 LRESULT result; 811 820 812 if (WINPROC_MapMsg32ATo32W( hwnd, msg, wParam, &lParam ) == -1) return 0;821 if (WINPROC_MapMsg32ATo32W( hwnd, msg, &wParam, &lParam ) == -1) return 0; 813 822 result = func( hwnd, msg, wParam, lParam ); 814 823 WINPROC_UnmapMsg32ATo32W( hwnd, msg, wParam, lParam ); … … 911 920 //TODO: Ignoring all messages could be dangerous. But processing them, 912 921 //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)) 914 923 { 915 924 if (msg.message == WM_QUIT) { … … 965 974 //TODO: Ignoring all messages could be dangerous. But processing them, 966 975 //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)) 968 977 { 969 978 if (msg.message == WM_QUIT) { … … 971 980 return WAIT_ABANDONED; 972 981 } 973 982 974 983 /* otherwise dispatch it */ 975 984 DispatchMessageA(&msg); … … 1036 1045 //TODO: Ignoring all messages could be dangerous. But processing them, 1037 1046 //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)) 1039 1048 { 1040 1049 if (msg.message == WM_QUIT) { -
trunk/src/user32/winmouse.cpp
r9019 r10185 1 /* $Id: winmouse.cpp,v 1.2 6 2002-08-16 16:49:05sandervl Exp $ */1 /* $Id: winmouse.cpp,v 1.27 2003-07-28 11:27:50 sandervl Exp $ */ 2 2 /* 3 3 * Win32 mouse functions … … 40 40 #include "hook.h" 41 41 42 #include <winkeyboard.h> 43 42 44 #define DBG_LOCALLOG DBG_winmouse 43 45 #include "dbglocal.h" … … 150 152 { 151 153 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); 152 156 return hwndPrev; 153 157 } … … 252 256 INPUT i; 253 257 254 // format input packet255 258 i.type = INPUT_MOUSE; 256 259 i.mi.dx = dx; … … 292 295 // TranslateMessage posts an appropriate 293 296 // WM_CHAR message. 297 294 298 HWND hwnd = GetForegroundWindow(); 295 299 296 300 LPINPUT piBase = pInputs; 297 301 for (int i = 0; … … 305 309 { 306 310 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 } 311 368 } 312 369 break; … … 319 376 BOOL fUnicode = (p->dwFlags & KEYEVENTF_UNICODE) == KEYEVENTF_UNICODE; 320 377 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. 321 382 322 383 // build keyboard message … … 360 421 361 422 SetMessageExtraInfo( (LPARAM)p->dwExtraInfo ); 423 424 KeySetOverlayKeyState(msg.wParam, (msg.message == WM_KEYDOWN) ? KEYOVERLAYSTATE_DOWN : KEYOVERLAYSTATE_DONTCARE); 362 425 363 426 if (fUnicode) … … 365 428 else 366 429 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 368 441 //restore extra info 369 442 SetMessageExtraInfo(extrainfo); … … 656 729 //****************************************************************************** 657 730 //****************************************************************************** 731 ULONG 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:07sandervl Exp $ */1 /* $Id: winmouse.h,v 1.9 2003-07-28 11:27:51 sandervl Exp $ */ 2 2 /* 3 3 * Mouse handler for DINPUT … … 12 12 #define __WINMOUSE_H__ 13 13 14 ULONG GetMouseKeyState(); 15 14 16 #endif //__WINMOUSE_H__
Note:
See TracChangeset
for help on using the changeset viewer.