Bonjour à vous,

J'ai un petit soucis, peut être que vous aurez une réponse, je ne trouve rien sur le net...

Je développe un logiciel pour une tablette panasonic, j'ai besoin d'avoir accès son appareil photo dorsal et non frontal.

Mon code marche bien, j'ai rien inventer j'utilise ce que tout le monde connais à savoir (ci-dessous le module) :

Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
Module modcam
 
    Public Const WM_CAP As Short = &H400S
    Public Const WM_CAP_DRIVER_CONNECT As Integer = WM_CAP + 10
    Public Const WM_CAP_DRIVER_DISCONNECT As Integer = WM_CAP + 11
    Public Const WM_CAP_EDIT_COPY As Integer = WM_CAP + 30
    Public Const WM_CAP_SET_PREVIEW As Integer = WM_CAP + 50
    Public Const WM_CAP_SET_PREVIEWRATE As Integer = WM_CAP + 52
    Public Const WM_CAP_SET_SCALE As Integer = WM_CAP + 53
    Public Const WS_CHILD As Integer = &H40000000
    Public Const WS_VISIBLE As Integer = &H10000000
    Public Const SWP_NOMOVE As Short = &H2S
    Public Const SWP_NOSIZE As Short = 1
    Public Const SWP_NOZORDER As Short = &H4S
    Public Const HWND_BOTTOM As Short = 1
    Public iDevice As Integer = 0
    Public hHwnd As Integer
 
    Public Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal hwnd As Integer, ByVal wmsg As Integer, ByVal wparam As Integer, <MarshalAs(UnmanagedType.AsAny)> ByVal lParam As Object) As Integer
    Public Declare Function SetWindowPos Lib "user32" Alias "SetWindowPos" (ByVal hwnd As Integer, ByVal hWndInsertAfter As Integer, ByVal x As Integer, ByVal y As Integer, ByVal cx As Integer, ByVal cy As Integer, ByVal wFlags As Integer) As Integer
    Public Declare Function DestroyWindow Lib "user32" (ByVal hndw As Integer) As Boolean
    Public Declare Function capCreateCaptureWindowA Lib "avicap32.dll" (ByVal lpszWindowName As String, ByVal dwStyle As Integer, ByVal x As Integer, ByVal y As Integer, ByVal nWidth As Integer, ByVal nHeight As Short, ByVal hWndParent As Integer, ByVal nID As Integer) As Integer
    Public Declare Function capGetDriverDescriptionA Lib "avicap32.dll" (ByVal wDriver As Short, ByVal lpszName As String, ByVal cbName As Integer, ByVal lpszVer As String, ByVal cbVer As Integer) As Boolean
 
End Module
Le problème est comme j'ai 2 caméras sur la tablette quand je lance le module, il me mets la fenêtre pour selectionner la caméra. (j'ai essayé de faire varier la variable pour le choix de la caméra, mais elles ont le même pilote)

il y'aurait il un moyen par le code de mettre systhématiquement le 1er choix dans la fenêtre qui s'affiche qui est celle ci :

Nom : Capture.PNG
Affichages : 494
Taille : 34,9 Ko

Je ne sais pas si je me suis bien exprimé mais je sèche depuis 4H sur ce problème....

PS : sur mon PC qui n'a qu'une seule webcam, la fenêtre de dialogue ne s'affiche pas. mes deux appareils sont sur Windows 10