Here is the signature for CreateEvent
HANDLE WINAPI CreateEvent(
__in_opt LPSECURITY_ATTRIBUTES lpEventAttributes,
__in BOOL bManualReset,
__in BOOL bInitialState,
__in_opt LPCTSTR lpName
);
You ave to pass a SECURITY_ATTRIBUTES structure granting access to the user (or a group) that will call OpenEvent.
Take a look at
Creating a Security Descriptor for a New Object in C++[
^] - it shows how to work with SECURITY_ATTRIBUTES.
Best regards
Espen Harlinn