c# - Why windows media player is not closing with player.Close() method? -



c# - Why windows media player is not closing with player.Close() method? -

i creating media player object in simple console application, play file. though media player getting launched successfully, when using close() method, process still runs , media player window not close. needs done? here code wrote..

windowsmediaplayer player= new windowsmediaplayer(); player.openplayer("c:\\abc.wmv"); thread.sleep(2000); player.controls.stop(); player.close();

here process doesn't exit , file still keeps running. how can close application?

the automation interface doesn't have way forcefulness player exit. less ideal approach kill it:

var prc = process.getprocessesbyname("wmplayer"); if (prc.length > 0) prc[prc.length - 1].kill();

the improve mouse trap embed player own gui, easy winforms.

c# windows-media-player wmplib

Comments

Popular posts from this blog

How do I check if an insert was successful with MySQLdb in Python? -

delphi - blogger via idHTTP : error 400 bad request -

postgresql - ERROR: operator is not unique: unknown + unknown -