In the Hungarian national team in 2015 he got a chance in the last two matches of the European Championship qualifying series, and then, after the successful qualification, the first right winger of the national team, Péter Gulyás, was injured shortly before the European Championship, Hornyák took his place in the framework of the 2016 European Men's Handball Championship. He represented Hungary at the 2018 European Men's Handball Championship, 2019 World Men's Handball Championship And 2020 European Men's Handball Championship.