Hi there!
I was wondering if there is a way to prevent that AutoRun feature on CD.
What I'm trying to do, is to make an App for storing musical CD data (like CD library). The problem is, when I want to scan CD for Music titles, Authors and the name of the CD, the media player automaticly starts - I don't want that to happen!
Holding the shift key down will temporarily disable AutoRun. I don't know if you could simulate that with code, though.
Josh
Get these: MozillaOperaOpenBSD
I have books for sale: "MCSD in a Nutshell" and "VB Distributed Exam Cram" - PM me for details. Will also trade for a decent ATX Pentium 2 MB/CPU/RAM combo.
zigona just use keyb_event. It simulates pressing a key.
Private Declare Sub keybd_event Lib "user32.dll" (ByVal bVk As Byte, ByVal bScan As Byte, ByVal dwFlags As Long, ByVal dwExtraInfo As Long)
Private Sub Form_KeyPress(KeyAscii As Integer)
Public Const KEYEVENTF_EXTENDEDKEY = &H1
Public Const KEYEVENTF_KEYUP = &H2
Public Const VK_SHIFT = &H10
then for like form_load
keybd_event VK_SHIFT, 0, 0, 0
and when u want to release it
keybd_event VK_SHIFT, 0, KEYEVENTF_KEYUP, 0
Private Declare Sub keybd_event Lib "user32.dll" (ByVal bVk As Byte, ByVal bScan As Byte, ByVal dwFlags As Long, ByVal dwExtraInfo As Long)
Public Const KEYEVENTF_EXTENDEDKEY = &H1
Public Const KEYEVENTF_KEYUP = &H2
Public Const VK_SHIFT = &H10
then for like form_load
keybd_event VK_SHIFT, 0, 0, 0
and when u want to release it
keybd_event VK_SHIFT, 0, KEYEVENTF_KEYUP, 0
sorry there was not supposed to be a form1_Keypress statement
BTW: Do you know, where can post (or upload) the project I've made (it's using some good code from this site).
I don't want people to have the same problems I had and they can also learn something new (I know I did).