Run-Time Dynamic Events

A new feature of Windows 95 is the ability of device drivers and applications to query and notify each other about changes in the state of the system, particularly changes in the system hardware. Although Windows applications have been able to broadcast messages to other Windows applications in all releases of Windows subsequent to 3.0, it was not possible for VxDs to do so, nor was it possible to query other system components before taking action. Applications can use Windows 95's new capabilities to take appropriate action for such events as the addition or removal of a device; for example, an application that is using a floppy disk can use these API elements to receive a notification if the floppy disk is removed.

The SHELL_BroadcastSystemMessage function broadcasts a message to one or more of the following classes of system components:

The counterpart to the SHELL_BroadcastSystemMessage function that is used by Windows applications is the BroadcastSystemMessage function. Windows applications receive broadcast system messages through their normal message procedure. The message is not sent to child windows.

The WM_DEVICECHANGE message identifies a change in the status of the system hardware; it can be used with SHELL_BroadcastSystemMessage to inform system components of hardware changes. WM_DEVICECHANGE includes a number of query notifications; an application can return QUERY_VETOED to a query notification to veto the specified action.