CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 7 of 7
  1. #1
    Join Date
    Aug 2001
    Posts
    51

    Question Get count of handles

    Which Windows API will get you the number of handles in use by a process?

  2. #2
    Join Date
    Jun 2005
    Location
    Chennai , India
    Posts
    1,375

    Thumbs up Re: Get count of handles

    Quote Originally Posted by kberson
    Which Windows API will get you the number of handles in use by a process?
    Use EnumWindows/EnumChildWindows
    It takes seconds for rating…that actually compensates the minutes taken for giving answers
    The biggest guru-mantra is: Never share your secrets with anybody. It will destroy you.
    Regards, Be generous->Rate people
    Jayender!!

  3. #3
    Join Date
    Jun 2002
    Posts
    1,417

    Re: Get count of handles

    what kind of handles -- all handles such as gdi objects, file handles, windows handles, etc. or just windows handles. jayender's suggestion only returns windows handles.

  4. #4
    Join Date
    Aug 1999
    Location
    <Classified>
    Posts
    6,882

    Re: Get count of handles

    Regards,
    Ramkrishna Pawar

  5. #5
    Join Date
    Aug 2001
    Posts
    51

    Re: Get count of handles

    Quote Originally Posted by stober
    what kind of handles -- all handles such as gdi objects, file handles, windows handles, etc. or just windows handles. jayender's suggestion only returns windows handles.
    Good question! I'm looking for the value that the Task Manager displays when you check the handle count

  6. #6
    Join Date
    Feb 2003
    Location
    Iasi - Romania
    Posts
    8,234

    Re: Get count of handles

    Quote Originally Posted by kberson
    I'm looking for the value that the Task Manager displays when you check the handle count
    Well, that count is for the whole system and not for a process.

    However, to help starting let's open the list:
    1. GetGuiResources - the count of handles to graphical user interface (GUI) objects in use by the specified process.
    2. EnumProcessModules - retrieves a handle for each module in the specified process


    NOTE: when the list will be completed, do not forget toa add the process (handle) itself.
    Ovidiu
    "When in Rome, do as Romans do."
    My latest articles: https://codexpertro.wordpress.com/

  7. #7
    Join Date
    Aug 1999
    Location
    <Classified>
    Posts
    6,882

    Re: Get count of handles

    Regards,
    Ramkrishna Pawar

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

Featured