How do I stop Windows applications from stealing focus [closed] - terminal-services

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 9 years ago.
Improve this question
I know this isn't strictly a programming question but y'all must have experienced this.
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.
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?
#Jason - thanks for the reply, I'm running 64 bit Vista and 64 Bit Windows 2008. Any ideas how well it plays?
#Jason - good idea. Done.
#Ryan - thanks also for the answer. I tried Terminals 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.

I use Tweak UI to configure explorer so that apps don't steal focus; you can also configure how many times they flash in the taskbar as well.
EDIT: Once you are within Tweak UI, these options are found under General > Focus.
EDIT: #Kev, apparently there is a 64-bit version (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!

As an alternative, you could try using something like Terminals. 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).

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:
[HKEY_CURRENT_USER\ControlPanel\Desktop]
ForegroundLockTimeout = 0
However I found (Vista x64) that while focus on the original was maintained the offending window would still take the foreground - quite distracting.

Related

vb.net messageboxes not displaying

One of my duties at my job is to enhance and maintain a mature VB.Net windows application used internally by my company. We run 8 computers at the small company that each runs the app with no problems.
Recently we replaced one of the computers with a pretty standard notebook running Win 7 Professional with SP1 and for some reason, it won't display message boxes displayed using the normal MessageBox.Show("Message") method.
The vendor who sold us the computer says it must be the program, and I kind of sympathize with that view, but the fact is we have 8 other computers that all display their message boxes just fine.
Thought I'd post the issue here to see if anyone else has run into this and, if so, did they find a resolution?
I'm going to paint outside the lines a little bit and answer my own question with sort of a non-answer.
We battled that computer for about a week and a half and finally gave up and reinstalled the OS. Problem solved. Not really an answer because we still don't know what was going on or why reinstalling the OS fixed it.
Reinstalling was really an act of frustration/desperation as much as anything else. In the end we were just thankful the problem went away and we could move on. Figured I'd get this off of the unanswered questions list since I'm not really waiting for or expecting an answer at this point.

Disabling Start hardware button on windows 8 Phone

Am creating an application where i need to disable/override the hardware start button on a windows 8 tab.Can anyone write down a small piece of code and list the libraries that i have to refer?
You can't do that. It isn't something you can control from an app.
Also, even if you do manage to find some way to do it, you will almost certainly fail certification and your app won't be available in the store.
First welcome to stack overflow. People here are awesome at helping you in a pinch. That said, if you want someone to just lay down fresh code for you you're better off at http://www.freelancer.com
Also, windows phone OS is one of the most secure, consistent OS on the market. Manipulation of the start button destroys this consistency and is prohibited. I would suggest reviewing the MSDN documentation for certification requirements.
http://msdn.microsoft.com/en-us/library/windowsphone/develop/hh184843(v=vs.105).aspx

Getting rid of Metro interface [closed]

Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 10 years ago.
Improve this question
The company I work for primarily runs Windows XP machine. These machines are getting old and need to be replaced. I wanted to wait until Windows 8 was released since it is right around the corner. So, I have downloaded Windows 8 to test run and figure out the problems I am going to have with my users, programs, goup policy, and etc.
After installing I noticed pretty much everything has changed and I was a bit lost for awhile. In my opinion the Metro interface sucks and is definitely going to frustrate my users. If they are not comfortable using it they are going to be bugging me frequently. Not to mention it is going to cause numerous amendments to our group policy.
Overall I think it could be time consuming to support. So, I was wondering if there was a way to disable the Metro interface and show a traditional start button on the desktop. I would like to do this without a hack if at all possible.
There is not a way to disable Metro and replace the Start screen with a Start button. The Start screen will be the way you select programs from now on.
You can still run apps with the traditional desktop and taskbar. You can get to the desktop by clicking the Desktop tile on the Start screen, or using the Windows Key + D on the keyboard. There is no start button the new Win8 taskbar, and clicking the Windows Key on the keyboard will bring up the Start screen.
edit: Windows 8.1 has since added back the good-old "Start" button to the taskbar.
If your users are primarily going to use email and the a web browser for their applications then the Metro UI, while requiring a learning curve, may be a better experience for your users anyway. If your users could benefit from a more mobile, touch-driven experience then Metro again might be better. If you have a lot of power-users that require tools such as Visual Studio or Photoshop, then they are going to spend a lot of time in the traditional desktop as those apps don't make sense with a Metro UI.
Although I haven't been able to get around seeing the (Metro) start screen before I can get to the desktop, I would really recommend you have a look at ClassicShell. It is an OpenSource project that gives you a start menu and a start button. Again, after logging in you will still get to see the start screen and there appears to be no way to get rid of this as was possible in the beta version with the RPEnabled REG_DWORD value.
Furthermore you can get rid of the lock screen (before the login prompt) by means of a policy change. Start gpedit.msc elevated, then go to Computer Configuration -> Administrative Templates -> Control Panel -> Personalization and in the left pane double-click the setting Do not display the lock screen and set it to Enabled.
Short of the above I would go with Kate's advice of sticking with Windows 7. Too many desktop users have voiced their discontent with the usability (or rather its lack) in Windows 8, so there is a slim chance Microsoft will have to take action and re-enable some traditional elements. Of course I wouldn't get my hopes too high ...
you can try using Metrocontroller (google for it), it disables some or all metro features supposedly

