PC Review


Reply
Thread Tools Rate Thread

Closing a program which was opened with shellexecute

 
 
JonT
Guest
Posts: n/a
 
      27th Feb 2008
Good morning ,

I use the following code to open another program - does anybody the
corresponding code to close it again? Would really be most grateful
for any help - I've been looking for ages . . .

Private Declare Function ShellExecute Lib "shell32.dll" Alias
"ShellExecuteA" _
(ByVal hwnd As Long, ByVal lpOperation As String, ByVal lpFile As
String, _
ByVal lpParameters As String, ByVal lpDirectory As String, ByVal
nShowCmd _
As Long) As Long

Sub openProg()
Dim URL As String
URL = "C:\Program Files\....exe"
Call ShellExecute(0&, vbNullString, URL, vbNullString,
vbNullString, vbNormalFocus)

End Sub

Thanks very much in advance for any help you may be able to give.

JonT
 
Reply With Quote
 
 
 
 
michael.beckinsale
Guest
Posts: n/a
 
      27th Feb 2008
Hi JonT,

How about something like......................

Application.Quit

...........you may have to qualify the application.

Regards

Michael
 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Closing a Doc versus Closing the Program in Word 2007 =?Utf-8?B?RGVsbGE=?= Microsoft Word Document Management 4 6th Jun 2007 04:16 PM
Closing a workbook after it has opened another belkingold Microsoft Excel Programming 5 30th Oct 2006 06:51 PM
Outlook keeps closing after being opened . How do i fix this? =?Utf-8?B?Sm9obiBD?= Microsoft Outlook Discussion 0 2nd Feb 2006 04:23 AM
Closing an application before it's opened. ssg31415926 Microsoft Dot NET Framework Forms 2 12th Aug 2005 03:39 PM
Closing Opened Files =?Utf-8?B?R2FicmllbCBHaXJhbGRv?= Microsoft Windows 2000 2 29th Jun 2005 07:30 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 04:48 AM.