Red de conocimiento informático - Conocimiento informático - Cómo hacer que un programa C# emita sonidos

Cómo hacer que un programa C# emita sonidos

usando System.Collections

usando System.ComponentModel

usando System.Windows.Forms

usando System.Runtime; InteropServices

Usando System.Diagnostics

usando System.Management

usando Microsoft.Win32

espacio de nombres XKTSys

{

// <.summary>

// Descripción resumida de frmSplash.

//

clase pública frmSplash: System.Windows.Forms.Forms.

sistema privado.Windows.Forms.PictureBox picReview <; /p>

Sistema privado.Windows.Forms.PictureBox picTest;

Sistema privado.Windows.Forms.PictureBox picExercisePictureBox picExercise

cadena privada strDBPath=""

p>

[DllImport("winmm.dll")]

bool externo estático público PlaySound( string pszSound,int hmod,int fdwSound

); public const int SND_FILENAME= 0x00020000;

public const int SND_ASYNC=0x0001;

frmExercise privado frmExercise1

frmTest privado

frmReview privado frmReview1;

Sistema privado.

frmSplash público()

{

//

/ / Soporte Windows Forms requerido para el diseñador

//

InitializeComponent ();

this.strDBPath=Environment.CurrentDirectory

this.Text =APP_TITLE;

}

//

// El punto de entrada principal de la aplicación.

//

[STAThread]

static void Main()

{

Application.Run(new frmSplash());

}

/ //

// Limpia todos los recursos en uso.

// //

anulación protegida void Dispose( bool disposing )

{

if( disposing )

{

if( componentes ! = nulo)

{

componentes.Dispose()

}

}

}

}

base.Dispose(dispose);

}

#region Código generado por Windows Forms Designer

//

// Designer admite los métodos requeridos; no utilice el editor de código para modificar

//El contenido de este método.

//

private void InitializeComponent()

{

System.Resources.ResourceManager recursos = nuevo System. Resources.ResourceManager(typeof(frmSplash));

this.picExercise = nuevo System.Windows.Forms.PictureBox(typeof(frmSplash));

this.picExercise = nuevo Sistema. Windows.Forms.PictureBox(typeof(frmSplash)).picReview = nuevo System.Windows.Forms.PictureBox();

this.picTest = nuevo System.Windows.Forms.PictureBox(); >

this.picExit = nuevo System.Windows.Forms.PictureBox();

this.picHelp = nuevo System.Windows.Forms.PictureBox()

this.picExercise .Size = new System.Drawing.Size(134, 30);

this.picExercise.SizeMode = SizeMode.AutoSize

this.picExercise.TabIndex = 7; >

this.picExercise.TabStop = false;

this.picExercise.Click+= nuevo System.EventHandler(this.picExercise_Click);

this.picExercise.MouseEnter += nuevo); System.EventHandler( this.picExercise_MouseEnter);

this.picExercise.MouseLeave += nuevo System.EventHandler(this.picExercise_MouseLeave).

/

/ / picReview

/

this.picReview.Cursor = System.Windows.Forms.Cursors.Hand;

this.picReview.Image = ((System. Dibujo .Image)(resources.GetObject("picReview.Image"));

this.picReview.Location = new System.Drawing.Point(225, 216);

this.picReview.SizeMode = System.Windows.Forms.PictureBoxSizeMode.AutoSize;

this.picReview.TabIndex = 8

this.picReview. = falso;

this.picRe

view.Click += new System.EventHttp.

this.picTest.Cursor = System.Windows.Forms.Cursors.Hand;

this.picTest.Image = ((System. Drawing.Image)(resources.GetObject ("picTest.Image")));

this.picTest.Location = new System.Windows.Forms.Cursors.Hand

this; .picTest.Image = ((System.Drawing.Image)(resources.GetObject ("picTest.Image")));