Crash Reporter for Cocoa app [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 8 years ago.
Improve this question
I'm working on a Cocoa app targeting Leopard and above, and I'm thinking about adding a crash reporter to it (I'd like to think my app won't crash, but let's get real here). I have some mostly conceptual questions before I really get started.
1) How does this work conceptually, knowing when there's a crash and bringing up a reporter? Do I have a daemon running looking for a crash, or do I wait until my app is launched next time to report?
2) Can this be done in Cocoa? Or would I have to dip into Carbon or IOKit or somesuch?
3) Is this even a good idea? Mac OS X already has a built in crash reporter, but as a developer I don't get to see the crash logs. I don't think my app will be crashing often, frankly, but I just don't want to be naive but this sort of thing.
What are your thoughts and opinions regarding this?
I've had a lot of success with UKCrashReporter. The code is straighforward and easy to modify to match the L&F of your app.
PLCrashReporter looks interesting, though.
I'd stay away from Smart Crash Reporter just because many users (rightfully) don't appreciate your app injecting code into unexpected places and it strikes me as a fragile (perhaps dangerous to use in a released app) approach.
Others have answered the question well and pointed to some good example code.
Coding it yourself is fairly simple. The strategy generally is:
catch appropriate signals
launch a separate crash reporter app that lives inside your application's bundle
the crash reporter app then finds the latest crash log entry for your app and sends it to you via whatever method you desire (POST, email, etc)
I've also rolled my own: SFBCrashReporter
There is a small post on my blog about it.
I have seen a few apps use Smart Crash Reporter or perhaps some variant of it. When your application crashes, it will bring up the usual Apple crash dialog with an extra button which says "Send to both Apple and You"
I would shy away from Smart Crash Reporter for the single reason that it has a bad taste for a lot of users, and is a good way to get bad press for your app (deserved or not) PLCrashReporter or UKCrashReporter http://zathras.de/angelweb/sourcecode.htm they will give some ideas about what to do and how to do it in ways that don't inject into other code space.
Another option is Google's Breakpad. It has a Cocoa framework wrapper, and is compatible with Mozilla's Socorro server. It's used by Firefox, and the Cocoa framework is used in the current betas of Camino. The client-side integration is pretty easy, but I've never looked at what it takes to run an instance of the Socorro server.
I'm using ILCrashReporter and it works really nicely. The method is email based so it works well with Fogbugz.

How do you automate some routine actions for improving productivity? [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 2 years ago.
Improve this question
Every morning, after logging into your machine, you do a variety of routine stuffs.
The list can include stuffs like opening/checking your email clients, rss readers, launching visual studio, running some business apps, typing some replies, getting latest version from Source Control, compiling, connecting to a different domain etc. To a big extend, we can automate using scripting solutions like AutoIt, nightly jobs etc.
I would love to hear from you geeks out there for the list of stuffs you found doing repeatedly and how you solved it by automating it. Any cool tips?
I use Linux. I have a bunch of scripts that do anything I want. Typically I write a script whenever a "block" of work can be reused in the future. For example, simple refactorings, deployments, etc...
Over time I started to combine these blocks, hence getting ever more efficient.
Regarding the "load stuff at startup", under Linux that comes out of the box (you can "save your current session" when you log out or turn off the computer).
On windows, my suggestion is to use programs that can be automated via command line.
A favorite way is to leave the computer on at night or better, if it's a laptop, put it to sleep. Running a web browsing virtual machine in VMware or similar works also, you can set the VM start along with the machine and save its state on shutdown, so your web pages and email client stay open. This works for development also if you're doing scripting or something similar where the performance hit of the VM on large compiles won't negate the benefits.
SlickRun is very handy for this, just a few keys to navigate to anything common and a very small footprint. With input variables and file path recognition all part of it I can quick remote desktop to any machine, search anything, pull up whatever's needed.
On OS X, I have an Applescript that I run at the beginning of the day. It sets an away message on IM, hides or quits programs that would distract me, gets new mail, and so forth. I also plug in my USB backup disk, so when I'm going home, another script ejects it and quits some programs. When the script is done, so am I.
I invoke these scripts with key combos using Quicksilver.
If you don't have a Mac, by the way, Quicksilver and Applescript are probably the #1 and #2 reasons to switch. Between the two of them, you can tell your computer to do practically anything you want in very short order.
Use a good app launcher such as Quicksilver or Launchy to cut down on the time it takes to perform simple tasks. They're usually not scriptable, but they do let you do each step faster.
Writing shell scripts (Applescript, Bash, PowerShell, etc..) is a great way to automate most mundane tasks, assuming your apps are scriptable, as well as pick up a new language. As you venture further into this practice, you'll find yourself more and more annoyed at the apps you use that aren't scriptable, to the point where it starts to affect your choice of apps ;-)
Also, consider a cron job, Windows scheduled task, or similar OS X analog to automatically run certain tasks at certain times of day/week/month/year. You can use this for anything from the "workday morning" scripts mentioned previously, to reminding you of your wife's birthday and anniversary every year. There's some more info here for *NIX systems, or here for Windows boxes.
Happy automation!
I have a hard time wrapping my head around Applescript, but since Apple runs BASH scripts just fine, I just use those instead. I've got a development server on my mac, so I've got a script that I can run to create a new site directory, create a new virtual host in apache, add a new domain to my /etc/hosts file, etc.
It's especially cool to integrate Bash (or probably applescript, although I don't know how) with Growl. That way, you can put a nice message up on the screen, complete with a png icon. This is more useful for things that your scripts do during the day though.
I do most of my programming work on a development server at work, so in the evening I simply detach my screen session and re-attach it in the morning, so it takes just a few seconds until I'm exactly where I left the day before.
I have some macros defined in mutt to clean up my inbox (archive commit mails etc.), I have a script that mounts some directories on the development server on my notebook via sshfs (works without interaction using public keys), and after that all I have to do is start up a browser and get a coffee. :)