Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Close exe within FoxPro

Status
Not open for further replies.

ShortyII

Programmer
Sep 8, 2003
57
NL
Hello,

This is wath i want to do.
Check if a application is running if it does then close it.

I know how to check on running apps:
FindWindow is the title bar of the window
SET LIBRARY TO CFYPATH + "\exe\foxtools.fll" ADDITIVE
lGetwind = regfn("FindWindow","CC","I")
lWclass=0
lHandle=callfn(lGetwind,lWclass,lWindowTitle)
IF lHandle <> 0
ON KEY LABEL ESCAPE *
SET ESCAPE OFF
WAIT WINDOW &quot;THIS PROGRAM IS ALREADY RUNNING !&quot; NOWAIT
QUIT
ENDIF
SET LIBRARY TO

But how can i close the running app ?
The app isn't foxpro but a own written vb app.

The things i found on the internet where for VFPW and not for FoxPro 2.6A

This is a commend rgbean shared with me but i don't know how to realize this:
If you are running under a 32-bit OS (Win 9,x, NT/2000/XP), the problem is that many of the API calls aren't directly available through FOXTOOLS. You'll may need to use CALL32 - available at Then use the API SendMessage() with the &quot;close&quot; option. (Close is where the 2nd parameter has a value of 16.)

If someone could PLEASE help me.

Already thanx alot
 
I spent a couple hours trying to get CALL32 working with FindWindow() and SendMessage() in FPW, but it crashed my system numerous times and I found it to be very unreliable as to which programs would respond to the SendMessage(). If you need this capability, you really need to create a VFP application (a true 32-bit app) to do it - it's very simple (assuming your program has the proper security level in Win NT/2000/XP), and there are a number of examples around. It appears FPW lost this capability when you left Win 3.x - the last 16-bit Windows OS!

Rick
 
Super Thanx Rick for your effort!!!!!
Then i do have to search for a other solution.

But thanx again!
 
He Rick
Can i ask you then a other question.
Do you know how i can make a foxpro app always on top?
So if i open outlook it stays above outlook.

Thanx
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top