How can I detect if the current viewed page is administrative? How do I detect whether the user the page is currently viewing, is considered administrative?  An administrative page can be recognized when the administration theme is activated.

In my case I would like to print a notice if this condition is met, and if the user can 'administer modules'.
This can be done with path_is_admin(current_path()).

For example, the following hook implementation can be used.

function mymodule_init() {
  if (user_access('administer modules') &amp;&amp; path_is_admin(current_path())) {
      drupal_set_message(t('Message'));
  }
}