delegate int EnumWindowsProc(IntPtr hWnd, IntPtr lParam);
Delegate Function EnumWindowsProc( _
ByVal hWnd As System.IntPtr, ByVal lParam As IntPtr) As Integer
If you're going to use the lparam to return a by-value result (such as the hwnd of a window you are looking for) then you want to declare the lparam as a ref:
delegate int EnumWindowsProc(IntPtr hWnd, ref IntPtr lParam);