_DllCallBack() creates a stub in executable memory on local heap which forwards a stack pointer to AutoIt's message queue where it gets caught by a handler function. Sound's pretty tricky but i did my best to make it easy to use: #include "DllCallBack.au3" ; Create Stub $hStub_EnumWindows = _DllCallBack ("_EnumWindowsProc", _ ; Name of the function "hwnd;ptr") ; DllStruct like parameter definition