How to pass the address of a thread function as a callback to winapi?
问题 I have a simple thread and inside the execute I try to call EnumWindows() with the address of one of the functions defined in the thread. So I'm trying to do this: EnumWindows(@cbEnumWindowsClickOK, 0); where cbEnumWindowsClickOK is an EnumWindowProc defined inside the thread class, like so: TAutoClickOKThread = class(TThread) private fExitEvent : THandle; function cbEnumWindowsClickOK(Wnd: HWND; Info: Pointer): BOOL; public constructor Create(ExitEvent : Thandle); procedure Execute();