Changeset 215 for trunk/src/user32/wndclass.cpp
- Timestamp:
- Jun 26, 1999, 3:21:53 PM (26 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/user32/wndclass.cpp
r208 r215 1 /* $Id: wndclass.cpp,v 1. 8 1999-06-26 08:25:22sandervl Exp $ */1 /* $Id: wndclass.cpp,v 1.9 1999-06-26 13:21:11 sandervl Exp $ */ 2 2 3 3 /* … … 16 16 #include <os2win.h> 17 17 #include <stdarg.h> 18 #include <stdio.h> 19 #include <string.h> 20 #include <stdlib.h> 18 21 #include <assert.h> 19 #include "misc.h" 20 #include "user32.h" 21 #include "wndproc.h" 22 #include "wndclass.h" 22 #include <misc.h> 23 #include <wndproc.h> 24 #include <wndclass.h> 25 #include <nameid.h> 26 #include <spy.h> 23 27 #include "hooks.h" 24 #include <spy.h>25 28 26 29 //default window handlers that are registered by RegisterClass are called … … 64 67 LRESULT WIN32API ButtonCallback(HWND hwnd, UINT Msg, WPARAM wParam, LPARAM lParam) 65 68 { 69 DWORD dwStyle, dwExStyle; 70 71 PostSpyMessage(hwnd, Msg, wParam, lParam); 66 72 switch(Msg) 67 73 { 74 case WM_MOUSEACTIVATE: 75 //Open32 sends an OS/2 window message for a button click 76 if(HIWORD(lParam) == 0x71) //WM_BUTTONCLICKFIRST 77 { 78 lParam = (WM_LBUTTONDOWN << 16) | LOWORD(lParam); 79 } 80 dwStyle = GetWindowLongA(hwnd, GWL_STYLE); 81 dwExStyle = GetWindowLongA(hwnd, GWL_EXSTYLE); 82 83 if(dwStyle & WS_CHILD && !(dwExStyle & WS_EX_NOPARENTNOTIFY) ) 84 { 85 HWND hwndParent = GetParent(hwnd); 86 87 Win32WindowProc *parentwnd = Win32WindowProc::FindProc(hwndParent); 88 if(parentwnd) { 89 LRESULT rc = parentwnd->SendMessageA(hwndParent, Msg, wParam, lParam); 90 if(rc) return TRUE; 91 } 92 } 93 break; 68 94 case WM_CREATE: 69 95 case WM_DESTROY: … … 80 106 LRESULT WIN32API ListboxCallback(HWND hwnd, UINT Msg, WPARAM wParam, LPARAM lParam) 81 107 { 108 PostSpyMessage(hwnd, Msg, wParam, lParam); 82 109 return ListboxHandler(hwnd, Msg, wParam, lParam); 83 110 } … … 86 113 LRESULT WIN32API ComboboxCallback(HWND hwnd, UINT Msg, WPARAM wParam, LPARAM lParam) 87 114 { 115 PostSpyMessage(hwnd, Msg, wParam, lParam); 88 116 return ComboboxHandler(hwnd, Msg, wParam, lParam); 89 117 } … … 92 120 LRESULT WIN32API MdiClientCallback(HWND hwnd, UINT Msg, WPARAM wParam, LPARAM lParam) 93 121 { 122 PostSpyMessage(hwnd, Msg, wParam, lParam); 94 123 return MdiClientHandler(hwnd, Msg, wParam, lParam); 95 124 } … … 98 127 LRESULT WIN32API EditCallback(HWND hwnd, UINT Msg, WPARAM wParam, LPARAM lParam) 99 128 { 129 PostSpyMessage(hwnd, Msg, wParam, lParam); 100 130 return EditHandler(hwnd, Msg, wParam, lParam); 101 131 } … … 104 134 LRESULT WIN32API ScrollbarCallback(HWND hwnd, UINT Msg, WPARAM wParam, LPARAM lParam) 105 135 { 136 PostSpyMessage(hwnd, Msg, wParam, lParam); 106 137 return ScrollbarHandler(hwnd, Msg, wParam, lParam); 107 138 } … … 110 141 LRESULT WIN32API StaticCallback(HWND hwnd, UINT Msg, WPARAM wParam, LPARAM lParam) 111 142 { 143 PostSpyMessage(hwnd, Msg, wParam, lParam); 112 144 return StaticHandler(hwnd, Msg, wParam, lParam); 113 145 } … … 198 230 { 199 231 dprintf(("KERNEL32: UnregisterSystemClasses")); 200 if(hwndButton) O32_DestroyWindow(hwndButton);201 if(hwndListbox) O32_DestroyWindow(hwndListbox);202 if(hwndCombobox) O32_DestroyWindow(hwndCombobox);203 if(hwndMdiClient) O32_DestroyWindow(hwndMdiClient);204 if(hwndEdit) O32_DestroyWindow(hwndEdit);205 if(hwndScrollbar) O32_DestroyWindow(hwndScrollbar);206 if(hwndStatic) O32_DestroyWindow(hwndStatic);232 if(hwndButton) O32_DestroyWindow(hwndButton); 233 if(hwndListbox) O32_DestroyWindow(hwndListbox); 234 if(hwndCombobox) O32_DestroyWindow(hwndCombobox); 235 if(hwndMdiClient) O32_DestroyWindow(hwndMdiClient); 236 if(hwndEdit) O32_DestroyWindow(hwndEdit); 237 if(hwndScrollbar) O32_DestroyWindow(hwndScrollbar); 238 if(hwndStatic) O32_DestroyWindow(hwndStatic); 207 239 if(ButtonClass) delete ButtonClass; 208 240 if(ListboxClass) delete ListboxClass; … … 257 289 //These are not supported by Open32 258 290 wc.style &= ~(CS_PARENTDC | CS_CLASSDC); 259 260 //SvL: 18-7-'98 Breaks apps (solitaire, rasmol..)261 #if 0262 /* @@@PH 98/06/21 experimental fix for WInhlp32 */263 #ifndef CS_SYNCPAINT264 #define CS_SYNCPAINT 0x02000000L265 #endif266 267 wc.style |= CS_SYNCPAINT;268 #endif269 291 270 292 wc.lpfnWndProc = (WNDPROC)Win32WindowClass::GetOS2ClassCallback(); … … 840 862 case WM_KEYUP: 841 863 case WM_CHAR: //SvL: Correct Open32 key mapping bug 864 //TODO: Not good enough, look at Wine 842 865 lParam = MapOEMToRealKey(wParam, lParam); 843 866 break; 867 868 case WM_MOUSEACTIVATE: 869 //Open32 sends an OS/2 window message for a button click 870 if(HIWORD(lParam) == 0x71) //WM_BUTTONCLICKFIRST 871 { 872 lParam = (WM_LBUTTONDOWN << 16) | LOWORD(lParam); 873 } 874 break; 875 844 876 case WM_ACTIVATE: 845 if(LOWORD(wParam) != WA_INACTIVE) 846 { 847 //EB: I think the problem is not a missing wm_erasebkgnd. 848 //Maybe some wrong flags in open32 during async repainting. 849 //SvL: Bugfix, Open32 is NOT sending this to the window (messes up Solitaire) 850 RECT rect; 851 HRGN hrgn; 852 HDC hdc = GetDC(hwnd); 853 854 // erase the dirty rect 855 GetUpdateRect(hwnd, &rect, TRUE); 856 hrgn = CreateRectRgnIndirect(&rect); 857 SelectClipRgn (hdc, hrgn); 858 DeleteObject (hrgn); 859 wclass->GetWinCallback()(hwnd, WM_ERASEBKGND, hdc, (LPARAM)&rect); 860 SelectClipRgn (hdc, NULL); 861 ReleaseDC(hwnd, hdc); 862 } 877 if(LOWORD(wParam) != WA_INACTIVE) 878 { 879 //EB: I think the problem is not a missing wm_erasebkgnd. 880 //Maybe some wrong flags in open32 during async repainting. 881 RECT rect; 882 HRGN hrgn; 883 HDC hdc = GetDC(hwnd); 884 885 // erase the dirty rect 886 GetUpdateRect(hwnd, &rect, TRUE); 887 hrgn = CreateRectRgnIndirect(&rect); 888 SelectClipRgn (hdc, hrgn); 889 DeleteObject (hrgn); 890 wclass->GetWinCallback()(hwnd, WM_ERASEBKGND, hdc, (LPARAM)&rect); 891 SelectClipRgn (hdc, NULL); 892 ReleaseDC(hwnd, hdc); 893 } 863 894 break; 864 895 }
Note:
See TracChangeset
for help on using the changeset viewer.