I am developing a program in Visual Basic .Net 2005 to launch an external program, using the Process Control.
I am trying to use FindWindow to retrieve the handle of a top-level window.
Declare Auto Function FindWindow Lib "USER32.DLL" (ByVal lpClassName As String, ByVal lpWindowName As String) As IntPtr
However, the external program has two windows with the same WindowName, and FindWindow does not always obtain the handle to the right window. The class names of the two windows are different. None of my windows are parent or child windows.
Some insight on how to solve the problem will be very valuable.
Kind Regards
Sunzara