IT Community - Software Programming, Web Development and Technical Support

How to get a reference to primary thread from process ?

This is a discussion on How to get a reference to primary thread from process ? within the Mobile Software Development forums, part of the Software Development category; I have a Process. Now I want a reference to this process' primary thread. Process.Threads can give me a ...


Go Back   IT Community - Software Programming, Web Development and Technical Support > Software Development > Mobile Software Development

Register FAQ Members List Calendar Mark Forums Read
  #1 (permalink)  
Old 07-17-2007, 11:06 PM
theone theone is offline
D-Web Sr.Programmer
 
Join Date: Jun 2007
Posts: 129
theone is on a distinguished road
Default How to get a reference to primary thread from process ?

I have a Process. Now I want a reference to this process' primary thread.

Process.Threads can give me a ProcessThreadCollection, but I still don't know which one is the primary thread. From ProcessThreadCollection doc: "The primary thread is not necessarily at index zero in the array". So the question is: How can I get it, when I have the process?


Thanks in Advance,

Last edited by theone : 07-30-2007 at 03:49 AM.
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 07-30-2007, 03:50 AM
kingmaker kingmaker is offline
D-Web Genius
 
Join Date: Jun 2007
Posts: 882
kingmaker is on a distinguished road
Send a message via Yahoo to kingmaker
Default Re: How to get a reference to primary thread from process ?

Hi theOne



The static method "Thread.CurrentThread", called from your primary thread, should do the trick.
__________________
The KINGMAKER
Makes Every Thing Possible

Stuffs (My Blog)
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

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

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Describe the difference between a Thread and a Process? vadivelanvaidyanathan ASP and ASP.NET Programming 6 10-29-2008 04:03 AM
How to wait a program control until a thread completes it process? $enthil C# Programming 4 11-16-2007 03:08 AM
Process & Thread Sathish Kumar C# Programming 4 08-22-2007 04:47 AM
Describe the difference between a Thread and a Process? kingmaker C# Programming 1 07-30-2007 12:21 AM
What are the primary considerations when implementing a user defined key? oxygen Java Programming 1 07-26-2007 04:52 AM


All times are GMT -7. The time now is 09:15 PM.


Copyright ©2004 - 2007, DiscussWeb. All Rights Reserved.

SEO by vBSEO 3.0.0