In Harry Potter: Order of the Phoenix, we see that Voldemort uses Harry's mind to trick him and after that torture him, so he is aware of the connection between them. But why didn't he use it after these events? Was Harry able to control his mind after those experiences?
Professor Dumbledore tells us explicitly that after the fight in the Ministry, the Dark Lord is deliberately blocking the mental connection between him and Harry. From the Half-Blood Prince chapter 4 (thanks to Jonah for locating this):
‘So tell me Harry,’ said Dumbledore. ‘Your scar … has it been hurting at all?’
Harry raised a hand unconsciously to his forehead and rubbed the lightning-shaped mark.
‘No,’ he said, ‘and I've been wondering about that. I thought it would be burning all the time now Voldemort's getting so powerful again.’
He glanced up at Dumbledore and saw that he was wearing a satisfied expression.
‘I, on the other hand, thought otherwise,’ said Dumbledore. ‘Lord Voldemort has finally realised the dangerous access to his thoughts and feelings you have been enjoying. It appears that he is now employing Occlumency against you.’
As for why the Dark Lord find the connection dangerous from this point, we find the explanation in the Order of the Phoenix. When the Dark Lord showed up in the Ministry of Magic, he tried to go the full way of mind control, and mentally possessed Harry for a short time. The Dark Lord could not hold the possession for long, because of Harry's strong emotions that he could not understand, and he had to let Harry free. Starting from that time, he was afraid of trying to mentally control Harry.
Let's recall first the possession itself, from Order of the Phoenix chapter 36.
Then he [the Dark Lord] was gone and the water fell with a crash back into its pool, slopping wildly over the sides, drenching the polished floor.
‘MASTER!’ screamed Bellatrix.
Sure it was over, sure Voldemort had decided to flee, Harry made to run out from behind his statue guard, but Dumbledore bellowed: ‘Stay where you are, Harry!’
For the first time, Dumbledore sounded frightened. Harry could not see why: the hall was quite empty but for themselves, the sobbing Bellatrix still trapped under the witch statue, and the baby phoenix Fawkes croaking feebly on the floor –
Then Harry's scar burst open and he knew he was dead: it was pain beyond imagining, pain past endurance –
He was gone from the hall, he was locked in the coils of a creature with red eyes, so tightly bound that Harry did not know where his body ended and the creature's began: they were fused together, bound by pain, and there was no escape –
And when the creature spoke, it used Harry's mouth, so that in his agony he felt his jaw move …
‘Kill me now, Dumbledore …’
Blinded and dying, every part of him screaming for release, Harry felt the creature use him again …
‘If death is nothing, Dumbledore, kill the boy …’
Let the pain stop, thought Harry … let him kill us … end it, Dumbledore … death is nothing compared to this …
And I'll see Sirius again …
And as Harry's heart filled with emotion, the creature's coils loosened, the pain was gone; Harry was lying face down on the floor, his glasses gone, shivering as through he lay upon ice, not wood …
Harry could expel the Dark Lord's mind control. Although Professor Dumbledore had not foreseen this, he did understand how that's happened after the fact, and explains it in chapter 37:
‘There is no shame in what you are feeling, Harry,’ said Dumbledore's voice. ‘On the contrary … the fact that you can feel pain like this is your greatest strength.’
then, skipping some of Harry's outbursts of rage, onto Dumbledore's explanations,
[…] though I was sure, at the time, that nothing could have been more dangerous than to open your mind even further to Voldemort while in my presence –’
and later in the same chapter:
‘There is a room in the Department of Mysteries,’ interrupted Dumbledore, ‘that is kept locked at all times. It contains a force that is at once more wonderful and more terrible than death, than human intelligence, than the forces of nature. It is also, perhaps, the most mysterious of the many subjects for study that reside there. It is the power held within that room that you possess in such quantities and which Voldemort has not at all. That power took you to save Sirius tonight. That power also saved you from possession by Voldemort, because he could not bear to reside in a body so full of the force he detests. In the end, it mattered not that you could not close your mind. In was your heart that saved you.’