| 1 | /* $Id: winmenu.cpp,v 1.1 1999-07-20 07:42:36 sandervl Exp $ */
|
|---|
| 2 |
|
|---|
| 3 | /*
|
|---|
| 4 | * Win32 menu API functions for OS/2
|
|---|
| 5 | *
|
|---|
| 6 | * Copyright 1998 Sander van Leeuwen
|
|---|
| 7 | * Copyright 1998 Patrick Haller
|
|---|
| 8 | *
|
|---|
| 9 | * Parts ported from Wine: (ChangeMenuA/W)
|
|---|
| 10 | * Copyright 1993 Martin Ayotte
|
|---|
| 11 | * Copyright 1994 Alexandre Julliard
|
|---|
| 12 | * Copyright 1997 Morten Welinder
|
|---|
| 13 | *
|
|---|
| 14 | *
|
|---|
| 15 | * Project Odin Software License can be found in LICENSE.TXT
|
|---|
| 16 | *
|
|---|
| 17 | */
|
|---|
| 18 | #include <os2win.h>
|
|---|
| 19 | #include <stdlib.h>
|
|---|
| 20 | #include <win32wnd.h>
|
|---|
| 21 |
|
|---|
| 22 | //******************************************************************************
|
|---|
| 23 | //******************************************************************************
|
|---|
| 24 | HMENU WIN32API LoadMenuA(HINSTANCE hinst, LPCSTR lpszMenu)
|
|---|
| 25 | {
|
|---|
| 26 | HMENU rc;
|
|---|
| 27 |
|
|---|
| 28 | rc = (HMENU)FindResourceA(hinst, lpszMenu, RT_MENUA);
|
|---|
| 29 | dprintf(("LoadMenuA (%X) returned %d\n", hinst, rc));
|
|---|
| 30 | return(rc);
|
|---|
| 31 | }
|
|---|
| 32 | //******************************************************************************
|
|---|
| 33 | //******************************************************************************
|
|---|
| 34 | HMENU WIN32API LoadMenuW(HINSTANCE hinst, LPCWSTR lpszMenu)
|
|---|
| 35 | {
|
|---|
| 36 | HMENU rc;
|
|---|
| 37 |
|
|---|
| 38 | rc = (HMENU)FindResourceW(hinst, lpszMenu, RT_MENUW);
|
|---|
| 39 | dprintf(("LoadMenuW (%X) returned %d\n", hinst, rc));
|
|---|
| 40 | return(rc);
|
|---|
| 41 | }
|
|---|
| 42 | //******************************************************************************
|
|---|
| 43 | //******************************************************************************
|
|---|
| 44 | HMENU WIN32API LoadMenuIndirectA( const MENUITEMTEMPLATEHEADER * arg1)
|
|---|
| 45 | {
|
|---|
| 46 | char *astring = NULL;
|
|---|
| 47 | HMENU rc;
|
|---|
| 48 |
|
|---|
| 49 | dprintf(("OS2LoadMenuIndirectA\n"));
|
|---|
| 50 |
|
|---|
| 51 | rc = O32_LoadMenuIndirect(arg1);
|
|---|
| 52 | if(astring)
|
|---|
| 53 | FreeAsciiString(astring);
|
|---|
| 54 | return(rc);
|
|---|
| 55 | }
|
|---|
| 56 | //******************************************************************************
|
|---|
| 57 | //******************************************************************************
|
|---|
| 58 | BOOL WIN32API DestroyMenu(HMENU hmenu)
|
|---|
| 59 | {
|
|---|
| 60 | Win32Resource *winres;
|
|---|
| 61 |
|
|---|
| 62 | dprintf(("OS2DestroyMenu\n"));
|
|---|
| 63 | if(HIWORD(hmenu) == 0) {
|
|---|
| 64 | SetLastError(ERROR_INVALID_PARAMETER);
|
|---|
| 65 | return FALSE;
|
|---|
| 66 | }
|
|---|
| 67 | winres = (Win32Resource *)hmenu;
|
|---|
| 68 | delete winres;
|
|---|
| 69 | return TRUE;
|
|---|
| 70 | }
|
|---|
| 71 | //******************************************************************************
|
|---|
| 72 | //Won't work...
|
|---|
| 73 | //******************************************************************************
|
|---|
| 74 | HMENU WIN32API LoadMenuIndirectW(const MENUITEMTEMPLATEHEADER * arg1)
|
|---|
| 75 | {
|
|---|
| 76 | dprintf(("OS2LoadMenuIndirectW, improperly implemented!!\n"));
|
|---|
| 77 |
|
|---|
| 78 | return 0;
|
|---|
| 79 | // return O32_LoadMenuIndirect(arg1);
|
|---|
| 80 | }
|
|---|
| 81 | //******************************************************************************
|
|---|
| 82 | //******************************************************************************
|
|---|
| 83 | HMENU WIN32API GetMenu( HWND hwnd)
|
|---|
| 84 | {
|
|---|
| 85 | Win32Window *window;
|
|---|
| 86 |
|
|---|
| 87 | window = Win32Window::GetWindowFromHandle(hwnd);
|
|---|
| 88 | if(!window) {
|
|---|
| 89 | dprintf(("GetMenu, window %x not found", hwnd));
|
|---|
| 90 | return 0;
|
|---|
| 91 | }
|
|---|
| 92 | dprintf(("GetMenu %x", hwnd));
|
|---|
| 93 | return window->GetMenu();
|
|---|
| 94 | }
|
|---|
| 95 | //******************************************************************************
|
|---|
| 96 | //******************************************************************************
|
|---|
| 97 | BOOL WIN32API SetMenu( HWND hwnd, HMENU hmenu)
|
|---|
| 98 | {
|
|---|
| 99 | Win32Window *window;
|
|---|
| 100 |
|
|---|
| 101 | window = Win32Window::GetWindowFromHandle(hwnd);
|
|---|
| 102 | if(!window) {
|
|---|
| 103 | dprintf(("GetMenu, window %x not found", hwnd));
|
|---|
| 104 | return 0;
|
|---|
| 105 | }
|
|---|
| 106 | dprintf(("SetMenu %x %x\n", hwnd, hmenu));
|
|---|
| 107 | window->SetMenu(hmenu);
|
|---|
| 108 | return TRUE;
|
|---|
| 109 | }
|
|---|
| 110 | //******************************************************************************
|
|---|
| 111 | //******************************************************************************
|
|---|
| 112 | DWORD WIN32API GetMenuCheckMarkDimensions(void)
|
|---|
| 113 | {
|
|---|
| 114 | #ifdef DEBUG
|
|---|
| 115 | WriteLog("USER32: GetMenuCheckMarkDimensions\n");
|
|---|
| 116 | #endif
|
|---|
| 117 | return O32_GetMenuCheckMarkDimensions();
|
|---|
| 118 | }
|
|---|
| 119 | //******************************************************************************
|
|---|
| 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 | {
|
|---|
| 159 | char *astring = (char *)malloc(cchMax);
|
|---|
| 160 | int rc;
|
|---|
| 161 |
|
|---|
| 162 | dprintf(("USER32: OS2GetMenuStringW\n"));
|
|---|
| 163 | rc = O32_GetMenuString(hmenu, idItem, astring, cchMax, fuFlags);
|
|---|
| 164 | free(astring);
|
|---|
| 165 | if(rc) {
|
|---|
| 166 | dprintf(("USER32: OS2GetMenuStringW %s\n", astring));
|
|---|
| 167 | AsciiToUnicode(astring, lpsz);
|
|---|
| 168 | }
|
|---|
| 169 | else lpsz[0] = 0;
|
|---|
| 170 | return(rc);
|
|---|
| 171 | }
|
|---|
| 172 | //******************************************************************************
|
|---|
| 173 | //******************************************************************************
|
|---|
| 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 | {
|
|---|
| 221 | RECT *rect = NULL;
|
|---|
| 222 |
|
|---|
| 223 | #ifdef DEBUG
|
|---|
| 224 | WriteLog("USER32: TrackPopupMenuEx, not completely implemented\n");
|
|---|
| 225 | #endif
|
|---|
| 226 | if(lpPM->cbSize != 0)
|
|---|
| 227 | rect = &lpPM->rcExclude;
|
|---|
| 228 |
|
|---|
| 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);
|
|---|
| 240 |
|
|---|
| 241 | 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);
|
|---|
| 246 | 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 | {
|
|---|
| 255 | BOOL rc;
|
|---|
| 256 | char *astring = NULL;
|
|---|
| 257 |
|
|---|
| 258 | #ifdef DEBUG
|
|---|
| 259 | WriteLog("USER32: OS2AppendMenuW\n");
|
|---|
| 260 | #endif
|
|---|
| 261 | if(arg2 & MF_STRING && (int)arg4 >> 16 != 0)
|
|---|
| 262 | astring = UnicodeToAsciiString((LPWSTR)arg4);
|
|---|
| 263 | else
|
|---|
| 264 | astring = (char *) arg4;
|
|---|
| 265 |
|
|---|
| 266 | rc = O32_AppendMenu(arg1, arg2, arg3, astring);
|
|---|
| 267 | if(arg2 & MF_STRING && (int)arg4 >> 16 != 0)
|
|---|
| 268 | FreeAsciiString(astring);
|
|---|
| 269 | return(rc);
|
|---|
| 270 | }
|
|---|
| 271 | //******************************************************************************
|
|---|
| 272 | //******************************************************************************
|
|---|
| 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);
|
|---|
| 279 | }
|
|---|
| 280 | //******************************************************************************
|
|---|
| 281 | //******************************************************************************
|
|---|
| 282 | HMENU WIN32API CreateMenu(void)
|
|---|
| 283 | {
|
|---|
| 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
|
|---|
| 293 | }
|
|---|
| 294 | //******************************************************************************
|
|---|
| 295 | //******************************************************************************
|
|---|
| 296 | HMENU WIN32API CreatePopupMenu(void)
|
|---|
| 297 | {
|
|---|
| 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
|
|---|
| 331 | if(arg3 & MF_STRING && (int)arg5 >> 16 != 0)
|
|---|
| 332 | astring = UnicodeToAsciiString((LPWSTR)arg5);
|
|---|
| 333 | else
|
|---|
| 334 | astring = (char *) arg5;
|
|---|
| 335 |
|
|---|
| 336 | rc = O32_ModifyMenu(arg1, arg2, arg3, arg4, astring);
|
|---|
| 337 | if(arg3 & MF_STRING && (int)arg5 >> 16 != 0)
|
|---|
| 338 | FreeAsciiString(astring);
|
|---|
| 339 | return(rc);
|
|---|
| 340 | }
|
|---|
| 341 | //******************************************************************************
|
|---|
| 342 | //******************************************************************************
|
|---|
| 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
|
|---|
| 387 | if(arg3 & MF_STRING && (int)arg5 >> 16 != 0)
|
|---|
| 388 | astring = UnicodeToAsciiString((LPWSTR)arg5);
|
|---|
| 389 | else
|
|---|
| 390 | astring = (char *) arg5;
|
|---|
| 391 |
|
|---|
| 392 | rc = O32_InsertMenu(arg1, arg2, arg3, arg4, astring);
|
|---|
| 393 | if(arg3 & MF_STRING && (int)arg5 >> 16 != 0)
|
|---|
| 394 | FreeAsciiString(astring);
|
|---|
| 395 | return(rc);
|
|---|
| 396 | }
|
|---|
| 397 | //******************************************************************************
|
|---|
| 398 | //******************************************************************************
|
|---|
| 399 | BOOL WIN32API SetMenuContextHelpId(HMENU hmenu, DWORD dwContextHelpId)
|
|---|
| 400 | {
|
|---|
| 401 | #ifdef DEBUG
|
|---|
| 402 | WriteLog("USER32: OS2SetMenuContextHelpId, not implemented\n");
|
|---|
| 403 | #endif
|
|---|
| 404 | return(TRUE);
|
|---|
| 405 | }
|
|---|
| 406 | //******************************************************************************
|
|---|
| 407 | //******************************************************************************
|
|---|
| 408 | DWORD WIN32API GetMenuContextHelpId(HMENU hmenu)
|
|---|
| 409 | {
|
|---|
| 410 | #ifdef DEBUG
|
|---|
| 411 | WriteLog("USER32: OS2GetMenuContextHelpId, not implemented\n");
|
|---|
| 412 | #endif
|
|---|
| 413 | return(0);
|
|---|
| 414 | }
|
|---|
| 415 | //******************************************************************************
|
|---|
| 416 | //******************************************************************************
|
|---|
| 417 | BOOL WIN32API CheckMenuRadioItem(HMENU hmenu, UINT idFirst, UINT idLast,
|
|---|
| 418 | UINT idCheck, UINT uFlags)
|
|---|
| 419 | {
|
|---|
| 420 | #ifdef DEBUG
|
|---|
| 421 | WriteLog("USER32: OS2CheckMenuRadioItem, not implemented\n");
|
|---|
| 422 | #endif
|
|---|
| 423 | return(TRUE);
|
|---|
| 424 | }
|
|---|
| 425 | //******************************************************************************
|
|---|
| 426 | //Stolen from Wine (controls\menu.c)
|
|---|
| 427 | //******************************************************************************
|
|---|
| 428 | BOOL WIN32API ChangeMenuA(HMENU hMenu, UINT pos, LPCSTR data, UINT id, UINT flags)
|
|---|
| 429 | {
|
|---|
| 430 | #ifdef DEBUG
|
|---|
| 431 | WriteLog("USER32: ChangeMenuA flags %X\n", flags);
|
|---|
| 432 | #endif
|
|---|
| 433 | if (flags & MF_APPEND) return AppendMenuA(hMenu, flags & ~MF_APPEND,
|
|---|
| 434 | id, data );
|
|---|
| 435 | if (flags & MF_DELETE) return DeleteMenu(hMenu, pos, flags & ~MF_DELETE);
|
|---|
| 436 | if (flags & MF_CHANGE) return ModifyMenuA(hMenu, pos, flags & ~MF_CHANGE,
|
|---|
| 437 | id, data );
|
|---|
| 438 | if (flags & MF_REMOVE) return RemoveMenu(hMenu,
|
|---|
| 439 | flags & MF_BYPOSITION ? pos : id,
|
|---|
| 440 | flags & ~MF_REMOVE );
|
|---|
| 441 | /* Default: MF_INSERT */
|
|---|
| 442 | return InsertMenuA( hMenu, pos, flags, id, data );
|
|---|
| 443 | }
|
|---|
| 444 | //******************************************************************************
|
|---|
| 445 | //Stolen from Wine (controls\menu.c)
|
|---|
| 446 | //******************************************************************************
|
|---|
| 447 | BOOL WIN32API ChangeMenuW(HMENU hMenu, UINT pos, LPCWSTR data,
|
|---|
| 448 | UINT id, UINT flags )
|
|---|
| 449 | {
|
|---|
| 450 | #ifdef DEBUG
|
|---|
| 451 | WriteLog("USER32: ChangeMenuW flags %X\n", flags);
|
|---|
| 452 | #endif
|
|---|
| 453 | if (flags & MF_APPEND) return AppendMenuW(hMenu, flags & ~MF_APPEND,
|
|---|
| 454 | id, data );
|
|---|
| 455 | if (flags & MF_DELETE) return DeleteMenu(hMenu, pos, flags & ~MF_DELETE);
|
|---|
| 456 | if (flags & MF_CHANGE) return ModifyMenuW(hMenu, pos, flags & ~MF_CHANGE,
|
|---|
| 457 | id, data );
|
|---|
| 458 | if (flags & MF_REMOVE) return RemoveMenu(hMenu,
|
|---|
| 459 | flags & MF_BYPOSITION ? pos : id,
|
|---|
| 460 | flags & ~MF_REMOVE );
|
|---|
| 461 | /* Default: MF_INSERT */
|
|---|
| 462 | return InsertMenuW(hMenu, pos, flags, id, data);
|
|---|
| 463 | }
|
|---|
| 464 | //******************************************************************************
|
|---|
| 465 | //******************************************************************************
|
|---|
| 466 | BOOL WIN32API SetMenuItemInfoA(HMENU hmenu, UINT par1, BOOL par2,
|
|---|
| 467 | const MENUITEMINFOA * lpMenuItemInfo)
|
|---|
| 468 | {
|
|---|
| 469 | #ifdef DEBUG
|
|---|
| 470 | WriteLog("USER32: SetMenuItemInfoA, faked\n");
|
|---|
| 471 | #endif
|
|---|
| 472 | return(TRUE);
|
|---|
| 473 | }
|
|---|
| 474 | /*****************************************************************************
|
|---|
| 475 | * Name : BOOL WIN32API SetMenuItemInfoW
|
|---|
| 476 | * Purpose : The SetMenuItemInfo function changes information about a menu item.
|
|---|
| 477 | * Parameters:
|
|---|
| 478 | * Variables :
|
|---|
| 479 | * Result : If the function succeeds, the return value is TRUE.
|
|---|
| 480 | * If the function fails, the return value is FALSE. To get extended
|
|---|
| 481 | * error information, use the GetLastError function.
|
|---|
| 482 | * Remark :
|
|---|
| 483 | * Status : UNTESTED STUB
|
|---|
| 484 | *
|
|---|
| 485 | * Author : Patrick Haller [Thu, 1998/02/26 11:55]
|
|---|
| 486 | *****************************************************************************/
|
|---|
| 487 |
|
|---|
| 488 | BOOL WIN32API SetMenuItemInfoW(HMENU hMenu,
|
|---|
| 489 | UINT uItem,
|
|---|
| 490 | BOOL fByPosition,
|
|---|
| 491 | const MENUITEMINFOW *lpmmi)
|
|---|
| 492 | {
|
|---|
| 493 | dprintf(("USER32:SetMenuItemInfoW (%08xh,%08xh,%08xh,%08x) not implemented.\n",
|
|---|
| 494 | hMenu,
|
|---|
| 495 | uItem,
|
|---|
| 496 | fByPosition,
|
|---|
| 497 | lpmmi));
|
|---|
| 498 |
|
|---|
| 499 | return (SetMenuItemInfoA(hMenu,
|
|---|
| 500 | uItem,
|
|---|
| 501 | fByPosition,
|
|---|
| 502 | (const MENUITEMINFOA *)lpmmi));
|
|---|
| 503 | }
|
|---|
| 504 | //******************************************************************************
|
|---|
| 505 | //******************************************************************************
|
|---|
| 506 | BOOL WIN32API SetMenuDefaultItem(HMENU hmenu, UINT uItem, UINT fByPos )
|
|---|
| 507 | {
|
|---|
| 508 | #ifdef DEBUG
|
|---|
| 509 | WriteLog("USER32: SetMenuDefaultItem, faked\n");
|
|---|
| 510 | #endif
|
|---|
| 511 | return(TRUE);
|
|---|
| 512 | }
|
|---|
| 513 | //******************************************************************************
|
|---|
| 514 | //******************************************************************************
|
|---|
| 515 | BOOL WIN32API GetMenuItemInfoA(HMENU hmenu, UINT uItem, BOOL aBool,
|
|---|
| 516 | MENUITEMINFOA *lpMenuItemInfo )
|
|---|
| 517 |
|
|---|
| 518 | {
|
|---|
| 519 | #ifdef DEBUG
|
|---|
| 520 | WriteLog("USER32: GetMenuItemInfoA, faked\n");
|
|---|
| 521 | #endif
|
|---|
| 522 | return(TRUE);
|
|---|
| 523 | }
|
|---|
| 524 | /*****************************************************************************
|
|---|
| 525 | * Name : UINT WIN32API GetMenuDefaultItem
|
|---|
| 526 | * Purpose : The GetMenuDefaultItem function determines the default menu item
|
|---|
| 527 | * on the specified menu.
|
|---|
| 528 | * Parameters:
|
|---|
| 529 | * Variables :
|
|---|
| 530 | * Result : If the function succeeds, the return value is the identifier or
|
|---|
| 531 | * position of the menu item.
|
|---|
| 532 | * If the function fails, the return value is - 1.
|
|---|
| 533 | * Remark :
|
|---|
| 534 | * Status : UNTESTED STUB
|
|---|
| 535 | *
|
|---|
| 536 | * Author : Patrick Haller [Thu, 1998/02/26 11:55]
|
|---|
| 537 | *****************************************************************************/
|
|---|
| 538 |
|
|---|
| 539 | UINT WIN32API GetMenuDefaultItem(HMENU hMenu,
|
|---|
| 540 | UINT fByPos,
|
|---|
| 541 | UINT gmdiFlags)
|
|---|
| 542 | {
|
|---|
| 543 | dprintf(("USER32:GetMenuDefaultItem (%08xh,%u,%08x) not implemented.\n",
|
|---|
| 544 | hMenu,
|
|---|
| 545 | fByPos,
|
|---|
| 546 | gmdiFlags));
|
|---|
| 547 |
|
|---|
| 548 | return (-1);
|
|---|
| 549 | }
|
|---|
| 550 |
|
|---|
| 551 |
|
|---|
| 552 | /*****************************************************************************
|
|---|
| 553 | * Name : BOOL WIN32API GetMenuItemInfoW
|
|---|
| 554 | * Purpose : The GetMenuItemInfo function retrieves information about a menu item.
|
|---|
| 555 | * Parameters:
|
|---|
| 556 | * Variables :
|
|---|
| 557 | * Result : If the function succeeds, the return value is TRUE.
|
|---|
| 558 | * If the function fails, the return value is FALSE. To get extended
|
|---|
| 559 | * error information, use the GetLastError function.
|
|---|
| 560 | * Remark :
|
|---|
| 561 | * Status : UNTESTED STUB
|
|---|
| 562 | *
|
|---|
| 563 | * Author : Patrick Haller [Thu, 1998/02/26 11:55]
|
|---|
| 564 | *****************************************************************************/
|
|---|
| 565 |
|
|---|
| 566 | BOOL WIN32API GetMenuItemInfoW(HMENU hMenu,
|
|---|
| 567 | UINT uItem,
|
|---|
| 568 | BOOL fByPosition,
|
|---|
| 569 | MENUITEMINFOW * lpmii)
|
|---|
| 570 | {
|
|---|
| 571 | dprintf(("USER32:GetMenuItemInfoW (%08xh,%08xh,%u,%08x) not implemented.\n",
|
|---|
| 572 | hMenu,
|
|---|
| 573 | uItem,
|
|---|
| 574 | fByPosition,
|
|---|
| 575 | lpmii));
|
|---|
| 576 |
|
|---|
| 577 | return(GetMenuItemInfoA(hMenu,
|
|---|
| 578 | uItem,
|
|---|
| 579 | fByPosition,
|
|---|
| 580 | (MENUITEMINFOA *)lpmii));
|
|---|
| 581 | }
|
|---|
| 582 |
|
|---|
| 583 |
|
|---|
| 584 | /*****************************************************************************
|
|---|
| 585 | * Name : BOOL WIN32API GetMenuItemRect
|
|---|
| 586 | * Purpose : The GetMenuItemRect function retrieves the bounding rectangle
|
|---|
| 587 | * for the specified menu item.
|
|---|
| 588 | * Parameters:
|
|---|
| 589 | * Variables :
|
|---|
| 590 | * Result : If the function succeeds, the return value is TRUE.
|
|---|
| 591 | * If the function fails, the return value is FALSE. To get
|
|---|
| 592 | * extended error information, use the GetLastError function.
|
|---|
| 593 | * Remark :
|
|---|
| 594 | * Status : UNTESTED STUB
|
|---|
| 595 | *
|
|---|
| 596 | * Author : Patrick Haller [Thu, 1998/02/26 11:55]
|
|---|
| 597 | *****************************************************************************/
|
|---|
| 598 |
|
|---|
| 599 | BOOL WIN32API GetMenuItemRect(HWND hWnd,
|
|---|
| 600 | HMENU hMenu,
|
|---|
| 601 | UINT uItem,
|
|---|
| 602 | LPRECT lprcItem)
|
|---|
| 603 | {
|
|---|
| 604 | dprintf(("USER32:GetMenuItemRect (%08xh,%08xh,%08xh,%08x) not implemented.\n",
|
|---|
| 605 | hWnd,
|
|---|
| 606 | hMenu,
|
|---|
| 607 | uItem,
|
|---|
| 608 | lprcItem));
|
|---|
| 609 |
|
|---|
| 610 | return (FALSE);
|
|---|
| 611 | }
|
|---|
| 612 | /*****************************************************************************
|
|---|
| 613 | * Name : BOOL WIN32API InsertMenuItemA
|
|---|
| 614 | * Purpose : The InsertMenuItem function inserts a new menu item at the specified
|
|---|
| 615 | * position in a menu bar or pop-up menu.
|
|---|
| 616 | * Parameters:
|
|---|
| 617 | * Variables :
|
|---|
| 618 | * Result : If the function succeeds, the return value is TRUE.
|
|---|
| 619 | * If the function fails, the return value is FALSE. To get extended
|
|---|
| 620 | * error information, use the GetLastError function.
|
|---|
| 621 | * Remark :
|
|---|
| 622 | * Status : UNTESTED STUB
|
|---|
| 623 | *
|
|---|
| 624 | * Author : Patrick Haller [Thu, 1998/02/26 11:55]
|
|---|
| 625 | *****************************************************************************/
|
|---|
| 626 |
|
|---|
| 627 | BOOL WIN32API InsertMenuItemA(HMENU hMenu,
|
|---|
| 628 | UINT uItem,
|
|---|
| 629 | BOOL fByPosition,
|
|---|
| 630 | const MENUITEMINFOA* lpmii)
|
|---|
| 631 | {
|
|---|
| 632 | dprintf(("USER32:InsertMenuItemA (%08xh,%08xh,%u,%08x) not implemented.\n",
|
|---|
| 633 | hMenu,
|
|---|
| 634 | uItem,
|
|---|
| 635 | fByPosition,
|
|---|
| 636 | lpmii));
|
|---|
| 637 |
|
|---|
| 638 | return (FALSE);
|
|---|
| 639 | }
|
|---|
| 640 |
|
|---|
| 641 |
|
|---|
| 642 | /*****************************************************************************
|
|---|
| 643 | * Name : BOOL WIN32API InsertMenuItemW
|
|---|
| 644 | * Purpose : The InsertMenuItem function inserts a new menu item at the specified
|
|---|
| 645 | * position in a menu bar or pop-up menu.
|
|---|
| 646 | * Parameters:
|
|---|
| 647 | * Variables :
|
|---|
| 648 | * Result : If the function succeeds, the return value is TRUE.
|
|---|
| 649 | * If the function fails, the return value is FALSE. To get extended
|
|---|
| 650 | * error information, use the GetLastError function.
|
|---|
| 651 | * Remark :
|
|---|
| 652 | * Status : UNTESTED STUB
|
|---|
| 653 | *
|
|---|
| 654 | * Author : Patrick Haller [Thu, 1998/02/26 11:55]
|
|---|
| 655 | *****************************************************************************/
|
|---|
| 656 |
|
|---|
| 657 | BOOL WIN32API InsertMenuItemW(HMENU hMenu,
|
|---|
| 658 | UINT uItem,
|
|---|
| 659 | BOOL fByPosition,
|
|---|
| 660 | const MENUITEMINFOW * lpmii)
|
|---|
| 661 | {
|
|---|
| 662 | dprintf(("USER32:InsertMenuItemW (%08xh,%08xh,%u,%08x) not implemented.\n",
|
|---|
| 663 | hMenu,
|
|---|
| 664 | uItem,
|
|---|
| 665 | fByPosition,
|
|---|
| 666 | lpmii));
|
|---|
| 667 |
|
|---|
| 668 | return (FALSE);
|
|---|
| 669 | }
|
|---|
| 670 | /*****************************************************************************
|
|---|
| 671 | * Name : UINT WIN32API MenuItemFromPoint
|
|---|
| 672 | * Purpose : The MenuItemFromPoint function determines which menu item, if
|
|---|
| 673 | * any, is at the specified location.
|
|---|
| 674 | * Parameters:
|
|---|
| 675 | * Variables :
|
|---|
| 676 | * Result : Returns the zero-based position of the menu item at the specified
|
|---|
| 677 | * location or -1 if no menu item is at the specified location.
|
|---|
| 678 | * Remark :
|
|---|
| 679 | * Status : UNTESTED STUB
|
|---|
| 680 | *
|
|---|
| 681 | * Author : Patrick Haller [Thu, 1998/02/26 11:55]
|
|---|
| 682 | *****************************************************************************/
|
|---|
| 683 |
|
|---|
| 684 | UINT WIN32API MenuItemFromPoint(HWND hWnd,
|
|---|
| 685 | HMENU hMenu,
|
|---|
| 686 | POINT ptScreen)
|
|---|
| 687 | {
|
|---|
| 688 | dprintf(("USER32:MenuItemFromPoint (%08xh,%08xh,%u) not implemented.\n",
|
|---|
| 689 | hWnd,
|
|---|
| 690 | hMenu,
|
|---|
| 691 | ptScreen));
|
|---|
| 692 |
|
|---|
| 693 | return (-1);
|
|---|
| 694 | }
|
|---|