News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

Menu Template - how to create ?

Started by Rainstorm, January 17, 2008, 10:44:54 AM

Previous topic - Next topic

Rainstorm

Hi

in the Microsoft SDK they write
QuoteFor information about creating a menu-template resource, see the documentation included with your development tools.
Does this mean the SDK has no documentation on this ? -  & there is no way of doing this with the SDK ? (the template itself)

I found an example of a menu in the examples folder in the masm installation but would appreciate if someone would point me to some documentation on creating these templates/resources.

Thanks for the assistance..

Rainstorm
-


zooba

Quote from: Rainstorm on January 17, 2008, 10:44:54 AM
in the Microsoft SDK they write
QuoteFor information about creating a menu-template resource, see the documentation included with your development tools.
Does this mean the SDK has no documentation on this ? -  & there is no way of doing this with the SDK ? (the template itself)

They are probably referring to a menu editor or resource editor rather than typing the entire thing by hand. Assembly language programmers aren't really the target of most of Microsoft's documentation - Visual C++ is.

Cheers,

Zooba :U

Rainstorm

zooba, ramguru..guys thanks for clearing that up... : )

yah am doing it by hand

Vortex

#4
Hi Rainstorm,

Here is a method to create and use menu templates.

- Create a resource script with the menu :

Menurc.rc :

#define IDM_ABOUT 11
#define IDM_EXIT 12

10000 MENU
BEGIN
    POPUP "&File"
    BEGIN
        MENUITEM "&About",IDM_ABOUT
    MENUITEM "&Exit",IDM_EXIT
    END
END


- Compile it using rc.exe and extract the binary menu template data with res2obj :

\masm32\bin\rc Menurc.rc
res2obj Menurc.res Menurc.obj _pMenuTemplate


Menurc.obj is a MS COFF object module including the binary resource data. _pMenuTemplate is a label identifying the menu template. Additionaly, the tool has the capacity to create plain binary ( .bin ) files.

- Load the menu and assign it to the application window :

    .IF uMsg==WM_INITDIALOG
        .
        .
        invoke  LoadMenuIndirect,ADDR pMenuTemplate
        mov     hMenuTemplate,eax
        invoke  SetMenu,hWnd,eax
        .
        .

[attachment deleted by admin]

Rainstorm

hi vortex,

that was helpful.. thankyou for the example.