GetMenu function retrieves a handle to the menu assigned to the specified window. This is a simple wrapper around Win32 function.
$menu_id = GetMenu( $hwnd );
Handle of a window having a menu
Menu handle