If I need to get an hWnd and I am using a console app, how can I set it?
Printable View
If I need to get an hWnd and I am using a console app, how can I set it?
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
Never mind, I'll just integrate a form into my console app and call ShellExecute from there....
Of perhaps better if I'll use the handle returned by GetDesktopWindow api...