T
Tim Bücker
Following scenario:
The user opens a form, a thread is started to play a sound ...
[ThreadStart Method Example]
public void playSoundUsingThread()
{
if (File.Exists(fileLocation))
PlaySound(fileLocation, 0, 0); // winmm.dll
}
.... after that the user immediately closes the form and the music should stop at once!
But using thread.Abort(); doesn´t help as it gives the thread enough time to continue its "singing".
Is it possible to somehow stop the thread at once?
Thanks a lot for any information regarding this point!
Greetings,
Tim.
The user opens a form, a thread is started to play a sound ...
[ThreadStart Method Example]
public void playSoundUsingThread()
{
if (File.Exists(fileLocation))
PlaySound(fileLocation, 0, 0); // winmm.dll
}
.... after that the user immediately closes the form and the music should stop at once!
But using thread.Abort(); doesn´t help as it gives the thread enough time to continue its "singing".
Is it possible to somehow stop the thread at once?
Thanks a lot for any information regarding this point!
Greetings,
Tim.