﻿id	summary	reporter	owner	description	type	status	milestone	component	version	severity	resolution	keywords	cc
3963	_WinAPI_OpenEvent function missing in WinAPIProc.au3	kleiza44@…	Jpm	"Please add _WinAPI_OpenEvent function that allows to check global events from windows.

_WinAPI_CreateEvent function by documentation should allow to open events, but if global event was created using different application, then script won't be able to access it.

Function in windows: https://learn.microsoft.com/en-us/windows/win32/api/synchapi/nf-synchapi-createeventa?redirectedfrom=MSDN&f1url=%3FappId%3DDev10IDEF1%26l%3DEN-US%26k%3Dk(CreateEvent)%3Bk(DevLang-C)%3Bk(TargetOS-WINDOWS)%26rd%3Dtrue

Function written in AutoIT which works in my case (Maybe positions of parameters could be changed like in already written AutoIT functions, to keep same structure in all AutoIT functions):


{{{
Func _WinAPI_OpenEvent($sName = """", $dwDesiredAccess = 0x1F0003 , $bInheritHandle = True)
	If $sName = """" Then $sName = Null

	Local $aCall = DllCall(""kernel32.dll"", ""handle"", ""OpenEventW"", ""struct*"", $dwDesiredAccess, ""bool"", $bInheritHandle, _
			""wstr"", $sName)
	If @error Then Return SetError(@error, @extended, 0)

	Local $iLastError = _WinAPI_GetLastError()
	If $iLastError Then Return SetExtended($iLastError, 0)

	Return $aCall[0]
EndFunc   ;==>_WinAPI_OpenEvent
}}}

If this function can be added, then it would make sense to add it to documentation as well like in here : https://www.autoitscript.com/autoit3/docs/libfunctions/_WinAPI_CreateEvent.htm"	Feature Request	closed	3.3.17.0	AutoIt		None	Completed		
