The application takes pictures from the camera ... When you connect to the camera window on some laptops, a dialog for selecting a recording device appears. It must somehow be stopped. The solution proposed here I tested and deleted from the code, as it for some reason does not work. Just in case, here is the camera connection code:
// в WinMain CamAvailable = FindCamDriver(); if(CamAvailable){ DWORD BindingThread; CreateThread(NULL, 0, BindCam, NULL, 0, &BindingThread); } ... // Функции... bool FindCamDriver(){ while(!capGetDriverDescription(CamDeviceDriver, CamDeviceName, sizeof(CamDeviceName), CamDeviceVersion, sizeof(CamDeviceVersion))){ if (++CamDeviceDriver > 9){ return false; } } return true; } DWORD WINAPI BindCam(LPVOID){ while(!capDriverConnect(HStream, CamDeviceDriver)){ continue; } ShowWindow(HStream, SW_SHOW); ShowWindow(FrameButton, SW_SHOW); return 0; } Question: How to deal with this dialog box? Is it possible to intercept him like that and kill him before launching, or should he prescribe somewhere so that it does not appear? If so, how?
Clarification: the client application must also be launched from under the guest, so there is no access to the admin registry keys.
PS: I know, vfw is an outdated technology, but DirectShow MinGW is not friendly, and static links with ffmpeg or opencv will indecently inflate the executable file, and collect them for gcc headache.