0

In my code I launch System Information and open a .nfo file.

Here is the code:

ProcessStartInfo psi = new ProcessStartInfo
{
    FileName = "msinfo32.exe",
    Arguments = "\"C:\Users\myName\Desktop\example.nfo\""
};
Process.Start(psi);

The problem is that the text is partially cut because it is too long. Of course, the user can grab the column header, but I would like to open the application with the appropriated width as default.

The text is cut...

I don't know how to set the column's width programmatically.

BTW: I see that sometimes the application's default width is different, for example I launched msinfo32.exe and here the columns are much wider:

Wider columns

RK Coder
  • 398
  • 2
  • 14
  • @Dennis AFAIK, that's a native windows window and not a user defined one. – Zein Makki Sep 05 '16 at 05:18
  • @user3185569: sorry, I've missed that it isn't your GUI, and you're just launching another application. I doubt that there is a way to set column width through command line. – Dennis Sep 05 '16 at 05:20
  • 1
    @Dennis It is not me who asked the question, I think you need some morning coffee :) – Zein Makki Sep 05 '16 at 05:22
  • You could try to get the needed information directly in C# and display them on your own WinForm using a ListView. Then its no problem to fit it to the content like in this example: http://stackoverflow.com/questions/1257500/c-sharp-listview-column-width-auto – Lion Sep 05 '16 at 05:35

0 Answers0