At 5:59 PM -0500 2001/12/19, Axel Rose wrote:
>Your menu id checker doesn't give me the needed results though:

Sorry, try this...

#!perl5

use Mac::Memory;
use Mac::Resources;
use Mac::MoreFiles;
use Mac::Menus;

  $programPath = $Application{McPL};
  &read_resource;

exit;

sub read_resource {
    my $refnum = FSpOpenResFile($programPath, 1);
    for $resID (129..140) {
        $handle = Get1Resource('MENU',$resID);
        if( $handle) {
            $info = $handle->get;
            $len = unpack("\@14 C1",$info);
            $menuName = unpack("\@15 a$len",$info);
            if($menuName) {
                $menuHandle = GetMenuHandle($resID);
                $data  = $menuHandle->menuData;
                print "$resID = $menuName ($data)\n";
            }
        }
    }
    CloseResFile $refnum;
}

__END__


On my Mac this yields...

129 = File (File)
130 = Edit (Edit)
131 = Window (Window)
132 = Script (Script)
133 = Editor (Alpha)

----

ID 128 is the Apple menu. If the $resID loop had started with 128 then id
128 would have yielded ascii 20 which is the little apple symbol in the
Chicago font.

David Seay
http://www.mastercall.com/g-s/



Reply via email to