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!

Question about running an external exe

Status
Not open for further replies.

redwolfe

MIS
Jan 12, 2000
89
US
I'm using VFP 9. I want to use a FoxPro form to call an external exe. Is there a way to make the form invisible while the external exe is running and reappear when the external exe terminates?
 
Code:
#define WS_START_NORMAL    1
#define WS_START_MINIMISED 2
#define WS_START_MAXIMISED 3

thisform.Hide()
oWsh = CREATEOBJECT([WScript.Shell])
oWSH = CREATEOBJECT([WScript.Shell])
oWSH.Run([full_path_to_external_application goes here] ,;
          WS_START_MAXIMISED, .t.)
thisform.Show()


Borislav Borissov
VFP9 SP1, SQL Server 2000/2005.
 

Redwolfe,

Borislav beat me to it. I was going to suggest the same thing.

However, you should note that your entire application will be suspended while the external application is running. If the user switches back to it, they will see an hourglass.

Borislav,

Did you accidently duplicate this line:
oWSH = CREATEOBJECT([WScript.Shell])

Mike

__________________________________
Mike Lewis (Edinburgh, Scotland)

My Visual FoxPro site: www.ml-consult.co.uk
 
I removed one of the lines "oWSH = CREATEOBJECT([WScript.Shell])", and the code seems to work ok.

Thanks
 
Yes Mike. :)
That was because I tryed this code and run Notepad, Then put #defines and then copy and paste code here. Removed all unneccesary lines, but missed that with CREATEOBJECT()

Borislav Borissov
VFP9 SP1, SQL Server 2000/2005.
 
As I stated in the original post, I am somewhat rusty when it comes to FoxPro. I also want to hide the default Visual FoxPro window. I tried using hide/show window screen, but that didn't work. I got a quick flash of activity and it was over with nothing really happening (that I could see). I want the application to run on the desktop with only that application's window showing. You guys have been very helpful so far, and I really appreciate it.
 

Redwolfe,

As I stated in the original post, I ... want to hide the default Visual FoxPro window.

Excuse me, but you didn't. You said you wanted to run the EXE from a form, and you wanted to make the form invisible.

Now you are saying you want to make the Visual Foxpro window invisible. To do that, you need to do:

_SCREEN.visible = .F.

just before you run the EXE, and:

-SCREEN.visible = .T.

when it returns control.

Mike



__________________________________
Mike Lewis (Edinburgh, Scotland)

My Visual FoxPro site: www.ml-consult.co.uk
 
Mike,
Not to be trite, but you've misquoted Redwolf. He said:

As I stated in the original post, I am somewhat rusty when it comes to FoxPro.

He has then added:

I also want to hide the default Visual FoxPro window.

However, you are right, he did not state he was rusty originally... :)

Just keeping it real.



Best Regards,
Scott

"Everything should be made as simple as possible, and no simpler."[hammer]
 
Scott,

You missed the vital part of my quote:


The ellipsis indicates that I omitted some text from the quote because it is not relevant to the point being quoted. The fact that Redwolfe was rusty wasn't related to the fact that he seemed unsure about whether he wanted to hide the screen or the form. At least, that was my opinion.

Mike

__________________________________
Mike Lewis (Edinburgh, Scotland)

My Visual FoxPro site: www.ml-consult.co.uk
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top