I know the name of the process. How can you get the handle of the main window of this process by its name?

    1 answer 1

    Can

    1. enumerate all windows with EnumWindows ,
    2. for each window, determine the id using GetWindowThreadProcessId ,
    3. number processes by calling NtQuerySystemInformation ,
    4. find by process name its id , and by id handle of the main window.