Find process id by window's handle

后端 未结 2 1095
渐次进展
渐次进展 2020-12-14 06:22

i have a problem with getting a specific PID of a process, the problem with this process is that it\'s a hidden process, it\'s not showing on task manager / powershell, com

2条回答
  •  太阳男子
    2020-12-14 07:21

    You will need to use P/invoke with the Windows API.

    Declare a function in your class like

     [DllImport("User32.dll")]
     static extern uint GetWindowThreadProcessId(IntPtr hWnd, out uint lpdwProcessId);
    

    and then call it in your class.

    See PInvoke.

提交回复
热议问题