detecting Windows(or its name) in VB and use it in other program
Is it possible to write a VB program that detects the name of a window and use it to interact with that window(finding captions or clicking buttons)?
What API functions should I use?
Re: detecting Windows(or its name) in VB and use it in other program
Try this:
Declare Function FindWindow& Lib "user32" Alias "FindWindowA" (byval lpClassName as string, byval lpWindowName as string)
It will return you a handle of window. As a parameters you can use either Caption of window or Window Class. Window Class of particular window you can find using Spy++ wich comes with VB (with Enterprise edition for sure). Example of finding MS Word:
lngHandle = FindWindow("OpusApp", vbNullString)
Example when you know Caption:
lngHandle = = FindWindow(vbNullString,"MyWindow")
HTH
Vlad