Celtic88 Posted April 13, 2013 Posted April 13, 2013 how to detect the presence of a webcam on a PC please?
JohnOne Posted April 13, 2013 Posted April 13, 2013 (edited) I'd probably start with something like this $StructName = DllStructCreate("char[1024]") $StructDesc = DllStructCreate("char[1024]") For $i = 0 To 9 $aRslt = DllCall("Avicap32.dll", "bool", "capGetDriverDescription", "dword", $i, "ptr", DllStructGetPtr($StructName), "dword", DllStructGetSize($StructName), "ptr", DllStructGetPtr($StructDesc), "dword", DllStructGetSize($StructDesc)) If @error Then Exit (MsgBox(0, "DllCall Error", @error)) EndIf If $aRslt[0] Then ConsoleWrite(DllStructGetData($StructName, 1) & @LF & DllStructGetData($StructDesc, 1) & @LF & @LF) EndIf Next EDIT: I get no results from this, but I have no webcams, so I cannot say if it works one way or the other. But the idea is, if you have webcam drivers installed, it's likely you have a webcam installed. Edited April 13, 2013 by JohnOne Celtic88 1 AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans.
Celtic88 Posted April 13, 2013 Author Posted April 13, 2013 (edited) I'd probably start with something like this $StructName = DllStructCreate("char[1024]") $StructDesc = DllStructCreate("char[1024]") For $i = 0 To 9 $aRslt = DllCall("Avicap32.dll", "bool", "capGetDriverDescription", "dword", $i, "ptr", DllStructGetPtr($StructName), "dword", DllStructGetSize($StructName), "ptr", DllStructGetPtr($StructDesc), "dword", DllStructGetSize($StructDesc)) If @error Then Exit (MsgBox(0, "DllCall Error", @error)) EndIf If $aRslt[0] Then ConsoleWrite(DllStructGetData($StructName, 1) & @LF & DllStructGetData($StructDesc, 1) & @LF & @LF) EndIf Next EDIT: I get no results from this, but I have no webcams, so I cannot say if it works one way or the other. But the idea is, if you have webcam drivers installed, it's likely you have a webcam installed. OMG WORK LIKE A CHARM THANK YOU JohnOn YOURE A LEGEND Another question Edited April 13, 2013 by JustBegun
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now