Page 1 of 1 1
Topic Options
#90708 - 2002-12-30 09:44 PM Locate Active Window
Microcyb Offline
Getting the hang of it

Registered: 2002-12-30
Posts: 95
Loc: Hell
O.K. here is a newbee question for you all.

Say I would like to know if an Win32 application is running or active, like for exmaple:

Notepad.exe was running on the desktop.

Can you do a script to know if it was running or not???
_________________________
www.microcyb.com

Top
#90709 - 2002-12-30 09:47 PM Re: Locate Active Window
Radimus Moderator Offline
Moderator
*****

Registered: 2000-01-06
Posts: 5187
Loc: Tampa, FL
well, there are UDFs to determine if a specific process is running.

look for FindProc() and EnumProcess()
_________________________
How to ask questions the smart way <-----------> Before you ask

Top
#90710 - 2002-12-30 09:54 PM Re: Locate Active Window
Les Offline
KiX Master
*****

Registered: 2001-06-11
Posts: 12734
Loc: fortfrances.on.ca
One could also use the return code of SetFocus().
_________________________
Give a man a fish and he will be back for more. Slap him with a fish and he will go away forever.

Top
#90711 - 2002-12-30 09:59 PM Re: Locate Active Window
Microcyb Offline
Getting the hang of it

Registered: 2002-12-30
Posts: 95
Loc: Hell
Hmm interesting I will have to look into that.

Are their any exmaples on here to see???

Been looking at the manual and stuff and not finding a good simple exmaples to play with.
_________________________
www.microcyb.com

Top
#90712 - 2002-12-30 10:01 PM Re: Locate Active Window
Les Offline
KiX Master
*****

Registered: 2001-06-11
Posts: 12734
Loc: fortfrances.on.ca
code:
Run "control printers"
While SetFocus ("Printers") <> 0
Sleep 1
$Index = $Index + 1
if $index > 10
$RC = MessageBox("DOH!" + Chr(13) + "Window did not open within a reasonable time!"
+ Chr(13) + "Please notify the FF HelpDesk at ext. 1864","NetWare Printer UnInstall",48,60)
goto DOH
endif
Loop

_________________________
Give a man a fish and he will be back for more. Slap him with a fish and he will go away forever.

Top
#90713 - 2002-12-30 10:05 PM Re: Locate Active Window
Microcyb Offline
Getting the hang of it

Registered: 2002-12-30
Posts: 95
Loc: Hell
Oh YEAH BABY!!!!!

Worked the first time.

O.K. how about this as a sample.

LOL

open the calulator and do a 1+1=
_________________________
www.microcyb.com

Top
#90714 - 2002-12-30 10:12 PM Re: Locate Active Window
Microcyb Offline
Getting the hang of it

Registered: 2002-12-30
Posts: 95
Loc: Hell
Posted in my site for others:
http://www.microcyb.com/?m=c&c=295
_________________________
www.microcyb.com

Top
#90715 - 2002-12-30 10:18 PM Re: Locate Active Window
Les Offline
KiX Master
*****

Registered: 2001-06-11
Posts: 12734
Loc: fortfrances.on.ca
code:
Break on
Run "%SystemRoot%\System32\calc.exe"
While SetFocus ("Calculator") <> 0
Sleep 1
$Index = $Index + 1
if $index > 10
$RC = MessageBox("DOH!" + Chr(13) + "Window did not open within a reasonable time!"
,"Calculator Example",48,60)
goto DOH
endif
Loop
$_ = SendKeys("1") ;Do the math
$_ = SendKeys("{+}") ;Do the math
$_ = SendKeys("1") ;Do the math
$_ = SendKeys("{ENTER}") ;Do the math
:DOH
get $_

_________________________
Give a man a fish and he will be back for more. Slap him with a fish and he will go away forever.

Top
#90716 - 2002-12-30 10:58 PM Re: Locate Active Window
Microcyb Offline
Getting the hang of it

Registered: 2002-12-30
Posts: 95
Loc: Hell
All I can say is you de MAN!!!
_________________________
www.microcyb.com

Top
#90717 - 2002-12-30 11:09 PM Re: Locate Active Window
Microcyb Offline
Getting the hang of it

Registered: 2002-12-30
Posts: 95
Loc: Hell
I think I am in love with a program. LOL
That calc example is PERFECT!!!!!!
_________________________
www.microcyb.com

Top
#90718 - 2002-12-31 05:25 PM Re: Locate Active Window
Sealeopard Offline
KiX Master
*****

Registered: 2001-04-25
Posts: 11165
Loc: Boston, MA, USA
Please use the KiXtart BBS Search as these topics have already been discussed numerous times.
_________________________
There are two types of vessels, submarines and targets.

Top
Page 1 of 1 1


Moderator:  Shawn, ShaneEP, Ruud van Velsen, Arend_, Jochen, Radimus, Glenn Barnas, Allen, Mart 
Hop to:
Shout Box

Who's Online
0 registered and 756 anonymous users online.
Newest Members
Viginette, ManuvdWielNL, Sir_Barrington, batdk82, StuTheCoder
17888 Registered Users

Generated in 0.059 seconds in which 0.036 seconds were spent on a total of 12 queries. Zlib compression enabled.

Search the board with:
superb Board Search
or try with google:
Google
Web kixtart.org