To fully answer your question would take days to typing. So i'll start us with Sauraseni instead of going too far back. The most important players in changing the Indian Sub-Continent, even more than the British, were the Mughals. They were the last remnants of the great Khanates left behind by Genghis Khan. They occupied central asia and spoke Chatangi, the central asian language. This group of Khans realized that their resources were depleting and they needed to expand. The Ottomans and Persians were starting to be threats and they needed a new stronghold, so they decided to once again try what their ancestors had failed at. They marched through Khyber pass. In 1526 Babur, the Mughal Shah, managed to cross the Khyber pass, overwhelming the small rajput clans and pashtuns who protected it and made their way to Panipat starting their Mughal Empire.
So fast forward a couple of years, Babur has Agra as his capital and the commonly spoken language there is Sauraseni, a Sanskrit language spoke in the Northern Provinces of India. The grammar of Modern Hindi is take from this language as well as the script style. The Mughals spoke their language of Chattangi, but they knew that it would not stick so they adopted persian since it was a commonly known language in the area. It was also used in much of the art forms of that era.
As the Mughal era progressed the Persian spoken in the courts started to warp further and further to better suit the needs of the Indian people. The grammar style changed to sanskrit grammar, the scripts was also getting more sanskritized, and words started to cross over. A new language was developing commonly called Dehlavi, or Khari Boli.
This is the language that was also known as Hindi-Urdu and where split occurs. Wanting to differentiate themselves from the common Hindus who spoke Dehlavi, the Mughal court adopted Urdu as a prestige language using the Persian script. Dehlavi was free to continue using the Sanskrit script. During the waning periods of the Mughals, and rise of the British, the Brits seeking to gain Hindu favor in their war against the Mughals adopted Hindustani, another name for the Sanskrit Dehlavi, as the language in Company controlled provinces. As the empire grew so did the spread of Hindustani. Hence why India's widely spoken official language is Hindi. On the other hand the Muslim League went with Urdu to give homage to their past rule of the sub-continent and have a language in the Persian Script.
Tracing the Boundaries Between Hindi and Urdu: Lost and Added in Translation Between 20th Century by Christine Everaert is available for free somewhere on the internet. I suggest reading it if you have more questions, or just feel free to ask.
Not an answer but Hindi is not India's national language - http://en.wikipedia.org/wiki/National_language#India . Hindi is an official language, as is English and many others - http://en.wikipedia.org/wiki/Languages_with_official_status_in_India#State_level