G
Guest
Could anyone explain to me why this code doesn't work:
[DllImport("coredll.dll")]
private static extern bool EnumWindows(EnumWindowsProc func, int lParam);
public delegate bool EnumWindowsProc(int hWnd, int lParam);
private static bool EnumWnds(int hWnd, int lParam)
{
return true;
}
private void function()
{
EnumWindowsProc ef = new EnumWindowsProc(EnumWnds);
EnumWindows(ef, 0);
}
EnumWindows causes an exception...
Thank you.
[DllImport("coredll.dll")]
private static extern bool EnumWindows(EnumWindowsProc func, int lParam);
public delegate bool EnumWindowsProc(int hWnd, int lParam);
private static bool EnumWnds(int hWnd, int lParam)
{
return true;
}
private void function()
{
EnumWindowsProc ef = new EnumWindowsProc(EnumWnds);
EnumWindows(ef, 0);
}
EnumWindows causes an exception...
Thank you.