I don’t fully understand these topics.
I work with several WinAPI methods
public delegate bool Win32Callback(IntPtr hwnd, ref IntPtr lParam);
[DllImport("user32.Dll")]
[return: MarshalAs(UnmanagedType.Bool)]
public static extern bool EnumChildWindows(IntPtr parentHandle, Win32Callback callback, IntPtr lParam);
and
public static bool BrowserEnumChildrenCallback(IntPtr hWnd, ref IntPtr lParam)
{
if (hWndMeetsConditions)
return true;
//code
return false;
}
Is it possible get hWnd for which was returned true from BrowserEnumChildrenCallback?
Win32Callback callBack = new MainWindow.Win32Callback(BrowserEnumChildrenCallback);
if (EnumChildWindows(hWnd, callBack, hWnd))
{
//here
}
Several problems:
Answering the actual question: store the window handle in a field of your class. Thus:
A lambda works well too.