nivisde 发表于 2012-9-22 23:57:48

请教一个关于windows 系统创建自定义事件 的问题

本帖最后由 nivisde 于 2012-9-23 00:16 编辑

_EventLog__RegisterSource
--------------------------------------------------------------------------------

Retrieves a registered handle to the specified event log
#Include <EventLog.au3>
_EventLog__RegisterSource($sServerName, $sSourceName)

参数

$sServerName The UNC name of the server on where the event log will be opened. If blank, the operation is
performed on the local computer.
$sSourceName The name of the event source whose handle is to be retrieved. The source name must be a subkey
of a log under the Eventlog registry key.

返回值

Success: The handle to an event log
Failure: 0
注意/说明

If the source name cannot be found, the event logging service uses the Application log; it does not create a
new source. Events are reported for the source, however, there are no message and category message files
specified for looking up descriptions of the event identifiers for the source. To close the handle to the
event log, use the DeregisterEventSource function.

按照说明 用这个_EventLog__RegisterSource 函数
The source name must be a subkey
of a log under the Eventlog registry key.
必须是存在的事件名?那好像不符合我的要求呢。如何创建一个自定义的事件名。、像下面图中这个


如果使用
_WinAPI_CreateEvent
--------------------------------------------------------------------------------
创建或者打开一个命名的或者未命名的事件对象
#Include <WinAPI.au3>
_WinAPI_CreateEvent([$pAttributes = 0 [, $fManualReset = True [, $fInitialState = True [, $sName = ""]]]])

第一个参数不台理解。
$pAttributes [可选参数] Pointer to a $tagSECURITY_ATTRIBUTES structure. If 0, the handle cannot be inherited by child
processes. The Descriptor member of the structure specifies a security descriptor for the new event. If
pAttributes is 0, the event gets a default security descriptor. The ACLs in the default security descriptor
for an event come from the primary or impersonation token of the creator.
页: [1]
查看完整版本: 请教一个关于windows 系统创建自定义事件 的问题