473,395 Members | 1,678 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

using CloseMainWindow

Hi All,
I'm trying to gracefully run all running processes for an application. The
problem I am running into in multiple people will be logged in for the app. I
am currently using:
For Each vProcessName In vProcessList.GetProcessesByName("processname")
Try
Dim vresult As Integer
vProcessName.CloseMainWindow()
Catch ex As Exception
End Try
Next

The problem I am having is this only ends the application for the logged in
session, not all sessions. Is there a security permission I can set to allow
the command to end all instances of the application?
Thanks,
Ron
Jul 21 '05 #1
1 1500
Maybe, I said maybe, the problem is about "For Each"

Try to copy vProcessList.GetProcessesByName("processname") to an array of
string first, For Each with the array you created.
Because: You cannot let the array changed while For Each running.

"Ron Bromwell" <Ro*********@discussions.microsoft.com> wrote in message
news:AA**********************************@microsof t.com...
Hi All,
I'm trying to gracefully run all running processes for an application. The
problem I am running into in multiple people will be logged in for the
app. I
am currently using:
For Each vProcessName In
vProcessList.GetProcessesByName("processname")
Try
Dim vresult As Integer
vProcessName.CloseMainWindow()
Catch ex As Exception
End Try
Next

The problem I am having is this only ends the application for the logged
in
session, not all sessions. Is there a security permission I can set to
allow
the command to end all instances of the application?
Thanks,
Ron

Jul 21 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Shawn Hogan | last post by:
I'm trying to open an instance of the default browser and browse to a URL. I'm seeing an issue with the process class where if i execute my process using this code Dim p As Process = New Process...
2
by: rawCoder | last post by:
Hi All, I have a *.cer file, a public key of some one and I want to encrypt some thing using this public key. Can someone point me to a sample code for Encrypting some file using...
4
by: Ohad Young | last post by:
Hi, I need to open (launch) an external application from my winform application. The application is not a dot.net application, for example the windows calculator. I'm using the...
1
by: Ron Bromwell | last post by:
Hi All, I'm trying to gracefully run all running processes for an application. The problem I am running into in multiple people will be logged in for the app. I am currently using: For Each...
1
by: Mike Kober | last post by:
I'm having difficulty getting this to work. Any help would be appreciated. What I'm trying to do is to open Explorer onto the Windows/fonts directory and then close it. I've added a font...
3
by: Andy | last post by:
Is there a way to force a window to close without displaying a popup asking: "Windows cannot end this program....If you choose to end the program immediately, you will lose any unsaved data." ...
6
by: =?Utf-8?B?U3RldmVU?= | last post by:
I have written a very simple application that simply spawns IE then closes it. The issue I have is that CloseMainWindow() always returns a false indicating the message was never sent. Does...
3
by: JDeats | last post by:
I have some .NET 1.1 code that utilizes this technique for encrypting and decrypting a file. http://support.microsoft.com/kb/307010 In .NET 2.0 this approach is not fully supported (a .NET 2.0...
2
by: John Bradley | last post by:
I've looked high and low, but I can't seem to find an answer. When I open an application using the shell command, as seen below, how can I close the application? I am creating a menu system for...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.