INFO: Changing the Foreground Window in Windows 98 and Windows 2000

ID: Q227043


The information in this article applies to:
  • Microsoft Win32 Application Programming Interface (API), included with:
    • Microsoft Windows 2000
    • Microsoft Windows 98


SUMMARY

In Windows 98 and Windows 2000 your application can only take over the foreground under certain conditions. This article contains more specific information about these conditions. Generally speaking, if a user is actively working with another application you are not able to change the foreground window.


MORE INFORMATION

If you design an application for Windows 98 and/or Windows 2000 with the assumption that you can always take over the active window, your application may fail. If your application tries to take over the foreground under restricted conditions, your application flashes in the user's taskbar. Your application can take over the foreground under one of the following conditions:

  • Your application is the foreground window.


  • Your application activated the current foreground window.


  • Your application received the last input event.


  • There is currently no active foreground window.


  • The foreground application is being debugged.


  • The foreground lock timeout has expired.


The following condition is new for Windows 2000:
  • No menus are active.



REFERENCES

For additional information about the Windows API calls that you can use to control the foreground window, please see the Platform SDK Documentation and the following article in the Microsoft Knowledge Base:

Q97925 SetActiveWindow() and SetForegroundWindow() Clarification

Additional query words: SetForegroundWindow CompatGuideChange

Keywords : kbWinOS2000 kbSysSettings kbGrpUser kbWinOS98 kbCompatVers
Version : winnt:
Platform : winnt
Issue type : kbinfo


Last Reviewed: February 1, 2000
© 2000 Microsoft Corporation. All rights reserved. Terms of Use.