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.

  • You can nail the "hacker" way, putting the hook in a separate thread to create windows, asking the window class, and nailing the window, hiding its appearance and clicking on OK, and legally as - a good question. - nick_n_a
  • No matter how, the main thing without admin privileges. I found that if in the task manager to switch from the video device selection application to its process, it will be my process! That is, I need to somehow get the helnd of this window and immediately beat him. And how to get this handle? - Iceman
  • Hook on so and msdn with WH_CBT in parameter - nick_n_a

0