ArrayList ListOfDevices = new ArrayList(); string Name = String.Empty.PadRight(50); string Version = String.Empty.PadRight(100); bool EndOfDeviceList = false; short index = 0; int DeviceID = 0; [DllImport("avicap32.dll")] protected static extern bool capGetDriverDescriptionA(short wDriverIndex, [MarshalAs(UnmanagedType.VBByRefStr)]ref String lpszName, int cbName, [MarshalAs(UnmanagedType.VBByRefStr)] ref String lpszVer, int cbVer); do { // Get Driver name and version EndOfDeviceList = capGetDriverDescriptionA(index, ref Name, 100, ref Version, 100); // If there was a device add device name to the list if (EndOfDeviceList) ListOfDevices.Add(Name.Trim()); //c1.Items.Add(Name.Trim()); index += 1; } while (!(EndOfDeviceList == false)); foreach (string NameCamera in ListOfDevices) { int i = 0; if (NameCamera == "device name") DeviceID = i; i++; } SendMessage(mCapHwnd, WM_CAP_CONNECT, DeviceID, 0); SendMessage(mCapHwnd, WM_CAP_SET_PREVIEWRATE, 66, 0); //66 SendMessage(mCapHwnd, WM_CAP_SET_PREVIEW, 1, 0);
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)