![]() hWnd can be used to further examine properties of the window. If you are trying to GetWindowText () from a window in another process, then GetWindowText () will use the string from the special place and not send a message. I know from > WinSight32 that the paraent window has 12 childs. / /// Window handle /// Caller-defined variable we use it for a pointer to our list /// True to continue enumerating, false to bail. This callback function receives a windows handle ( hWnd) of one of the windows of the system. Quote > I am trying to find child windows of a specific parent. / /// Delegate for the EnumChildWindows method You can modify this to check to see if you want to cancel the operation, then return a null here return true EnumChildWindows(), Enumerates all child windows that belong to a specified parent window. Throw new InvalidCastException( " GCHandle Target could not be cast as List") GCHandle gch = GCHandle.FromIntPtr(pointer) / /// Handle of the next window /// Pointer to a GCHandle that holds a reference to the list to fill /// True to continue the enumeration, false to bail private static bool EnumWindow( IntPtr handle, IntPtr pointer) / /// Callback method to be used when enumerating windows. ![]() GCHandle listHandle = GCHandle.Alloc(result) ĮnumWindowProc childProc = new EnumWindowProc(EnumWindow) ĮnumChildWindows(parent, childProc, GCHandle.ToIntPtr(listHandle)) / /// Parent of the windows to return /// List of child windows public static List GetChildWindows( IntPtr parent) Public static extern bool EnumChildWindows( IntPtr window, EnumWindowProc callback, IntPtr i)
0 Comments
Leave a Reply. |