Jump to content
Sign in to follow this  
rojiblanco

How to reset Event

Recommended Posts

rojiblanco

I use _WinAPI_CreateEvent,so how to release this event and Reset this Event if i set $fManualReset =True

Please tell me how can i do

thanks alot.

Edited by rojiblanco

Share this post


Link to post
Share on other sites
martin

I use _WinAPI_CreateEvent,so how to release this event and Reset this Event if i set $fManualReset =True

Please tell me how can i do

thanks alot.

Presumably like this, which seems to be missing from WInAPI.au3.

; #FUNCTION# ====================================================================================================

================
; Name...........: _WinAPI_ResetSetEvent
; Description ...: Reset the specified event object to the non-signaled state
; Syntax.........: _WinAPI_ResetSetEvent($hEvent)
; Parameters ....: $hEvent    - Handle to the event object
;                               -The handle must have the EVENT_MODIFY_STATE access right.
; Return values .: Success    - True
;                   Failure   - False
; Author ........: martin 
; Modified.......:
; Remarks .......: The state of an event object remains nonsignaled until it is explicitly set to signaled by the SetEvent or PulseEvent function.
;                   This  nonsignaled state blocks the execution of any threads that have specified the event object in a call to one of the wait functions.
;                   The ResetEvent function is used primarily for manual-reset event objects, which must be set explicitly to the nonsignaled state. 
;                         Auto-reset event objects automatically change from signaled to nonsignaled after a single waiting thread is released.
;
;                   Resetting an event that is already reset has no effect.
; Related .......:
; Link ..........; "http://msdn.microsoft.com/en-us/library/ms685081(VS.85).aspx"
; Example .......;
;Tested ..........;No :)
Func _WinAPI_ResetSetEvent($hEvent)
    Local $aResult

    $aResult = DllCall("Kernel32.dll", "int", "ResetSetEvent", "hwnd", $hEvent)
    Return SetError(_WinAPI_GetLastError(), 0, $aResult[0] <> 0)
    
EndFunc  ;==>_WinAPI_ResetSetEvent
Edited by martin

Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×