{"id":10,"date":"2014-07-16T13:37:11","date_gmt":"2014-07-16T12:37:11","guid":{"rendered":"http:\/\/banfi.co.uk\/blog\/?p=10"},"modified":"2014-07-17T22:19:29","modified_gmt":"2014-07-17T21:19:29","slug":"resizing-using-smartsize-with-axmsrdpclient-microsoft-terminal-services-control-type-library-com","status":"publish","type":"post","link":"https:\/\/banfi.co.uk\/blog\/2014\/07\/resizing-using-smartsize-with-axmsrdpclient-microsoft-terminal-services-control-type-library-com\/","title":{"rendered":"Resizing using smartsize with AxMsRdpClient (Microsoft Terminal Services Control Type Library COM)"},"content":{"rendered":"<p>I&#8217;ve been using the AxMsRdpClient from Microsoft Terminal Services Control Type Library COM (Imported from AxInterop.MSTSCLib) in a project through Visual Studio 2010 using VB.NET<\/p>\n<p> and found the only way to re-size the RDP window via smart size is after making a connection at full size to the RDP and then forcing the size down.<\/p>\n<p>This took me a good hour to work out since I can&#8217;t find any examples of this online.<\/p>\n<p>I&#8217;m sharing this as it may help someone else looking to work with AxMsRdpClient<\/p>\n<pre class=\"brush: vb; title: ; notranslate\" title=\"\"> \r\nPrivate Sub ConnectScreen1_Click(sender As System.Object, e As System.EventArgs) Handles ConnectScreen1.Click\r\n        ''Check if we are already connected to a RDP session - If so Return \r\n        If AxMsRdpClient8NotSafeForScripting1.Connected = 1 Then Return\r\n\r\n        ''specify the server the RDP is going to connect up\r\n        AxMsRdpClient8NotSafeForScripting1.Server = Settings.Default.RDP1\r\n        AxMsRdpClient8NotSafeForScripting1.Height = 768\r\n        AxMsRdpClient8NotSafeForScripting1.Width = 1024\r\n        AxMsRdpClient8NotSafeForScripting1.ConnectingText = &quot;Connecting...&quot;\r\n\r\n\r\n        ''enable smart sizing\r\n        AxMsRdpClient8NotSafeForScripting1.AdvancedSettings7.SmartSizing = True\r\n\r\n\r\n        ''connect up the RDP session\r\n        AxMsRdpClient8NotSafeForScripting1.Connect()\r\n        \r\n        ''now resize\r\n        AxMsRdpClient8NotSafeForScripting1.Height = 580\r\n        AxMsRdpClient8NotSafeForScripting1.Width = 760\r\n    End Sub\r\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>I&#8217;ve been using the AxMsRdpClient from Microsoft Terminal Services Control Type Library COM (Imported from AxInterop.MSTSCLib) in a project through Visual Studio 2010 using VB.NET and found the only way to re-size the RDP window via smart size is after making a connection at full size to the RDP and then forcing the size down. &hellip; <a href=\"https:\/\/banfi.co.uk\/blog\/2014\/07\/resizing-using-smartsize-with-axmsrdpclient-microsoft-terminal-services-control-type-library-com\/\" class=\"more-link\">Continue reading <span class=\"screen-reader-text\">Resizing using smartsize with AxMsRdpClient (Microsoft Terminal Services Control Type Library COM)<\/span> <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[4,6,5,3],"tags":[],"class_list":["post-10","post","type-post","status-publish","format-standard","hentry","category-net","category-axinterop-mstsclib","category-vb-net","category-visual-basic"],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/banfi.co.uk\/blog\/wp-json\/wp\/v2\/posts\/10","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/banfi.co.uk\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/banfi.co.uk\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/banfi.co.uk\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/banfi.co.uk\/blog\/wp-json\/wp\/v2\/comments?post=10"}],"version-history":[{"count":2,"href":"https:\/\/banfi.co.uk\/blog\/wp-json\/wp\/v2\/posts\/10\/revisions"}],"predecessor-version":[{"id":21,"href":"https:\/\/banfi.co.uk\/blog\/wp-json\/wp\/v2\/posts\/10\/revisions\/21"}],"wp:attachment":[{"href":"https:\/\/banfi.co.uk\/blog\/wp-json\/wp\/v2\/media?parent=10"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/banfi.co.uk\/blog\/wp-json\/wp\/v2\/categories?post=10"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/banfi.co.uk\/blog\/wp-json\/wp\/v2\/tags?post=10"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}