Ignore:
Timestamp:
Nov 14, 1999, 1:00:01 PM (26 years ago)
Author:
sandervl
Message:

WindowFromPoint fix + GetMenuItemRect implemented

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/user32/oslibmenu.cpp

    r1513 r1732  
    1 /* $Id: oslibmenu.cpp,v 1.4 1999-10-30 09:19:44 sandervl Exp $ */
     1/* $Id: oslibmenu.cpp,v 1.5 1999-11-14 12:00:01 sandervl Exp $ */
    22/*
    33 * Window Menu wrapper functions for OS/2
     
    7979}
    8080//******************************************************************************
     81//Returns menu item rectange in screen coordinates
     82//******************************************************************************
     83BOOL OSLibGetMenuItemRect(HWND hMenu, int index, LPRECT pRect)
     84{
     85  RECTL rectl;
     86  BOOL  rc;
     87  ULONG id;
     88
     89   //First get id from menu index
     90   id = (ULONG)WinSendMsg(hMenu, MM_ITEMIDFROMPOSITION, MPARAM(index), 0);
     91
     92   rc = (BOOL)WinSendMsg(hMenu, MM_QUERYITEMRECT, MPARAM(id), (MPARAM)&rectl);
     93   if(rc == FALSE) {
     94        dprintf(("OSLibGetMenuItemRect %x %d %d failed!", hMenu, index, id));
     95        return FALSE;
     96   }
     97   WinMapWindowPoints(hMenu, HWND_DESKTOP, (PPOINTL)&rectl, 2);
     98   pRect->left  = rectl.xLeft;
     99   pRect->right = rectl.xRight;
     100   pRect->top   = OSLibQueryScreenHeight() - rectl.yTop;
     101   pRect->bottom= OSLibQueryScreenHeight() - rectl.yBottom;
     102   return TRUE;
     103}
     104//******************************************************************************
    81105//******************************************************************************
    82106
Note: See TracChangeset for help on using the changeset viewer.