سؤال

I need to write a function to detect the application name that issued a cd-rom open. Basically I need to listen to DriverChangedEvents in windows(which I know how to do). What I need your help is how to figure out the application name that sent the request to open cd-rom

هل كانت مفيدة؟

المحلول

Create a wrapper winmm.dll for your system which wraps all access to the real winmm.dll. Then look for calls to mciSendString() with arguments like "set cdaudio door open" and "set cdaudio door closed".

Also see this question.

An example of how to wrap a Windows DLL in your own. The source for said example.

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top