C# port of ResideMenu