- Timestamp:
- Jul 15, 1999, 8:03:03 PM (26 years ago)
- Location:
- trunk/src/user32/new
- Files:
-
- 1 added
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/user32/new/makefile
r300 r309 1 # $Id: makefile,v 1. 1 1999-07-14 08:35:35sandervl Exp $1 # $Id: makefile,v 1.2 1999-07-15 18:03:01 sandervl Exp $ 2 2 3 3 # … … 27 27 uitools.obj unknown.obj spy.obj wndmsg.obj \ 28 28 pmwindow.obj win32class.obj win32wnd.obj win32dlg.obj \ 29 msgbox.obj window.obj windowmsg.obj windowclass.obj \30 windowword.obj gen_object.obj oslibwin.obj 29 msgbox.obj window.obj windowmsg.obj windowclass.obj windlgmsg.obj \ 30 windowword.obj gen_object.obj oslibwin.obj 31 31 32 32 … … 69 69 window.obj: window.cpp win32class.h win32wnd.h 70 70 windowmsg.obj: windowmsg.cpp win32class.h win32wnd.h 71 windlgmsg.obj: windlgmsg.cpp win32class.h win32wnd.h win32dlg.h 71 72 windowclass.obj: windowclass.cpp win32class.h win32wnd.h 72 73 windowword.obj: windowword.cpp win32class.h win32wnd.h win32dlg.h -
trunk/src/user32/new/oslibwin.cpp
r304 r309 1 /* $Id: oslibwin.cpp,v 1. 2 1999-07-14 21:05:58 cbratschiExp $ */1 /* $Id: oslibwin.cpp,v 1.3 1999-07-15 18:03:02 sandervl Exp $ */ 2 2 /* 3 3 * Window API wrappers for OS/2 … … 125 125 //****************************************************************************** 126 126 //****************************************************************************** 127 BOOL OSLibPostMessage(HWND hwnd, ULONG msg, ULONG wParam, ULONG lParam) 128 { 129 return WinPostMsg(hwnd, msg, (MPARAM)wParam, (MPARAM)lParam); 130 } 131 //****************************************************************************** 132 //****************************************************************************** 133 -
trunk/src/user32/new/oslibwin.h
r300 r309 1 /* $Id: oslibwin.h,v 1. 1 1999-07-14 08:35:35sandervl Exp $ */1 /* $Id: oslibwin.h,v 1.2 1999-07-15 18:03:02 sandervl Exp $ */ 2 2 /* 3 3 * Window API wrappers for OS/2 … … 28 28 ULONG OSLibWinGetWindowULong(HWND hwnd, ULONG offset); 29 29 30 BOOL OSLibPostMessage(HWND hwnd, ULONG msg, ULONG wParam, ULONG lParam); 31 30 32 #endif //__OSLIBWIN_H__ -
trunk/src/user32/new/pmwindow.cpp
r304 r309 1 /* $Id: pmwindow.cpp,v 1. 3 1999-07-14 21:05:58 cbratschiExp $ */1 /* $Id: pmwindow.cpp,v 1.4 1999-07-15 18:03:02 sandervl Exp $ */ 2 2 /* 3 3 * Win32 Window Managment Code for OS/2 … … 14 14 #include <os2.h> /* PM header file */ 15 15 #include <os2wrap.h> 16 #include <stdlib.h> 16 17 #include "win32type.h" 17 18 #include <wprocess.h> … … 68 69 MRESULT EXPENTRY Win32WindowProc(HWND hwnd, ULONG msg, MPARAM mp1, MPARAM mp2) 69 70 { 71 POSTMSG_PACKET *postmsg; 70 72 Win32Window *win32wnd; 71 73 ULONG magic; … … 84 86 switch( msg ) 85 87 { 88 //internal messages 89 case WM_WIN32_POSTMESSAGEA: 90 postmsg = (POSTMSG_PACKET *)mp1; 91 if(postmsg == NULL) { 92 dprintf(("WM_WIN32_POSTMESSAGEA, postmsg NULL!!")); 93 break; 94 } 95 win32wnd->SendMessageA(postmsg->Msg, postmsg->wParam, postmsg->lParam); 96 free(postmsg); 97 break; 98 99 case WM_WIN32_POSTMESSAGEW: 100 postmsg = (POSTMSG_PACKET *)mp1; 101 if(postmsg == NULL) { 102 dprintf(("WM_WIN32_POSTMESSAGEW, postmsg NULL!!")); 103 break; 104 } 105 win32wnd->SendMessageW(postmsg->Msg, postmsg->wParam, postmsg->lParam); 106 free(postmsg); 107 break; 108 109 //OS/2 msgs 86 110 case WM_CREATE: 87 111 //Processing is done in after WinCreateWindow returns -
trunk/src/user32/new/win32type.h
r300 r309 47 47 #define PDWORD DWORD * 48 48 #define LRESULT DWORD 49 #define LPARAM DWORD50 #define WPARAM DWORD49 #define LPARAM signed long 50 #define WPARAM unsigned int 51 51 #define CONST const 52 52 #define LPTSTR char * -
trunk/src/user32/new/win32wnd.cpp
r304 r309 1 /* $Id: win32wnd.cpp,v 1. 2 1999-07-14 21:05:58 cbratschiExp $ */1 /* $Id: win32wnd.cpp,v 1.3 1999-07-15 18:03:02 sandervl Exp $ */ 2 2 /* 3 3 * Win32 Window Code for OS/2 … … 571 571 } 572 572 //****************************************************************************** 573 //todo, unicode msgs 574 //****************************************************************************** 575 LRESULT Win32Window::SendMessageW(ULONG Msg, WPARAM wParam, LPARAM lParam) 576 { 577 if(PostSpyMessage(getWindowHandle(), Msg, wParam, lParam) == FALSE) 578 dprintf(("SendMessageA %s for %x %x %x", GetMsgText(Msg), getWindowHandle(), wParam, lParam)); 579 580 if(HkCBT::OS2HkCBTProc(getWindowHandle(), Msg, wParam, lParam) == TRUE) {//hook swallowed msg 581 return(0); 582 } 583 switch(Msg) 584 { 585 case WM_CREATE: 586 { 587 if(win32wndproc(getWindowHandle(), WM_NCCREATE, 0, lParam) == 0) { 588 dprintf(("WM_NCCREATE returned FALSE\n")); 589 return(0); //don't create window 590 } 591 if(win32wndproc(getWindowHandle(), WM_CREATE, 0, lParam) == 0) { 592 dprintf(("WM_CREATE returned FALSE\n")); 593 return(0); //don't create window 594 } 595 NotifyParent(Msg, wParam, lParam); 596 597 return(1); 598 } 599 case WM_LBUTTONDOWN: 600 case WM_MBUTTONDOWN: 601 case WM_RBUTTONDOWN: 602 NotifyParent(Msg, wParam, lParam); 603 return win32wndproc(getWindowHandle(), Msg, wParam, lParam); 604 605 case WM_DESTROY: 606 win32wndproc(getWindowHandle(), WM_NCDESTROY, 0, 0); 607 NotifyParent(Msg, wParam, lParam); 608 return win32wndproc(getWindowHandle(), WM_DESTROY, 0, 0); 609 default: 610 return win32wndproc(getWindowHandle(), Msg, wParam, lParam); 611 } 612 } 613 //****************************************************************************** 614 //****************************************************************************** 615 LRESULT Win32Window::PostMessageA(ULONG msg, WPARAM wParam, LPARAM lParam) 616 { 617 POSTMSG_PACKET *postmsg; 618 619 postmsg = (POSTMSG_PACKET *)malloc(sizeof(POSTMSG_PACKET)); 620 if(postmsg == NULL) { 621 dprintf(("Win32Window::PostMessageA: malloc returned NULL!!")); 622 } 623 postmsg->Msg = msg; 624 postmsg->wParam = wParam; 625 postmsg->lParam = lParam; 626 return OSLibPostMessage(OS2Hwnd, WM_WIN32_POSTMESSAGEA, (ULONG)postmsg, 0); 627 } 628 //****************************************************************************** 629 //****************************************************************************** 630 LRESULT Win32Window::PostMessageW(ULONG msg, WPARAM wParam, LPARAM lParam) 631 { 632 POSTMSG_PACKET *postmsg; 633 634 postmsg = (POSTMSG_PACKET *)malloc(sizeof(POSTMSG_PACKET)); 635 if(postmsg == NULL) { 636 dprintf(("Win32Window::PostMessageW: malloc returned NULL!!")); 637 } 638 postmsg->Msg = msg; 639 postmsg->wParam = wParam; 640 postmsg->lParam = lParam; 641 return OSLibPostMessage(OS2Hwnd, WM_WIN32_POSTMESSAGEW, (ULONG)postmsg, 0); 642 } 643 //****************************************************************************** 573 644 //****************************************************************************** 574 645 void Win32Window::NotifyParent(UINT Msg, WPARAM wParam, LPARAM lParam) -
trunk/src/user32/new/win32wnd.h
r300 r309 1 /* $Id: win32wnd.h,v 1. 2 1999-07-14 08:35:37sandervl Exp $ */1 /* $Id: win32wnd.h,v 1.3 1999-07-15 18:03:03 sandervl Exp $ */ 2 2 /* 3 3 * Win32 Window Code for OS/2 … … 33 33 ULONG win32CreateStruct; //or dialog create dword 34 34 } CUSTOMWNDDATA; 35 36 typedef struct 37 { 38 ULONG Msg; 39 ULONG wParam; 40 ULONG lParam; 41 } POSTMSG_PACKET; 42 43 #define WM_WIN32_POSTMESSAGEA 0x4000 44 #define WM_WIN32_POSTMESSAGEW 0x4001 35 45 36 46 class Win32Window : public GenericObject … … 74 84 void setWindowId(DWORD id) { windowId = id; }; 75 85 86 DWORD getFlags() { return flags; }; 87 void setFlags(DWORD newflags) { flags = newflags; }; 88 76 89 LRESULT SendMessageA(ULONG msg, WPARAM wParam, LPARAM lParam); 77 90 LRESULT SendMessageW(ULONG msg, WPARAM wParam, LPARAM lParam); 91 LRESULT PostMessageA(ULONG msg, WPARAM wParam, LPARAM lParam); 92 LRESULT PostMessageW(ULONG msg, WPARAM wParam, LPARAM lParam); 78 93 LRESULT DefWindowProcA(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam); 79 94 LRESULT DefWindowProcW(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam); -
trunk/src/user32/new/windowmsg.cpp
r304 r309 1 /* $Id: windowmsg.cpp,v 1. 2 1999-07-14 21:05:59 cbratschiExp $ */1 /* $Id: windowmsg.cpp,v 1.3 1999-07-15 18:03:03 sandervl Exp $ */ 2 2 /* 3 3 * Win32 window message APIs for OS/2 4 4 * 5 5 * Copyright 1999 Sander van Leeuwen 6 * 7 * Parts based on Wine Windows code (windows\message.c) 8 * 9 * Copyright 1993, 1994 Alexandre Julliard 6 10 * 7 11 * … … 11 15 #include <os2win.h> 12 16 #include <misc.h> 13 14 15 //****************************************************************************** 16 //****************************************************************************** 17 LONG WIN32API SendDlgItemMessageA( HWND arg1, int arg2, UINT arg3, WPARAM arg4, LPARAM arg5) 18 { 19 #ifdef DEBUG 20 WriteLog("USER32: SendDlgItemMessageA\n"); 21 #endif 22 return O32_SendDlgItemMessage(arg1, arg2, arg3, arg4, arg5); 23 } 24 //****************************************************************************** 25 //****************************************************************************** 26 LONG WIN32API SendDlgItemMessageW( HWND arg1, int arg2, UINT arg3, WPARAM arg4, LPARAM arg5) 27 { 28 #ifdef DEBUG 29 WriteLog("USER32: SendDlgItemMessageW\n"); 30 #endif 31 return O32_SendDlgItemMessage(arg1, arg2, arg3, arg4, arg5); 32 } 17 #include <win32wnd.h> 18 #include <handlemanager.h> 19 #include <win.h> 20 33 21 //****************************************************************************** 34 22 //****************************************************************************** … … 41 29 //****************************************************************************** 42 30 //****************************************************************************** 43 LONG WIN32API DispatchMessageA( const MSG * arg1) 44 { 45 //// dprintf(("USER32: DispatchMessage\n")); 46 return O32_DispatchMessage(arg1); 47 } 48 //****************************************************************************** 49 //****************************************************************************** 50 LONG WIN32API DispatchMessageW( const MSG * arg1) 51 { 52 #ifdef DEBUG 53 WriteLog("USER32: DispatchMessageW\n"); 54 #endif 55 // NOTE: This will not work as is (needs UNICODE support) 56 return O32_DispatchMessage(arg1); 31 LONG WIN32API DispatchMessageA( const MSG * msg) 32 { 33 LONG retval; 34 int painting; 35 Win32Window *window; 36 37 /* Process timer messages */ 38 if ((msg->message == WM_TIMER) || (msg->message == WM_SYSTIMER)) 39 { 40 if (msg->lParam) 41 { 42 return SendMessageA(msg->hwnd, msg->message, msg->wParam, GetTickCount()); 43 } 44 } 45 46 if (!msg->hwnd) return 0; 47 48 if(HMHandleTranslateToOS2(msg->hwnd, (PULONG)&window) != NO_ERROR) { 49 dprintf(("DispatchMessageA, window %x not found", msg->hwnd)); 50 return 0; 51 } 52 53 painting = (msg->message == WM_PAINT); 54 if (painting) window->setFlags(window->getFlags() | WIN_NEEDS_BEGINPAINT); 55 56 retval = window->SendMessageA(msg->message, msg->wParam, msg->lParam ); 57 58 #if 0 59 if(HMHandleTranslateToOS2(msg->hwnd, (PULONG)&window) != NO_ERROR) { 60 dprintf(("DispatchMessageA, window %x not found", msg->hwnd)); 61 return 0; 62 } 63 64 if (painting && (wndPtr->getFlags() & WIN_NEEDS_BEGINPAINT) && wndPtr->hrgnUpdate) 65 { 66 ERR_(msg)("BeginPaint not called on WM_PAINT for hwnd %04x!\n", 67 msg->hwnd); 68 wndPtr->flags &= ~WIN_NEEDS_BEGINPAINT; 69 /* Validate the update region to avoid infinite WM_PAINT loop */ 70 ValidateRect( msg->hwnd, NULL ); 71 } 72 #endif 73 return retval; 74 } 75 //****************************************************************************** 76 //****************************************************************************** 77 LONG WIN32API DispatchMessageW( const MSG * msg) 78 { 79 LONG retval; 80 int painting; 81 Win32Window *window; 82 83 /* Process timer messages */ 84 if ((msg->message == WM_TIMER) || (msg->message == WM_SYSTIMER)) 85 { 86 if (msg->lParam) 87 { 88 return SendMessageW(msg->hwnd, msg->message, msg->wParam, GetTickCount()); 89 } 90 } 91 92 if (!msg->hwnd) return 0; 93 94 if(HMHandleTranslateToOS2(msg->hwnd, (PULONG)&window) != NO_ERROR) { 95 dprintf(("DispatchMessageW, window %x not found", msg->hwnd)); 96 return 0; 97 } 98 99 painting = (msg->message == WM_PAINT); 100 if (painting) window->setFlags(window->getFlags() | WIN_NEEDS_BEGINPAINT); 101 102 retval = window->SendMessageW(msg->message, msg->wParam, msg->lParam ); 103 104 #if 0 105 if(HMHandleTranslateToOS2(msg->hwnd, (PULONG)&window) != NO_ERROR) { 106 dprintf(("DispatchMessageW, window %x not found", msg->hwnd)); 107 return 0; 108 } 109 110 if (painting && (wndPtr->getFlags() & WIN_NEEDS_BEGINPAINT) && wndPtr->hrgnUpdate) 111 { 112 ERR_(msg)("BeginPaint not called on WM_PAINT for hwnd %04x!\n", 113 msg->hwnd); 114 wndPtr->flags &= ~WIN_NEEDS_BEGINPAINT; 115 /* Validate the update region to avoid infinite WM_PAINT loop */ 116 ValidateRect( msg->hwnd, NULL ); 117 } 118 #endif 119 return retval; 57 120 } 58 121 //****************************************************************************** … … 67 130 //****************************************************************************** 68 131 //****************************************************************************** 69 LRESULT WIN32API SendMessageA(HWND arg1, UINT arg2, WPARAM arg3, LPARAM arg4)70 { 71 LRESULT rc;72 73 #ifdef DEBUG1 74 WriteLog("USER32: SendMessage....\n");75 #endif 76 rc = O32_SendMessage(arg1, arg2, arg3, arg4);77 #ifdef DEBUG1 78 WriteLog("USER32: *****SendMessage %X %X %X %X returned %d\n", arg1, arg2, arg3, arg4, rc); 79 #endif 80 return(rc); 81 } 82 //****************************************************************************** 83 //****************************************************************************** 84 LRESULT WIN32API SendMessageW( HWND arg1, UINT arg2, WPARAM arg3, LPARAM arg4) 85 {86 LRESULT rc;87 88 #ifdef DEBUG 89 WriteLog("USER32: SendMessageW....\n");90 #endif 91 rc = O32_SendMessage(arg1, arg2, arg3, arg4); 92 #ifdef DEBUG 93 WriteLog("USER32: SendMessageW %X %X %X %X returned %d\n", arg1, arg2, arg3, arg4, rc); 94 #endif 95 return(rc);96 } 97 //****************************************************************************** 98 //****************************************************************************** 99 BOOL WIN32API IsDialogMessageA( HWND arg1, LPMSG arg2) 100 { 101 #ifdef DEBUG 102 //// WriteLog("USER32: IsDialogMessage\n"); 103 #endif 104 return O32_IsDialogMessage(arg1, arg2); 105 } 106 //****************************************************************************** 107 //****************************************************************************** 108 BOOL WIN32API PostMessageA( HWND arg1, UINT arg2, WPARAM arg3, LPARAM arg4) 109 {110 #ifdef DEBUG 111 WriteLog("USER32: PostMessageA %X %X %X %X\n", arg1, arg2, arg3, arg4);112 #endif 113 return O32_PostMessage(arg1, arg2, arg3, arg4);132 LRESULT WIN32API SendMessageA(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) 133 { 134 Win32Window *window; 135 136 if(HMHandleTranslateToOS2(hwnd, (PULONG)&window) != NO_ERROR) { 137 dprintf(("SendMessageA, window %x not found", hwnd)); 138 return 0; 139 } 140 return window->SendMessageA(msg, wParam, lParam); 141 } 142 //****************************************************************************** 143 //****************************************************************************** 144 LRESULT WIN32API SendMessageW(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) 145 { 146 Win32Window *window; 147 148 if(HMHandleTranslateToOS2(hwnd, (PULONG)&window) != NO_ERROR) { 149 dprintf(("SendMessageW, window %x not found", hwnd)); 150 return 0; 151 } 152 return window->SendMessageW(msg, wParam, lParam); 153 } 154 //****************************************************************************** 155 //****************************************************************************** 156 BOOL WIN32API PostMessageA(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) 157 { 158 Win32Window *window; 159 160 if(HMHandleTranslateToOS2(hwnd, (PULONG)&window) != NO_ERROR) { 161 dprintf(("PostMessageA, window %x not found", hwnd)); 162 return 0; 163 } 164 return window->PostMessageA(msg, wParam, lParam); 165 } 166 //****************************************************************************** 167 //****************************************************************************** 168 BOOL WIN32API PostMessageW(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) 169 { 170 Win32Window *window; 171 172 if(HMHandleTranslateToOS2(hwnd, (PULONG)&window) != NO_ERROR) { 173 dprintf(("PostMessageW, window %x not found", hwnd)); 174 return 0; 175 } 176 return window->PostMessageW(msg, wParam, lParam); 114 177 } 115 178 //****************************************************************************** … … 143 206 //****************************************************************************** 144 207 //****************************************************************************** 145 // NOTE: Open32 function doesn't have the 'W'.146 BOOL WIN32API PostMessageW( HWND arg1, UINT arg2, WPARAM arg3, LPARAM arg4)147 {148 #ifdef DEBUG149 WriteLog("USER32: PostMessageW\n");150 #endif151 // NOTE: This will not work as is (needs UNICODE support)152 return O32_PostMessage(arg1, arg2, arg3, arg4);153 }154 //******************************************************************************155 //******************************************************************************156 208 BOOL WIN32API InSendMessage(void) 157 209 { … … 162 214 } 163 215 //****************************************************************************** 164 //******************************************************************************165 BOOL WIN32API IsDialogMessageW( HWND arg1, LPMSG arg2)166 {167 #ifdef DEBUG168 WriteLog("USER32: IsDialogMessageW\n");169 #endif170 // NOTE: This will not work as is (needs UNICODE support)171 return O32_IsDialogMessage(arg1, arg2);172 }173 216 //****************************************************************************** 174 217 //******************************************************************************
Note:
See TracChangeset
for help on using the changeset viewer.