WM_ACTIVATEAPP Has lParam of Zero (0)

Last reviewed: September 29, 1995
Article ID: Q135785
The information in this article applies to:
  • Microsoft Win32 Application Programming Interface (API) included with:

        - Microsoft Windows NT version 3.51
        - Microsoft Windows 95 version 4.0
        - Microsoft Win32s version 1.3
    

SUMMARY

Although the current Win32 documentation does not specifically indicate this, it is possible (and very likely) that the WM_ACTIVATEAPP message will be received by an application with the lParam equal to 0. You can in fact get 0 in lParam when activating and deactivating.

MORE INFORMATION

In previous versions of Windows, activation and deactivation used to be synchronous. This meant that you could never switch away from an application that was locked up because the application becoming active had to wait for a synchronous reply from the application being deactivated. The activating application would get stuck waiting for the deactivating application to process and return from the WM_ACTIVATEAPP, WM_ACTIVATE, and WM_NCACTIVATE messages.

In Windows 95 and Windows NT, Microsoft removed every place where these types of synchronous lockups can occur. When asynchronous activation occurs, the activating application becomes active immediately, and the messages to the deactivating application occur later. This means two things:

  • An application can be terminated in the middle of this process. If this happens, the thread ID/task handle that is passed in the lParam is invalid.
  • When the deactivated application gets notified, it is possible that the activated application is no longer active. A third application might have been activated in the interim.


Additional reference words: 4.00 1.30 Windows 95
KBCategory: kbui
KBSubcategory: UsrWndw


THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

Last reviewed: September 29, 1995
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.