Esempio n. 1
0
        public string GetProcessName(int hwnd)
        {
            int pid;

            User32Wrapper.GetWindowThreadProcessId(hwnd, out pid);
            var process = Process.GetProcessById(pid);

            return(process.ProcessName);
        }
Esempio n. 2
0
        public string GetExecutableFilename(int hwnd)
        {
            var result = "";
            int pid;

            User32Wrapper.GetWindowThreadProcessId(hwnd, out pid);
            var process = Process.GetProcessById(pid);

            try
            {
                result = process.MainModule.FileName;
            }
            catch { }

            return(result);
        }