To all the Windows programmers

UFO

Active member
USE THE FUNCTION SetFocus WITH CAUTION!!!!!!!!!

I had it with when I'm writing in a window and suddenly some other pops up and messes things up.
 
That should be SetforegroundWindow(), SetFocus() only applies to your own windows, you can't make the focus go to a window that your process isn't related to.

And in XP/2K there are user settings for what you want the default behaviour of SetforegroundWindow() to be.

Worst example of a bad application stealing the focus is Media Player 6, every time to switches to a new song it puts itself in the foreground.
 
Back
Top