Hello,
I am having the oddest error with the EnumChildWindows function. Below are
the imports, and the methods.
[DllImport("user32.dll", SetLastError=true)]
public static extern int EnumChildWindows(IntPtr hWndParent, EnumChildProc
callback, int lParam);
public delegate int EnumChildProc(IntPtr hwnd, long lParam);
public void M_initChildWindows()
{
if(WindowObject_Basic_GDI_Handle != IntPtr.Zero)
{
try
{
User32.EnumChildWindows(WindowObject_Basic_GDI_Han dle, new
User32.EnumChildProc(M_addChildWindows), 0);
}
catch(Exception e)
{
System.Diagnostics.Debug.WriteLine("Child Window failure: " +
e.Message);
}
}
}
private int M_addChildWindows(IntPtr Window, long Data)
{
if(Window != IntPtr.Zero)
{
ChildWindowObject_Basic c_WindowObject_Basic = new
ChildWindowObject_Basic(Window);
c_WindowObject_Basic_Array.Add(c_WindowObject_Basi c);
}
return 1;
}
I keep getting a 127 error, even though it appears to enumerate the windows.
I placed it within a try statement to continue working other things, but
it's coming back to bite me in the ass.
Anyone have any ideas?
Thanks,
Ryan