Opened 15 years ago

Closed 15 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: Severity: None
Keywords: Cc:


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)

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

Until GUIGetMsg() = -3

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

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

Attachments (0)

Change History (1)

comment:1 Changed 15 years ago by Valik

  • Resolution set to No Bug
  • Status changed from new to closed

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

Guidelines for posting comments:

  • You cannot re-open a ticket but you may still leave a comment if you have additional information to add.
  • In-depth discussions should take place on the forum.

For more information see the full version of the ticket guidelines here.

Add Comment

Modify Ticket

as closed The ticket will remain with no owner.

E-mail address and user name can be saved in the Preferences.

Note: See TracTickets for help on using tickets.