Task Manager Application, Alt-Tab Icon questions

  • Thread starter Thread starter Tom
  • Start date Start date
T

Tom

I'm having a problem with both the Alt-Tab icon on my C# project and the
Task Manager Application tab.

1. Alt-Tab. The icon is not the one set in the Properties of the .EXE
project in VS.NET. It's the Windows default application icon. This is not
a problem of the wrong device on the icon (i.e. no 32x32 icon). That's
fine.
2. Task Manager Applications Tab. It just doesn't show up.

Both forms (the splash screen and the main form) have ShowInTaskbar = true.

I'd be grateful for any help you can provide.

Thanks,
Tom Clement

P.S. I think this may be related to the way I'm starting my splashscreen and
main application window. The abbreviated code follows:

// StartShell.cs

static void Main(string[] commandLine)
{
StartShell oStartShell = new StartShell(commandLine);
}

public StartShell(string[] commandLine)
{
SplashScreen frmSplash = new SplashScreen();
frmSplash.Show();

// Do stuff to read config file and load some components.
...
ApplicationShell frmMainApp = new ApplicationShell();

// Pass info to frmMainApp...
frmMainApp.SplashScreen = frmSplash;
...

frmMainApp.ShowDialog();
}

....

// MainApp.cs

......
private void MainApp_Load(object sender, System.EventArgs e)
{
frmSplash.GoAway(); // Closes the splash screen after a fade
away delay.
}
 
Hi,
frmMainApp.ShowDialog();

This is most likely the line causing the problem. Why don't you use a
sequence like this:

public static void Main()
{
SplashScreen splash = new Splash();
splash.Show();
splash.Update();

MainForm mainForm = new MainForm(args);
form.Splash = splash;

Application.Run(mainForm);
}

and in the MainForm_Load() :
{
// ...
Splash.GoAway();
}

--
Dmitriy Lapshin [C# / .NET MVP]
X-Unity Test Studio
http://x-unity.miik.com.ua/teststudio.aspx
Bring the power of unit testing to VS .NET IDE

Tom said:
I'm having a problem with both the Alt-Tab icon on my C# project and the
Task Manager Application tab.

1. Alt-Tab. The icon is not the one set in the Properties of the .EXE
project in VS.NET. It's the Windows default application icon. This is not
a problem of the wrong device on the icon (i.e. no 32x32 icon). That's
fine.
2. Task Manager Applications Tab. It just doesn't show up.

Both forms (the splash screen and the main form) have ShowInTaskbar = true.

I'd be grateful for any help you can provide.

Thanks,
Tom Clement

P.S. I think this may be related to the way I'm starting my splashscreen and
main application window. The abbreviated code follows:

// StartShell.cs

static void Main(string[] commandLine)
{
StartShell oStartShell = new StartShell(commandLine);
}

public StartShell(string[] commandLine)
{
SplashScreen frmSplash = new SplashScreen();
frmSplash.Show();

// Do stuff to read config file and load some components.
...
ApplicationShell frmMainApp = new ApplicationShell();

// Pass info to frmMainApp...
frmMainApp.SplashScreen = frmSplash;
...

frmMainApp.ShowDialog();
}

...

// MainApp.cs

.....
private void MainApp_Load(object sender, System.EventArgs e)
{
frmSplash.GoAway(); // Closes the splash screen after a fade
away delay.
}
 
Thanks very much for your help Dmitriy. Yep, you nailed it. I don't know
why I used ShowDialog() instead of Application.Run(). It's embarassing to
think about how much time I spent trying to answer questions like "where
does the task manager get it's list of running applications?", when the
answer was so straightforward ;)

Tom


Dmitriy Lapshin said:
Hi,
frmMainApp.ShowDialog();

This is most likely the line causing the problem. Why don't you use a
sequence like this:

public static void Main()
{
SplashScreen splash = new Splash();
splash.Show();
splash.Update();

MainForm mainForm = new MainForm(args);
form.Splash = splash;

Application.Run(mainForm);
}

and in the MainForm_Load() :
{
// ...
Splash.GoAway();
}

--
Dmitriy Lapshin [C# / .NET MVP]
X-Unity Test Studio
http://x-unity.miik.com.ua/teststudio.aspx
Bring the power of unit testing to VS .NET IDE

Tom said:
I'm having a problem with both the Alt-Tab icon on my C# project and the
Task Manager Application tab.

1. Alt-Tab. The icon is not the one set in the Properties of the .EXE
project in VS.NET. It's the Windows default application icon. This is not
a problem of the wrong device on the icon (i.e. no 32x32 icon). That's
fine.
2. Task Manager Applications Tab. It just doesn't show up.

Both forms (the splash screen and the main form) have ShowInTaskbar = true.

I'd be grateful for any help you can provide.

Thanks,
Tom Clement

P.S. I think this may be related to the way I'm starting my splashscreen and
main application window. The abbreviated code follows:

// StartShell.cs

static void Main(string[] commandLine)
{
StartShell oStartShell = new StartShell(commandLine);
}

public StartShell(string[] commandLine)
{
SplashScreen frmSplash = new SplashScreen();
frmSplash.Show();

// Do stuff to read config file and load some components.
...
ApplicationShell frmMainApp = new ApplicationShell();

// Pass info to frmMainApp...
frmMainApp.SplashScreen = frmSplash;
...

frmMainApp.ShowDialog();
}

...

// MainApp.cs

.....
private void MainApp_Load(object sender, System.EventArgs e)
{
frmSplash.GoAway(); // Closes the splash screen after a fade
away delay.
}
 
Back
Top