BOOL enum windows(WNDENUMPROC lpEnumFunc,LPARAM lParam)
One of the clues that this function needs callback is the existence of lpEnumFunc parameter. In parameter names that use pointers to point to callback Functions, it is often seen that lp (long pointer) prefixes are combined with func suffixes. See the Microsoft Platform SDK for documentation on Win32 functions.
Create a managed callback function. This example declares a delegate type called CallBack, which accepts two parameters (hwnd and lparam). The first parameter is the handle of the window; The second parameter is application-defined. In this version, both parameters must be integers.
Callback functions usually return a non-zero value to indicate success and a zero value to indicate failure. This example explicitly sets the return value to true to continue the enumeration.
Create a delegate and pass it as a parameter to the EnumWindows function. Platform calls automatically convert delegates to a common callback format.