Prime Minister David Cameron sent Rebekah Brooks a "keep your head up" message when she quit News International, she has said.
Mrs Brooks told the Leveson Inquiry she got "indirect messages" from a number of Tories but ex-PM Gordon Brown was "probably getting the bunting out".
She quit as chief executive in July 2011 after the phone-hacking scandal led to the News of the World's closure.
Mrs Brooks denied reports she and Mr Cameron texted 12 times a day.
Asked by counsel to the inquiry, Robert Jay QC, if Mr Cameron had sent her a "keep your head up" message when she resigned she said it had been "something along those lines".
Mrs Brooks - who was News of the World editor when voicemails of murdered schoolgirl Milly Dowler's mobile phone were allegedly intercepted - said she received "indirect" rather than direct text messages from a number of politicians at that time.
They included messages from "Number 10, Number 11, the Home Office and the Foreign Office" and former Prime Minister Tony Blair.
She said the suggestion she and Mr Cameron texted 12 times a day were "thankfully" untrue and was more likely be about once a week.
She added that in the run-up to the 2010 general election, she had texted Mr Cameron about his performance after a TV debate with Gordon Brown and Nick Clegg, adding: "Like everyone, I felt the first one wasn't very good."
Pushed by Mr Jay, she said Mr Cameron would generally sign texts with "DC".
" undefined , lots of love, until I told him it meant 'laugh out loud'," Mrs Brooks added.
Asked later whether the prime minister had backed News Corp's bid for control of BSkyB, Mrs Brooks said he was "not particularly" supportive and added: "Mr Cameron always made it very clear that it was a quasi-judicial decision."
Mr Jay asked her if the Chancellor, George Osborne, supported the bid.
She said he was "interested in our arguments" and she added: "One of the points we were trying to make is that if that level of investment was coming into the UK it would create a lot of jobs in call centres, for example. But he said it was not his decision."
Mrs Brooks refused to name the source of a story from 2006 about Mr Brown's son Fraser being diagnosed with cystic fibrosis.
Five years later Mr Brown criticised the way the story had been handled, but Mrs Brooks said she had the express permission of the Browns to run the story.
She denied when asked by Mr Jay if she got the story through "subterfuge".
Mrs Brooks also rejected a suggestion that they hacked into any medical records or were given information from an NHS worker.
She said Mrs Brown was her "friend" and she felt "very sad" for them but she added: "They felt that, as prime minister, there were an awful lot of parents coping with cystic fibrosis and one of the overwhelming memories is that when the story was published they wanted us to highlight the positives."
Later Mr Brown and his wife issued a statement to say claims they gave permission for the Sun to publish a story about their son's medical condition were "untrue".
"At no stage did anyone from the Sun ask permission to publish this story. Given that we were presented with a fait accompli our whole objective was to minimise the damage. We handled it as best we could at the time."
On her relationship with News Corp executive chairman Rupert Murdoch, Mrs Brooks said "in the main, on the big issues we had similar views" but they disagreed over issues including the environment, immigration and font size.
She said she preferred more celebrities in the paper while he wanted more serious issues, "although he liked X Factor".
She said she spoke to Mr Murdoch "very frequently" but denied reports they went swimming together when he was in London.
Mrs Brooks denied she became the "go-between" in an "increasingly fraught" relationship between Rupert Murdoch and his son James which developed after the phone-hacking scandal.
The inquiry heard she became close friends with Mr Blair and his wife Cherie, as well as his spin doctor Alastair Campbell and his partner.
But she said she did not exchange texts or emails with Mr Blair because "he did not have a mobile phone or in fact, I think, use a computer when he was prime minister".
Mrs Brooks said, according to her former personal assistant's "very incomplete" diary, she met or dined with Mr Blair at least 30 times between 1998 and 2007.
After Mr Brown took over as prime minister in 2007, she met or dined with him at least five times, including once at his home.
She recorded one lunch and four dinners with Mr Cameron in 2010, including a Christmas dinner party at her Oxfordshire home on 23 December.
The phone-hacking scandal at the News of the World Sunday tabloid led to its closure and the establishment of the Leveson Inquiry, an MPs' inquiry and the launch of three police investigations.
Mrs Brooks has denied any knowledge of phone-hacking on her watch.
She was arrested on 17 July 2011 over phone-hacking and corruption allegations.
She was released on bail and re-arrested on 13 March 2012, on suspicion of conspiracy to pervert the course of justice, and bailed again to appear at a London police station in May 2012.
Inquiry lawyers have not been allowed to ask Mrs Brooks any questions that could prejudice the police investigation into phone hacking or any future trials.
Meanwhile, the Leveson Inquiry witness list for next week has been published and includes appearances from Mr Blair's former spin doctor, Alistair Campbell, on Monday.
Sky News political editor Adam Boulton and former Foreign Secretary Jack Straw are also among those who will appear.