+static OSStatus helpMenuStatus = noErr ;
+static MenuRef helpMenuHandle = NULL ;
+static MenuItemIndex firstCustomItemIndex = 0 ;
+
+OSStatus UMAGetHelpMenu(
+ MenuRef * outHelpMenu,
+ MenuItemIndex * outFirstCustomItemIndex)
+{
+#if TARGET_CARBON
+ return HMGetHelpMenu( outHelpMenu , outFirstCustomItemIndex ) ;
+#else
+ if ( helpMenuHandle == NULL )
+ {
+ helpMenuStatus = HMGetHelpMenuHandle( &helpMenuHandle ) ;
+ if ( helpMenuStatus == noErr )
+ {
+ firstCustomItemIndex = CountMenuItems( helpMenuHandle ) + 1 ;
+ }
+ }
+ if ( outFirstCustomItemIndex )
+ {
+ *outFirstCustomItemIndex = firstCustomItemIndex ;
+ }
+ *outHelpMenu = helpMenuHandle ;
+ return helpMenuStatus ;
+#endif
+}