473,387 Members | 1,899 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,387 software developers and data experts.

Set process object = current app?

Hello,
I would like to instance a new System.Diagnostics.Process object that is the
current application, but I can't see a quick way of doing this. I know how
to "start" a process, but it's already running. Do I really need to iterate
through the collection of processes? And if so, how do I know which is the
one I'm "in" (i.e. the user may have run more than one occurrence)?

Thanks
Oct 5 '06 #1
2 1348
james wrote:
Hello,
I would like to instance a new System.Diagnostics.Process object that is
the current application, but I can't see a quick way of doing this. I
know how to "start" a process, but it's already running. Do I really need
to iterate through the collection of processes? And if so, how do I know
which is the one I'm "in" (i.e. the user may have run more than one
occurrence)?
System.Diagnostics.Process proc =
System.Diagnostics.Process.GetCurrentProcess();
--
Tom Porterfield

Oct 5 '06 #2

"Tom Porterfield" <tp******@mvps.orgwrote in message
news:%2****************@TK2MSFTNGP06.phx.gbl...
james wrote:
>Hello,
I would like to instance a new System.Diagnostics.Process object that is
the current application, but I can't see a quick way of doing this.

System.Diagnostics.Process proc =
System.Diagnostics.Process.GetCurrentProcess();
Knew it would be simple! Thanks,
James.
Oct 6 '06 #3

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

Similar topics

1
by: Peter Åstrand | last post by:
There's a new PEP available: PEP 324: popen5 - New POSIX process module A copy is included below. Comments are appreciated. ---- PEP: 324 Title: popen5 - New POSIX process module
1
by: wesley | last post by:
Hello, How do I pass object to the current running process? For example my assembly is called program.exe. Once program.exe is running sometime I want to call it again ie: program.exe /m...
18
by: jas | last post by:
Hi, I would like to start a new process and be able to read/write from/to it. I have tried things like... import subprocess as sp p = sp.Popen("cmd.exe", stdout=sp.PIPE)...
8
by: Wim | last post by:
My GUI application starts a process (a console program) when the user hits Play. I would like to add an option to pause that process. The code I've added to detect if the user hit pause/unpause...
12
by: GTi | last post by:
I have small program that always must be running when a user is logged on. Since users can close this program I must create a program that always check if this program is running. So I created a...
6
by: Paul Colton | last post by:
I want to pre-process some of my pages using some custom code, then output the ASP.NET page so the regular ASP.NET handler takes care of it. I'd like for page caching, etc. to work as normal. ...
3
by: rao | last post by:
Hi All, I am generating temporary xml files to bind it to tree view control. A unique xml file is generated for each user. I generating these files Using streamwriter class. Later when I try to...
7
by: MgGuigg | last post by:
Hello all, This is my first time posting a question to this forum, so here is hoping I am following protocol. I am scraping the rust off my old Basic programming skills, and have just recently...
4
by: Hans | last post by:
Hi, I want to allow users to start my application only once. To do so, I use Process Processes = Process.GetProcessesByName("MyApp"); to get all processes running on the machine and compair...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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
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,...

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.