let's say that you just bought a fancy keyboard with fancy buttons, and you want at a press of a button be ready to go...
here's something very simple
Code: Select all
p.s = ProgramParameter()
OpenConsole()
Print("looking for "+p+"... ")
If FindWindow_(0,p) <> 0
PrintN("found")
r = 1
Else
PrintN("not found")
r = 0
EndIf
End r
compile as console executable as 'findwindow.exe' and put it somewhere in the search path
now, let's say you run trillian from a batch file...
Code: Select all
c:
cd c:\software\batch
findwindow trillian
if errorlevel 1 goto trillianloaded
trillian.lnk
:trillianloaded
or, with one press of a key, you want to get ready to program... launch total commander, your email client, map the server, start your messenger, get in the japbe mood and add some music...
Code: Select all
c:
cd c:\software\batch
totalcommander.lnk
outlookexpress.lnk
call mapserv1.bat
call trillian.bat
japbe.lnk
call pbforums.bat
dbpoweramp.lnk
as a final note (something i feel very stupid about because it took me so long to figure it out) launching a program under win2k / winxp without halting the batchfile is done by calling the schortcut (.lnk) file, not the exe... so copy / create shortcuts where necessary