Ask the Expert

SetForgroundWindow API function

SetForgroundWindow API function does not work with Microsoft Windows 2000. Is there any other suitable API that does the same task?
Actually, SetForgroundWindow works exactly as it is supposed to. What is different is that Microsoft fixed the incredibly annoying problem that used to plague NT4 and Win9x: applications stealing focus from the user is using. There are ways to fiddle around it, but Microsoft's taken an even tougher stance with Windows XP and the techniques that work on Windows 2000 will not work on Windows XP. You can still call SetForgroundWindow, but the window will flash three times in the taskbar to indicate your application needs attention.

This was first published in July 2001

Join the conversationComment

Share
Comments

    Results

    Contribute to the conversation

    All fields are required. Comments will appear at the bottom of the article.