Code:
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 Throw New Exception("GCHandle Target could not be cast as List(Of IntPtr)")
ChildrenList.Add(Handle)
Return True
End Function
Ovo je ok samo sto ubacujes u listu sve prozore ..
Dodaj jos win api f-ju :
Code:
Private Shared Sub GetClassName(ByVal hWnd As System.IntPtr, _
ByVal lpClassName As System.Text.StringBuilder, ByVal nMaxCount As Integer)
End Function
Pa bi onda tvoja EnumWindow procedura trebalo ovako nesto da izgleda ,
Nisam testirao ali svejedno probaj :
Code:
Private Shared Function EnumWindow(ByVal Handle As IntPtr, ByVal Parameter As IntPtr) As Boolean
Dim ChildrenList As List(Of IntPtr) = GCHandle.FromIntPtr(Parameter).Target
Dim Res As IntPtr ;
Dim ClassName As New StringBuilder(100)
Res = GetClassName(Handle , ClassName, ClassName.Capacity)
//instanca win explorera ..
If String.Compare(ClassName.ToString(), "CabinetWClass",True,CultureInfo.InvariantCulture) = 0 Then
ChildrenList.Add(Handle)
Return True
End Function
Classname od bilo kog programa mozes uvek da saznas ako pokrenes utility VS2005 Spy++ koji ti daje informacije o svim pokrenutim aplikacijama
prozorima , Thread-id itd ....
Pozdrav!!!
Viva lollapalooza