jan1024188_1

Hello,

I have a few questions about C#:

1. How to make the C# application quit Like
PostQuitMessage(0); 
in winapi.

2. Is possible to use same commands in C# like these in C++
PlaySound(); ShellExecute();

Thanks in advance

(have to know some C# basics because the project I work on is for C#)


Re: Visual C# General Make C# application quit??

Timo S

Hi! Welcome to the world of C#!

1.If you want to close C# application, you should type Application.Exit();

2.And yes, you can use that kind of methods in C#. For example there is PlaySound() method in System.Media namespace.

Hope this helps,
Timo Salomaki






Re: Visual C# General Make C# application quit??

Timo S

Code Snippet

using System;

 public class HelloWorld
{
public static void Main()
{
Console.WriteLine("Hello, World!");
}
}

Hello World console program in C#





Re: Visual C# General Make C# application quit??

Ken Tucker

If you only have one open form you can use this.Close();

The other option is Application.Exit();







Re: Visual C# General Make C# application quit??

Bruno_1

Also ShellExecute --> Process.Start(string executablename);
C# is cool !






Re: Visual C# General Make C# application quit??

jan1024188_1

Hi.

Application.Exit(); works great.

I am not writing a console application so I dont need any HelloWorld console ***.