Since admin menu itself knows how to display where you are at, it is reasonable to look at code responsible for that logic.
Menu output is generated by _wp_menu_output()
in menu-header.php
. It makes use of number of global variables, namely:
global $self, $parent_file, $submenu_file, $plugin_page, $pagenow, $typenow;
The actual logic is quite extensive and naturally differs for native and plugin pages. Look for assignments of 'current'
to CSS classes and around.