Changeset 2204 for trunk/src/user32
- Timestamp:
- Dec 26, 1999, 6:30:20 PM (26 years ago)
- Location:
- trunk/src/user32
- Files:
-
- 18 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/user32/USER32.DEF
r1971 r2204 1 ; $Id: USER32.DEF,v 1.2 2 1999-12-05 00:31:46 sandervlExp $1 ; $Id: USER32.DEF,v 1.23 1999-12-26 17:30:13 cbratschi Exp $ 2 2 3 3 ;Created by BLAST for IBM's compiler … … 633 633 ; Wine/Odin helper function 634 634 GetSysColorPen = _GetSysColorPen@4 @2002 635 TrackWin32Window = _TrackWin32Window@8 @2003636 635 637 636 Win32ToOS2Handle__FUl = Win32ToOS2Handle__15Win32BaseWindowFUl @2006 -
trunk/src/user32/button.cpp
r2185 r2204 1 /* $Id: button.cpp,v 1.2 4 1999-12-21 17:03:42cbratschi Exp $ */1 /* $Id: button.cpp,v 1.25 1999-12-26 17:30:14 cbratschi Exp $ */ 2 2 /* File: button.cpp -- Button type widgets 3 3 * … … 219 219 BUTTONINFO* infoPtr = (BUTTONINFO*)GetInfoPtr(hwnd); 220 220 DWORD dwStyle = GetWindowLongA(hwnd,GWL_STYLE); 221 221 DWORD style = dwStyle & 0x0F; 222 223 if (style == BS_GROUPBOX) return 0; 222 224 SetCapture(hwnd); 223 225 SetFocus(hwnd); … … 234 236 BUTTONINFO* infoPtr = (BUTTONINFO*)GetInfoPtr(hwnd); 235 237 DWORD dwStyle = GetWindowLongA(hwnd,GWL_STYLE); 238 DWORD style = dwStyle & 0x0F; 236 239 RECT rect; 237 240 POINT pt; 238 241 242 if (style == BS_GROUPBOX) return 0; 239 243 pt.x = LOWORD(lParam); 240 244 pt.y = HIWORD(lParam); … … 460 464 static LRESULT BUTTON_SetStyle(HWND hwnd,WPARAM wParam,LPARAM lParam) 461 465 { 462 DWORD dwStyle = GetWindowLongA(hwnd,GWL_STYLE) ;466 DWORD dwStyle = GetWindowLongA(hwnd,GWL_STYLE),newStyle; 463 467 464 468 if ((wParam & 0x0f) >= MAX_BTN_TYPE) return 0; 465 dwStyle = (dwStyle & 0xfffffff0) | (wParam & 0x0000000f); 466 SetWindowLongA(hwnd,GWL_STYLE,dwStyle); 467 PAINT_BUTTON(hwnd,dwStyle & 0x0f,ODA_DRAWENTIRE); 469 newStyle = (dwStyle & 0xfffffff0) | (wParam & 0x0000000f); 470 471 if (newStyle != dwStyle) 472 { 473 SetWindowLongA(hwnd,GWL_STYLE,newStyle); 474 PAINT_BUTTON(hwnd,newStyle & 0x0f,ODA_DRAWENTIRE); 475 } 468 476 469 477 return 0; … … 542 550 { 543 551 BUTTONINFO* infoPtr = (BUTTONINFO*)GetInfoPtr(hwnd); 544 DWORD style = GetWindowLongA(hwnd,GWL_STYLE) & 0x0 f;552 DWORD style = GetWindowLongA(hwnd,GWL_STYLE) & 0x0F; 545 553 546 554 if (wParam) -
trunk/src/user32/edit.cpp
r2185 r2204 1 /* $Id: edit.cpp,v 1.2 4 1999-12-21 17:03:43cbratschi Exp $ */1 /* $Id: edit.cpp,v 1.25 1999-12-26 17:30:14 cbratschi Exp $ */ 2 2 /* 3 3 * Edit control … … 176 176 static void EDIT_MoveWordForward(HWND hwnd, EDITSTATE *es, BOOL extend); 177 177 static void EDIT_PaintLine(HWND hwnd, EDITSTATE *es, HDC hdc, INT line, BOOL rev); 178 static INTEDIT_PaintText(HWND hwnd, EDITSTATE *es, HDC hdc, INT x, INT y, INT line, INT col, INT count, BOOL rev);178 static VOID EDIT_PaintText(HWND hwnd, EDITSTATE *es, HDC hdc, INT x, INT y, INT line, INT col, INT count, BOOL rev); 179 179 static void EDIT_SetCaretPos(HWND hwnd, EDITSTATE *es, INT pos, BOOL after_wrap); 180 180 static void EDIT_SetRectNP(HWND hwnd, EDITSTATE *es, LPRECT lprc); … … 1633 1633 * 1634 1634 */ 1635 static INTEDIT_PaintText(HWND hwnd, EDITSTATE *es, HDC dc, INT x, INT y, INT line, INT col, INT count, BOOL rev)1635 static VOID EDIT_PaintText(HWND hwnd, EDITSTATE *es, HDC dc, INT x, INT y, INT line, INT col, INT count, BOOL rev) 1636 1636 { 1637 1637 COLORREF BkColor; 1638 1638 COLORREF TextColor; 1639 INT ret;1640 1639 INT li; 1641 1640 1642 1641 if (!count) 1643 return 0;1642 return; 1644 1643 BkColor = GetBkColor(dc); 1645 1644 TextColor = GetTextColor(dc); … … 1652 1651 if (es->style & ES_MULTILINE) 1653 1652 { 1654 ret = (INT)LOWORD(TabbedTextOutA(dc, x, y, es->text + li + col, count,1655 es->tabs_count, es->tabs, es->format_rect.left - es->x_offset));1653 TabbedTextOutA(dc, x, y, es->text + li + col, count, 1654 es->tabs_count, es->tabs, es->format_rect.left - es->x_offset); 1656 1655 } else 1657 1656 { 1658 1657 LPSTR text = EDIT_GetPasswordPointer_SL(hwnd, es); 1659 1658 POINT pt; 1660 UINT oldAlign = GetTextAlign(dc);1661 1662 MoveToEx(dc,x,y,NULL);1663 SetTextAlign(dc,(oldAlign & ~TA_NOUPDATECP) | TA_UPDATECP);1664 1659 1665 1660 TextOutA(dc,x,y,text+li+col,count); 1666 GetCurrentPositionEx(dc,&pt);1667 SetTextAlign(dc,oldAlign);1668 ret = pt.x-x;1669 1661 if (es->style & ES_PASSWORD) 1670 1662 HeapFree(es->heap, 0, text); … … 1675 1667 SetTextColor(dc, TextColor); 1676 1668 } 1677 return ret;1678 1669 } 1679 1670 … … 1715 1706 { 1716 1707 CopyRect(&es->format_rect, rc); 1717 if (es->style & WS_BORDER) { 1718 INT bw = GetSystemMetrics(SM_CXBORDER) + 1; 1719 es->format_rect.left += bw; 1720 es->format_rect.top += bw; 1721 es->format_rect.right -= bw; 1722 es->format_rect.bottom -= bw; 1708 if (es->style & WS_BORDER) 1709 { 1710 INT bw = GetSystemMetrics(SM_CXBORDER)+1,bh = GetSystemMetrics(SM_CYBORDER)+1; 1711 1712 es->format_rect.left += bw; 1713 es->format_rect.top += bh; 1714 es->format_rect.right -= bw; 1715 es->format_rect.bottom -= bh; 1723 1716 } 1724 1717 es->format_rect.left += es->left_margin; … … 2745 2738 ORDER_UINT(start, old_start); 2746 2739 ORDER_UINT(old_start, old_end); 2740 if (start == old_start && end == old_end) return; 2747 2741 if (end != old_start) 2748 2742 { -
trunk/src/user32/oslibmsgtranslate.cpp
r2200 r2204 1 /* $Id: oslibmsgtranslate.cpp,v 1. 1 1999-12-24 18:42:46 sandervlExp $ */1 /* $Id: oslibmsgtranslate.cpp,v 1.2 1999-12-26 17:30:15 cbratschi Exp $ */ 2 2 /* 3 3 * Window message translation functions for OS/2 … … 283 283 if(win32wnd->lastHitTestVal != HTCLIENT_W) { 284 284 winMsg->message = WINWM_NCLBUTTONDOWN + (os2Msg->msg - WM_BUTTON1DOWN); 285 winMsg->wParam = win32wnd->lastHitTestVal; 285 286 winMsg->lParam = MAKELONG(winMsg->pt.x, winMsg->pt.y); //screen coordinates 286 287 } … … 324 325 325 326 //WM_NCMOUSEMOVE is posted when the cursor moves into a non-client area of the window 326 if(win32wnd->lastHitTestVal != HTCLIENT_W) { 327 setcursormsg = WINWM_NCMOUSEMOVE; 328 winMsg->wParam = (WPARAM)win32wnd->lastHitTestVal; 329 } 330 else winMsg->wParam = (WPARAM)keystate; 327 if(win32wnd->lastHitTestVal != HTCLIENT_W) 328 { 329 setcursormsg = WINWM_NCMOUSEMOVE; 330 winMsg->wParam = (WPARAM)win32wnd->lastHitTestVal; 331 winMsg->lParam = MAKELONG(winMsg->pt.x,winMsg->pt.y); 332 } else 333 { 334 winMsg->wParam = (WPARAM)keystate; 335 winMsg->lParam = MAKELONG(SHORT1FROMMP(os2Msg->mp1), MapOS2ToWin32Y(win32wnd, SHORT2FROMMP(os2Msg->mp1))); 336 } 331 337 //OS/2 Window coordinates -> Win32 Window coordinates 332 338 winMsg->message = setcursormsg; 333 winMsg->lParam = MAKELONG(SHORT1FROMMP(os2Msg->mp1), MapOS2ToWin32Y(win32wnd, SHORT2FROMMP(os2Msg->mp1)));334 339 break; 335 340 } 336 341 337 342 case WM_CONTROL: 343 goto dummymessage; 344 338 345 case WM_COMMAND: 339 346 if(SHORT1FROMMP(os2Msg->mp2) == CMDSRC_MENU) { … … 511 518 } 512 519 } 513 goto dummymessage; 520 goto dummymessage; //for caret blinking 514 521 515 522 case WM_SETWINDOWPARAMS: … … 556 563 557 564 case WM_HITTEST: 558 // Only send this message if the window is enabled559 if (WinIsWindowEnabled(os2Msg->hwnd))560 { 561 OSLIBPOINT pt;562 pt.x = (*(POINTS *)&os2Msg->mp1).x;563 pt.y = (*(POINTS *)&os2Msg->mp1).y; 564 MapOS2ToWin32Point( OSLIB_HWND_DESKTOP, os2Msg->hwnd,&pt);565 winMsg->message= WINWM_NCHITTEST;566 winMsg->lParam = MAKELONG((USHORT)pt.x, (USHORT)pt.y);567 break;568 }569 goto dummymessage;565 { 566 OSLIBPOINT pt; 567 568 pt.x = (*(POINTS *)&os2Msg->mp1).x; 569 pt.y = (*(POINTS *)&os2Msg->mp1).y; 570 571 MapOS2ToWin32Point(OSLIB_HWND_DESKTOP,os2Msg->hwnd,&pt); 572 winMsg->message = WINWM_NCHITTEST; 573 winMsg->wParam = 0; 574 winMsg->lParam = MAKELONG((USHORT)pt.x, (USHORT)pt.y); 575 break; 576 } 570 577 571 578 case WM_CONTEXTMENU: -
trunk/src/user32/oslibutil.cpp
r949 r2204 1 /* $Id: oslibutil.cpp,v 1. 1 1999-09-15 23:18:54 sandervlExp $ */1 /* $Id: oslibutil.cpp,v 1.2 1999-12-26 17:30:15 cbratschi Exp $ */ 2 2 /* 3 3 * Window API utility functions for OS/2 … … 24 24 if(thdb) 25 25 { 26 26 return (HAB)thdb->hab; 27 27 } 28 28 … … 39 39 if(thdb) 40 40 { 41 41 thdb->hab = (ULONG)hab; 42 42 } 43 else 43 else dprintf(("SetThreadHAB: thdb == NULL!!")); 44 44 } 45 45 //****************************************************************************** … … 52 52 if(thdb) 53 53 { 54 54 return (HMQ)thdb->hmq; 55 55 } 56 56 … … 67 67 if(thdb) 68 68 { 69 thdb->hmq = (ULONG)hmq; 69 thdb->hmq = (ULONG)hmq; 70 70 } 71 else 71 else dprintf(("SetThreadMessageQueue: thdb == NULL!!")); 72 72 } 73 73 //****************************************************************************** 74 74 //****************************************************************************** 75 DWORD GetThreadMessageExtraInfo() 76 { 77 THDB *thdb; 78 79 thdb = GetThreadTHDB(); 80 if(thdb) 81 { 82 return thdb->lParam; 83 } 84 85 dprintf(("GetThreadMessageExtraInfo: thdb == NULL!!")); 86 return 0; 87 } 88 //****************************************************************************** 89 //****************************************************************************** 90 DWORD SetThreadMessageExtraInfo(DWORD lParam) 91 { 92 THDB *thdb; 93 94 thdb = GetThreadTHDB(); 95 if(thdb) 96 { 97 thdb->lParam = lParam; 98 } 99 else dprintf(("SetThreadMessageExtraInfo: thdb == NULL!!")); 100 return 0; 101 } -
trunk/src/user32/oslibutil.h
r949 r2204 1 /* $Id: oslibutil.h,v 1. 1 1999-09-15 23:18:54 sandervlExp $ */1 /* $Id: oslibutil.h,v 1.2 1999-12-26 17:30:15 cbratschi Exp $ */ 2 2 /* 3 3 * Window API utility functions for OS/2 … … 24 24 void SetThreadMessageQueue(HMQ hmq); 25 25 26 DWORD GetThreadMessageExtraInfo(); 27 DWORD SetThreadMessageExtraInfo(DWORD lParam); 28 26 29 #endif //__OSLIBUTIL_H__ -
trunk/src/user32/oslibwin.cpp
r2201 r2204 1 /* $Id: oslibwin.cpp,v 1.5 1 1999-12-24 18:51:55 sandervlExp $ */1 /* $Id: oslibwin.cpp,v 1.52 1999-12-26 17:30:15 cbratschi Exp $ */ 2 2 /* 3 3 * Window API wrappers for OS/2 … … 1196 1196 //****************************************************************************** 1197 1197 //****************************************************************************** 1198 BOOL OSLibWinEnableWindowUpdate(HWND hwnd,BOOL fEnable) 1199 { 1200 return WinEnableWindowUpdate(hwnd,fEnable); 1201 } -
trunk/src/user32/oslibwin.h
r1983 r2204 1 /* $Id: oslibwin.h,v 1.2 7 1999-12-05 16:37:58 sandervlExp $ */1 /* $Id: oslibwin.h,v 1.28 1999-12-26 17:30:16 cbratschi Exp $ */ 2 2 /* 3 3 * Window API wrappers for OS/2 … … 285 285 BOOL OSLibWinSetKeyboardStateTable(unsigned char * PMKeyState); 286 286 287 #define HTOS_NORMAL 0 288 #define HTOS_TRANSPARENT (-1) 289 #define HTOS_DISCARD (-2) 290 #define HTOS_ERROR (-3) 291 292 BOOL OSLibWinEnableWindowUpdate(HWND hwnd,BOOL fEnable); 293 287 294 #endif //__OSLIBWIN_H__ -
trunk/src/user32/pmframe.cpp
r2200 r2204 1 /* $Id: pmframe.cpp,v 1. 29 1999-12-24 18:39:10 sandervlExp $ */1 /* $Id: pmframe.cpp,v 1.30 1999-12-26 17:30:16 cbratschi Exp $ */ 2 2 /* 3 3 * Win32 Frame Managment Code for OS/2 … … 203 203 //****************************************************************************** 204 204 //****************************************************************************** 205 void FrameTrackFrame(Win32BaseWindow *win32wnd,BOOL lefttop) 206 { 207 INT flags = lefttop ? (TF_LEFT | TF_TOP):(TF_RIGHT | TF_BOTTOM); 208 209 WinSendMsg(win32wnd->getOS2FrameWindowHandle(),WM_TRACKFRAME,(MPARAM)flags,(MPARAM)0); 210 } 211 //****************************************************************************** 212 // used by statusbar control 213 //****************************************************************************** 214 VOID WINAPI TrackWin32Window(HWND hwnd,BOOL lefttop) 215 { 216 Win32BaseWindow *win32wnd = Win32BaseWindow::GetWindowFromHandle(hwnd); 217 INT flags = lefttop ? (TF_LEFT | TF_TOP):(TF_RIGHT | TF_BOTTOM); 218 219 if (!win32wnd) return; 220 205 VOID FrameTrackFrame(Win32BaseWindow *win32wnd,DWORD flags) 206 { 221 207 WinSendMsg(win32wnd->getOS2FrameWindowHandle(),WM_TRACKFRAME,(MPARAM)flags,(MPARAM)0); 222 208 } … … 319 305 WINDOWPOS wp; 320 306 HWND hParent = NULLHANDLE; 321 LONG yDelta = pswp->cy - swpOld.cy;322 LONG xDelta = pswp->cx - swpOld.cx;323 LONG clientHeight;324 307 325 308 dprintf(("PMFRAME: WM_WINDOWPOSCHANGED (%x) %x %x (%d,%d) (%d,%d)", mp2, win32wnd->getWindowHandle(), pswp->fl, pswp->x, pswp->y, pswp->cx, pswp->cy)); 326 327 //Save height so WM_WINDOWPOSCHANGED handler in pmwindow.cpp328 //(for client) doesn't overwrite the client rectangle (breaks ydelta calculation)329 clientHeight = win32wnd->getWindowHeight();330 309 331 310 RestoreOS2TIB(); 332 311 rc = OldFrameProc(hwnd,msg,mp1,mp2); 333 312 SetWin32TIB(); 334 335 if (win32wnd->getParent() && win32wnd->getParent()->InMovingChildren())336 goto PosChangedEnd; //same Win32 pos, only OS/2 pos changed337 313 338 314 if ((pswp->fl & (SWP_SIZE | SWP_MOVE | SWP_ZORDER)) == 0) … … 349 325 OSLibMapSWPtoWINDOWPOSFrame(pswp, &wp, &swpOld, hParent, hwnd); 350 326 351 //delta is difference between old and new client height352 yDelta = swpOld.cy - clientHeight;353 354 327 win32wnd->setWindowRect(wp.x, wp.y, wp.x+wp.cx, wp.y+wp.cy); 355 328 win32wnd->setClientRect(swpOld.x, swpOld.y, swpOld.x + swpOld.cx, swpOld.y + swpOld.cy); 356 329 357 wp.hwnd = win32wnd->getWindowHandle(); 358 if ((pswp->fl & SWP_ZORDER) && (pswp->hwndInsertBehind > HWND_BOTTOM)) 359 { 360 Win32BaseWindow *wndAfter = Win32BaseWindow::GetWindowFromOS2Handle(pswp->hwndInsertBehind); 361 if(wndAfter) wp.hwndInsertAfter = wndAfter->getWindowHandle(); 362 } 363 364 #if 0 //CB: PM does it now for us (-> WM_CALVALIDRECTS) 365 // if you remove this code, delete *MovingChildren in Win32BaseWindow class 366 if (yDelta != 0 || xDelta != 0) 367 { 368 HENUM henum = WinBeginEnumWindows(WinWindowFromID(hwnd,FID_CLIENT)); 369 SWP swp[10]; 370 int i = 0; 371 HWND hwnd; 372 373 win32wnd->setMovingChildren(TRUE); 374 while ((hwnd = WinGetNextWindow(henum)) != NULLHANDLE) 375 { 376 WinQueryWindowPos(hwnd, &(swp[i])); 377 378 #ifdef DEBUG 379 Win32BaseWindow *window = Win32BaseWindow::GetWindowFromOS2Handle(hwnd); 380 dprintf(("ENUMERATE %x delta %d (%d,%d) (%d,%d) %x", (window) ? window->getWindowHandle() : hwnd, 381 yDelta, swp[i].x, swp[i].y, swp[i].cx, swp[i].cy, swp[i].fl)); 382 #endif 383 384 //if(swp[i].y != 0) //CB: y value of 0 is valid! 385 { 386 //child window at offset <> 0 from client area -> offset now changes 387 swp[i].y += yDelta; 388 swp[i].fl = SWP_MOVE | SWP_NOADJUST; 389 } 390 //else child window with the same start coordinates as the client area 391 //The app should resize it. 392 393 if (i == 9) 394 { 395 WinSetMultWindowPos(GetThreadHAB(), swp, 10); 396 i = 0; 397 } 398 else 399 { 400 i++; 401 } 402 } 403 404 WinEndEnumWindows(henum); 405 406 if (i) 407 WinSetMultWindowPos(GetThreadHAB(), swp, i); 408 win32wnd->setMovingChildren(FALSE); 409 } 410 if (yDelta != 0) 411 { 412 POINT pt; 413 if(GetCaretPos (&pt) == TRUE) 414 { 415 pt.y -= yDelta; 416 SetCaretPos (pt.x, pt.y); 417 } 418 } 419 #endif 420 if(!win32wnd->CanReceiveSizeMsgs()) 421 goto PosChangedEnd; 422 423 win32wnd->MsgPosChanged((LPARAM)&wp); 330 if(win32wnd->CanReceiveSizeMsgs()) 331 win32wnd->MsgPosChanged((LPARAM)&wp); 424 332 425 333 PosChangedEnd: … … 703 611 } 704 612 613 DWORD FrameHitTest(Win32BaseWindow *win32wnd,INT x,INT y) 614 { 615 POINTL point; 616 HWND hwnd = win32wnd->getOS2FrameWindowHandle(),child; 617 618 if (hwnd == win32wnd->getOS2WindowHandle()) return HTCLIENT_W; 619 if (win32wnd->getOS2WindowHandle() == WinQueryCapture(HWND_DESKTOP)) return HTCLIENT_W; 620 point.x = x; 621 point.y = WinQuerySysValue(HWND_DESKTOP,SV_CYSCREEN)-y-1; 622 WinMapWindowPoints(HWND_DESKTOP,hwnd,&point,1); 623 child = WinWindowFromPoint(hwnd,&point,FALSE); 624 625 if (child == 0) return HTERROR_W; 626 if (child == win32wnd->getOS2FrameWindowHandle()) 627 { 628 RECTL client,frame; 629 630 if (CanDrawSizeBox(win32wnd)) 631 { 632 RECTL rect; 633 634 GetSizeBox(win32wnd,&rect); 635 if (WinPtInRect(GetThreadHAB(),&rect,&point)) return HTGROWBOX_W; 636 } 637 //somewhere in the border 638 INT w = WinQuerySysValue(HWND_DESKTOP,SV_CXMINMAXBUTTON); 639 INT h = WinQuerySysValue(HWND_DESKTOP,SV_CXMINMAXBUTTON); 640 WinQueryWindowRect(hwnd,&frame); 641 642 if (point.y < h) 643 { 644 if (point.x < w) return HTBOTTOMLEFT_W; 645 if (point.x > frame.xRight-1-w) return HTBOTTOMRIGHT_W; 646 return HTBOTTOM_W; 647 } 648 if (point.y > frame.yTop-1-h) 649 { 650 if (point.x < w) return HTTOPLEFT_W; 651 if (point.x > frame.xRight-1-w) return HTTOPRIGHT_W; 652 return HTTOP_W; 653 } 654 return HTBORDER_W; 655 } else 656 { 657 if (child == WinWindowFromID(hwnd,FID_CLIENT)) return HTCLIENT_W; 658 if (child == WinWindowFromID(hwnd,FID_VERTSCROLL)) return HTVSCROLL_W; 659 if (child == WinWindowFromID(hwnd,FID_HORZSCROLL)) return HTHSCROLL_W; 660 if (child == WinWindowFromID(hwnd,FID_SYSMENU)) return HTSYSMENU_W; 661 if (child == WinWindowFromID(hwnd,FID_TITLEBAR)) return HTCAPTION_W; 662 if (child == WinWindowFromID(hwnd,FID_MENU)) return HTMENU_W; 663 if (child == WinWindowFromID(hwnd,FID_MINMAX)) 664 { 665 //CB: close, reduce or zoom 666 return HTZOOM_W; 667 } 668 669 return HTERROR_W; 670 } 671 } -
trunk/src/user32/pmframe.h
r1693 r2204 1 /* $Id: pmframe.h,v 1. 4 1999-11-10 17:11:30cbratschi Exp $ */1 /* $Id: pmframe.h,v 1.5 1999-12-26 17:30:16 cbratschi Exp $ */ 2 2 /* 3 3 * Win32 Frame Managment Code for OS/2 … … 18 18 VOID FrameUpdateFrame(Win32BaseWindow *win32wnd,DWORD flags); 19 19 20 #define HTERROR_W (-2) 21 #define HTTRANSPARENT_W (-1) 22 #define HTNOWHERE_W 0 23 #define HTCLIENT_W 1 24 #define HTCAPTION_W 2 25 #define HTSYSMENU_W 3 26 #define HTSIZE_W 4 27 #define HTMENU_W 5 28 #define HTHSCROLL_W 6 29 #define HTVSCROLL_W 7 30 #define HTMINBUTTON_W 8 31 #define HTMAXBUTTON_W 9 32 #define HTLEFT_W 10 33 #define HTRIGHT_W 11 34 #define HTTOP_W 12 35 #define HTTOPLEFT_W 13 36 #define HTTOPRIGHT_W 14 37 #define HTBOTTOM_W 15 38 #define HTBOTTOMLEFT_W 16 39 #define HTBOTTOMRIGHT_W 17 40 #define HTBORDER_W 18 41 #define HTGROWBOX_W HTSIZE_W 42 #define HTREDUCE_W HTMINBUTTON_W 43 #define HTZOOM_W HTMAXBUTTON_W 44 #define HTOBJECT_W 19 45 #define HTCLOSE_W 20 46 #define HTHELP_W 21 47 #define HTSIZEFIRST_W HTLEFT_W 48 #define HTSIZELAST_W HTBOTTOMRIGHT_W 49 50 DWORD FrameHitTest(Win32BaseWindow *win32wnd,INT x,INT y); 51 52 #define TFOS_LEFT 0x0001 53 #define TFOS_TOP 0x0002 54 #define TFOS_RIGHT 0x0004 55 #define TFOS_BOTTOM 0x0008 56 /* TF_MOVE = TF_LEFT | TF_TOP | TF_RIGHT | TF_BOTTOM */ 57 #define TFOS_MOVE 0x000F 58 59 VOID FrameTrackFrame(Win32BaseWindow *win32wnd,DWORD flags); 60 20 61 #endif -
trunk/src/user32/pmwindow.cpp
r2200 r2204 1 /* $Id: pmwindow.cpp,v 1. 69 1999-12-24 18:39:10 sandervlExp $ */1 /* $Id: pmwindow.cpp,v 1.70 1999-12-26 17:30:16 cbratschi Exp $ */ 2 2 /* 3 3 * Win32 Window Managment Code for OS/2 … … 136 136 Win32BaseWindow *win32wnd; 137 137 THDB *thdb; 138 APIRET rc ;138 APIRET rc = 0; 139 139 MSG winMsg, *pWinMsg; 140 140 … … 175 175 if(msg == WIN32APP_POSTMSG && (ULONG)mp1 == WIN32PM_MAGIC) { 176 176 //win32 app user message 177 return (MRESULT)win32wnd->PostMessage((POSTMSG_PACKET *)mp2); ;177 return (MRESULT)win32wnd->PostMessage((POSTMSG_PACKET *)mp2); 178 178 } 179 179 switch( msg ) … … 203 203 case WM_QUIT: 204 204 dprintf(("OS2: WM_QUIT %x", hwnd)); 205 if(win32wnd->MsgQuit()) { 206 goto RunDefWndProc; 207 } 205 win32wnd->MsgQuit(); 208 206 break; 209 207 210 208 case WM_CLOSE: 211 209 dprintf(("OS2: WM_CLOSE %x", hwnd)); 212 if(win32wnd->MsgClose()) { 213 goto RunDefWndProc; 214 } 210 win32wnd->MsgClose(); 215 211 break; 216 212 217 213 case WM_DESTROY: 218 214 dprintf(("OS2: WM_DESTROY %x", hwnd)); 219 if(win32wnd->MsgDestroy()) { 220 goto RunDefWndProc; 221 } 215 win32wnd->MsgDestroy(); 222 216 break; 223 217 224 218 case WM_ENABLE: 225 219 dprintf(("OS2: WM_ENABLE %x", hwnd)); 226 if(win32wnd->MsgEnable(SHORT1FROMMP(mp1))) { 227 goto RunDefWndProc; 228 } 220 win32wnd->MsgEnable(SHORT1FROMMP(mp1)); 229 221 break; 230 222 231 223 case WM_SHOW: 232 224 dprintf(("OS2: WM_SHOW %x %d", hwnd, mp1)); 233 if(win32wnd->MsgShow((ULONG)mp1)) { 234 goto RunDefWndProc; 235 } 225 win32wnd->MsgShow((ULONG)mp1); 236 226 break; 237 227 … … 322 312 } 323 313 324 if(win32wnd->MsgActivate(SHORT1FROMMP(mp1), fMinimized, Win32BaseWindow::OS2ToWin32Handle(hwndActivate))) { 325 goto RunDefWndProc; 326 } 327 break; 314 win32wnd->MsgActivate(SHORT1FROMMP(mp1), fMinimized, Win32BaseWindow::OS2ToWin32Handle(hwndActivate)); 315 break; 316 } 317 318 case WM_SIZE: 319 { 320 dprintf(("OS2: WM_SIZE (%d,%d) (%d,%d)", SHORT1FROMMP(mp2), SHORT2FROMMP(mp2), SHORT1FROMMP(mp1), SHORT2FROMMP(mp2))); 321 break; 322 } 323 324 case WM_MINMAXFRAME: 325 { 326 dprintf(("OS2: WM_MINMAXFRAME")); 327 break; 328 } 329 330 case WM_OWNERPOSCHANGE: 331 { 332 dprintf(("OS2: WM_OWNERPOSCHANGE")); 333 goto RunDefWndProc; 334 } 335 336 case WM_CALCVALIDRECTS: 337 { 338 dprintf(("OS2: WM_CALCVALIDRECTS")); 339 goto RunDefWndProc; 328 340 } 329 341 … … 341 353 HWND hwndFocusWin32 = Win32BaseWindow::OS2ToWin32Handle(hwndFocus); 342 354 recreateCaret (hwndFocusWin32); 343 rc = win32wnd->MsgSetFocus(hwndFocusWin32); 344 } 345 else rc = win32wnd->MsgKillFocus(Win32BaseWindow::OS2ToWin32Handle(hwndFocus)); 346 if(rc) { 347 goto RunDefWndProc; 348 } 355 win32wnd->MsgSetFocus(hwndFocusWin32); 356 } 357 else win32wnd->MsgKillFocus(Win32BaseWindow::OS2ToWin32Handle(hwndFocus)); 349 358 break; 350 359 } … … 362 371 case WM_BUTTON3UP: 363 372 case WM_BUTTON3DBLCLK: 364 if(win32wnd->MsgButton(pWinMsg)) { 365 goto RunDefWndProc; 366 } 373 win32wnd->MsgButton(pWinMsg); 374 rc = TRUE; 367 375 break; 368 376 … … 386 394 387 395 case WM_CONTROL: 396 goto RunDefWndProc; 397 388 398 case WM_COMMAND: 389 399 dprintf(("OS2: WM_COMMAND %x %x %x", hwnd, mp1, mp2)); 390 400 win32wnd->DispatchMsg(pWinMsg); 391 //todo controls + accelerators392 401 break; 393 402 394 403 case WM_SYSCOMMAND: 395 { 396 if(win32wnd->DispatchMsg(pWinMsg)) { 397 goto RunDefWndProc; 398 } 399 break; 400 } 404 win32wnd->DispatchMsg(pWinMsg); 405 break; 406 401 407 case WM_CHAR: 402 {403 408 win32wnd->DispatchMsg(pWinMsg); 404 409 break; 405 }406 410 407 411 case WM_INITMENU: … … 424 428 dprintf(("OS2: WM_SETWINDOWPARAMS %x", hwnd)); 425 429 if(wndParams->fsStatus & WPM_TEXT) { 426 if(win32wnd->MsgSetText(wndParams->pszText, wndParams->cchText)) { 427 goto RunDefWndProc; 428 } 430 win32wnd->MsgSetText(wndParams->pszText, wndParams->cchText); 429 431 } 430 432 goto RunDefWndProc; … … 458 460 459 461 case WM_HITTEST: 460 // Only send this message if the window is enabled 461 if (WinIsWindowEnabled(hwnd)) 462 { 463 if(win32wnd->MsgHitTest(pWinMsg)) { 464 goto RunDefWndProc; 465 } 466 } 467 else goto RunDefWndProc; 462 { 463 DWORD res; 464 465 // Only send this message if the window is enabled 466 if (!WinIsWindowEnabled(hwnd)) 467 res = HT_ERROR; 468 else if (win32wnd->getIgnoreHitTest()) 469 res = HT_NORMAL; 470 else 471 { 472 dprintf(("USER32: WM_HITTEST %x (%d,%d)",hwnd,(*(POINTS *)&mp1).x,(*(POINTS *)&mp1).y)); 473 474 //CB: WinWindowFromPoint: PM sends WM_HITTEST -> loop -> stack overflow 475 win32wnd->setIgnoreHitTest(TRUE); 476 res = win32wnd->MsgHitTest(pWinMsg); 477 win32wnd->setIgnoreHitTest(FALSE); 478 } 479 RestoreOS2TIB(); 480 return (MRESULT)res; 481 } 468 482 469 483 case WM_CONTEXTMENU: … … 479 493 dprintf(("OS2: WM_ERASEBACKGROUND %x", win32wnd->getWindowHandle())); 480 494 break; 481 }482 483 case WM_SIZE:484 {485 dprintf(("OS2: WM_SIZE (%d,%d) (%d,%d)", SHORT1FROMMP(mp2), SHORT2FROMMP(mp2), SHORT1FROMMP(mp1), SHORT2FROMMP(mp2)));486 break;487 }488 case WM_MINMAXFRAME:489 {490 dprintf(("OS2: WM_MINMAXFRAME"));491 break;492 }493 case WM_OWNERPOSCHANGE:494 {495 dprintf(("OS2: WM_OWNERPOSCHANGE"));496 goto RunDefWndProc;497 }498 499 case WM_CALCVALIDRECTS:500 {501 dprintf(("OS2: WM_CALCVALIDRECTS"));502 goto RunDefWndProc;503 495 } 504 496 … … 533 525 } 534 526 RestoreOS2TIB(); 535 return (MRESULT) FALSE;527 return (MRESULT)rc; 536 528 537 529 RunDefWndProc: -
trunk/src/user32/scroll.cpp
r2093 r2204 1 /* $Id: scroll.cpp,v 1.2 8 1999-12-16 16:53:57 cbratschi Exp $ */1 /* $Id: scroll.cpp,v 1.29 1999-12-26 17:30:17 cbratschi Exp $ */ 2 2 /* 3 3 * Scrollbar control … … 732 732 if (!(dwStyle & SBS_SIZEGRIP)) return res; 733 733 734 if (msg == WM_SETCURSOR) 735 { 736 RECT rect; 737 738 SCROLL_GetSizeBox(hwnd,dwStyle,&rect); 739 GetCursorPos(&pt); 740 ScreenToClient(hwnd,&pt); 741 742 if (PtInRect(&rect,pt)) 743 { 744 SetCursor(LoadCursorA(0,IDC_SIZENWSEA)); 745 return TRUE; 746 } 747 748 return DefWindowProcA(hwnd,WM_SETCURSOR,wParam,lParam); 749 } else if (msg == WM_LBUTTONDOWN) 734 if (msg == WM_NCHITTEST) 750 735 { 751 736 if (dwStyle & SBS_SIZEGRIP) … … 755 740 pt.x = (SHORT)LOWORD(lParam); 756 741 pt.y = (SHORT)HIWORD(lParam); 742 ScreenToClient(hwnd,&pt); 757 743 SCROLL_GetSizeBox(hwnd,dwStyle,&rect); 758 744 if (PtInRect(&rect,pt)) 759 745 { 760 HWND hwndFrame; 761 762 Win32BaseWindow *win32wnd = Win32BaseWindow::GetWindowFromHandle(hwnd); 763 if (!win32wnd) return res; 764 hwndFrame = OSLibWinQueryWindow(win32wnd->getOS2WindowHandle(),QWOS_OWNER); 765 win32wnd = Win32BaseWindow::GetWindowFromOS2FrameHandle(hwndFrame); 766 if (!win32wnd) return res; 767 FrameTrackFrame(win32wnd,dwStyle & SBS_SIZEBOXTOPLEFTALIGN); 746 if (dwStyle & SBS_SIZEBOXTOPLEFTALIGN) 747 return HTTOPLEFT; 748 else 749 return HTBOTTOMRIGHT; 768 750 } 769 751 } 752 return DefWindowProcA(hwnd,WM_NCHITTEST,wParam,lParam); 753 } else if (msg == WM_LBUTTONDOWN) 754 { 755 return DefWindowProcA(hwnd,WM_LBUTTONDOWN,wParam,lParam); 770 756 } 771 757 … … 774 760 } 775 761 776 if (msg == WM_SETCURSOR) return DefWindowProcA(hwnd,WM_SETCURSOR,wParam,lParam); 777 if (!SCROLL_Scrolling && msg != WM_LBUTTONDOWN) return res; 778 779 vertical = SCROLL_GetScrollBarRect( hwnd, nBar, &rect, 780 &arrowSize, &thumbSize, &thumbPos ); 762 if (msg == WM_NCHITTEST) return DefWindowProcA(hwnd,WM_NCHITTEST,wParam,lParam); 763 764 vertical = SCROLL_GetScrollBarRect(hwnd,nBar,&rect,&arrowSize,&thumbSize,&thumbPos); 781 765 if (nBar == SB_CTL) hwndOwner = GetParent(hwnd); else 782 766 { … … 792 776 } 793 777 794 hwndCtl = (nBar == SB_CTL) ? hwnd :0;778 hwndCtl = (nBar == SB_CTL) ? hwnd:0; 795 779 796 780 switch (msg) … … 800 784 pt.y = (SHORT)HIWORD(lParam); 801 785 SCROLL_trackVertical = vertical; 802 SCROLL_trackHitTest = hittest = SCROLL_HitTest( hwnd, nBar, pt, FALSE);786 SCROLL_trackHitTest = hittest = SCROLL_HitTest(hwnd,nBar,pt,FALSE); 803 787 if (SCROLL_trackHitTest == SCROLL_NOWHERE) 804 788 { … … 819 803 trackThumbPos = thumbPos; 820 804 prevPt = pt; 821 SetCapture( hwnd);822 if (nBar == SB_CTL) SetFocus( hwnd);805 if (nBar == SB_CTL) SetFocus(hwnd); 806 SetCapture(hwnd); 823 807 break; 824 808 825 809 case WM_MOUSEMOVE: 826 pt.x = (SHORT)LOWORD(lParam); 827 pt.y = (SHORT)HIWORD(lParam); 828 hittest = SCROLL_HitTest( hwnd, nBar, pt, TRUE ); 829 prevPt = pt; 810 if (SCROLL_Scrolling) 811 { 812 pt.x = (SHORT)LOWORD(lParam); 813 pt.y = (SHORT)HIWORD(lParam); 814 hittest = SCROLL_HitTest(hwnd,nBar,pt,TRUE); 815 prevPt = pt; 816 } else return res; 830 817 break; 831 818 … … 1138 1125 case WM_LBUTTONDOWN: 1139 1126 case WM_LBUTTONUP: 1127 case WM_NCHITTEST: 1140 1128 case WM_CAPTURECHANGED: 1141 1129 case WM_MOUSEMOVE: 1142 case WM_SETCURSOR:1143 1130 case WM_SYSTIMER: 1144 1131 case WM_SETFOCUS: … … 1216 1203 case WM_LBUTTONDOWN: 1217 1204 case WM_LBUTTONUP: 1205 case WM_NCHITTEST: 1218 1206 case WM_CAPTURECHANGED: 1219 1207 case WM_MOUSEMOVE: 1220 case WM_SETCURSOR:1221 1208 case WM_SYSTIMER: 1222 1209 case WM_SETFOCUS: … … 1271 1258 case WM_LBUTTONDOWN: 1272 1259 case WM_LBUTTONUP: 1260 case WM_NCHITTEST: 1273 1261 case WM_CAPTURECHANGED: 1274 1262 case WM_MOUSEMOVE: 1275 case WM_SETCURSOR:1276 1263 case WM_SYSTIMER: 1277 1264 case WM_SETFOCUS: -
trunk/src/user32/user32exp.def
r1818 r2204 578 578 GetOS2Callback__15Win32WindowProcFv @2001 579 579 _GetSysColorPen@4 @2002 580 _TrackWin32Window@8 @2003581 580 Win32ToOS2Handle__FUl @2006 582 581 _MOUSE_Enable@4 @2007 -
trunk/src/user32/win32wbase.cpp
r2202 r2204 1 /* $Id: win32wbase.cpp,v 1.11 8 1999-12-24 21:44:04 sandervlExp $ */1 /* $Id: win32wbase.cpp,v 1.119 1999-12-26 17:30:18 cbratschi Exp $ */ 2 2 /* 3 3 * Win32 Window Base Class for OS/2 … … 8 8 * Parts based on Wine Windows code (windows\win.c) 9 9 * 10 * Copyright 1993, 1994 Alexandre Julliard 10 * Copyright 1993, 1994, 1996 Alexandre Julliard 11 * 1995 Alex Korobka 11 12 * 12 13 * TODO: Not thread/process safe … … 146 147 fInternalMsg = FALSE; 147 148 fNoSizeMsg = FALSE; 148 fMovingChildren = FALSE;149 149 fIsDestroyed = FALSE; 150 150 fDestroyWindowCalled = FALSE; … … 190 190 flags = 0; 191 191 isIcon = FALSE; 192 lastHitTestVal = 0; 192 lastHitTestVal = HTOS_NORMAL; 193 fIgnoreHitTest = FALSE; 193 194 owner = NULL; 194 195 windowClass = 0; … … 777 778 ULONG Win32BaseWindow::MsgClose() 778 779 { 779 if(SendInternalMessageA(WM_CLOSE, 0, 0) == 0) { 780 dprintf(("Win32BaseWindow::MsgClose, app handles msg")); 781 return 0; //app handles this message 782 } 783 return 1; 780 return SendInternalMessageA(WM_CLOSE,0,0); 784 781 } 785 782 //****************************************************************************** … … 856 853 ULONG Win32BaseWindow::MsgPosChanging(LPARAM lp) 857 854 { 858 if(fNoSizeMsg || (getParent() && getParent()->InMovingChildren()))855 if(fNoSizeMsg) 859 856 return 1; 860 857 … … 865 862 ULONG Win32BaseWindow::MsgPosChanged(LPARAM lp) 866 863 { 867 if(fNoSizeMsg || (getParent() && getParent()->InMovingChildren()))864 if(fNoSizeMsg) 868 865 return 1; 869 866 … … 892 889 lastHitTestVal = SendInternalMessageA(WM_NCHITTEST, 0, MAKELONG((USHORT)msg->pt.x, (USHORT)msg->pt.y)); 893 890 dprintf2(("MsgHitTest returned %x", lastHitTestVal)); 894 return 1; //TODO: May need to change this 891 892 if (lastHitTestVal == HTERROR) 893 return HTOS_ERROR; 894 895 #if 0 //CB: problems with groupboxes, internal handling is better 896 if (lastHitTestVal == HTTRANSPARENT) 897 return HTOS_TRANSPARENT; 898 #endif 899 900 return HTOS_NORMAL; 895 901 } 896 902 //****************************************************************************** … … 967 973 968 974 dprintf(("MsgButton at (%d,%d)", msg->pt.x, msg->pt.y)); 969 switch(msg->message) { //TODO: double click also?975 switch(msg->message) { 970 976 case WM_LBUTTONDBLCLK: 971 977 case WM_RBUTTONDBLCLK: 972 978 case WM_MBUTTONDBLCLK: 979 case WM_NCLBUTTONDBLCLK: 980 case WM_NCRBUTTONDBLCLK: 981 case WM_NCMBUTTONDBLCLK: 973 982 if (!(windowClass && windowClass->getClassLongA(GCL_STYLE) & CS_DBLCLKS)) 974 983 { 975 984 msg->message = msg->message - (WM_LBUTTONDBLCLK - WM_LBUTTONDOWN); //dblclick -> down 976 985 MsgButton(msg); 986 msg->message++; //button-up 977 987 return MsgButton(msg); 978 988 } … … 981 991 case WM_RBUTTONDOWN: 982 992 case WM_MBUTTONDOWN: 993 case WM_NCLBUTTONDOWN: 994 case WM_NCRBUTTONDOWN: 995 case WM_NCMBUTTONDOWN: 983 996 fClick = TRUE; 984 997 break; … … 1236 1249 } 1237 1250 /*********************************************************************** 1251 * NC_HandleNCLButtonDown 1252 * 1253 * Handle a WM_NCLBUTTONDOWN message. Called from DefWindowProc(). 1254 */ 1255 LONG Win32BaseWindow::HandleNCLButtonDown(WPARAM wParam,LPARAM lParam) 1256 { 1257 switch(wParam) /* Hit test */ 1258 { 1259 case HTCAPTION: 1260 SendInternalMessageA(WM_SYSCOMMAND,SC_MOVE+HTCAPTION,lParam); 1261 break; 1262 1263 case HTSYSMENU: 1264 SendInternalMessageA(WM_SYSCOMMAND,SC_MOUSEMENU+HTSYSMENU,lParam); 1265 break; 1266 1267 case HTMENU: 1268 SendInternalMessageA(WM_SYSCOMMAND,SC_MOUSEMENU,lParam); 1269 break; 1270 1271 case HTHSCROLL: 1272 SendInternalMessageA(WM_SYSCOMMAND,SC_HSCROLL+HTHSCROLL,lParam); 1273 break; 1274 1275 case HTVSCROLL: 1276 SendInternalMessageA(WM_SYSCOMMAND,SC_VSCROLL+HTVSCROLL,lParam); 1277 break; 1278 1279 case HTLEFT: 1280 case HTRIGHT: 1281 case HTTOP: 1282 case HTTOPLEFT: 1283 case HTTOPRIGHT: 1284 case HTBOTTOM: 1285 case HTBOTTOMLEFT: 1286 case HTBOTTOMRIGHT: 1287 /* make sure hittest fits into 0xf and doesn't overlap with HTSYSMENU */ 1288 SendInternalMessageA(WM_SYSCOMMAND,SC_SIZE+wParam-2,lParam); 1289 break; 1290 case HTBORDER: 1291 break; 1292 } 1293 1294 return 0; 1295 } 1296 //****************************************************************************** 1297 //****************************************************************************** 1298 LONG Win32BaseWindow::HandleNCLButtonUp(WPARAM wParam,LPARAM lParam) 1299 { 1300 switch(wParam) /* Hit test */ 1301 { 1302 case HTMINBUTTON: 1303 SendInternalMessageA(WM_SYSCOMMAND,SC_MINIMIZE,lParam); 1304 break; 1305 1306 case HTMAXBUTTON: 1307 SendInternalMessageA(WM_SYSCOMMAND,SC_MAXIMIZE,lParam); 1308 break; 1309 1310 case HTCLOSE: 1311 SendInternalMessageA(WM_SYSCOMMAND,SC_CLOSE,lParam); 1312 break; 1313 } 1314 1315 return 0; 1316 } 1317 /*********************************************************************** 1318 * NC_HandleNCLButtonDblClk 1319 * 1320 * Handle a WM_NCLBUTTONDBLCLK message. Called from DefWindowProc(). 1321 */ 1322 LONG Win32BaseWindow::HandleNCLButtonDblClk(WPARAM wParam,LPARAM lParam) 1323 { 1324 /* 1325 * if this is an icon, send a restore since we are handling 1326 * a double click 1327 */ 1328 if (dwStyle & WS_MINIMIZE) 1329 { 1330 SendInternalMessageA(WM_SYSCOMMAND,SC_RESTORE,lParam); 1331 return 0; 1332 } 1333 1334 switch(wParam) /* Hit test */ 1335 { 1336 case HTCAPTION: 1337 /* stop processing if WS_MAXIMIZEBOX is missing */ 1338 if (dwStyle & WS_MAXIMIZEBOX) 1339 SendInternalMessageA(WM_SYSCOMMAND, 1340 (dwStyle & WS_MAXIMIZE) ? SC_RESTORE : SC_MAXIMIZE, 1341 lParam); 1342 break; 1343 1344 case HTSYSMENU: 1345 if (!(GetClassWord(Win32Hwnd,GCW_STYLE) & CS_NOCLOSE)) 1346 SendInternalMessageA(WM_SYSCOMMAND,SC_CLOSE,lParam); 1347 break; 1348 1349 case HTHSCROLL: 1350 SendInternalMessageA(WM_SYSCOMMAND,SC_HSCROLL+HTHSCROLL,lParam); 1351 break; 1352 1353 case HTVSCROLL: 1354 SendInternalMessageA(WM_SYSCOMMAND,SC_VSCROLL+HTVSCROLL,lParam); 1355 break; 1356 } 1357 1358 return 0; 1359 } 1360 /*********************************************************************** 1238 1361 * NC_HandleSysCommand 1239 1362 * … … 1251 1374 switch (uCommand) 1252 1375 { 1253 #if 0 1376 1254 1377 case SC_SIZE: 1378 { 1379 DWORD flags = 0; 1380 1381 switch ((wParam & 0xF)+2) 1382 { 1383 case HTLEFT: 1384 flags = TFOS_LEFT; 1385 break; 1386 1387 case HTRIGHT: 1388 flags = TFOS_RIGHT; 1389 break; 1390 1391 case HTTOP: 1392 flags = TFOS_TOP; 1393 break; 1394 1395 case HTTOPLEFT: 1396 flags = TFOS_TOP | TFOS_LEFT; 1397 break; 1398 1399 case HTTOPRIGHT: 1400 flags = TFOS_TOP | TFOS_RIGHT; 1401 break; 1402 1403 case HTBOTTOM: 1404 flags = TFOS_BOTTOM; 1405 break; 1406 1407 case HTBOTTOMLEFT: 1408 flags = TFOS_BOTTOM | TFOS_LEFT; 1409 break; 1410 1411 case HTBOTTOMRIGHT: 1412 flags = TFOS_BOTTOM | TFOS_RIGHT; 1413 break; 1414 } 1415 if (flags) FrameTrackFrame(this,flags); 1416 break; 1417 } 1418 1255 1419 case SC_MOVE: 1256 NC_DoSizeMove( hwnd, wParam ); 1257 break; 1258 #endif 1420 FrameTrackFrame(this,TFOS_MOVE); 1421 break; 1259 1422 1260 1423 case SC_MINIMIZE: … … 1362 1525 //****************************************************************************** 1363 1526 //****************************************************************************** 1527 LRESULT Win32BaseWindow::DefWndPrint(HDC hdc,ULONG uFlags) 1528 { 1529 /* 1530 * Visibility flag. 1531 */ 1532 if ( (uFlags & PRF_CHECKVISIBLE) && 1533 !IsWindowVisible() ) 1534 return 0; 1535 1536 /* 1537 * Unimplemented flags. 1538 */ 1539 if ( (uFlags & PRF_CHILDREN) || 1540 (uFlags & PRF_OWNED) || 1541 (uFlags & PRF_NONCLIENT) ) 1542 { 1543 dprintf(("WM_PRINT message with unsupported flags\n")); 1544 } 1545 1546 /* 1547 * Background 1548 */ 1549 if ( uFlags & PRF_ERASEBKGND) 1550 SendInternalMessageA(WM_ERASEBKGND, (WPARAM)hdc, 0); 1551 1552 /* 1553 * Client area 1554 */ 1555 if ( uFlags & PRF_CLIENT) 1556 SendInternalMessageA(WM_PRINTCLIENT, (WPARAM)hdc, PRF_CLIENT); 1557 1558 1559 return 0; 1560 } 1561 //****************************************************************************** 1562 //****************************************************************************** 1364 1563 LRESULT Win32BaseWindow::DefWindowProcA(UINT Msg, WPARAM wParam, LPARAM lParam) 1365 1564 { … … 1411 1610 case WM_SETREDRAW: 1412 1611 { 1413 DWORD oldStyle = getStyle(); 1414 1415 if(wParam) 1416 setStyle(getStyle() | WS_VISIBLE); 1417 else setStyle(getStyle() & ~WS_VISIBLE); 1418 1419 updateWindowStyle(getExStyle(), oldStyle); 1420 1421 return 0; //TODO 1422 } 1612 if (wParam) 1613 { 1614 setStyle(getStyle() | WS_VISIBLE); 1615 OSLibWinEnableWindowUpdate(OS2HwndFrame,TRUE); 1616 } else 1617 { 1618 if (getStyle() & WS_VISIBLE) 1619 { 1620 setStyle(getStyle() & ~WS_VISIBLE); 1621 OSLibWinEnableWindowUpdate(OS2HwndFrame,FALSE); 1622 } 1623 } 1624 return 0; 1625 } 1626 1627 case WM_NCPAINT: 1628 return 0; 1629 1630 case WM_NCACTIVATE: 1631 return TRUE; 1632 1423 1633 case WM_NCCREATE: 1424 1634 return(TRUE); 1635 1636 case WM_NCDESTROY: 1637 return 0; 1425 1638 1426 1639 case WM_NCCALCSIZE: … … 1458 1671 return (LOWORD(lParam) == HTCAPTION) ? MA_NOACTIVATE : MA_ACTIVATE; 1459 1672 } 1673 1674 case WM_ACTIVATE: 1675 //CB: todo 1676 return 0; 1677 1460 1678 case WM_SETCURSOR: 1461 1679 { … … 1470 1688 if (wParam == Win32Hwnd) 1471 1689 { 1472 HCURSOR hCursor = windowClass ? windowClass->getCursor():LoadCursorA(0,IDC_ARROWA); 1473 1474 if (hCursor) SetCursor(hCursor); 1475 return 1; 1690 HCURSOR hCursor; 1691 1692 switch(lastHitTestVal) 1693 { 1694 case HTLEFT: 1695 case HTRIGHT: 1696 hCursor = LoadCursorA(0,IDC_SIZEWEA); 1697 break; 1698 1699 case HTTOP: 1700 case HTBOTTOM: 1701 hCursor = LoadCursorA(0,IDC_SIZENSA); 1702 break; 1703 1704 case HTTOPLEFT: 1705 case HTBOTTOMRIGHT: 1706 hCursor = LoadCursorA(0,IDC_SIZENWSEA); 1707 break; 1708 1709 case HTTOPRIGHT: 1710 case HTBOTTOMLEFT: 1711 hCursor = LoadCursorA(0,IDC_SIZENESWA); 1712 break; 1713 1714 default: 1715 hCursor = windowClass ? windowClass->getCursor():LoadCursorA(0,IDC_ARROWA); 1716 break; 1717 } 1718 1719 if (hCursor) 1720 { 1721 SetCursor(hCursor); 1722 return 1; 1723 } else return 0; 1476 1724 } else return 0; 1477 1725 } 1726 1478 1727 case WM_MOUSEMOVE: 1479 return 0; //we do our own cursor handling1728 return 0; 1480 1729 1481 1730 case WM_WINDOWPOSCHANGED: … … 1525 1774 return 1; 1526 1775 } 1776 1777 case WM_PRINT: 1778 return DefWndPrint(wParam,lParam); 1779 1527 1780 case WM_PAINTICON: 1528 1781 case WM_PAINT: … … 1548 1801 1549 1802 case WM_NCLBUTTONDOWN: 1803 return HandleNCLButtonDown(wParam,lParam); 1804 1550 1805 case WM_NCLBUTTONUP: 1806 return HandleNCLButtonUp(wParam,lParam); 1807 1551 1808 case WM_NCLBUTTONDBLCLK: 1552 case WM_NCRBUTTONUP: 1809 return HandleNCLButtonDblClk(wParam,lParam); 1810 1553 1811 case WM_NCRBUTTONDOWN: 1554 1812 case WM_NCRBUTTONDBLCLK: 1555 1813 case WM_NCMBUTTONDOWN: 1814 case WM_NCMBUTTONDBLCLK: 1815 if (lastHitTestVal == HTERROR) MessageBeep(MB_ICONEXCLAMATION); 1816 return 0; 1817 1818 case WM_NCRBUTTONUP: 1556 1819 case WM_NCMBUTTONUP: 1557 case WM_NCMBUTTONDBLCLK: 1558 return 0; //TODO: Send WM_SYSCOMMAND if required 1559 1560 case WM_NCHITTEST: //TODO: Calculate position of 1561 return HTCLIENT; 1820 return 0; 1821 1822 case WM_NCHITTEST: 1823 { 1824 POINT point; 1825 1826 point.x = (SHORT)LOWORD(lParam); 1827 point.y = (SHORT)HIWORD(lParam); 1828 1829 return FrameHitTest(this,point.x,point.y); 1830 } 1562 1831 1563 1832 case WM_SYSCOMMAND: … … 1612 1881 return 0; 1613 1882 1883 case WM_SHOWWINDOW: 1884 if (!lParam) return 0; /* sent from ShowWindow */ 1885 if (!(dwStyle & WS_POPUP) || !owner) return 0; 1886 if ((dwStyle & WS_VISIBLE) && wParam) return 0; 1887 else if (!(dwStyle & WS_VISIBLE) && !wParam) return 0; 1888 ShowWindow(wParam ? SW_SHOWNOACTIVATE : SW_HIDE); 1889 return 0; 1890 1891 case WM_CANCELMODE: 1892 //if (getParent() == windowDesktop) EndMenu(); 1893 if (GetCapture() == Win32Hwnd) ReleaseCapture(); 1894 return 0; 1895 1896 case WM_DROPOBJECT: 1897 return DRAG_FILE; 1898 1899 case WM_QUERYDROPOBJECT: 1900 if (dwExStyle & WS_EX_ACCEPTFILES) return 1; 1901 return 0; 1902 1903 case WM_QUERYDRAGICON: 1904 { 1905 HICON hIcon = windowClass->getCursor(); 1906 UINT len; 1907 1908 if(hIcon) return (LRESULT)hIcon; 1909 for(len = 1; len < 64; len++) 1910 { 1911 hIcon = LoadIconA(hInstance,MAKEINTRESOURCEA(len)); 1912 if(hIcon) 1913 return (LRESULT)hIcon; 1914 } 1915 return (LRESULT)LoadIconA(0,IDI_APPLICATIONA); 1916 } 1917 1614 1918 case WM_QUERYOPEN: 1615 1919 case WM_QUERYENDSESSION: … … 1637 1941 return result; 1638 1942 } 1943 1639 1944 case WM_NOTIFY: 1640 1945 return 0; //comctl32 controls expect this … … 1644 1949 return 0; 1645 1950 } 1646 return 1; 1951 return 1; //CB: shouldn't this be 0? 1647 1952 } 1648 1953 } … … 2744 3049 if(IsWindowDestroyed()) return; 2745 3050 2746 if (dwStyle != oldStyle) OSLibSetWindowStyle(OS2HwndFrame, dwStyle, fTaskList); 3051 //CB: todo: dwExStyle, creating new frame controls, destroy not used, WS_VISIBLE, ... 3052 // write test cases 3053 if (dwStyle & 0xFFFF0000 != oldStyle & 0xFFFF0000) 3054 OSLibSetWindowStyle(OS2HwndFrame, dwStyle, fTaskList); 2747 3055 } 2748 3056 //****************************************************************************** … … 2780 3088 ss.styleOld = getStyle(); 2781 3089 ss.styleNew = value | (ss.styleOld & (WS_VISIBLE | WS_CHILD)); 2782 dprintf(("SetWindowLong GWL_STYLE %x old %x new style %x", getWindowHandle(), getStyle(), value));3090 dprintf(("SetWindowLong GWL_STYLE %x old %x new style %x", getWindowHandle(), ss.styleOld, ss.styleNew)); 2783 3091 SendInternalMessageA(WM_STYLECHANGING,GWL_STYLE,(LPARAM)&ss); 2784 3092 setStyle(ss.styleNew); -
trunk/src/user32/win32wbase.h
r2202 r2204 1 /* $Id: win32wbase.h,v 1.5 7 1999-12-24 21:44:04 sandervlExp $ */1 /* $Id: win32wbase.h,v 1.58 1999-12-26 17:30:19 cbratschi Exp $ */ 2 2 /* 3 3 * Win32 Window Base Class for OS/2 … … 103 103 HWND getOS2FrameWindowHandle() { return OS2HwndFrame; }; 104 104 Win32WndClass *getWindowClass() { return windowClass; }; 105 106 BOOL getIgnoreHitTest() { return fIgnoreHitTest; } 107 VOID setIgnoreHitTest(BOOL ignore) { fIgnoreHitTest = ignore; } 105 108 106 109 DWORD getWindowContextHelpId() { return contextHelpId; }; … … 173 176 HWND getOS2HwndModalDialog() { return OS2HwndModalDialog; }; 174 177 BOOL CanReceiveSizeMsgs() { return !fNoSizeMsg; }; 175 BOOL InMovingChildren() { return fMovingChildren; };176 VOID setMovingChildren(BOOL fMC) { fMovingChildren = fMC; };177 178 BOOL IsWindowDestroyed() { return fIsDestroyed; }; 178 179 BOOL IsWindowEnabled(); … … 217 218 218 219 LRESULT DefWndControlColor(UINT ctlType, HDC hdc); 220 LRESULT DefWndPrint(HDC hdc,ULONG uFlags); 219 221 220 222 void NotifyParent(UINT Msg, WPARAM wParam, LPARAM lParam); … … 286 288 DWORD contextHelpId; 287 289 LONG lastHitTestVal; //Last value returned by WM_NCHITTEST handler 290 BOOL fIgnoreHitTest; //Use WinWindowFromPoint during WM_HITTEST 288 291 289 292 BOOL isIcon; … … 296 299 //sent by PM and those sent by apps 297 300 BOOL fNoSizeMsg; 298 BOOL fMovingChildren;299 301 BOOL fIsDestroyed; 300 302 BOOL fDestroyWindowCalled; //DestroyWindow was called for this window … … 343 345 void GetMinMaxInfo(POINT *maxSize, POINT *maxPos, POINT *minTrack, POINT *maxTrack ); 344 346 LONG HandleWindowPosChanging(WINDOWPOS *winpos); 347 LONG HandleNCLButtonDown(WPARAM wParam,LPARAM lParam); 348 LONG HandleNCLButtonUp(WPARAM wParam,LPARAM lParam); 349 LONG HandleNCLButtonDblClk(WPARAM wParam,LPARAM lParam); 345 350 LONG HandleSysCommand(WPARAM wParam, POINT *pt32); 346 351 -
trunk/src/user32/windlgmsg.cpp
r1205 r2204 1 /* $Id: windlgmsg.cpp,v 1. 2 1999-10-08 21:30:52cbratschi Exp $ */1 /* $Id: windlgmsg.cpp,v 1.3 1999-12-26 17:30:20 cbratschi Exp $ */ 2 2 /* 3 3 * Win32 dialog message APIs for OS/2 … … 16 16 #include <os2win.h> 17 17 #include <misc.h> 18 #include <string.h> 19 #include <ctype.h> 18 20 #include "win32wbase.h" 19 21 #include "win32dlg.h" … … 55 57 return 0; 56 58 } 57 //TODO58 #if 059 59 /*********************************************************************** 60 60 * DIALOG_IsAccelerator … … 64 64 HWND hwndControl = hwnd; 65 65 HWND hwndNext; 66 W ND *wndPtr;66 Win32BaseWindow *win32wnd; 67 67 BOOL RetVal = FALSE; 68 68 INT dlgCode; … … 82 82 do 83 83 { 84 w ndPtr = WIN_FindWndPtr( hwndControl);85 if ( (w ndPtr!= NULL) &&86 ((w ndPtr->dwStyle& (WS_VISIBLE | WS_DISABLED)) == WS_VISIBLE) )84 win32wnd = Win32BaseWindow::GetWindowFromHandle(hwndControl); 85 if ( (win32wnd != NULL) && 86 ((win32wnd->getStyle() & (WS_VISIBLE | WS_DISABLED)) == WS_VISIBLE) ) 87 87 { 88 dlgCode = SendMessageA( hwndControl, WM_GETDLGCODE, 0, 0 ); 89 if ( (dlgCode & (DLGC_BUTTON | DLGC_STATIC)) && 90 (wndPtr->text!=NULL)) 88 dlgCode = SendMessageA( hwndControl, WM_GETDLGCODE, 0, 0 ); 89 if (dlgCode & (DLGC_BUTTON | DLGC_STATIC)) 90 { 91 INT textLen = win32wnd->GetWindowTextLength(); 92 93 if (textLen > 0) 91 94 { 92 95 /* find the accelerator key */ 93 LPSTR p = wndPtr->text - 2; 96 char* text; 97 LPSTR p; 98 99 text = (char*)malloc(textLen+1); 100 win32wnd->GetWindowTextA(text,textLen); 101 p = text - 2; 94 102 do 95 103 { … … 102 110 { 103 111 if ((dlgCode & DLGC_STATIC) || 104 (w ndPtr->dwStyle& 0x0f) == BS_GROUPBOX )112 (win32wnd->getStyle() & 0x0f) == BS_GROUPBOX ) 105 113 { 106 114 /* set focus to the control */ … … 115 123 /* send command message as from the control */ 116 124 SendMessageA( hwndDlg, WM_COMMAND, 117 MAKEWPARAM( LOWORD(w ndPtr->wIDmenu),125 MAKEWPARAM( LOWORD(win32wnd->getWindowId()), 118 126 BN_CLICKED ), 119 127 (LPARAM)hwndControl ); … … 126 134 } 127 135 RetVal = TRUE; 128 WIN_ReleaseWndPtr(wndPtr);136 free(text); 129 137 break; 130 138 } 139 free(text); 131 140 } 141 } 132 142 hwndNext = GetWindow( hwndControl, GW_CHILD ); 133 143 } … … 136 146 hwndNext = 0; 137 147 } 138 WIN_ReleaseWndPtr(wndPtr);139 148 if (!hwndNext) 140 149 { … … 163 172 return RetVal; 164 173 } 165 #endif166 174 /*********************************************************************** 167 175 * DIALOG_IsDialogMessage … … 251 259 /* drop through */ 252 260 253 //TODO:254 #if 0255 261 case WM_SYSCHAR: 256 262 if (DIALOG_IsAccelerator( hwnd, hwndDlg, wParam )) … … 260 266 } 261 267 break; 262 #endif263 268 } 264 269 -
trunk/src/user32/windowmsg.cpp
r2200 r2204 1 /* $Id: windowmsg.cpp,v 1.1 1 1999-12-24 18:39:13 sandervlExp $ */1 /* $Id: windowmsg.cpp,v 1.12 1999-12-26 17:30:20 cbratschi Exp $ */ 2 2 /* 3 3 * Win32 window message APIs for OS/2 … … 11 11 * TODO: GetQueueStatus: QS_HOTKEY (oslibmsg.cpp) & low word bits 12 12 * TODO: MsgWaitForMultipleObjects: timeout isn't handled correctly (can return too late) 13 * TODO: GetMessageExtraInfo14 13 * 15 14 * Project Odin Software License can be found in LICENSE.TXT … … 22 21 #include <heapstring.h> 23 22 #include <handlemanager.h> 23 #include "oslibutil.h" 24 24 #include "oslibwin.h" 25 25 #include "oslibmsg.h" … … 95 95 } 96 96 //****************************************************************************** 97 //TODO: 97 //TODO: 98 98 //****************************************************************************** 99 99 LONG WIN32API GetMessageExtraInfo() 100 100 { 101 dprintf(("USER32: GetMessageExtraInfo NOT SUPPORTED"));102 return 0;101 dprintf(("USER32: GetMessageExtraInfo")); 102 return GetThreadMessageExtraInfo(); 103 103 } 104 104 //****************************************************************************** … … 124 124 if (hwnd == HWND_BROADCAST|| hwnd == HWND_TOPMOST) 125 125 { 126 127 126 Win32BaseWindow::BroadcastMessageA(BROADCAST_SEND, msg, wParam, lParam); 127 return TRUE; 128 128 } 129 129 … … 143 143 if (hwnd == HWND_BROADCAST|| hwnd == HWND_TOPMOST) 144 144 { 145 146 145 Win32BaseWindow::BroadcastMessageW(BROADCAST_SEND, msg, wParam, lParam); 146 return TRUE; 147 147 } 148 148 … … 162 162 if (hwnd == HWND_BROADCAST) //Not HWND_TOPMOST??? 163 163 { 164 165 164 Win32BaseWindow::BroadcastMessageA(BROADCAST_POST, msg, wParam, lParam); 165 return TRUE; 166 166 } 167 167 … … 185 185 if (hwnd == HWND_BROADCAST) //Not HWND_TOPMOST??? 186 186 { 187 188 187 Win32BaseWindow::BroadcastMessageW(BROADCAST_POST, msg, wParam, lParam); 188 return TRUE; 189 189 } 190 190 … … 264 264 } 265 265 //****************************************************************************** 266 //No need to support this 266 //No need to support this (obsolete, not implemented by Win32) 267 267 //****************************************************************************** 268 268 BOOL WIN32API SetMessageQueue(int cMessagesMax) … … 320 320 { 321 321 #ifdef DEBUG 322 WriteLog("USER32: SetMessageExtraInfo , not implemented\n");322 WriteLog("USER32: SetMessageExtraInfo\n"); 323 323 #endif 324 return (0);324 return SetThreadMessageExtraInfo(lParam); 325 325 } 326 326 /***************************************************************************** … … 447 447 //****************************************************************************** 448 448 /********************************************************************** 449 * 449 * WINPROC_TestCBForStr 450 450 * 451 451 * Return TRUE if the lparam is a string … … 454 454 { 455 455 BOOL retvalue; 456 DWORD dwStyle = GetWindowLongA(hwnd,GWL_STYLE); 456 DWORD dwStyle = GetWindowLongA(hwnd,GWL_STYLE); 457 457 retvalue = ( !(LOWORD(dwStyle) & (CBS_OWNERDRAWFIXED | CBS_OWNERDRAWVARIABLE)) || 458 458 (LOWORD(dwStyle) & CBS_HASSTRINGS) ); 459 459 return retvalue; 460 460 } 461 461 /********************************************************************** 462 * 462 * WINPROC_TestLBForStr 463 463 * 464 464 * Return TRUE if the lparam is a string … … 467 467 { 468 468 BOOL retvalue; 469 DWORD dwStyle = GetWindowLongA(hwnd,GWL_STYLE); 469 DWORD dwStyle = GetWindowLongA(hwnd,GWL_STYLE); 470 470 retvalue = ( !(LOWORD(dwStyle) & (LBS_OWNERDRAWFIXED | LBS_OWNERDRAWVARIABLE)) || 471 471 (LOWORD(dwStyle) & LBS_HASSTRINGS) ); 472 472 return retvalue; 473 473 } 474 474 475 475 /********************************************************************** 476 * 476 * WINPROC_MapMsg32ATo32W 477 477 * 478 478 * Map a message from Ansi to Unicode. … … 484 484 * FIXME: 485 485 * WM_GETTEXT/WM_SETTEXT and static control with SS_ICON style: 486 * the first four bytes are the handle of the icon 486 * the first four bytes are the handle of the icon 487 487 * when the WM_SETTEXT message has been used to set the icon 488 488 */ … … 550 550 case LB_ADDSTRING: 551 551 case LB_INSERTSTRING: 552 552 if ( WINPROC_TestLBForStr( hwnd )) 553 553 *plparam = (LPARAM)HEAP_strdupAtoW( GetProcessHeap(), 0, (LPCSTR)*plparam ); 554 554 return (*plparam ? 1 : -1); 555 555 556 case LB_GETTEXT: 556 case LB_GETTEXT: /* fixme: fixed sized buffer */ 557 557 { if ( WINPROC_TestLBForStr( hwnd )) 558 558 { LPARAM *ptr = (LPARAM *)HeapAlloc( GetProcessHeap(), 0, 256 * sizeof(WCHAR) + sizeof(LPARAM) ); 559 559 if (!ptr) return -1; 560 560 *ptr++ = *plparam; /* Store previous lParam */ 561 561 *plparam = (LPARAM)ptr; 562 562 } 563 563 } 564 564 return 1; … … 567 567 case CB_ADDSTRING: 568 568 case CB_INSERTSTRING: 569 569 if ( WINPROC_TestCBForStr( hwnd )) 570 570 *plparam = (LPARAM)HEAP_strdupAtoW( GetProcessHeap(), 0, (LPCSTR)*plparam ); 571 571 return (*plparam ? 1 : -1); … … 577 577 *ptr++ = *plparam; /* Store previous lParam */ 578 578 *plparam = (LPARAM)ptr; 579 579 } 580 580 } 581 581 return 1; … … 584 584 case EM_GETLINE: 585 585 { WORD len = (WORD)*plparam; 586 586 LPARAM *ptr = (LPARAM *) HEAP_xalloc( GetProcessHeap(), 0, sizeof(LPARAM) + sizeof (WORD) + len*sizeof(WCHAR) ); 587 587 if (!ptr) return -1; 588 588 *ptr++ = *plparam; /* Store previous lParam */ 589 589 *((WORD *) ptr) = len; /* Store the length */ 590 590 *plparam = (LPARAM)ptr; 591 591 } 592 592 return 1; 593 593 … … 606 606 607 607 /********************************************************************** 608 * 608 * WINPROC_UnmapMsg32ATo32W 609 609 * 610 610 * Unmap a message that was mapped from Ansi to Unicode. … … 662 662 case LB_ADDSTRING: 663 663 case LB_INSERTSTRING: 664 664 if ( WINPROC_TestLBForStr( hwnd )) 665 665 HeapFree( GetProcessHeap(), 0, (void *)lParam ); 666 666 break; … … 669 669 { if ( WINPROC_TestLBForStr( hwnd )) 670 670 { LPARAM *ptr = (LPARAM *)lParam - 1; 671 671 lstrcpyWtoA( (LPSTR)*ptr, (LPWSTR)(lParam) ); 672 672 HeapFree( GetProcessHeap(), 0, ptr ); 673 673 } 674 674 } 675 675 break; … … 678 678 case CB_ADDSTRING: 679 679 case CB_INSERTSTRING: 680 680 if ( WINPROC_TestCBForStr( hwnd )) 681 681 HeapFree( GetProcessHeap(), 0, (void *)lParam ); 682 682 break; … … 684 684 case CB_GETLBTEXT: 685 685 { if ( WINPROC_TestCBForStr( hwnd )) 686 686 { LPARAM *ptr = (LPARAM *)lParam - 1; 687 687 lstrcpyWtoA( (LPSTR)*ptr, (LPWSTR)(lParam) ); 688 688 HeapFree( GetProcessHeap(), 0, ptr ); 689 689 } 690 690 } 691 691 break; … … 694 694 case EM_GETLINE: 695 695 { LPARAM * ptr = (LPARAM *)lParam - 1; /* get the old lParam */ 696 696 WORD len = *(WORD *) lParam; 697 697 lstrcpynWtoA( (LPSTR)*ptr , (LPWSTR)lParam, len ); 698 698 HeapFree( GetProcessHeap(), 0, ptr ); … … 704 704 705 705 /********************************************************************** 706 * 706 * WINPROC_MapMsg32WTo32A 707 707 * 708 708 * Map a message from Unicode to Ansi. … … 772 772 case LB_ADDSTRING: 773 773 case LB_INSERTSTRING: 774 774 if ( WINPROC_TestLBForStr( hwnd )) 775 775 *plparam = (LPARAM)HEAP_strdupWtoA( GetProcessHeap(), 0, (LPCWSTR)*plparam ); 776 776 return (*plparam ? 1 : -1); 777 777 778 case LB_GETTEXT: 778 case LB_GETTEXT: /* fixme: fixed sized buffer */ 779 779 { if ( WINPROC_TestLBForStr( hwnd )) 780 780 { LPARAM *ptr = (LPARAM *)HeapAlloc( GetProcessHeap(), 0, 256 + sizeof(LPARAM) ); 781 781 if (!ptr) return -1; 782 782 *ptr++ = *plparam; /* Store previous lParam */ 783 783 *plparam = (LPARAM)ptr; 784 784 } 785 785 } 786 786 return 1; … … 789 789 case CB_ADDSTRING: 790 790 case CB_INSERTSTRING: 791 791 if ( WINPROC_TestCBForStr( hwnd )) 792 792 *plparam = (LPARAM)HEAP_strdupWtoA( GetProcessHeap(), 0, (LPCWSTR)*plparam ); 793 793 return (*plparam ? 1 : -1); 794 794 795 case CB_GETLBTEXT: 795 case CB_GETLBTEXT: /* fixme: fixed sized buffer */ 796 796 { if ( WINPROC_TestCBForStr( hwnd )) 797 797 { LPARAM *ptr = (LPARAM *)HeapAlloc( GetProcessHeap(), 0, 256 + sizeof(LPARAM) ); 798 798 if (!ptr) return -1; 799 799 *ptr++ = *plparam; /* Store previous lParam */ 800 800 *plparam = (LPARAM)ptr; 801 801 } 802 802 } 803 803 return 1; … … 806 806 case EM_GETLINE: 807 807 { WORD len = (WORD)*plparam; 808 808 LPARAM *ptr = (LPARAM *) HEAP_xalloc( GetProcessHeap(), 0, sizeof(LPARAM) + sizeof (WORD) + len*sizeof(CHAR) ); 809 809 if (!ptr) return -1; 810 810 *ptr++ = *plparam; /* Store previous lParam */ 811 811 *((WORD *) ptr) = len; /* Store the length */ 812 812 *plparam = (LPARAM)ptr; 813 813 } 814 814 return 1; 815 815 … … 828 828 829 829 /********************************************************************** 830 * 830 * WINPROC_UnmapMsg32WTo32A 831 831 * 832 832 * Unmap a message that was mapped from Unicode to Ansi. … … 884 884 case LB_ADDSTRING: 885 885 case LB_INSERTSTRING: 886 886 if ( WINPROC_TestLBForStr( hwnd )) 887 887 HeapFree( GetProcessHeap(), 0, (void *)lParam ); 888 888 break; … … 893 893 lstrcpyAtoW( (LPWSTR)*ptr, (LPSTR)(lParam) ); 894 894 HeapFree(GetProcessHeap(), 0, ptr ); 895 895 } 896 896 } 897 897 break; … … 900 900 case CB_ADDSTRING: 901 901 case CB_INSERTSTRING: 902 902 if ( WINPROC_TestCBForStr( hwnd )) 903 903 HeapFree( GetProcessHeap(), 0, (void *)lParam ); 904 904 break; … … 909 909 lstrcpyAtoW( (LPWSTR)*ptr, (LPSTR)(lParam) ); 910 910 HeapFree( GetProcessHeap(), 0, ptr ); 911 911 } 912 912 } 913 913 break; … … 916 916 case EM_GETLINE: 917 917 { LPARAM * ptr = (LPARAM *)lParam - 1; /* get the old lparam */ 918 918 WORD len = *(WORD *)ptr; 919 919 lstrcpynAtoW( (LPWSTR) *ptr, (LPSTR)lParam, len ); 920 920 HeapFree( GetProcessHeap(), 0, ptr ); … … 925 925 926 926 /********************************************************************** 927 * 927 * WINPROC_CallProc32ATo32W 928 928 * 929 929 * Call a window procedure, translating args from Ansi to Unicode. … … 942 942 943 943 /********************************************************************** 944 * 944 * WINPROC_CallProc32WTo32A 945 945 * 946 946 * Call a window procedure, translating args from Unicode to Ansi. … … 970 970 dprintf(("USER32: GetQueueStatus")); 971 971 queueStatus = OSLibWinQueryQueueStatus(); 972 972 973 973 queueStatus = MAKELONG(queueStatus, queueStatus); 974 974 return queueStatus & MAKELONG(flags, flags); … … 1011 1011 if (nCount == 0) 1012 1012 { 1013 1014 1015 1016 1017 1018 1013 if(dwMilliseconds == 0) { 1014 if(GetQueueStatus(dwWakeMask) == 0) { 1015 return WAIT_TIMEOUT; 1016 } 1017 return WAIT_OBJECT_0; 1018 } 1019 1019 //SvL: Check time, wait for any message, check msg type and determine if 1020 1020 // we have to return 1021 1022 1021 //TODO: Timeout isn't handled correctly (can return too late) 1022 curtime = GetCurrentTime(); 1023 1023 endtime = curtime + dwMilliseconds; 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1024 while(curtime < endtime || dwMilliseconds == INFINITE) { 1025 if(OSLibWinWaitMessage() == FALSE) { 1026 dprintf(("OSLibWinWaitMessage returned FALSE!")); 1027 return -1; 1028 } 1029 if(GetQueueStatus(dwWakeMask) != 0) { 1030 return WAIT_OBJECT_0; 1031 } 1032 curtime = GetCurrentTime(); 1033 } 1034 1034 return WAIT_TIMEOUT; 1035 1035 } -
trunk/src/user32/wndmsg.cpp
r1408 r2204 1 /* $Id: wndmsg.cpp,v 1. 7 1999-10-23 10:21:45 sandervlExp $ */1 /* $Id: wndmsg.cpp,v 1.8 1999-12-26 17:30:20 cbratschi Exp $ */ 2 2 /* 3 3 * Win32 window message text function for OS/2 … … 338 338 { "WM_INITMENUPOPUP", WM_INITMENUPOPUP, // 0x0117 339 339 0}, 340 { "WM_SYSTIMER", WM_SYSTIMER, // 0x0118 341 0}, 340 342 { "WM_MENUSELECT", WM_MENUSELECT, // 0x011F 341 343 0}, … … 690 692 return(gaMsgs[i].pszMsg); 691 693 } 692 sprintf(msgtxt, "%s %X ", "Unknown Message ", Msg); 694 if (Msg >= WM_USER) 695 sprintf(msgtxt,"User Message %X (WM_USER+%d)",Msg,Msg-WM_USER); 696 else 697 sprintf(msgtxt, "%s %X ","Unknown Message ", Msg); 693 698 return(msgtxt); 694 699 }
Note:
See TracChangeset
for help on using the changeset viewer.