- Timestamp:
- Jun 6, 1999, 2:25:49 PM (26 years ago)
- Location:
- trunk/src
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/gdi32/gdi32.cpp
r4 r37 1 /* $Id: gdi32.cpp,v 1. 1 1999-05-24 20:19:39 ktkExp $ */1 /* $Id: gdi32.cpp,v 1.2 1999-06-06 12:25:48 cbratschi Exp $ */ 2 2 3 3 /* … … 43 43 } POLYTEXTW; 44 44 45 46 static ULONG CalcBitmapSize(ULONG cBits, LONG cx, LONG cy) 47 { 48 ULONG alignment; 49 ULONG factor; 50 BOOL flag = TRUE; //true: '*' false: '/' 51 52 cy = cy < 0 ? -cy : cy; 53 54 switch(cBits) 55 { 56 case 1: 57 factor = 8; 58 flag = FALSE; 59 break; 60 61 case 4: 62 factor = 2; 63 flag = FALSE; 64 break; 65 66 case 8: 67 factor = 1; 68 break; 69 70 case 16: 71 factor = 2; 72 break; 73 74 case 24: 75 factor = 3; 76 break; 77 78 case 32: 79 return cx*cy; 80 81 default: 82 return 0; 83 } 84 85 if (flag) 86 alignment = (cx = (cx*factor)) % 4; 87 else 88 alignment = (cx = ((cx+factor-1)/factor)) % 4; 89 90 if (alignment != 0) 91 cx += 4 - alignment; 92 93 return cx*cy; 94 } 45 95 46 96 //****************************************************************************** … … 1815 1865 //****************************************************************************** 1816 1866 //****************************************************************************** 1817 INT WIN32API SetDIBitsToDevice( HDC arg1, INT arg2, INT arg3, DWORD arg4, DWORD arg5, INT arg6, INT arg7, UINT arg8, UINT arg9, LPCVOID arg10, const BITMAPINFO *arg11, UINT arg12) 1818 { 1819 dprintf(("GDI32: OS2SetDIBitsToDevice")); 1820 return O32_SetDIBitsToDevice(arg1, arg2, arg3, (int)arg4, (int)arg5, arg6, arg7, arg8, arg9, (PVOID)arg10, (PBITMAPINFO)arg11, arg12); 1867 INT WIN32API SetDIBitsToDevice(HDC hdc, INT xDest, INT yDest, DWORD cx, DWORD cy, INT xSrc, INT ySrc, UINT startscan, UINT lines, LPCVOID bits, const BITMAPINFO *info, UINT coloruse) 1868 { 1869 INT result, imgsize, palsize; 1870 char *ptr; 1871 1872 dprintf(("GDI32: OS2SetDIBitsToDevice hdc:%X xDest:%d yDest:%d, cx:%d, cy:%d, xSrc:%d, ySrc:%d, startscan:%d, lines:%d, bits:%X, info%X, coloruse:%d", 1873 hdc, xDest, yDest, cx, cy, xSrc, ySrc, startscan, lines, (LPVOID) bits, (PBITMAPINFO)info, coloruse)); 1874 1875 // EB: ->>> Crazy. Nobody seen this Open32 bug ? 1876 // Dont't like dirty pointers, but Open32 needs a bit help. 1877 // Only tested with winmine. 1878 palsize = (1 << info->bmiHeader.biBitCount) * sizeof(RGBQUAD); 1879 imgsize = CalcBitmapSize(info->bmiHeader.biBitCount, 1880 info->bmiHeader.biWidth, info->bmiHeader.biHeight); 1881 ptr = ((char *)info) + palsize + sizeof(BITMAPINFOHEADER); 1882 if(bits >= ptr && bits < ptr + imgsize) 1883 { 1884 bits = (char *)bits - imgsize + 1885 CalcBitmapSize(info->bmiHeader.biBitCount, 1886 info->bmiHeader.biWidth, lines); 1887 } 1888 // EB: <<<- 1889 1890 result = O32_SetDIBitsToDevice(hdc, xDest, yDest, cx, cy, xSrc, ySrc, startscan, lines, (PVOID) bits, (PBITMAPINFO)info, coloruse); 1891 return result; 1821 1892 } 1822 1893 //****************************************************************************** -
trunk/src/kernel32/heap.cpp
r20 r37 1 /* $Id: heap.cpp,v 1. 4 1999-05-31 23:17:17 phallerExp $ */1 /* $Id: heap.cpp,v 1.5 1999-06-06 12:25:49 cbratschi Exp $ */ 2 2 3 3 /* … … 71 71 curheap = new OS2Heap(hHeap, flOptions, dwInitialSize, dwMaximumSize); 72 72 if(curheap == NULL) { 73 73 O32_HeapDestroy(hHeap); 74 74 return(NULL); 75 75 } 76 76 if(curheap->getHeapHandle() == NULL) { 77 77 O32_HeapDestroy(hHeap); 78 78 delete curheap; 79 79 return(NULL); … … 98 98 /* PH: Though "HeapSize" is a reserved word for the linker, ILINK can be 99 99 tricked by placing the word HEAPSIZE in quotes. It then exports it properly 100 to the target DLL. 100 to the target DLL. 101 101 */ 102 102 DWORD WIN32API HeapSize(HANDLE hHeap, DWORD arg2, PVOID arg3) … … 154 154 //SvL: Only one process heap per process 155 155 if(processheap == NULL) { 156 157 158 159 160 161 162 163 156 //TODO: I haven't thought real hard about this. I added it just to make "hdr.exe" happy. 157 hHeap = O32_HeapCreate(HEAP_GENERATE_EXCEPTIONS, 1, 0x4000); 158 OS2ProcessHeap = new OS2Heap(hHeap, HEAP_GENERATE_EXCEPTIONS, 0x4000, 0); 159 if(OS2ProcessHeap == NULL) { 160 O32_HeapDestroy(hHeap); 161 return(NULL); 162 } 163 processheap = hHeap; 164 164 } 165 165 return(processheap); … … 173 173 174 174 if(processheap == NULL) { 175 176 175 if(GetProcessHeap() == NULL) 176 return(NULL); 177 177 } 178 178 if(fuFlags & LMEM_ZEROINIT) … … 209 209 210 210 if(OS2ProcessHeap->GetLockCnt((LPVOID)hMem) != 0) { 211 212 211 dprintf(("LocalFree, lock count != 0\n")); 212 return(hMem); //TODO: SetLastError 213 213 } 214 214 if(OS2ProcessHeap->Free(0, (LPVOID)hMem) == FALSE) { 215 215 return(hMem); //TODO: SetLastError 216 216 } 217 217 return NULL; //success … … 238 238 HLOCAL WIN32API LocalReAlloc(HLOCAL hMem, DWORD cbBytes, UINT fuFlags) 239 239 { 240 LPVOIDlpMem;240 HLOCAL lpMem; 241 241 242 242 dprintf(("KERNEL32: LocalReAlloc %X %d %X\n", hMem, cbBytes, fuFlags)); 243 243 //SvL: 8-8-'98: Notepad bugfix (assumes address is identical when new size < old size) 244 if(OS2ProcessHeap->Size(0, (LPVOID)hMem) > cbBytes) 245 return hMem; 246 247 lpMem = (LPVOID)O32_LocalAlloc(fuFlags, cbBytes); 248 memcpy(lpMem, (LPVOID)hMem, min(cbBytes, OS2ProcessHeap->Size(0, (LPVOID)hMem))); 244 if(OS2ProcessHeap->Size(0, (LPVOID)hMem) >= cbBytes) 245 { 246 dprintf(("KERNEL32: LocalReAlloc returned %X\n", hMem)); 247 return hMem; 248 } 249 250 lpMem = LocalAlloc(fuFlags, cbBytes); 251 memcpy((LPVOID)lpMem, (LPVOID)hMem, min(cbBytes, OS2ProcessHeap->Size(0, (LPVOID)hMem))); 249 252 OS2ProcessHeap->Free(0, (LPVOID)hMem); 253 254 dprintf(("KERNEL32: LocalReAlloc returned %X\n", lpMem)); 250 255 return((HLOCAL)lpMem); 251 256 } -
trunk/src/kernel32/resource.cpp
r25 r37 1 /* $Id: resource.cpp,v 1. 3 1999-06-01 15:47:38 phallerExp $ */1 /* $Id: resource.cpp,v 1.4 1999-06-06 12:25:49 cbratschi Exp $ */ 2 2 3 3 /* … … 31 31 32 32 dprintf(("FindResourceA %X", hModule)); 33 if(hModule == 0 || hModule == -1) 34 module = (Win32Image *)WinExe; 35 else module = (Win32Image *)Win32Dll::findModule(hModule); 33 // EB: ->>> added real exe module handle 34 if(hModule == 0 || hModule == -1 || (WinExe != NULL && hModule == WinExe->getOS2InstanceHandle())) 35 module = (Win32Image *)WinExe; 36 else 37 module = (Win32Image *)Win32Dll::findModule(hModule); 36 38 37 39 if(module == NULL) … … 43 45 //****************************************************************************** 44 46 HRSRC WIN32API FindResourceW(HINSTANCE hModule, LPCWSTR lpszName, 45 47 LPCWSTR lpszType) 46 48 { 47 49 Win32Image *module; … … 53 55 54 56 if(module == NULL) 55 57 return(NULL); 56 58 57 59 return module->findResourceW((LPWSTR)lpszName, (LPWSTR)lpszType); -
trunk/src/kernel32/winres.cpp
r4 r37 1 /* $Id: winres.cpp,v 1. 1 1999-05-24 20:19:50 ktkExp $ */1 /* $Id: winres.cpp,v 1.2 1999-06-06 12:25:49 cbratschi Exp $ */ 2 2 3 3 /* … … 32 32 #include "winexe.h" 33 33 34 static ULONG CalcBitmapSize(ULONG cBits, LONG cx, LONG cy) 35 { 36 ULONG alignment; 37 ULONG factor; 38 BOOL flag = TRUE; //true: '*' false: '/' 39 40 cy = cy < 0 ? -cy : cy; 41 42 switch(cBits) 43 { 44 case 1: 45 factor = 8; 46 flag = FALSE; 47 break; 48 49 case 4: 50 factor = 2; 51 flag = FALSE; 52 break; 53 54 case 8: 55 factor = 1; 56 break; 57 58 case 16: 59 factor = 2; 60 break; 61 62 case 24: 63 factor = 3; 64 break; 65 66 case 32: 67 return cx*cy; 68 69 default: 70 return 0; 71 } 72 73 if (flag) 74 alignment = (cx = (cx*factor)) % 4; 75 else 76 alignment = (cx = ((cx+factor-1)/factor)) % 4; 77 78 if (alignment != 0) 79 cx += 4 - alignment; 80 81 return cx*cy; 82 } 83 34 84 //****************************************************************************** 35 85 //****************************************************************************** … … 187 237 RGB2 *os2rgb; 188 238 int palsize = 0; 239 int imgsize; 189 240 190 241 if(bmphdr->cbSize != sizeof(BITMAPFILEHEADER2)) … … 194 245 palsize = (1 << bmphdr->bmp2.cBitCount) * sizeof(RGBQUAD); 195 246 } 247 248 // EB: ->>> added imgsize 249 if(bmphdr->bmp2.cbImage == 0) 250 imgsize = CalcBitmapSize(bmphdr->bmp2.cBitCount, 251 bmphdr->bmp2.cx, 252 bmphdr->bmp2.cy); 253 else 254 imgsize = bmphdr->bmp2.cbImage; 255 196 256 winbmphdr = (WINBITMAPINFOHEADER *)malloc(sizeof(WINBITMAPINFOHEADER) + 197 bmphdr->bmp2.cbImage + palsize); 198 memset((char *)winbmphdr, 0, sizeof(WINBITMAPINFOHEADER) + bmphdr->bmp2.cbImage + 199 palsize); 257 imgsize + palsize); 258 memset((char *)winbmphdr, 0, sizeof(WINBITMAPINFOHEADER) + imgsize + palsize); 200 259 201 260 winbmphdr->biSize = sizeof(WINBITMAPINFOHEADER); … … 206 265 //TODO: Identical except for BI_BITFIELDS (3L) type! 207 266 winbmphdr->biCompression = bmphdr->bmp2.ulCompression; 208 winbmphdr->biSizeImage = bmphdr->bmp2.cbImage; 267 winbmphdr->biSizeImage = bmphdr->bmp2.cbImage; //imgsize; 209 268 //TODO: Doesn't seem to be completely identical.. 210 269 winbmphdr->biClrUsed = bmphdr->bmp2.cclrUsed; … … 221 280 rgb = (RGBQUAD *)((int)rgb + palsize); 222 281 } 223 memcpy((char *)rgb, (char *)os2rgb, winbmphdr->biSizeImage);282 memcpy((char *)rgb, (char *)os2rgb, imgsize); 224 283 return((PVOID)winbmphdr); 225 284 } -
trunk/src/user32/defwndproc.cpp
r4 r37 1 /* $Id: defwndproc.cpp,v 1. 1 1999-05-24 20:20:01 ktkExp $ */1 /* $Id: defwndproc.cpp,v 1.2 1999-06-06 12:25:49 cbratschi Exp $ */ 2 2 3 3 /* … … 22 22 #endif 23 23 switch(Msg) { 24 case WM_NCCREATE://SvL: YAFMO (yet another feature missing in Open32) 25 return(TRUE); 26 case WM_CTLCOLORMSGBOX: 27 case WM_CTLCOLOREDIT: 28 case WM_CTLCOLORLISTBOX: 29 case WM_CTLCOLORBTN: 30 case WM_CTLCOLORDLG: 31 case WM_CTLCOLORSTATIC: 32 case WM_CTLCOLORSCROLLBAR: 33 SetBkColor((HDC)wParam, GetSysColor(COLOR_WINDOW)); 34 SetTextColor((HDC)wParam, GetSysColor(COLOR_WINDOWTEXT)); 35 return GetSysColorBrush(COLOR_BTNFACE); 36 37 default: 38 return O32_DefWindowProc(hwnd, Msg, wParam, lParam); 24 case WM_SETREDRAW: //Open32 does not set the visible flag 25 { 26 long dwStyle = GetWindowLongA (hwnd, GWL_STYLE); 27 if(wParam) 28 SetWindowLongA (hwnd, GWL_STYLE, dwStyle | WS_VISIBLE); 29 else 30 SetWindowLongA (hwnd, GWL_STYLE, dwStyle & ~WS_VISIBLE); 31 return O32_DefWindowProc(hwnd, Msg, wParam, lParam); 32 } 33 case WM_NCCREATE://SvL: YAFMO (yet another feature missing in Open32) 34 return(TRUE); 35 case WM_CTLCOLORMSGBOX: 36 case WM_CTLCOLOREDIT: 37 case WM_CTLCOLORLISTBOX: 38 case WM_CTLCOLORBTN: 39 case WM_CTLCOLORDLG: 40 case WM_CTLCOLORSTATIC: 41 case WM_CTLCOLORSCROLLBAR: 42 SetBkColor((HDC)wParam, GetSysColor(COLOR_WINDOW)); 43 SetTextColor((HDC)wParam, GetSysColor(COLOR_WINDOWTEXT)); 44 return GetSysColorBrush(COLOR_BTNFACE); 45 46 default: 47 return O32_DefWindowProc(hwnd, Msg, wParam, lParam); 39 48 } 40 49 } … … 48 57 #endif 49 58 switch(Msg) { 50 case WM_NCCREATE://SvL: YAOFM (yet another open32 feature missing) 51 return(TRUE); 52 case WM_CTLCOLORMSGBOX: 53 case WM_CTLCOLOREDIT: 54 case WM_CTLCOLORLISTBOX: 55 case WM_CTLCOLORBTN: 56 case WM_CTLCOLORDLG: 57 case WM_CTLCOLORSTATIC: 58 case WM_CTLCOLORSCROLLBAR: 59 SetBkColor((HDC)wParam, GetSysColor(COLOR_WINDOW)); 60 SetTextColor((HDC)wParam, GetSysColor(COLOR_WINDOWTEXT)); 61 return GetSysColorBrush(COLOR_BTNFACE); 62 63 default: 64 return O32_DefWindowProc(hwnd, Msg, wParam, lParam); 59 case WM_SETREDRAW: //Open32 does not set the visible flag 60 { 61 long dwStyle = GetWindowLongA (hwnd, GWL_STYLE); 62 if(wParam) 63 SetWindowLongA (hwnd, GWL_STYLE, dwStyle | WS_VISIBLE); 64 else 65 SetWindowLongA (hwnd, GWL_STYLE, dwStyle & ~WS_VISIBLE); 66 return O32_DefWindowProc(hwnd, Msg, wParam, lParam); 67 } 68 case WM_NCCREATE://SvL: YAOFM (yet another open32 feature missing) 69 return(TRUE); 70 case WM_CTLCOLORMSGBOX: 71 case WM_CTLCOLOREDIT: 72 case WM_CTLCOLORLISTBOX: 73 case WM_CTLCOLORBTN: 74 case WM_CTLCOLORDLG: 75 case WM_CTLCOLORSTATIC: 76 case WM_CTLCOLORSCROLLBAR: 77 SetBkColor((HDC)wParam, GetSysColor(COLOR_WINDOW)); 78 SetTextColor((HDC)wParam, GetSysColor(COLOR_WINDOWTEXT)); 79 return GetSysColorBrush(COLOR_BTNFACE); 80 81 default: 82 return O32_DefWindowProc(hwnd, Msg, wParam, lParam); 65 83 } 66 84 } … … 73 91 #endif 74 92 switch(Msg) { 75 case WM_NCCREATE://SvL: YAOFM (yet another open32 feature missing) 76 return(TRUE); 77 case WM_CTLCOLORMSGBOX: 78 case WM_CTLCOLOREDIT: 79 case WM_CTLCOLORLISTBOX: 80 case WM_CTLCOLORBTN: 81 case WM_CTLCOLORDLG: 82 case WM_CTLCOLORSTATIC: 83 case WM_CTLCOLORSCROLLBAR: 84 SetBkColor((HDC)wParam, GetSysColor(COLOR_WINDOW)); 85 SetTextColor((HDC)wParam, GetSysColor(COLOR_WINDOWTEXT)); 86 return GetSysColorBrush(COLOR_BTNFACE); 87 88 default: 89 return O32_DefDlgProc(hwnd, Msg, wParam, lParam); 93 case WM_SETREDRAW: //Open32 does not set the visible flag 94 { 95 long dwStyle = GetWindowLongA (hwnd, GWL_STYLE); 96 if(wParam) 97 SetWindowLongA (hwnd, GWL_STYLE, dwStyle | WS_VISIBLE); 98 else 99 SetWindowLongA (hwnd, GWL_STYLE, dwStyle & ~WS_VISIBLE); 100 return O32_DefWindowProc(hwnd, Msg, wParam, lParam); 101 } 102 case WM_NCCREATE://SvL: YAOFM (yet another open32 feature missing) 103 return(TRUE); 104 case WM_CTLCOLORMSGBOX: 105 case WM_CTLCOLOREDIT: 106 case WM_CTLCOLORLISTBOX: 107 case WM_CTLCOLORBTN: 108 case WM_CTLCOLORDLG: 109 case WM_CTLCOLORSTATIC: 110 case WM_CTLCOLORSCROLLBAR: 111 SetBkColor((HDC)wParam, GetSysColor(COLOR_WINDOW)); 112 SetTextColor((HDC)wParam, GetSysColor(COLOR_WINDOWTEXT)); 113 return GetSysColorBrush(COLOR_BTNFACE); 114 115 default: 116 return O32_DefDlgProc(hwnd, Msg, wParam, lParam); 90 117 } 91 118 } … … 99 126 #endif 100 127 switch(Msg) { 101 case WM_NCCREATE://SvL: YAOFM (yet another open32 feature missing) 102 return(TRUE); 103 case WM_CTLCOLORMSGBOX: 104 case WM_CTLCOLOREDIT: 105 case WM_CTLCOLORLISTBOX: 106 case WM_CTLCOLORBTN: 107 case WM_CTLCOLORDLG: 108 case WM_CTLCOLORSTATIC: 109 case WM_CTLCOLORSCROLLBAR: 110 SetBkColor((HDC)wParam, GetSysColor(COLOR_WINDOW)); 111 SetTextColor((HDC)wParam, GetSysColor(COLOR_WINDOWTEXT)); 112 return GetSysColorBrush(COLOR_BTNFACE); 113 114 default: 115 return O32_DefDlgProc(hwnd, Msg, wParam, lParam); 128 case WM_SETREDRAW: //Open32 does not set the visible flag 129 { 130 long dwStyle = GetWindowLongA (hwnd, GWL_STYLE); 131 if(wParam) 132 SetWindowLongA (hwnd, GWL_STYLE, dwStyle | WS_VISIBLE); 133 else 134 SetWindowLongA (hwnd, GWL_STYLE, dwStyle & ~WS_VISIBLE); 135 return O32_DefWindowProc(hwnd, Msg, wParam, lParam); 136 } 137 case WM_NCCREATE://SvL: YAOFM (yet another open32 feature missing) 138 return(TRUE); 139 case WM_CTLCOLORMSGBOX: 140 case WM_CTLCOLOREDIT: 141 case WM_CTLCOLORLISTBOX: 142 case WM_CTLCOLORBTN: 143 case WM_CTLCOLORDLG: 144 case WM_CTLCOLORSTATIC: 145 case WM_CTLCOLORSCROLLBAR: 146 SetBkColor((HDC)wParam, GetSysColor(COLOR_WINDOW)); 147 SetTextColor((HDC)wParam, GetSysColor(COLOR_WINDOWTEXT)); 148 return GetSysColorBrush(COLOR_BTNFACE); 149 150 default: 151 return O32_DefDlgProc(hwnd, Msg, wParam, lParam); 116 152 } 117 153 } … … 124 160 #endif 125 161 switch(Msg) { 126 case WM_NCCREATE://SvL: YAOFM (yet another open32 feature missing) 127 return(TRUE); 128 case WM_CTLCOLORMSGBOX: 129 case WM_CTLCOLOREDIT: 130 case WM_CTLCOLORLISTBOX: 131 case WM_CTLCOLORBTN: 132 case WM_CTLCOLORDLG: 133 case WM_CTLCOLORSTATIC: 134 case WM_CTLCOLORSCROLLBAR: 135 SetBkColor((HDC)wParam, GetSysColor(COLOR_WINDOW)); 136 SetTextColor((HDC)wParam, GetSysColor(COLOR_WINDOWTEXT)); 137 return GetSysColorBrush(COLOR_BTNFACE); 138 139 default: 140 return O32_DefFrameProc(hwndFrame, hwndClient, Msg, wParam, lParam); 162 case WM_SETREDRAW: //Open32 does not set the visible flag 163 { 164 //Frame 165 long dwStyle = GetWindowLongA (hwndFrame, GWL_STYLE); 166 if(wParam) 167 SetWindowLongA (hwndFrame, GWL_STYLE, dwStyle | WS_VISIBLE); 168 else 169 SetWindowLongA (hwndFrame, GWL_STYLE, dwStyle & ~WS_VISIBLE); 170 return O32_DefWindowProc(hwndFrame, Msg, wParam, lParam); 171 //Client 172 dwStyle = GetWindowLongA (hwndClient, GWL_STYLE); 173 if(wParam) 174 SetWindowLongA (hwndClient, GWL_STYLE, dwStyle | WS_VISIBLE); 175 else 176 SetWindowLongA (hwndClient, GWL_STYLE, dwStyle & ~WS_VISIBLE); 177 return O32_DefWindowProc(hwndClient, Msg, wParam, lParam); 178 } 179 case WM_NCCREATE://SvL: YAOFM (yet another open32 feature missing) 180 return(TRUE); 181 case WM_CTLCOLORMSGBOX: 182 case WM_CTLCOLOREDIT: 183 case WM_CTLCOLORLISTBOX: 184 case WM_CTLCOLORBTN: 185 case WM_CTLCOLORDLG: 186 case WM_CTLCOLORSTATIC: 187 case WM_CTLCOLORSCROLLBAR: 188 SetBkColor((HDC)wParam, GetSysColor(COLOR_WINDOW)); 189 SetTextColor((HDC)wParam, GetSysColor(COLOR_WINDOWTEXT)); 190 return GetSysColorBrush(COLOR_BTNFACE); 191 192 default: 193 return O32_DefFrameProc(hwndFrame, hwndClient, Msg, wParam, lParam); 141 194 } 142 195 } … … 150 203 #endif 151 204 switch(Msg) { 152 case WM_NCCREATE://SvL: YAOFM (yet another open32 feature missing) 153 return(TRUE); 154 case WM_CTLCOLORMSGBOX: 155 case WM_CTLCOLOREDIT: 156 case WM_CTLCOLORLISTBOX: 157 case WM_CTLCOLORBTN: 158 case WM_CTLCOLORDLG: 159 case WM_CTLCOLORSTATIC: 160 case WM_CTLCOLORSCROLLBAR: 161 SetBkColor((HDC)wParam, GetSysColor(COLOR_WINDOW)); 162 SetTextColor((HDC)wParam, GetSysColor(COLOR_WINDOWTEXT)); 163 return GetSysColorBrush(COLOR_BTNFACE); 164 165 default: 166 return O32_DefFrameProc(hwndFrame, hwndClient, Msg, wParam, lParam); 205 case WM_SETREDRAW: //Open32 does not set the visible flag 206 { 207 //Frame 208 long dwStyle = GetWindowLongA (hwndFrame, GWL_STYLE); 209 if(wParam) 210 SetWindowLongA (hwndFrame, GWL_STYLE, dwStyle | WS_VISIBLE); 211 else 212 SetWindowLongA (hwndFrame, GWL_STYLE, dwStyle & ~WS_VISIBLE); 213 return O32_DefWindowProc(hwndFrame, Msg, wParam, lParam); 214 //Client 215 dwStyle = GetWindowLongA (hwndClient, GWL_STYLE); 216 if(wParam) 217 SetWindowLongA (hwndClient, GWL_STYLE, dwStyle | WS_VISIBLE); 218 else 219 SetWindowLongA (hwndClient, GWL_STYLE, dwStyle & ~WS_VISIBLE); 220 return O32_DefWindowProc(hwndClient, Msg, wParam, lParam); 221 } 222 case WM_NCCREATE://SvL: YAOFM (yet another open32 feature missing) 223 return(TRUE); 224 case WM_CTLCOLORMSGBOX: 225 case WM_CTLCOLOREDIT: 226 case WM_CTLCOLORLISTBOX: 227 case WM_CTLCOLORBTN: 228 case WM_CTLCOLORDLG: 229 case WM_CTLCOLORSTATIC: 230 case WM_CTLCOLORSCROLLBAR: 231 SetBkColor((HDC)wParam, GetSysColor(COLOR_WINDOW)); 232 SetTextColor((HDC)wParam, GetSysColor(COLOR_WINDOWTEXT)); 233 return GetSysColorBrush(COLOR_BTNFACE); 234 235 default: 236 return O32_DefFrameProc(hwndFrame, hwndClient, Msg, wParam, lParam); 167 237 } 168 238 } … … 175 245 #endif 176 246 switch(Msg) { 177 case WM_NCCREATE://SvL: YAOFM (yet another open32 feature missing) 178 return(TRUE); 179 case WM_CTLCOLORMSGBOX: 180 case WM_CTLCOLOREDIT: 181 case WM_CTLCOLORLISTBOX: 182 case WM_CTLCOLORBTN: 183 case WM_CTLCOLORDLG: 184 case WM_CTLCOLORSTATIC: 185 case WM_CTLCOLORSCROLLBAR: 186 SetBkColor((HDC)wParam, GetSysColor(COLOR_WINDOW)); 187 SetTextColor((HDC)wParam, GetSysColor(COLOR_WINDOWTEXT)); 188 return GetSysColorBrush(COLOR_BTNFACE); 189 190 default: 191 return O32_DefMDIChildProc(hwnd, Msg, wParam, lParam); 247 case WM_SETREDRAW: //Open32 does not set the visible flag 248 { 249 long dwStyle = GetWindowLongA (hwnd, GWL_STYLE); 250 if(wParam) 251 SetWindowLongA (hwnd, GWL_STYLE, dwStyle | WS_VISIBLE); 252 else 253 SetWindowLongA (hwnd, GWL_STYLE, dwStyle & ~WS_VISIBLE); 254 return O32_DefWindowProc(hwnd, Msg, wParam, lParam); 255 } 256 case WM_NCCREATE://SvL: YAOFM (yet another open32 feature missing) 257 return(TRUE); 258 case WM_CTLCOLORMSGBOX: 259 case WM_CTLCOLOREDIT: 260 case WM_CTLCOLORLISTBOX: 261 case WM_CTLCOLORBTN: 262 case WM_CTLCOLORDLG: 263 case WM_CTLCOLORSTATIC: 264 case WM_CTLCOLORSCROLLBAR: 265 SetBkColor((HDC)wParam, GetSysColor(COLOR_WINDOW)); 266 SetTextColor((HDC)wParam, GetSysColor(COLOR_WINDOWTEXT)); 267 return GetSysColorBrush(COLOR_BTNFACE); 268 269 default: 270 return O32_DefMDIChildProc(hwnd, Msg, wParam, lParam); 192 271 } 193 272 } … … 201 280 #endif 202 281 switch(Msg) { 203 case WM_NCCREATE://SvL: YAOFM (yet another open32 feature missing) 204 return(TRUE); 205 case WM_CTLCOLORMSGBOX: 206 case WM_CTLCOLOREDIT: 207 case WM_CTLCOLORLISTBOX: 208 case WM_CTLCOLORBTN: 209 case WM_CTLCOLORDLG: 210 case WM_CTLCOLORSTATIC: 211 case WM_CTLCOLORSCROLLBAR: 212 SetBkColor((HDC)wParam, GetSysColor(COLOR_WINDOW)); 213 SetTextColor((HDC)wParam, GetSysColor(COLOR_WINDOWTEXT)); 214 return GetSysColorBrush(COLOR_BTNFACE); 215 216 default: 217 return O32_DefMDIChildProc(hwnd, Msg, wParam, lParam); 218 } 219 } 220 //****************************************************************************** 221 //****************************************************************************** 282 case WM_SETREDRAW: //Open32 does not set the visible flag 283 { 284 long dwStyle = GetWindowLongA (hwnd, GWL_STYLE); 285 if(wParam) 286 SetWindowLongA (hwnd, GWL_STYLE, dwStyle | WS_VISIBLE); 287 else 288 SetWindowLongA (hwnd, GWL_STYLE, dwStyle & ~WS_VISIBLE); 289 return O32_DefWindowProc(hwnd, Msg, wParam, lParam); 290 } 291 case WM_NCCREATE://SvL: YAOFM (yet another open32 feature missing) 292 return(TRUE); 293 case WM_CTLCOLORMSGBOX: 294 case WM_CTLCOLOREDIT: 295 case WM_CTLCOLORLISTBOX: 296 case WM_CTLCOLORBTN: 297 case WM_CTLCOLORDLG: 298 case WM_CTLCOLORSTATIC: 299 case WM_CTLCOLORSCROLLBAR: 300 SetBkColor((HDC)wParam, GetSysColor(COLOR_WINDOW)); 301 SetTextColor((HDC)wParam, GetSysColor(COLOR_WINDOWTEXT)); 302 return GetSysColorBrush(COLOR_BTNFACE); 303 304 default: 305 return O32_DefMDIChildProc(hwnd, Msg, wParam, lParam); 306 } 307 } 308 //****************************************************************************** 309 //****************************************************************************** -
trunk/src/user32/user32.cpp
r34 r37 1 /* $Id: user32.cpp,v 1. 3 1999-06-02 15:57:57cbratschi Exp $ */1 /* $Id: user32.cpp,v 1.4 1999-06-06 12:25:49 cbratschi Exp $ */ 2 2 3 3 /* … … 2223 2223 int pos; 2224 2224 2225 pos = GetScrollPos(hwnd, fnBar);2225 pos = O32_GetScrollPos(hwnd, fnBar); 2226 2226 #ifdef DEBUG 2227 2227 WriteLog("USER32: GetScrollPos of %X type %d returned %d\n", hwnd, fnBar, pos);
Note:
See TracChangeset
for help on using the changeset viewer.