Jump to content
Sign in to follow this  
Celtic88

Detection webcam :(

Recommended Posts

Celtic88

how to detect the presence of a webcam on a PC please?

Share this post


Link to post
Share on other sites
JohnOne

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 by JohnOne
  • Like 1

AutoIt Absolute Beginners    Require a serial    Pause Script    Video Tutorials by Morthawt   ipify 

Monkey's are, like, natures humans.

Share this post


Link to post
Share on other sites
Celtic88

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 :wub::D:ILA3:

Another question

Edited by JustBegun

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×