Page title set from the title callback doesn't change
You're missing the title arguments key in hook_menu

e.g:

/**
 * Implements hook_menu
 */
function custom_download_menu() {
  $items = array();

  $items['download-code/%'] = array(
    'title callback' =&gt; 'custom_download_page_title',
    'title arguments' =&gt; array(1), 
    'page callback' =&gt; 'custom_download_view',
    'access callback' =&gt; TRUE,
  );

  return $items;
}

/**
 * hook_menu title callback
 */
function custom_download_page_title($file) {
  if (isset($file) {
    $title = "Downloading " . $file . " Code";
  }
  else {
    $title = "Download Code";
  }
  return $title;
}


If the download link is


  download-code/my-file.txt


The page title should then reflect that.