Irishman Hughes won the first five races on Pivotal Movement (13-8), East Texas Red (5-2), Embankment (7-1), Magic Secret (4-1) and Links Drive Lady (5-2).
His winning run at the course, situated by the banks of the River Thames, was halted when he finished third on Ever Fortune (2-1) in the sixth race, but he took victory in the last two on Duke of Clarence (7-4) and Mama Quilla (15-8).
The combined odds of the seven winners was 10,168-1 and the bookmakers said the winning run cost them millions of pounds with one punter alone said to have won £159,000.
Hughes punched the air as he passed the winning post on Mama Quilla, before making a flying dismount on his return to the paddock.
"I feel over the moon," Hughes said. "I always said I might do it one day at Windsor - my lucky track. Without Richard Hannon I wouldn't be doing any of it."
Three of Hughes's seven winners were for trainer and father-in-law Hannon.
He is only the second ever rider to claim seven victories at a UK meeting.
Italian jockey Frankie Dettori memorably won all seven races at Ascot in 1996, costing bookmakers millions of pounds in payouts to gamblers.