Beispiel #1
0
// NB: Anyone using this function will have to manually seek back after
// calling ResIsMenuEx() (just as in ResIsDialogEx()).
// If you've already read the header, just call ResIsHeaderMenuEx().
bool ResIsMenuEx( WResFileID handle )
/***********************************/
{
    MenuHeader               header;
    bool                     ret;

    ret = ResReadMenuHeader( &header, handle );
    if( !ret ) {
        if( header.Version == MENUEX_VERSION_SIG ) {
            return( true );
        }
    }

    return( false );
}
Beispiel #2
0
bool DumpMenu( uint_32 offset, uint_32 length, WResFileID handle )
/****************************************************************/
{
    bool            error;
    WResFileOffset  prevpos;
    int             depth;  /* number of menu levels deep */
    MenuItem        *item;
    MenuHeader      head;

    length = length;
    prevpos = RCSEEK( handle, offset, SEEK_SET );
    error = (prevpos == -1);

    if( !error ) {
        error = ResReadMenuHeader( &head, handle );
    }
    if( !error ) {
        PrintHeader( &head );
    }

    depth = 1;
    while( depth > 0 && !error ) {
        item = ResNewMenuItem();
        error = ResReadMenuItem( item, handle );
        if( !error ) {
            if( item->IsPopup ) {
                depth++;
                PrintPopupItem( &(item->Item.Popup) );
                if (item->Item.Popup.ItemFlags & MENU_ENDMENU) {
                    depth--;
                }
            } else {
                PrintNormalItem( &(item->Item.Normal) );
                if (item->Item.Normal.ItemFlags & MENU_ENDMENU) {
                    depth--;
                }
            }
        }
        ResFreeMenuItem( item );
    }

    RCSEEK( handle, prevpos, SEEK_SET );

    return( error );
}
Beispiel #3
0
bool GUIResReadMenuHeader( MenuHeader *hdr )
{
    return( ResReadMenuHeader( hdr, hInstance.handle ) );
}