Click to See Complete Forum and Search --> : AutoPlay handling in C# App


chrmlim
September 30th, 2005, 09:21 PM
Hi all, I have an application in C++ (unmanaged) that was built to use the IQueryCancelAutoPlay interface and the AllowAutoPlay function to allow the application to determine whether it wants to handle media inserted into the CD/DVD drive or let Windows AutoPlay the media.

See http://msdn.microsoft.com/library/default.asp?url=/library/en-us/shellcc/platform/shell/reference/ifaces/iquerycancelautoplay/iquerycancelautoplay.asp for details.

I want to create a C# application that would do this very same thing. Unfortunately, I have not been able to find anyone who has done this through Google or MSDN.

Would anyone have an idea of where to start? I.e., any methods of importing/invoking the interface into C# would be great.

Thank you!

C

darwen
October 1st, 2005, 05:41 AM
Have a look at my article on accessing/using IUnknown-based interfaces here

http://www.codeguru.com/Csharp/Csharp/cs_misc/com/article.php/c9065/

It might give you what you need.

Darwen.

CynisterSix
October 21st, 2008, 02:46 PM
http://convert.codes-sources.com/file2cs.aspx?ID=47727&f=AutorunLib/AutoplayControler.vb

This code i think is what you are looking for... I have yet to test any of this but it looks like this is the next step.