Thread: Info on specific process

  1. #1
    Registered User
    Join Date
    Mar 2007

    Info on specific process

    Whats up guys, I was reading this tutorial
    and it helped me A LOT but I wondering how can you modify the code so it will only show information on specific process, lets say NotePad.exe, because all I want is to know notepad PID.

  2. #2
    Reverse Engineer maxorator's Avatar
    Join Date
    Aug 2005
    My function for that:
    DWORD GetProcessByFileName(char* name){
        DWORD process_id_array[1024];
        DWORD bytes_returned;
        DWORD num_processes;
        HANDLE hProcess;
        char image_name[256];
        char buffer[256];
        DWORD exitcode;
        EnumProcesses(process_id_array, 256*sizeof(DWORD), &bytes_returned);
        num_processes = bytes_returned/sizeof(DWORD);
        for(int i=0;i<num_processes;i++){
                    return process_id_array[i];
        return 0;
    It only fails if you have over 256 processes running which I doubt you have.
    "The Internet treats censorship as damage and routes around it." - John Gilmore

  3. #3
    Registered User
    Join Date
    Mar 2007
    Thanks a lot, but I read your code many times and could not figure it out, where do I put the name of the process I want to find? is it GetProcessByFileName(char* name) I replace the name by my process?

  4. #4
    Registered User Queatrix's Avatar
    Join Date
    Apr 2005
    You'r responce doesn't make much sence, maybe this will help.
    DWORD dwPID = GetProcessByFileName("Notepad.exe");
    dwPID is the process ID of the first program running with the file name of "Notepad.exe".

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Check number of times a process is running
    By linuxwolf in forum Windows Programming
    Replies: 6
    Last Post: 10-17-2008, 11:08 AM
  2. Question about getting an info class from another Form
    By Joelito in forum C# Programming
    Replies: 0
    Last Post: 10-16-2006, 01:02 PM
  3. Terminate Process by Specific FullFilePath
    By MattKamil in forum Windows Programming
    Replies: 1
    Last Post: 07-05-2006, 04:15 PM
  4. Process sending file descriptors to another process
    By Yasir_Malik in forum C Programming
    Replies: 4
    Last Post: 04-07-2005, 07:36 PM
  5. process ring
    By gregulator in forum C++ Programming
    Replies: 0
    Last Post: 02-28-2005, 07:21 PM
Website Security Test