Partager via


CeEventHasOccurred (Windows Embedded CE 6.0)

1/6/2010

This function is used by operating system (OS) components and by device drivers to send a notification that one of the supported events on the system has occurred.

This function is only available to platform and driver developers.

Syntax

BOOL CeEventHasOccurred(
  LONG lWhichEvent,
  TCHAR* pwszEndOfCommandLine
);

Parameters

  • lWhichEvent
    [in] Identifies the event that just occurred. It must be one of the events supported by CeRunAppAtEvent.
  • pwszEndOfCommandLine
    [in] Pointer to a string that contains a message associated with the event that just occurred. This string is appended to the command line that launches the application associated with the event.

Remarks

Calls to CeEventHasOccurred notify the OS that the event identified by the lWhichEvent parameter has just occurred. If an application has previously been associated with that event through a call to CeRunAppAtEvent, then it is launched with the command-line parameters supplied by CeRunAppAtEvent and pwszEndOfCommandLine. For example, an application named Program.exe could be associated with COM port detection using the following code:

CeRunAppAtEvent("Program.exe", NOTIFICATION_EVENT_RS232_DETECTED);

Then, the serial driver could signal a newly detected COM port with the following code:

CeEventHasOccurred (NOTIFICATION_EVENT_RS232_DETECTED, L"A new COM
 port has been detected!");

When the event is triggered, the application would be launched as though you entered the following command on the command line:

program.exe AppRunAtRs232Detect A new COM port has been detected!

In this example, CeRunAppAtEvent automatically adds the string AppRunAtRs232Detect to the command line.

To add your own notification event to your system, you must modify CeNotifyPublic_FilterEvent to recognize your event. Next, call CeEventHasOccurred from your software component or device driver, as appropriate.

The delay for blocking the CeEventHasOccured function while the OS initializes can be set with the ShortApiTimeout registry value. For more information, see General GWES Registry Settings.

Requirements

Header notify.h
Library coredll.lib
Windows Embedded CE Windows CE 2.0 and later

See Also

Reference

Notification Functions
CeRunAppAtEvent