Her Majesty’s praise was revealed on the opening day of this year’s General Assembly.
The letter was read aloud during the opening ceremony of the General Assembly by Rev Dr George Whyte, Chaplain-in-Ordinary and Principal Clerk of the Church of Scotland.
Her Majesty is being represented at the gathering by Lord Hodge as the Lord High Commissioner to the 2022 General Assembly.
Her letter stated: “The tragic loss of life and the scattering of refugees as a result of the war in Ukraine has caused much distress.
“It is encouraging to know that the Church of Scotland has been able to offer support through raising funds and providing a welcome to the stranger.
“We all hope that peace will be restored and we continue to uphold in prayer those who are putting into practice the love which is at the heart of the Gospel.
The Queen also praised the way churches and congregations came together during the pandemic - and offered prayers for the leadership of the Church “as they consider the future of parish life, and make decisions regarding buildings and congregations.”
Her Majesty added: “We ask for all those who carry these responsibilities the gifts of wisdom and compassion as they seek to respond to the promptings of the Holy Spirit while bearing in mind the concerns of church members.
“May your faith and courage be strengthened in your deliberations during the week ahead and through the times to come.”
This year's General Assembly will run until Thursday, May 26 as a hybrid event, with 400 commissioners attending in the Assembly Hall in Edinburgh and 200 others participating online.
A Fife minister, Rt Rev Dr Iain Greenshields, has been installed as the new Moderator of the General Assembly of the Church of Scotland.
The 68-year-old minister of St Margaret's Community Church in Dunfermline will chair proceedings from the Assembly Hall for five days and thereafter will act as the Church's ambassador at home and abroad for the next 12 months.