1. Menu help

I have been working on adding menus to my win32 library and I have some 
questions that I need help with.

1) How can the position of a dropdown/popup menu within a parent menu be 
determined if all we have is a menu handle (plus the parent's handle 
etc..)?
	
2) Where can I d/l a  Win32 API documentation file more recent than 14th 
March 1997?


TIA

Mike

new topic     » topic index » view message » categorize

2. Re: Menu help

----- Original Message -----
From: "Mike" <vulcan at win.co.nz>
To: "EUforum" <EUforum at topica.com>
Subject: Menu help


> I have been working on adding menus to my win32 library and I have some
> questions that I need help with.
>
> 1) How can the position of a dropdown/popup menu within a parent menu be
> determined if all we have is a menu handle (plus the parent's handle
> etc..)?

Here is a routine that works. Due to your request, I've added it to the
win32lib.

-----------------
global function getMenuPosn(integer pID)
    -- Given an ID of a menu item, this returns is zero-based
    -- position within its parent menu.

    -- Known bug: Doesn't work on submenus yet.

    atom lWnd
    atom lCount
    atom lPosn
    atom lID

    lPosn = -1

    lWnd = getHandle(pID)
    lCount = w32Func(xGetMenuItemCount, {lWnd})
    if lCount > 0 then
        for i = 0 to lCount - 1 do
            lID = w32Func(xGetMenuItemID,{lWnd, i})
            if lID = pID then
                return i
            end if
        end for
    end if

    return lPosn

end function


> 2) Where can I d/l a  Win32 API documentation file more recent than 14th
> March 1997?

You can get this from the MSDN site but be prepared for a HUGE download.

----------------
cheers,
Derek Parnell

new topic     » goto parent     » topic index » view message » categorize

Search



Quick Links

User menu

Not signed in.

Misc Menu