Start 1 or 2 notepad processes and then try this code
Code:
Sub Main()
Console.Title = "Playing with Handle in Console"
Dim counter As Integer = 0
For Each p As Process In Process.GetProcessesByName("notepad")
counter += 1
Console.WriteLine(counter & " p window Handle: " & p.MainWindowHandle.ToString)
Next
Console.ReadLine()
End Sub
Last edited by talkro; Mar 18th, 2007 at 08:38 AM.