public WindowProcess(IntPtr hWnd) { this.hWnd = hWnd; try { this.pid = WindowProcessor.GetProcessId(hWnd); this.imageFullPath = WindowProcessor.GetProcessFilePath(this.pid); // imageFolderName = Path.GetDirectoryName(imageFullPath); this.imageFileName = Path.GetFileName(imageFullPath); this.windowText = WindowProcessor.GetWindowText(hWnd); } catch (Exception ex) { Console.Out.WriteLine(ex.Message); } finally { this.timeRegistered = DateTime.Now; } }
public bool isAlive() { return(WindowProcessor.GetProcessId(this.hWnd) == this.pid); }