CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 4 of 4
  1. #1
    Guest

    Find the name of a process

    How can I find the name of a process%2

  2. #2
    Join Date
    May 1999
    Posts
    24

    Re: Find the name of a process

    If you mean the file name then:

    1. Get WindowThreadProcessId(...) to get Process ID from HWND;
    2. OpenProcess(...) or GetProcessInformation(...) to get HANDLE to the process;
    3. EnumProcessModules(...) to get HANDLEs to all modules of the process;
    4. GetModuleFileName(...) to get path to module's file.

    Actually, I had the reverse problem. And I solved it.
    I think this should work.


    Thanks,
    Ilgar Mashayev

  3. #3
    Join Date
    May 1999
    Location
    13 N 77 E
    Posts
    183

    Re: Find the name of a process

    could you tell me the reverse problem's solution
    How can i find the processid from the process name


  4. #4
    Join Date
    May 1999
    Posts
    24

    Re: Find the name of a process

    1. EnumProcess(...) to get process ID's array
    2. OpenProcess(...) to get process handle
    3. EnumModules(...) to get process' module handles
    First handle is the handle to executable
    4. GetModuleFileNameEx(...) to get it's path
    5. Compare it with your process name

    Search in the MSDN KB.(Enumerating Win32 Applications).

    If you need the source mail me.

    Thanks,
    Ilgar Mashayev

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