Hi,
ich habe momentan das Problem, dass wenn ich per API alle childwindows(controls) von z.B.Firefox auflisten möchte, werden mir keine childwindows zurückgegeben. Der Code dafür sieht momentan so aus:
Hat jemand dafür eine Idee?
Vielen Dank...
ich habe momentan das Problem, dass wenn ich per API alle childwindows(controls) von z.B.Firefox auflisten möchte, werden mir keine childwindows zurückgegeben. Der Code dafür sieht momentan so aus:
VB.NET-Quellcode
- Public Shared Function GetChildWindows(ByVal ParentHandle As IntPtr) As IntPtr()
- Dim ChildrenList As New List(Of IntPtr)
- Dim ListHandle As GCHandle = GCHandle.Alloc(ChildrenList)
- Try
- EnumChildWindows(ParentHandle, AddressOf EnumWindow, GCHandle.ToIntPtr(ListHandle))
- Finally
- If ListHandle.IsAllocated Then ListHandle.Free()
- End Try
- Return ChildrenList.ToArray
- End Function
- Private Shared Function EnumWindow(ByVal Handle As IntPtr, ByVal Parameter As IntPtr) As Boolean
- Dim ChildrenList As List(Of IntPtr) = GCHandle.FromIntPtr(Parameter).Target
- If ChildrenList Is Nothing Then return false
- ChildrenList.Add(Handle)
- Return True
- End Function
Hat jemand dafür eine Idee?
Vielen Dank...