Modify

Opened 17 years ago

Closed 17 years ago

#1053 closed Bug (No Bug)

The computer hangs for a while when used DllCallbackRegister()

Reported by: Yashied Owned by:
Milestone: Component: AutoIt
Version: 3.3.0.0 Severity: None
Keywords: Cc:

Description

The computer hangs for a while (from several seconds or more), if any key is holding down when clicking on the Close, Minimize, Maximize, or Help buttons.

#Include <WinAPI.au3>

Global $hProc = DllCallbackRegister('_MyHook', 'long', 'int;wparam;lparam')
Global $hHook = _WinAPI_SetWindowsHookEx($WH_KEYBOARD_LL, DllCallbackGetPtr($hProc), _WinAPI_GetModuleHandle(0), 0)

GUICreate('Bug')
GUICtrlCreateLabel('Hold down any key and then click mouse on the close button.', 50, 20)
GUISetState()

Do
Until GUIGetMsg() = -3

Func _MyHook($iCode, $wParam, $lParam)
	Return _WinAPI_CallNextHookEx($hHook, $iCode, $wParam, $lParam)
EndFunc   ;==>_MyHook

Func OnAutoItExit()
	ConsoleWrite('Call _WinAPI_UnhookWindowsHookEx()' & @CR)
	_WinAPI_UnhookWindowsHookEx($hHook)
EndFunc   ;==>OnAutoItExit

Attachments (0)

Change History (1)

comment:1 by Valik, 17 years ago

Resolution: No Bug
Status: newclosed

Multiple event sources are put into a queue. You're creating a conflict here. This is not a bug, it's a design limitation.

Modify Ticket

Action
as closed The ticket will remain with no owner.

Add Comment


E-mail address and name can be saved in the Preferences .
 
Note: See TracTickets for help on using tickets.