Click here to Skip to main content
15,879,535 members
Articles / Desktop Programming / Win32

CD / DVD Tray Locker

Rate me:
Please Sign up or sign in to vote.
4.86/5 (21 votes)
13 Jan 2011CPOL1 min read 31.3K   20  
How to prevent a CD/DVD drive from being opened.

Alternatives

Members may post updates or alternatives to this current article in order to show different approaches or add new features.

Please Sign up or sign in to vote.
13 Jan 2011Steve Maier
To get this to work in .NET 4, you have to change the DLLImport signature.[DllImport("kernel32.dll", SetLastError = true)]private static extern IntPtr CreateFile( string lpFileName, uint dwDesiredAccess, int dwShareMode, ref SECURITY_ATTRIBUTES lpSecurityAttributes, ...

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
CEO Dave Meadowcroft
United Kingdom United Kingdom
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Comments and Discussions