- Timestamp:
- Aug 31, 1999, 4:38:09 PM (26 years ago)
- Location:
- trunk/src/user32/new
- Files:
-
- 2 added
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/user32/new/makefile
r750 r753 1 # $Id: makefile,v 1.3 8 1999-08-31 10:36:22sandervl Exp $1 # $Id: makefile,v 1.39 1999-08-31 14:38:08 sandervl Exp $ 2 2 3 3 # … … 33 33 oslibutil.obj oslibmsg.obj dib.obj oslibdos.obj win32wmdichild.obj \ 34 34 winprop.obj wingdi.obj oslibgdi.obj winaccel.obj winscrollbar.obj \ 35 nativerc.obj oslibres.obj dummy.obj \35 nativerc.obj oslibres.obj dummy.obj oslibmenu.obj \ 36 36 windlgmsg.obj windlg.obj 37 37 … … 61 61 loadres.obj: loadres.cpp user32.h dib.h 62 62 icon.obj: icon.cpp $(PDWIN32_INCLUDE)\winicon.h 63 winmenu.obj: winmenu.cpp user32.h $(PDWIN32_INCLUDE)\winres.h win32wbase.h63 winmenu.obj: winmenu.cpp user32.h $(PDWIN32_INCLUDE)\winres.h $(PDWIN32_INCLUDE)\winresmenu.h win32wbase.h 64 64 syscolor.obj: syscolor.cpp syscolor.h 65 65 usrcall.obj: usrcall.cpp usrcall.h … … 103 103 win32class.obj: win32class.cpp win32class.h win32wbase.h win32dlg.h gen_object.h heapshared.h oslibwin.h win32wndchild.h 104 104 win32wbase.obj: win32wbase.cpp win32class.h win32wbase.h win32dlg.h gen_object.h heapshared.h oslibwin.h win32wndchild.h $(PDWIN32_INCLUDE)\winres.h oslibres.h win32wndhandle.h oslibdos.h 105 win32wnd.obj: win32wnd.cpp win32class.h win32wbase.h win32wnd.h win32dlg.h gen_object.h heapshared.h oslibwin.h win32wndchild.h $(PDWIN32_INCLUDE)\winres.h oslibres.h win32wndhandle.h oslibdos.h 105 win32wnd.obj: win32wnd.cpp win32class.h win32wbase.h win32wnd.h win32dlg.h gen_object.h heapshared.h oslibwin.h win32wndchild.h $(PDWIN32_INCLUDE)\winres.h oslibres.h win32wndhandle.h oslibdos.h oslibmenu.h 106 106 win32dlg.obj: win32dlg.cpp win32class.h win32wbase.h win32dlg.h gen_object.h heapshared.h oslibwin.h win32wndchild.h 107 107 win32wndchild.obj: win32wndchild.cpp win32wndchild.h … … 112 112 oslibutil.obj: oslibutil.cpp oslibutil.h $(PDWIN32_INCLUDE)\wprocess.h oslibmsg.h 113 113 oslibmsg.obj: oslibmsg.cpp oslibmsg.h 114 oslibmenu.obj: oslibmenu.cpp oslibmenu.h 114 115 oslibgdi.obj: oslibgdi.cpp oslibgdi.h win32wbase.h 115 116 oslibres.obj: oslibres.cpp oslibwin.h oslibres.h $(PDWIN32_INCLUDE)\winconst.h -
trunk/src/user32/new/oslibres.cpp
r647 r753 1 /* $Id: oslibres.cpp,v 1. 6 1999-08-23 13:56:35sandervl Exp $ */1 /* $Id: oslibres.cpp,v 1.7 1999-08-31 14:38:08 sandervl Exp $ */ 2 2 /* 3 3 * Window API wrappers for OS/2 … … 26 26 27 27 28 //******************************************************************************29 //******************************************************************************30 HWND OSLibWinCreateMenu(HWND hwndParent, PVOID menutemplate)31 {32 return WinCreateMenu(hwndParent, menutemplate);33 }34 28 //****************************************************************************** 35 29 //****************************************************************************** -
trunk/src/user32/new/oslibres.h
r601 r753 1 /* $Id: oslibres.h,v 1. 2 1999-08-20 20:09:51sandervl Exp $ */1 /* $Id: oslibres.h,v 1.3 1999-08-31 14:38:09 sandervl Exp $ */ 2 2 /* 3 3 * Window GUI resource wrapper functions for OS/2 … … 17 17 #endif 18 18 19 HWND OSLibWinCreateMenu(HWND hwndParent, PVOID menutemplate);20 19 HANDLE OSLibWinSetAccelTable(HWND hwnd, HANDLE hAccel, PVOID acceltemplate); 21 20 HANDLE OSLibWinCreateIcon(PVOID iconbitmap); -
trunk/src/user32/new/win32wbase.cpp
r750 r753 1 /* $Id: win32wbase.cpp,v 1. 3 1999-08-31 10:36:22sandervl Exp $ */1 /* $Id: win32wbase.cpp,v 1.4 1999-08-31 14:38:09 sandervl Exp $ */ 2 2 /* 3 3 * Win32 Window Base Class for OS/2 … … 23 23 #include <misc.h> 24 24 #include <heapstring.h> 25 #include <win32wnd.h> 25 #include <win32wbase.h> 26 #include <winres.h> 26 27 #include <spy.h> 27 28 #include "wndmsg.h" 28 29 #include "hooks.h" 29 #include <oslibwin.h> 30 #include <oslibutil.h> 31 #include <oslibgdi.h> 32 #include <oslibres.h> 30 #include "oslibwin.h" 31 #include "oslibutil.h" 32 #include "oslibgdi.h" 33 #include "oslibres.h" 34 #include "oslibmenu.h" 33 35 #include "oslibdos.h" 34 #include <winres.h>35 36 #include "syscolor.h" 36 37 #include "win32wndhandle.h" -
trunk/src/user32/new/winmenu.cpp
r741 r753 1 /* $Id: winmenu.cpp,v 1. 2 1999-08-30 11:59:54sandervl Exp $ */1 /* $Id: winmenu.cpp,v 1.3 1999-08-31 14:38:09 sandervl Exp $ */ 2 2 3 3 /* … … 19 19 #include <stdlib.h> 20 20 #include <win32wbase.h> 21 #include "oslibmenu.h" 22 #include <winresmenu.h> 21 23 22 24 //****************************************************************************** … … 51 53 rc = O32_LoadMenuIndirect(arg1); 52 54 if(astring) 53 FreeAsciiString(astring);55 FreeAsciiString(astring); 54 56 return(rc); 55 57 } … … 58 60 BOOL WIN32API DestroyMenu(HMENU hmenu) 59 61 { 60 Win32 Resource*winres;62 Win32MenuRes *winres; 61 63 62 64 dprintf(("OS2DestroyMenu\n")); 63 65 if(HIWORD(hmenu) == 0) { 64 SetLastError(ERROR_INVALID_PARAMETER);65 return FALSE;66 } 67 winres = (Win32 Resource*)hmenu;66 SetLastError(ERROR_INVALID_PARAMETER); 67 return FALSE; 68 } 69 winres = (Win32MenuRes *)hmenu; 68 70 delete winres; 69 71 return TRUE; … … 112 114 DWORD WIN32API GetMenuCheckMarkDimensions(void) 113 115 { 114 #ifdef DEBUG 115 WriteLog("USER32: GetMenuCheckMarkDimensions\n"); 116 #endif 116 dprintf(("USER32: GetMenuCheckMarkDimensions\n")); 117 117 return O32_GetMenuCheckMarkDimensions(); 118 118 } 119 119 //****************************************************************************** 120 120 //****************************************************************************** 121 int WIN32API GetMenuItemCount( HMENU arg1) 122 { 123 #ifdef DEBUG 124 WriteLog("USER32: GetMenuItemCount\n"); 125 #endif 126 return O32_GetMenuItemCount(arg1); 127 } 128 //****************************************************************************** 129 //****************************************************************************** 130 UINT WIN32API GetMenuItemID( HMENU arg1, int arg2) 131 { 132 #ifdef DEBUG 133 WriteLog("USER32: GetMenuItemID\n"); 134 #endif 135 return O32_GetMenuItemID(arg1, arg2); 136 } 137 //****************************************************************************** 138 //****************************************************************************** 139 UINT WIN32API GetMenuState( HMENU arg1, UINT arg2, UINT arg3) 140 { 141 #ifdef DEBUG 142 WriteLog("USER32: GetMenuState\n"); 143 #endif 144 return O32_GetMenuState(arg1, arg2, arg3); 145 } 146 //****************************************************************************** 147 //****************************************************************************** 148 int WIN32API GetMenuStringA( HMENU arg1, UINT arg2, LPSTR arg3, int arg4, UINT arg5) 149 { 150 #ifdef DEBUG 151 WriteLog("USER32: GetMenuString\n"); 152 #endif 153 return O32_GetMenuString(arg1, arg2, arg3, arg4, arg5); 154 } 155 //****************************************************************************** 156 //****************************************************************************** 157 int WIN32API GetMenuStringW(HMENU hmenu, UINT idItem, LPWSTR lpsz, int cchMax, UINT fuFlags) 158 { 121 int WIN32API GetMenuItemCount( HMENU hMenu) 122 { 123 Win32MenuRes *menu = (Win32MenuRes *)hMenu; 124 125 dprintf(("USER32: GetMenuItemCount %x", hMenu)); 126 if(menu == NULL || menu->getOS2Handle() == 0) 127 { 128 SetLastError(ERROR_INVALID_PARAMETER); 129 return 0; 130 } 131 return OSLibGetMenuItemCount(menu->getOS2Handle()); 132 } 133 //****************************************************************************** 134 //****************************************************************************** 135 UINT WIN32API GetMenuItemID( HMENU hMenu, int nPos) 136 { 137 Win32MenuRes *menu = (Win32MenuRes *)hMenu; 138 139 dprintf(("USER32: GetMenuItemID %x %d\n", hMenu, nPos)); 140 if(menu == NULL || menu->getOS2Handle() == 0) 141 { 142 SetLastError(ERROR_INVALID_PARAMETER); 143 return 0; 144 } 145 return O32_GetMenuItemID(menu->getOS2Handle(), nPos); 146 } 147 //****************************************************************************** 148 //****************************************************************************** 149 UINT WIN32API GetMenuState(HMENU hMenu, UINT arg2, UINT arg3) 150 { 151 Win32MenuRes *menu = (Win32MenuRes *)hMenu; 152 153 dprintf(("USER32: GetMenuState\n")); 154 if(menu == NULL || menu->getOS2Handle() == 0) 155 { 156 SetLastError(ERROR_INVALID_PARAMETER); 157 return 0; 158 } 159 return O32_GetMenuState(menu->getOS2Handle(), arg2, arg3); 160 } 161 //****************************************************************************** 162 //****************************************************************************** 163 int WIN32API GetMenuStringA( HMENU hMenu, UINT arg2, LPSTR arg3, int arg4, UINT arg5) 164 { 165 Win32MenuRes *menu = (Win32MenuRes *)hMenu; 166 167 dprintf(("USER32: GetMenuStringA")); 168 if(menu == NULL || menu->getOS2Handle() == 0) 169 { 170 SetLastError(ERROR_INVALID_PARAMETER); 171 return 0; 172 } 173 return O32_GetMenuString(menu->getOS2Handle(), arg2, arg3, arg4, arg5); 174 } 175 //****************************************************************************** 176 //****************************************************************************** 177 int WIN32API GetMenuStringW(HMENU hMenu, UINT idItem, LPWSTR lpsz, int cchMax, UINT fuFlags) 178 { 179 Win32MenuRes *menu = (Win32MenuRes *)hMenu; 159 180 char *astring = (char *)malloc(cchMax); 160 181 int rc; 161 182 162 dprintf(("USER32: OS2GetMenuStringW\n")); 163 rc = O32_GetMenuString(hmenu, idItem, astring, cchMax, fuFlags); 183 dprintf(("USER32: GetMenuStringW")); 184 if(menu == NULL || menu->getOS2Handle() == 0) 185 { 186 SetLastError(ERROR_INVALID_PARAMETER); 187 return 0; 188 } 189 rc = O32_GetMenuString(menu->getOS2Handle(), idItem, astring, cchMax, fuFlags); 164 190 free(astring); 165 191 if(rc) { … … 172 198 //****************************************************************************** 173 199 //****************************************************************************** 174 BOOL WIN32API SetMenuItemBitmaps( HMENU arg1, UINT arg2, UINT arg3, HBITMAP arg4, HBITMAP arg5) 175 { 176 #ifdef DEBUG 177 WriteLog("USER32: OS2SetMenuItemBitmaps\n"); 178 #endif 179 return O32_SetMenuItemBitmaps(arg1, arg2, arg3, arg4, arg5); 180 } 181 //****************************************************************************** 182 //****************************************************************************** 183 HMENU WIN32API GetSubMenu(HWND arg1, int arg2) 184 { 185 #ifdef DEBUG 186 WriteLog("USER32: GetSubMenu\n"); 187 #endif 188 return O32_GetSubMenu(arg1, arg2); 189 } 190 //****************************************************************************** 191 //****************************************************************************** 192 HMENU WIN32API GetSystemMenu( HWND arg1, BOOL arg2) 193 { 194 #ifdef DEBUG 195 WriteLog("USER32: GetSystemMenu\n"); 196 #endif 197 return O32_GetSystemMenu(arg1, arg2); 198 } 199 //****************************************************************************** 200 //****************************************************************************** 201 BOOL WIN32API IsMenu( HMENU arg1) 202 { 203 #ifdef DEBUG 204 WriteLog("USER32: IsMenu\n"); 205 #endif 206 return O32_IsMenu(arg1); 207 } 208 //****************************************************************************** 209 //****************************************************************************** 210 BOOL WIN32API TrackPopupMenu(HMENU arg1, UINT arg2, int arg3, int arg4, int arg5, HWND arg6, const RECT * arg7) 211 { 212 #ifdef DEBUG 213 WriteLog("USER32: TrackPopupMenu\n"); 214 #endif 215 return O32_TrackPopupMenu(arg1, arg2, arg3, arg4, arg5, arg6, arg7); 216 } 217 //****************************************************************************** 218 //****************************************************************************** 219 BOOL WIN32API TrackPopupMenuEx(HMENU hmenu, UINT flags, int X, int Y, HWND hwnd, LPTPMPARAMS lpPM) 220 { 200 BOOL WIN32API SetMenuItemBitmaps( HMENU hMenu, UINT arg2, UINT arg3, HBITMAP arg4, HBITMAP arg5) 201 { 202 Win32MenuRes *menu = (Win32MenuRes *)hMenu; 203 204 dprintf(("USER32: SetMenuItemBitmaps\n")); 205 if(menu == NULL || menu->getOS2Handle() == 0) 206 { 207 SetLastError(ERROR_INVALID_PARAMETER); 208 return 0; 209 } 210 return O32_SetMenuItemBitmaps(menu->getOS2Handle(), arg2, arg3, arg4, arg5); 211 } 212 //****************************************************************************** 213 //****************************************************************************** 214 HMENU WIN32API GetSubMenu(HWND hMenu, int arg2) 215 { 216 Win32MenuRes *menu = (Win32MenuRes *)hMenu; 217 218 dprintf(("USER32: GetSubMenu\n")); 219 if(menu == NULL || menu->getOS2Handle() == 0) 220 { 221 SetLastError(ERROR_INVALID_PARAMETER); 222 return 0; 223 } 224 return O32_GetSubMenu(menu->getOS2Handle(), arg2); 225 } 226 //****************************************************************************** 227 //****************************************************************************** 228 HMENU WIN32API GetSystemMenu( HWND hMenu, BOOL arg2) 229 { 230 Win32MenuRes *menu = (Win32MenuRes *)hMenu; 231 232 dprintf(("USER32: GetSystemMenu\n")); 233 if(menu == NULL || menu->getOS2Handle() == 0) 234 { 235 SetLastError(ERROR_INVALID_PARAMETER); 236 return 0; 237 } 238 return O32_GetSystemMenu(menu->getOS2Handle(), arg2); 239 } 240 //****************************************************************************** 241 //****************************************************************************** 242 BOOL WIN32API IsMenu( HMENU hMenu) 243 { 244 Win32MenuRes *menu = (Win32MenuRes *)hMenu; 245 246 dprintf(("USER32: IsMenu\n")); 247 if(menu == NULL || menu->getOS2Handle() == 0) 248 { 249 SetLastError(ERROR_INVALID_PARAMETER); 250 return 0; 251 } 252 return O32_IsMenu(menu->getOS2Handle()); 253 } 254 //****************************************************************************** 255 //****************************************************************************** 256 BOOL WIN32API TrackPopupMenu(HMENU hMenu, UINT arg2, int arg3, int arg4, int arg5, HWND arg6, const RECT * arg7) 257 { 258 Win32MenuRes *menu = (Win32MenuRes *)hMenu; 259 260 dprintf(("USER32: TrackPopupMenu\n")); 261 if(menu == NULL || menu->getOS2Handle() == 0) 262 { 263 SetLastError(ERROR_INVALID_PARAMETER); 264 return 0; 265 } 266 return O32_TrackPopupMenu(menu->getOS2Handle(), arg2, arg3, arg4, arg5, arg6, arg7); 267 } 268 //****************************************************************************** 269 //****************************************************************************** 270 BOOL WIN32API TrackPopupMenuEx(HMENU hMenu, UINT flags, int X, int Y, HWND hwnd, LPTPMPARAMS lpPM) 271 { 272 Win32MenuRes *menu = (Win32MenuRes *)hMenu; 221 273 RECT *rect = NULL; 222 274 223 #ifdef DEBUG 224 WriteLog("USER32: TrackPopupMenuEx, not completely implemented\n"); 225 #endif 226 if(lpPM->cbSize != 0) 275 276 dprintf(("USER32: TrackPopupMenuEx, not completely implemented\n")); 277 if(lpPM->cbSize != 0) 227 278 rect = &lpPM->rcExclude; 228 279 229 return O32_TrackPopupMenu(hmenu, flags, X, Y, 0, hwnd, rect); 230 } 231 //****************************************************************************** 232 //****************************************************************************** 233 BOOL WIN32API AppendMenuA(HMENU hMenu, UINT uFlags, UINT ulDNewItem, 234 LPCSTR lpNewItem) 235 { 236 #ifdef DEBUG 237 BOOL rc; 238 239 WriteLog("USER32: OS2AppendMenuA uFlags = %X\n", uFlags); 280 if(menu == NULL || menu->getOS2Handle() == 0) 281 { 282 SetLastError(ERROR_INVALID_PARAMETER); 283 return 0; 284 } 285 return O32_TrackPopupMenu(menu->getOS2Handle(), flags, X, Y, 0, hwnd, rect); 286 } 287 //****************************************************************************** 288 //****************************************************************************** 289 BOOL WIN32API AppendMenuA(HMENU hMenu, UINT uFlags, UINT ulDNewItem, LPCSTR lpNewItem) 290 { 291 Win32MenuRes *menu = (Win32MenuRes *)hMenu; 292 BOOL rc; 293 294 dprintf(("USER32: OS2AppendMenuA uFlags = %X\n", uFlags)); 240 295 241 296 if(uFlags & MF_STRING || uFlags == 0) 242 WriteLog("USER32: OS2AppendMenuA %s\n", lpNewItem); 243 244 rc = O32_AppendMenu(hMenu, uFlags, ulDNewItem, lpNewItem); 245 WriteLog("USER32: OS2AppendMenuA returned %d\n", rc); 297 dprintf(("USER32: OS2AppendMenuA %s\n", lpNewItem)); 298 299 if(menu == NULL || menu->getOS2Handle() == 0) 300 { 301 SetLastError(ERROR_INVALID_PARAMETER); 302 return 0; 303 } 304 rc = O32_AppendMenu(menu->getOS2Handle(), uFlags, ulDNewItem, lpNewItem); 305 dprintf(("USER32: OS2AppendMenuA returned %d\n", rc)); 246 306 return rc; 247 #else 248 return O32_AppendMenu(hMenu, uFlags, ulDNewItem, lpNewItem); 249 #endif 250 } 251 //****************************************************************************** 252 //****************************************************************************** 253 BOOL WIN32API AppendMenuW( HMENU arg1, UINT arg2, UINT arg3, LPCWSTR arg4) 254 { 307 } 308 //****************************************************************************** 309 //****************************************************************************** 310 BOOL WIN32API AppendMenuW( HMENU hMenu, UINT arg2, UINT arg3, LPCWSTR arg4) 311 { 312 Win32MenuRes *menu = (Win32MenuRes *)hMenu; 255 313 BOOL rc; 256 314 char *astring = NULL; 257 315 258 #ifdef DEBUG 259 WriteLog("USER32: OS2AppendMenuW\n"); 260 #endif 316 dprintf(("USER32: OS2AppendMenuW\n")); 317 261 318 if(arg2 & MF_STRING && (int)arg4 >> 16 != 0) 262 319 astring = UnicodeToAsciiString((LPWSTR)arg4); … … 264 321 astring = (char *) arg4; 265 322 266 rc = O32_AppendMenu(arg1, arg2, arg3, astring); 323 if(menu == NULL || menu->getOS2Handle() == 0) 324 { 325 SetLastError(ERROR_INVALID_PARAMETER); 326 return 0; 327 } 328 rc = O32_AppendMenu(menu->getOS2Handle(), arg2, arg3, astring); 267 329 if(arg2 & MF_STRING && (int)arg4 >> 16 != 0) 268 330 FreeAsciiString(astring); … … 271 333 //****************************************************************************** 272 334 //****************************************************************************** 273 DWORD WIN32API CheckMenuItem( HMENU arg1, UINT arg2, UINT arg3) 274 { 275 #ifdef DEBUG 276 WriteLog("USER32: OS2CheckMenuItem\n"); 277 #endif 278 return O32_CheckMenuItem(arg1, arg2, arg3); 335 DWORD WIN32API CheckMenuItem( HMENU hMenu, UINT arg2, UINT arg3) 336 { 337 Win32MenuRes *menu = (Win32MenuRes *)hMenu; 338 339 dprintf(("USER32: OS2CheckMenuItem\n")); 340 if(menu == NULL || menu->getOS2Handle() == 0) 341 { 342 SetLastError(ERROR_INVALID_PARAMETER); 343 return 0; 344 } 345 return O32_CheckMenuItem(menu->getOS2Handle(), arg2, arg3); 279 346 } 280 347 //****************************************************************************** … … 282 349 HMENU WIN32API CreateMenu(void) 283 350 { 284 #ifdef DEBUG 285 HMENU rc; 286 287 rc = O32_CreateMenu(); 288 WriteLog("USER32: OS2CreateMenu returned %d\n", rc); 289 return(rc); 290 #else 291 return(O32_CreateMenu()); 292 #endif 351 Win32MenuRes *menu = 0; 352 HMENU hMenu; 353 354 hMenu = O32_CreateMenu(); 355 if(hMenu) { 356 menu = new Win32MenuRes(hMenu); 357 if(menu == NULL) { 358 return 0; 359 } 360 } 361 dprintf(("USER32: OS2CreateMenu returned %d\n", hMenu)); 362 return (HMENU)menu; 293 363 } 294 364 //****************************************************************************** … … 296 366 HMENU WIN32API CreatePopupMenu(void) 297 367 { 298 #ifdef DEBUG 299 WriteLog("USER32: OS2CreatePopupMenu\n"); 300 #endif 301 return O32_CreatePopupMenu(); 302 } 303 //****************************************************************************** 304 //****************************************************************************** 305 BOOL WIN32API EnableMenuItem( HMENU arg1, UINT arg2, UINT arg3) 306 { 307 #ifdef DEBUG 308 WriteLog("USER32: OS2EnableMenuItem\n"); 309 #endif 310 return O32_EnableMenuItem(arg1, arg2, arg3); 311 } 312 //****************************************************************************** 313 //****************************************************************************** 314 BOOL WIN32API ModifyMenuA( HMENU arg1, UINT arg2, UINT arg3, UINT arg4, LPCSTR arg5) 315 { 316 #ifdef DEBUG 317 WriteLog("USER32: OS2ModifyMenuA\n"); 318 #endif 319 return O32_ModifyMenu(arg1, arg2, arg3, arg4, arg5); 320 } 321 //****************************************************************************** 322 //****************************************************************************** 323 BOOL WIN32API ModifyMenuW( HMENU arg1, UINT arg2, UINT arg3, UINT arg4, LPCWSTR arg5) 324 { 325 BOOL rc; 326 char *astring = NULL; 327 328 #ifdef DEBUG 329 WriteLog("USER32: OS2ModifyMenuW %s\n", astring); 330 #endif 368 Win32MenuRes *menu = 0; 369 HMENU hMenu; 370 371 dprintf(("USER32: OS2CreatePopupMenu\n")); 372 hMenu = O32_CreatePopupMenu(); 373 if(hMenu) { 374 menu = new Win32MenuRes(hMenu); 375 if(menu == NULL) { 376 return 0; 377 } 378 } 379 return (HMENU)menu; 380 } 381 //****************************************************************************** 382 //****************************************************************************** 383 BOOL WIN32API EnableMenuItem( HMENU hMenu, UINT arg2, UINT arg3) 384 { 385 Win32MenuRes *menu = (Win32MenuRes *)hMenu; 386 387 dprintf(("USER32: OS2EnableMenuItem\n")); 388 if(menu == NULL || menu->getOS2Handle() == 0) 389 { 390 SetLastError(ERROR_INVALID_PARAMETER); 391 return 0; 392 } 393 return O32_EnableMenuItem(menu->getOS2Handle(), arg2, arg3); 394 } 395 //****************************************************************************** 396 //****************************************************************************** 397 BOOL WIN32API ModifyMenuA( HMENU hMenu, UINT arg2, UINT arg3, UINT arg4, LPCSTR arg5) 398 { 399 Win32MenuRes *menu = (Win32MenuRes *)hMenu; 400 401 dprintf(("USER32: OS2ModifyMenuA\n")); 402 if(menu == NULL || menu->getOS2Handle() == 0) 403 { 404 SetLastError(ERROR_INVALID_PARAMETER); 405 return 0; 406 } 407 return O32_ModifyMenu(menu->getOS2Handle(), arg2, arg3, arg4, arg5); 408 } 409 //****************************************************************************** 410 //****************************************************************************** 411 BOOL WIN32API ModifyMenuW( HMENU hMenu, UINT arg2, UINT arg3, UINT arg4, LPCWSTR arg5) 412 { 413 BOOL rc; 414 char *astring = NULL; 415 Win32MenuRes *menu = (Win32MenuRes *)hMenu; 416 417 dprintf(("USER32: OS2ModifyMenuW %s\n", astring)); 418 419 if(menu == NULL || menu->getOS2Handle() == 0) 420 { 421 SetLastError(ERROR_INVALID_PARAMETER); 422 return 0; 423 } 424 331 425 if(arg3 & MF_STRING && (int)arg5 >> 16 != 0) 332 426 astring = UnicodeToAsciiString((LPWSTR)arg5); … … 334 428 astring = (char *) arg5; 335 429 336 rc = O32_ModifyMenu( arg1, arg2, arg3, arg4, astring);430 rc = O32_ModifyMenu(menu->getOS2Handle(), arg2, arg3, arg4, astring); 337 431 if(arg3 & MF_STRING && (int)arg5 >> 16 != 0) 338 432 FreeAsciiString(astring); … … 341 435 //****************************************************************************** 342 436 //****************************************************************************** 343 BOOL WIN32API RemoveMenu( HMENU arg1, UINT arg2, UINT arg3) 344 { 345 #ifdef DEBUG 346 WriteLog("USER32: OS2RemoveMenu\n"); 347 #endif 348 return O32_RemoveMenu(arg1, arg2, arg3); 349 } 350 //****************************************************************************** 351 //****************************************************************************** 352 BOOL WIN32API DeleteMenu( HMENU arg1, UINT arg2, UINT arg3) 353 { 354 #ifdef DEBUG 355 WriteLog("USER32: OS2DeleteMenu\n"); 356 #endif 357 return O32_DeleteMenu(arg1, arg2, arg3); 358 } 359 //****************************************************************************** 360 //****************************************************************************** 361 BOOL WIN32API HiliteMenuItem( HWND arg1, HMENU arg2, UINT arg3, UINT arg4) 362 { 363 #ifdef DEBUG 364 WriteLog("USER32: OS2HiliteMenuItem\n"); 365 #endif 366 return O32_HiliteMenuItem(arg1, arg2, arg3, arg4); 367 } 368 //****************************************************************************** 369 //****************************************************************************** 370 BOOL WIN32API InsertMenuA( HMENU arg1, UINT arg2, UINT arg3, UINT arg4, LPCSTR arg5) 371 { 372 #ifdef DEBUG 373 WriteLog("USER32: OS2InsertMenuA\n"); 374 #endif 375 return O32_InsertMenu(arg1, arg2, arg3, arg4, arg5); 376 } 377 //****************************************************************************** 378 //****************************************************************************** 379 BOOL WIN32API InsertMenuW(HMENU arg1, UINT arg2, UINT arg3, UINT arg4, LPCWSTR arg5) 380 { 381 BOOL rc; 382 char *astring = NULL; 383 384 #ifdef DEBUG 385 WriteLog("USER32: OS2InsertMenuW %s\n", astring); 386 #endif 437 BOOL WIN32API RemoveMenu( HMENU hMenu, UINT arg2, UINT arg3) 438 { 439 Win32MenuRes *menu = (Win32MenuRes *)hMenu; 440 441 dprintf(("USER32: OS2RemoveMenu\n")); 442 if(menu == NULL || menu->getOS2Handle() == 0) 443 { 444 SetLastError(ERROR_INVALID_PARAMETER); 445 return 0; 446 } 447 448 return O32_RemoveMenu(menu->getOS2Handle(), arg2, arg3); 449 } 450 //****************************************************************************** 451 //****************************************************************************** 452 BOOL WIN32API DeleteMenu( HMENU hMenu, UINT arg2, UINT arg3) 453 { 454 Win32MenuRes *menu = (Win32MenuRes *)hMenu; 455 456 dprintf(("USER32: OS2DeleteMenu\n")); 457 if(menu == NULL || menu->getOS2Handle() == 0) 458 { 459 SetLastError(ERROR_INVALID_PARAMETER); 460 return 0; 461 } 462 463 return O32_DeleteMenu(menu->getOS2Handle(), arg2, arg3); 464 } 465 //****************************************************************************** 466 //****************************************************************************** 467 BOOL WIN32API HiliteMenuItem( HWND hMenu, HMENU arg2, UINT arg3, UINT arg4) 468 { 469 Win32MenuRes *menu = (Win32MenuRes *)hMenu; 470 471 dprintf(("USER32: OS2HiliteMenuItem\n")); 472 if(menu == NULL || menu->getOS2Handle() == 0) 473 { 474 SetLastError(ERROR_INVALID_PARAMETER); 475 return 0; 476 } 477 478 return O32_HiliteMenuItem(menu->getOS2Handle(), arg2, arg3, arg4); 479 } 480 //****************************************************************************** 481 //****************************************************************************** 482 BOOL WIN32API InsertMenuA( HMENU hMenu, UINT arg2, UINT arg3, UINT arg4, LPCSTR arg5) 483 { 484 Win32MenuRes *menu = (Win32MenuRes *)hMenu; 485 486 dprintf(("USER32: OS2InsertMenuA\n")); 487 if(menu == NULL || menu->getOS2Handle() == 0) 488 { 489 SetLastError(ERROR_INVALID_PARAMETER); 490 return 0; 491 } 492 493 return O32_InsertMenu(menu->getOS2Handle(), arg2, arg3, arg4, arg5); 494 } 495 //****************************************************************************** 496 //****************************************************************************** 497 BOOL WIN32API InsertMenuW(HMENU hMenu, UINT arg2, UINT arg3, UINT arg4, LPCWSTR arg5) 498 { 499 BOOL rc; 500 char *astring = NULL; 501 Win32MenuRes *menu = (Win32MenuRes *)hMenu; 502 503 dprintf(("USER32: OS2InsertMenuW %s\n", astring)); 504 if(menu == NULL || menu->getOS2Handle() == 0) 505 { 506 SetLastError(ERROR_INVALID_PARAMETER); 507 return 0; 508 } 387 509 if(arg3 & MF_STRING && (int)arg5 >> 16 != 0) 388 510 astring = UnicodeToAsciiString((LPWSTR)arg5); … … 390 512 astring = (char *) arg5; 391 513 392 rc = O32_InsertMenu( arg1, arg2, arg3, arg4, astring);514 rc = O32_InsertMenu(menu->getOS2Handle(), arg2, arg3, arg4, astring); 393 515 if(arg3 & MF_STRING && (int)arg5 >> 16 != 0) 394 516 FreeAsciiString(astring); … … 399 521 BOOL WIN32API SetMenuContextHelpId(HMENU hmenu, DWORD dwContextHelpId) 400 522 { 401 #ifdef DEBUG 402 WriteLog("USER32: OS2SetMenuContextHelpId, not implemented\n"); 403 #endif 523 dprintf(("USER32: OS2SetMenuContextHelpId, not implemented\n")); 404 524 return(TRUE); 405 525 } … … 408 528 DWORD WIN32API GetMenuContextHelpId(HMENU hmenu) 409 529 { 410 #ifdef DEBUG 411 WriteLog("USER32: OS2GetMenuContextHelpId, not implemented\n"); 412 #endif 530 dprintf(("USER32: OS2GetMenuContextHelpId, not implemented\n")); 413 531 return(0); 414 532 } … … 418 536 UINT idCheck, UINT uFlags) 419 537 { 420 #ifdef DEBUG 421 WriteLog("USER32: OS2CheckMenuRadioItem, not implemented\n"); 422 #endif 538 dprintf(("USER32: OS2CheckMenuRadioItem, not implemented\n")); 423 539 return(TRUE); 424 540 } 425 541 //****************************************************************************** 426 //Stolen from Wine (controls\menu.c)427 542 //****************************************************************************** 428 543 BOOL WIN32API ChangeMenuA(HMENU hMenu, UINT pos, LPCSTR data, UINT id, UINT flags) 429 544 { 430 #ifdef DEBUG 431 WriteLog("USER32: ChangeMenuA flags %X\n", flags); 432 #endif 545 dprintf(("USER32: ChangeMenuA flags %X\n", flags)); 546 433 547 if (flags & MF_APPEND) return AppendMenuA(hMenu, flags & ~MF_APPEND, 434 548 id, data ); … … 443 557 } 444 558 //****************************************************************************** 445 //Stolen from Wine (controls\menu.c)446 559 //****************************************************************************** 447 560 BOOL WIN32API ChangeMenuW(HMENU hMenu, UINT pos, LPCWSTR data, 448 561 UINT id, UINT flags ) 449 562 { 450 #ifdef DEBUG 451 WriteLog("USER32: ChangeMenuW flags %X\n", flags); 452 #endif 563 dprintf(("USER32: ChangeMenuW flags %X\n", flags)); 564 453 565 if (flags & MF_APPEND) return AppendMenuW(hMenu, flags & ~MF_APPEND, 454 566 id, data ); … … 467 579 const MENUITEMINFOA * lpMenuItemInfo) 468 580 { 469 #ifdef DEBUG 470 WriteLog("USER32: SetMenuItemInfoA, faked\n"); 471 #endif 581 dprintf(("USER32: SetMenuItemInfoA, faked\n")); 472 582 return(TRUE); 473 583 } … … 506 616 BOOL WIN32API SetMenuDefaultItem(HMENU hmenu, UINT uItem, UINT fByPos ) 507 617 { 508 #ifdef DEBUG 509 WriteLog("USER32: SetMenuDefaultItem, faked\n"); 510 #endif 618 dprintf(("USER32: SetMenuDefaultItem, faked\n")); 511 619 return(TRUE); 512 620 } … … 517 625 518 626 { 519 #ifdef DEBUG 520 WriteLog("USER32: GetMenuItemInfoA, faked\n"); 521 #endif 627 dprintf(("USER32: GetMenuItemInfoA, faked\n")); 522 628 return(TRUE); 523 629 }
Note:
See TracChangeset
for help on using the changeset viewer.