Partager via


OpenEvent (Windows CE 5.0)

Send Feedback

This function opens an existing named event object.

HANDLEOpenEvent( DWORD dwDesiredAccess, BOOL bInheritHandle, LPCTSTR lpName);

Parameters

  • dwDesiredAccess
    [in] Specifies the requested access to the event object. For systems that support object security, the function fails if the security descriptor of the specified object does not permit the requested access for the calling process.

    dwDesiredAccess must also be set to the value in the following table.

    Value Description
    EVENT_ALL_ACCESS Specifies all possible access flags for the event object.
  • bInheritHandle
    [in] Specifies whether the returned handle is inheritable. Must be set to FALSE.

  • lpName
    [in] Pointer to a null-terminated string that names the event to be opened. Name comparisons are case-sensitive.

    Each object type, such as memory maps, semaphores, events, message queues, mutexes, and watchdog timers, has its own separate namespace. Empty strings, "", are handled as named objects. On Windows desktop-based platforms, synchronization objects all share the same namespace.

Return Values

If the function succeeds, the return value is a handle to the event object.

If the function fails, the return value is NULL. To get extended error information, call GetLastError.

Remarks

The OpenEvent function enables multiple processes to open handles of the same event object. The function succeeds only if some process has already created the event using the CreateEvent function. The calling process can use the returned handle in any function that requires a handle to an event object, subject to the limitations of the access specified in the dwDesiredAccess parameter.

Use the DuplicateHandle function to duplicate the handle. Use the CloseHandle function to close the handle. The system closes the handle automatically when the process terminates. The event object is destroyed when its last handle has been closed.

Requirements

OS Versions: Windows CE .NET 4.0 and later.
Header: Winbase.h.
Link Library: Coredll.lib.

See Also

CloseHandle | ResetEvent | SetEvent | CreateEvent | OpenEvent | CreateProcess | DuplicateHandle | PulseEvent

Send Feedback on this topic to the authors

Feedback FAQs

© 2006 Microsoft Corporation. All rights reserved.