<p>I know this isn't strictly a programming question but y'all must have experienced this. </p>

<p>So...you have four or five RDP sessions open over the corp VPN, you're bashing away inside your favourite IDE, your VPN to the data centre bounces briefly then recovers, all your RDP sessions start re-establishing their connections and whilst doing so sequentially keep grabbing focus, one after the other. Pretty bloody annoying and downright rude.</p>

<p>Any idea how to prevent this behaviour and just make the RDP client flash it's taskbar button instead of totally grabbing focus away from whatever you were doing?</p>

<p>@<a href="https://stackoverflow.com/questions/22903/how-do-i-stop-the-windows-rdp-client-grabbing-focus-after-a-reconnect#22911">Jason</a> - thanks for the reply, I'm running 64 bit Vista and 64 Bit Windows 2008. Any ideas how well it plays?</p>

<p>@<a href="https://stackoverflow.com/questions/22903/how-do-i-stop-the-windows-rdp-client-grabbing-focus-after-a-reconnect#23049">Jason</a> - good idea. Done.</p>

<p>@<a href="https://stackoverflow.com/questions/22903/how-do-i-stop-the-windows-rdp-client-grabbing-focus-after-a-reconnect#23139">Ryan</a> - thanks also for the answer. I tried <a href="http://www.codeplex.com/Terminals" rel="nofollow noreferrer">Terminals</a> a few times before, but quite often I need to see two or three sessions side by side which the tabbing doesn't really facilitate too well, would've been nice to have a 'pop out in own window' button. I did once grab the source code to fix stuff like that, but never got the time. I also found it behaved oddly whenever there was a brief network disconnect (e.g. xDSL flapping) and it would reconnect to the wrong session (usually a new one) and leave the session I had opened in a disconnected state on the server. Otherwise Terminals would've been really cool, we have 200+ windows servers, and organising all those .rdp files can be a pain.</p>

[{'answer_id': 22911, 'author': 'Jason Bunting', 'author_id': 1790, 'author_profile': 'https://Stackoverflow.com/users/1790', 'pm_score': 4, 'selected': True, 'text': '<p>I use <a href="http://www.microsoft.com/windowsxp/Downloads/powertoys/Xppowertoys.mspx" rel="nofollow noreferrer">Tweak UI</a> to configure explorer so that apps don\'t steal focus; you can also configure how many times they flash in the taskbar as well.</p>\n\n<p>EDIT: Once you are within Tweak UI, these options are found under General > Focus.</p>\n\n<p>EDIT: @Kev, apparently there is <a href="http://www.softpedia.com/get/Tweak/System-Tweak/TweakUI-64-Bit-Edition.shtml" rel="nofollow noreferrer">a 64-bit version</a> (not MS approved, apparently, I would scan it for viruses of course) that works successfully with the 64-bit version of XP. From what I understand, you download that and then run it in XP compatibility mode as administrator and it will do the trick. Tweak UI is basically a nice wrapper around a collection of registry hacks, so I imagine you could find the hacks themselves if you didn\'t care for running Tweak UI in this manner. Hope that works for you!</p>\n'}, {'answer_id': 23139, 'author': 'Ryan Farley', 'author_id': 1627, 'author_profile': 'https://Stackoverflow.com/users/1627', 'pm_score': 2, 'selected': False, 'text': '<p>As an alternative, you could try using something like <a href="http://www.codeplex.com/Terminals" rel="nofollow noreferrer">Terminals</a>. It allows you to have multiple remote desktop windows open at once all as tabs in the same window. Quite cool. Also, it is open source so you can change its behavior if needed (although I don\'t believe it steals focus like a normal RDP session does).  </p>\n\n<p><img src="https://i.stack.imgur.com/aLRB4.jpg" alt="Terminals Screenshot"></p>\n'}, {'answer_id': 315428, 'author': 'waldo', 'author_id': 4870, 'author_profile': 'https://Stackoverflow.com/users/4870', 'pm_score': 2, 'selected': False, 'text': "<p>Since I don't think there's an approved version of TweakUI other than for XP. Apparently making this change in the registry has a similar impact for Vista:</p>\n\n<blockquote>\n  <p>[HKEY_CURRENT_USER\\ControlPanel\\Desktop]</p>\n  \n  <p>ForegroundLockTimeout = 0</p>\n</blockquote>\n\n<p>However I found <em>(Vista x64)</em> that while focus on the original was maintained the offending window would still take the foreground - quite distracting.</p>\n"}]
['https://Stackoverflow.com/questions/22903', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/419/']