Ok, it's days I'm in trouble with this... it should be easy!
Say we have to do a class (say Windows) wich wraps EnumWindows (DllImpors[(user32.dll)])
This class have just to raise the event Enumerate for each call of EnumWindows to its callback.
I've no idea about how to do it!![]()
![]()
How to fill the "raising of event"?PHP Code:public class Windows
[DllImport("user32.dll")] private static extern
int EnumWindows(EnumWindowsProc ewp, int lParam);
//delegate used for EnumWindows() callback function
public delegate bool EnumWindowsProc(int hWnd, int lParam);
public Windows()
{
//Declare a callback delegate for EnumWindows() API call
EnumWindowsProc ewp = new EnumWindowsProc(EvalWindow);
//Enumerate all Windows
EnumWindows(ewp, 0);
}
//EnumWindows CALLBACK function
private bool EvalWindow(int hWnd, int lParam)
{
// RAISE THE EVENT!
// HOW???
}
}
}
Thanx




Reply With Quote