public void UpdateLocation(IntPtr handle)
 {
     try
     {
         var rect = WindowInfo.GetHandleDimensions(handle);
         this.Left   = rect.Left;
         this.Top    = rect.Top;
         this.Width  = rect.Right - rect.Left;
         this.Height = rect.Bottom - rect.Top;
     }
     catch (Exception ex)
     {
         Toolbox.LogException(ex);
     }
 }
Beispiel #2
0
 private void DisplayProcessInfo(WindowListItem proc)
 {
     try
     {
         var dimensions = WindowInfo.GetHandleDimensions(proc.Handle);
         TxtProcName.Text     = $"Process Name: {proc.Process.ProcessName}";
         TxtProcTitle.Text    = $"Process Title: {proc.Title}";
         TxtModName.Text      = $"Module Name: {proc.Process.MainModule.ModuleName}";
         TxtFilePath.Text     = $"File Path: {proc.Process.MainModule.FileName}";
         TxtProcLocation.Text = $"Location:{Environment.NewLine}   X: {dimensions.Left}{Environment.NewLine}   Y: {dimensions.Top}{Environment.NewLine}   Width: {dimensions.Right - dimensions.Left}{Environment.NewLine}   Height: {dimensions.Bottom - dimensions.Top}";
     }
     catch (Exception ex)
     {
         LogException(ex);
     }
 }