Getting info on front process - Programmer

This is a discussion on Getting info on front process - Programmer ; How can I get info (the name) of the process having user focus (Frontmost process)....

+ Reply to Thread
Results 1 to 2 of 2

Thread: Getting info on front process

  1. Getting info on front process

    How can I get info (the name) of the process having user focus
    (Frontmost process).

  2. Re: Getting info on front process

    Tommy Nordgren wrote:
    > How can I get info (the name) of the process having user focus
    > (Frontmost process).


    Using GetForegroundWindow(), GetWindowThreadProcessId() to get the process
    of the foreground window.

    There might be a better way, but what I did was then use Process32First() and
    Process32Next() to iterate through the process list looking for the matching
    process. Once you find it, you then want the szExeFile member of the
    PROCESSENTRY32 struct.

    - Paul

+ Reply to Thread