Get page slug in Admin menu

A fast and easy solution is to fetch the slug with $_GET['page']. Don’t forget to do some safety checks on the query after getting it.

Also, while i’m on it, to make the submenu items show up below your top level you need to change the first property of add_submenu_page to your top level slug.

add_action( 'admin_menu', 'MyPlugin_AddAdminMenus' );
function MyPlugin_AddAdminMenus()
{
    add_menu_page('General settings', 'MyPlugin', 'manage_options', 'my-plugin-General', 'render_generic_settings_page');

    add_submenu_page('my-plugin-General', 'General settings', 'General settings', 'manage_options', 'my-plugin-General');
    add_submenu_page('my-plugin-General', 'Lead capturing', 'Lead capturing', 'manage_options', 'my-plugin-SubPage1', 'render_generic_settings_page');
    add_submenu_page('my-plugin-General', 'Toggle features', 'Toggle features', 'manage_options', 'my-plugin-SubPage2', 'render_generic_settings_page');
}