For Programmers: Free Programming Magazines  


Home > Archive > C# > October 2005 > GetCurrentProcess hangs









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author GetCurrentProcess hangs
Tomas Vera

2005-10-13, 3:57 am

Hello All,
I'ma having trouble getting GetCurrentProcess() to work properly.
What I'm trying to accomplish is list all running processes. But my
call get GetProcesses() hangs.

While testing things out I found that the tiny program listed below
hangs as well.

Am I missing something?

-tomas


//---- This app hangs ----
using System;
using System.Diagnostics;

namespace proctest
{

class Class1
{

[STAThread]
static void Main(string[] args)
{

Console.WriteLine(Process.GetCurrentProcess().ProcessName);
}
}
}

// -- What's wrong with this code?



/*-------------------------------
* Tomas Vera
* tomas (at) sbcglobal (dot) net
*-------------------------------
*/
Richard T. Edwards

2005-10-14, 7:57 am

Try this line:

System.Windows.Forms.MessageBox.Show(Process.GetCurrentProcess().ProcessName.ToString());



"Tomas Vera" <tavera@NO_SPAM_sbcglobal.net> wrote in message
news:l1vrk19a8gvphl0j4oj1o8v1hdha5o84bn@
4ax.com...
> Hello All,
> I'ma having trouble getting GetCurrentProcess() to work properly.
> What I'm trying to accomplish is list all running processes. But my
> call get GetProcesses() hangs.
>
> While testing things out I found that the tiny program listed below
> hangs as well.
>
> Am I missing something?
>
> -tomas
>
>
> //---- This app hangs ----
> using System;
> using System.Diagnostics;
>
> namespace proctest
> {
>
> class Class1
> {
>
> [STAThread]
> static void Main(string[] args)
> {
>
> Console.WriteLine(Process.GetCurrentProcess().ProcessName);
> }
> }
> }
>
> // -- What's wrong with this code?
>
>
>
> /*-------------------------------
> * Tomas Vera
> * tomas (at) sbcglobal (dot) net
> *-------------------------------
> */



Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com