Question: In VB.net, you can set focus to an external application using
AppActivate("Windows Name") or AppActivate(processID as integer)
Now this works fine if you do for example:
Dim intNotePad As Integer = Shell("C:\WINNT\Notepad.exe",
AppWinStyle.MinimizedNoFocus) AppActivate(intNotePad)
But when I do
For Each theprocess As Process In processlist
If InStr(theprocess.ProcessName, "DWG") Then
strProcessList += String.Format("Process: {0} ID: {1}", theprocess.ProcessName, theprocess.Id) + vbCrLf
AppActivate(theprocess.ID)
End If
next theprocess
then it doesn't find the window, even if it's open and even if it finds the window using the window title.
But I need it by process id.
How can i do that ?
I need it to set focus on a 3rd party installer in a windows installer setup project.