detect open window

BlitzMax Forums/BlitzMax Programming/detect open window

ckob(Posted 2006) [#1]
Say I have a window/application running and I want another application to run that detects if that application is running is there a command to find a window?


ImaginaryHuman(Posted 2006) [#2]
Ther isn't A command but I'm sure some clever person knows of the o/s routines to use to achieve it.


Eikon(Posted 2006) [#3]
hWnd = FindWindow(ClassName$z, Title$z)
Extern "win32"
	Function FindWindow(lpClassName$z, lpWindowName$z) = "FindWindowA@8"
End Extern

AppTitle = "Find Me"
Graphics 320, 240, 0, 60

hWnd = FindWindow("BBDX7Device Window Class", "Find Me")

If Not hWnd Then Notify "Window not found"
(Windows)
Leave the ClassName param null if you want to return any window named "Find Me", regardless of class.


ckob(Posted 2006) [#4]
thanks eikon ill give it a try when I get home.