Results 1 to 13 of 13

Thread: Process information for process manager.

  1. #1

    Thread Starter
    Bad man! ident's Avatar
    Join Date
    Mar 2009
    Location
    Cambridge
    Posts
    5,401

    Process information for process manager.

    Couple of quickies

    1: Attached threads

    Rather then list all attached threads in a list view. I wanted total count.

    This is my own little work around.

    Code:
                    Dim oThreads As ProcessThreadCollection = ProcessID.Threads
                    Dim arryThreads As New List(Of Integer)
    
                    For x As Integer = 0 To oThreads.Count - 1
                        arryThreads.AddRange(New Integer() {x})
                    Next
    Code:
    lvi.SubItems.Add(arryThreads.Count.ToString)
    This there a direct call to get the total number? Adding to an array seems a tad silly.

    2: Individual CPU

    Can't find it on MSDN. Any links that will go into detail on Application CPU and maybe even more detail on features on what i could add.

  2. #2
    Pro Grammar chris128's Avatar
    Join Date
    Jun 2007
    Location
    England
    Posts
    7,604

    Re: Process information for process manager.

    You might want to take a look at weirddemon's source code for his process manager here and see if that helps out with either of those things: http://www.vbforums.com/showthread.php?t=599337
    My free .NET Windows API library (Version 2.2 Released 12/06/2011)

    Blog: cjwdev.wordpress.com
    Web: www.cjwdev.co.uk


  3. #3
    King of sapila
    Join Date
    Oct 2006
    Location
    Greece
    Posts
    6,763

    Re: Process information for process manager.

    What exactly you want to do with the cpu?
    ἄνδρα μοι ἔννεπε, μοῦσα, πολύτροπον, ὃς μάλα πολλὰ
    πλάγχθη, ἐπεὶ Τροίης ἱερὸν πτολίεθρον ἔπερσεν·

  4. #4

    Thread Starter
    Bad man! ident's Avatar
    Join Date
    Mar 2009
    Location
    Cambridge
    Posts
    5,401

    Re: Process information for process manager.

    Checking it out now chris, thanks

    Quote Originally Posted by sapator View Post
    What exactly you want to do with the cpu?
    Same as windows task manager. display individual process CPU

  5. #5
    King of sapila
    Join Date
    Oct 2006
    Location
    Greece
    Posts
    6,763

    Re: Process information for process manager.

    Sorry i don't get what you are saying.
    When can i see 2cpu's on the task manager?I have xp here btw with dual core.
    ἄνδρα μοι ἔννεπε, μοῦσα, πολύτροπον, ὃς μάλα πολλὰ
    πλάγχθη, ἐπεὶ Τροίης ἱερὸν πτολίεθρον ἔπερσεν·

  6. #6

    Thread Starter
    Bad man! ident's Avatar
    Join Date
    Mar 2009
    Location
    Cambridge
    Posts
    5,401

    Re: Process information for process manager.


  7. #7
    King of sapila
    Join Date
    Oct 2006
    Location
    Greece
    Posts
    6,763

    Re: Process information for process manager.

    Ehh?
    That is the cpu usage mate.Or you think it shows that you have 16cpus ?
    ἄνδρα μοι ἔννεπε, μοῦσα, πολύτροπον, ὃς μάλα πολλὰ
    πλάγχθη, ἐπεὶ Τροίης ἱερὸν πτολίεθρον ἔπερσεν·

  8. #8

    Thread Starter
    Bad man! ident's Avatar
    Join Date
    Mar 2009
    Location
    Cambridge
    Posts
    5,401

    Re: Process information for process manager.

    lol what you going on about 16 cpus

    I want to display a Individual CPU for a process exactly as above.

    I can display over all cpu but not sure how to get individual process cpu. some one said something about thread calculations

  9. #9
    King of sapila
    Join Date
    Oct 2006
    Location
    Greece
    Posts
    6,763

    Re: Process information for process manager.

    Ok fair enough.Haven't tried something like that but here is a nice article:
    http://www.codeproject.com/KB/system...scpuusage.aspx
    Just read this also:

    Re: Doesnt work with Dual Core or Multi CPU machines
    Use Following code:
    IdleProcessItem.SubItems[2].Text = (100 - Total / Environment.ProcessorCount) + "%";
    ἄνδρα μοι ἔννεπε, μοῦσα, πολύτροπον, ὃς μάλα πολλὰ
    πλάγχθη, ἐπεὶ Τροίης ἱερὸν πτολίεθρον ἔπερσεν·

  10. #10

    Thread Starter
    Bad man! ident's Avatar
    Join Date
    Mar 2009
    Location
    Cambridge
    Posts
    5,401

    Re: Process information for process manager.

    Will read that tomorrow. So wont mark resolved just yet.

    nice one

  11. #11
    King of sapila
    Join Date
    Oct 2006
    Location
    Greece
    Posts
    6,763

    Re: Process information for process manager.

    ok.
    ἄνδρα μοι ἔννεπε, μοῦσα, πολύτροπον, ὃς μάλα πολλὰ
    πλάγχθη, ἐπεὶ Τροίης ἱερὸν πτολίεθρον ἔπερσεν·

  12. #12

    Thread Starter
    Bad man! ident's Avatar
    Join Date
    Mar 2009
    Location
    Cambridge
    Posts
    5,401

    Re: Process information for process manager.

    Hi, that project has 3 errors that i am nor use to

    Error 1 Constants must be of an intrinsic or enumerated type, not a class, structure, type parameter, or array type.

    Private Const CLOSED_PROCESS As Process = Nothing
    Private Const PROCESS_INFO_NOT_FOUND As ProcessInfo = Nothing
    Public Const CLOSED_THREAD As ProcessThread = Nothing

  13. #13
    King of sapila
    Join Date
    Oct 2006
    Location
    Greece
    Posts
    6,763

    Re: Process information for process manager.

    Hi.
    Try remove const, p.e.
    Private CLOSED_PROCESS As Process = Nothing
    ἄνδρα μοι ἔννεπε, μοῦσα, πολύτροπον, ὃς μάλα πολλὰ
    πλάγχθη, ἐπεὶ Τροίης ἱερὸν πτολίεθρον ἔπερσεν·

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width