Source code of Windows XP (NT5)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

557 lines
16 KiB

  1. // File: videocpl.cpp
  2. #include "precomp.h"
  3. #include "confcpl.h"
  4. #include "help_ids.h"
  5. #include "vidview.h"
  6. #include "confroom.h"
  7. static const DWORD aContextHelpIds[] = {
  8. IDC_SENDRECEIVE_GROUP, IDH_VIDEO_SEND_RECEIVE,
  9. IDC_VIDEO_AUTOSEND, IDH_VIDEO_AUTO_SEND,
  10. IDC_VIDEO_AUTORECEIVE, IDH_VIDEO_AUTO_RECEIVE,
  11. IDC_VIDEO_SQCIF, IDH_VIDEO_SQCIF,
  12. IDC_VIDEO_QCIF, IDH_VIDEO_QCIF,
  13. IDC_VIDEO_CIF, IDH_VIDEO_CIF,
  14. IDC_VIDEO_QUALITY_DESC, IDH_VIDEO_QUALITY,
  15. IDC_VIDEO_QUALITY, IDH_VIDEO_QUALITY,
  16. IDC_VIDEO_QUALITY_LOW, IDH_VIDEO_QUALITY,
  17. IDC_VIDEO_QUALITY_HIGH, IDH_VIDEO_QUALITY,
  18. IDC_CAMERA_GROUP, IDH_VIDEO_CAMERA,
  19. IDC_COMBOCAP, IDH_VIDEO_CAPTURE,
  20. IDC_VIDEO_SOURCE, IDH_VIDEO_SOURCE,
  21. IDC_VIDEO_FORMAT, IDH_VIDEO_FORMAT,
  22. IDC_VIDEO_MIRROR, IDH_VIDEO_MIRROR,
  23. 0, 0 // terminator
  24. };
  25. INT_PTR APIENTRY VideoDlgProc( HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)
  26. {
  27. //BAD KARMA: this stuff should be in a struct and stored in "GWL_USERDATA"
  28. static PROPSHEETPAGE * ps;
  29. static BOOL fAllowSend = FALSE;
  30. static BOOL fAllowReceive = FALSE;
  31. static BOOL fOldAutoSend = FALSE;
  32. static BOOL fOldAutoReceive = FALSE;
  33. static BOOL fOldOpenLocalWindow = FALSE;
  34. static BOOL fOldCloseLocalWindow = FALSE;
  35. static DWORD dwOldQuality = FALSE;
  36. static DWORD dwNewQuality = 0;
  37. static DWORD dwOldFrameSize = 0;
  38. static DWORD dwNewFrameSize = 0;
  39. static BOOL fHasSourceDialog = FALSE;
  40. static BOOL fHasFormatDialog = FALSE;
  41. static BOOL dwFrameSizes = 0;
  42. static int nNumCapDev = 0;
  43. static DWORD dwOldCapDevID = 0;
  44. static DWORD dwNewCapDevID = 0;
  45. static int nMaxCapDevNameLen;
  46. static TCHAR *pszCapDevNames = (TCHAR *)NULL;
  47. static DWORD *pdwCapDevIDs = (DWORD *)NULL;
  48. static LPSTR szOldCapDevName = (LPSTR)NULL;
  49. static BOOL fOldMirror = FALSE;
  50. static CVideoWindow *m_pLocal = NULL;
  51. static CVideoWindow *m_pRemote = NULL;
  52. RegEntry rePolicies( POLICIES_KEY, HKEY_CURRENT_USER );
  53. switch (message) {
  54. case WM_INITDIALOG:
  55. {
  56. RegEntry reVideo(VIDEO_KEY, HKEY_CURRENT_USER);
  57. LPSTR szTemp = (LPSTR)NULL;
  58. // Save the PROPSHEETPAGE information.
  59. ps = (PROPSHEETPAGE *)lParam;
  60. CConfRoom* pcr = ::GetConfRoom();
  61. ASSERT(NULL != pcr);
  62. m_pLocal = pcr->GetLocalVideo();
  63. m_pRemote = pcr->GetRemoteVideo();
  64. ASSERT(NULL != m_pLocal && NULL != m_pRemote);
  65. fAllowSend = m_pLocal->IsXferAllowed();
  66. fAllowReceive = m_pRemote->IsXferAllowed();
  67. fOldAutoSend = m_pLocal->IsAutoXferEnabled();
  68. fOldAutoReceive = m_pRemote->IsAutoXferEnabled();
  69. fOldMirror = m_pLocal->GetMirror();
  70. dwFrameSizes = m_pLocal->GetFrameSizes();
  71. dwNewFrameSize = dwOldFrameSize = m_pLocal->GetFrameSize();
  72. dwNewQuality = dwOldQuality = m_pRemote->GetImageQuality();
  73. // If we have one or more capture devices installed, display its or their
  74. // names in a combo box. The user will be asked to select the device he/she
  75. // wants to use.
  76. if (nNumCapDev = m_pLocal->GetNumCapDev())
  77. {
  78. // Get the ID of the device currently selected
  79. nMaxCapDevNameLen = m_pLocal->GetMaxCapDevNameLen();
  80. dwOldCapDevID = reVideo.GetNumber(REGVAL_CAPTUREDEVICEID, ((UINT)-1));
  81. szTemp = reVideo.GetString(REGVAL_CAPTUREDEVICENAME);
  82. if (szTemp && (szOldCapDevName = (LPSTR)LocalAlloc(LPTR, sizeof(TCHAR) * nMaxCapDevNameLen)))
  83. lstrcpy(szOldCapDevName, szTemp);
  84. dwNewCapDevID = m_pLocal->GetCurrCapDevID();
  85. if ((!((dwOldCapDevID == ((UINT)-1)) || (dwNewCapDevID != dwOldCapDevID))) || (dwNewCapDevID == ((UINT)-1)))
  86. dwNewCapDevID = dwOldCapDevID;
  87. if (nMaxCapDevNameLen && (pdwCapDevIDs = (DWORD *)LocalAlloc(LPTR, nNumCapDev * (sizeof(TCHAR) * nMaxCapDevNameLen + sizeof(DWORD)))))
  88. {
  89. int i;
  90. pszCapDevNames = (TCHAR *)(pdwCapDevIDs + nNumCapDev);
  91. // Fill up the arrey of device IDs and names.
  92. // Only enabled capture devices are returned
  93. m_pLocal->EnumCapDev(pdwCapDevIDs, pszCapDevNames, nNumCapDev);
  94. // Are we still Ok?
  95. nNumCapDev = m_pLocal->GetNumCapDev();
  96. // Fill up the combo box with the capture devices names
  97. for (i=0; i<nNumCapDev; i++)
  98. SendMessage(GetDlgItem(hDlg, IDC_COMBOCAP), CB_INSERTSTRING, i, (LPARAM)(pszCapDevNames + i * nMaxCapDevNameLen));
  99. // Set the default capture device in the combo box
  100. for (i=0; i<nNumCapDev; i++)
  101. {
  102. if (!i)
  103. {
  104. SendMessage(GetDlgItem(hDlg, IDC_COMBOCAP), CB_SETCURSEL, 0, (LPARAM)NULL);
  105. // If for some reason, no device is registered yet, register one
  106. if (dwOldCapDevID == ((UINT)-1))
  107. {
  108. dwNewCapDevID = pdwCapDevIDs[i];
  109. reVideo.SetValue(REGVAL_CAPTUREDEVICEID, dwNewCapDevID);
  110. reVideo.SetValue(REGVAL_CAPTUREDEVICENAME, (LPSTR)(pszCapDevNames + i * nMaxCapDevNameLen));
  111. }
  112. }
  113. else
  114. {
  115. if (dwNewCapDevID == pdwCapDevIDs[i])
  116. {
  117. // The following will allow us to keep the right device
  118. // even if its ID has changed (if a lower ID device was
  119. // removed or added for instance)
  120. if (lstrcmp(szOldCapDevName, (LPSTR)(pszCapDevNames + i * nMaxCapDevNameLen)) != 0)
  121. {
  122. int j;
  123. // Look for the string in the array of device names
  124. for (j=0; j<nNumCapDev; j++)
  125. if (lstrcmp(szOldCapDevName, (LPSTR)(pszCapDevNames + j * nMaxCapDevNameLen)) == 0)
  126. break;
  127. if (j<nNumCapDev)
  128. {
  129. SendMessage(GetDlgItem(hDlg, IDC_COMBOCAP), CB_SETCURSEL, j, (LPARAM)NULL);
  130. if (dwNewCapDevID != (DWORD)j)
  131. {
  132. // The device ID has changed but the device name was found
  133. // Set the current device ID to the new onew
  134. reVideo.SetValue(REGVAL_CAPTUREDEVICEID, dwNewCapDevID = (DWORD)j);
  135. m_pLocal->SetCurrCapDevID(dwNewCapDevID);
  136. }
  137. }
  138. else
  139. {
  140. // This is either a totally new device or an updated version of the
  141. // driver. We should store the new string for that device
  142. reVideo.SetValue(REGVAL_CAPTUREDEVICENAME, (LPSTR)(pszCapDevNames + i * nMaxCapDevNameLen));
  143. SendMessage(GetDlgItem(hDlg, IDC_COMBOCAP), CB_SETCURSEL, i, (LPARAM)NULL);
  144. }
  145. }
  146. else
  147. SendMessage(GetDlgItem(hDlg, IDC_COMBOCAP), CB_SETCURSEL, i, (LPARAM)NULL);
  148. }
  149. else
  150. {
  151. if ((dwNewCapDevID >= (DWORD)nNumCapDev) || (dwNewCapDevID != pdwCapDevIDs[dwNewCapDevID]))
  152. {
  153. // Device is missing! Use the first one as the new default
  154. dwNewCapDevID = pdwCapDevIDs[0];
  155. reVideo.SetValue(REGVAL_CAPTUREDEVICEID, dwNewCapDevID);
  156. reVideo.SetValue(REGVAL_CAPTUREDEVICENAME, (LPSTR)(pszCapDevNames));
  157. m_pLocal->SetCurrCapDevID(dwNewCapDevID);
  158. }
  159. }
  160. }
  161. }
  162. }
  163. }
  164. else
  165. EnableWindow(GetDlgItem(hDlg, IDC_COMBOCAP), FALSE);
  166. // The dialog caps need to be evaluated
  167. fHasSourceDialog = m_pLocal->IsXferEnabled() &&
  168. m_pLocal->HasDialog(NM_VIDEO_SOURCE_DIALOG);
  169. fHasFormatDialog = m_pLocal->IsXferEnabled() &&
  170. m_pLocal->HasDialog(NM_VIDEO_FORMAT_DIALOG);
  171. ///////////////////////////////////////////////////////////
  172. //
  173. // Sending and Receiving Video
  174. //
  175. EnableWindow(GetDlgItem(hDlg, IDC_VIDEO_AUTOSEND),
  176. fAllowSend && (0 != dwFrameSizes));
  177. CheckDlgButton(hDlg, IDC_VIDEO_AUTOSEND,
  178. fAllowSend && fOldAutoSend);
  179. EnableWindow(GetDlgItem(hDlg, IDC_VIDEO_AUTORECEIVE), fAllowReceive);
  180. CheckDlgButton(hDlg, IDC_VIDEO_AUTORECEIVE,
  181. fAllowReceive && fOldAutoReceive);
  182. ///////////////////////////////////////////////////////////
  183. //
  184. // Video Image
  185. //
  186. EnableWindow(GetDlgItem(hDlg, IDC_VIDEO_SQCIF),
  187. fAllowSend && (dwFrameSizes & FRAME_SQCIF));
  188. EnableWindow(GetDlgItem(hDlg, IDC_VIDEO_QCIF),
  189. fAllowSend && (dwFrameSizes & FRAME_QCIF));
  190. EnableWindow(GetDlgItem(hDlg, IDC_VIDEO_CIF),
  191. fAllowSend && (dwFrameSizes & FRAME_CIF));
  192. switch (dwOldFrameSize & dwFrameSizes)
  193. {
  194. case FRAME_SQCIF:
  195. CheckDlgButton(hDlg, IDC_VIDEO_SQCIF, TRUE);
  196. break;
  197. case FRAME_CIF:
  198. CheckDlgButton(hDlg, IDC_VIDEO_CIF, TRUE);
  199. break;
  200. case FRAME_QCIF:
  201. default:
  202. CheckDlgButton(hDlg, IDC_VIDEO_QCIF, TRUE);
  203. break;
  204. }
  205. EnableWindow(GetDlgItem(hDlg, IDC_VIDEO_QUALITY),
  206. fAllowReceive);
  207. EnableWindow(GetDlgItem(hDlg, IDC_VIDEO_QUALITY_DESC),
  208. fAllowReceive);
  209. EnableWindow(GetDlgItem(hDlg, IDC_VIDEO_QUALITY_LOW),
  210. fAllowReceive);
  211. EnableWindow(GetDlgItem(hDlg, IDC_VIDEO_QUALITY_HIGH),
  212. fAllowReceive);
  213. SendDlgItemMessage (hDlg, IDC_VIDEO_QUALITY, TBM_SETRANGE, FALSE,
  214. MAKELONG (NM_VIDEO_MIN_QUALITY, NM_VIDEO_MAX_QUALITY ));
  215. SendDlgItemMessage (hDlg, IDC_VIDEO_QUALITY, TBM_SETTICFREQ,
  216. ( NM_VIDEO_MAX_QUALITY - NM_VIDEO_MIN_QUALITY )
  217. / 8, 0 );
  218. SendDlgItemMessage (hDlg, IDC_VIDEO_QUALITY, TBM_SETPAGESIZE,
  219. 0, ( NM_VIDEO_MAX_QUALITY - NM_VIDEO_MIN_QUALITY ) / 8 );
  220. SendDlgItemMessage (hDlg, IDC_VIDEO_QUALITY, TBM_SETLINESIZE,
  221. 0, 1 );
  222. SendDlgItemMessage (hDlg, IDC_VIDEO_QUALITY, TBM_SETPOS, TRUE,
  223. dwOldQuality );
  224. ///////////////////////////////////////////////////////////
  225. //
  226. // Video Card and Camera
  227. //
  228. EnableWindow(GetDlgItem(hDlg, IDC_VIDEO_SOURCE), fAllowSend && fHasSourceDialog);
  229. EnableWindow(GetDlgItem(hDlg, IDC_VIDEO_FORMAT), fAllowSend && fHasFormatDialog);
  230. // mirror video button
  231. EnableWindow(GetDlgItem(hDlg, IDC_VIDEO_MIRROR), fAllowSend);
  232. Button_SetCheck(GetDlgItem(hDlg, IDC_VIDEO_MIRROR), fOldMirror);
  233. return (TRUE);
  234. }
  235. case WM_NOTIFY:
  236. switch (((NMHDR FAR *) lParam)->code) {
  237. case PSN_APPLY:
  238. {
  239. BOOL fChecked;
  240. ///////////////////////////////////////////////////////////
  241. //
  242. // Sending and Receiving Video
  243. //
  244. if (fAllowSend)
  245. {
  246. fChecked = IsDlgButtonChecked(hDlg, IDC_VIDEO_AUTOSEND);
  247. if ( fChecked != fOldAutoSend )
  248. {
  249. m_pLocal->EnableAutoXfer(fChecked);
  250. g_dwChangedSettings |= CSETTING_L_VIDEO;
  251. }
  252. }
  253. if (fAllowReceive)
  254. {
  255. fChecked = IsDlgButtonChecked(hDlg, IDC_VIDEO_AUTORECEIVE);
  256. if ( fChecked != fOldAutoReceive ) {
  257. m_pRemote->EnableAutoXfer(fChecked);
  258. g_dwChangedSettings |= CSETTING_L_VIDEO;
  259. }
  260. }
  261. ///////////////////////////////////////////////////////////
  262. //
  263. // Video Image
  264. //
  265. if (dwNewFrameSize != dwOldFrameSize )
  266. {
  267. g_dwChangedSettings |= CSETTING_L_VIDEOSIZE;
  268. }
  269. if ( dwNewQuality != dwOldQuality )
  270. {
  271. g_dwChangedSettings |= CSETTING_L_VIDEO;
  272. }
  273. ///////////////////////////////////////////////////////////
  274. //
  275. // Capture Device
  276. //
  277. if (dwNewCapDevID != dwOldCapDevID)
  278. {
  279. g_dwChangedSettings |= CSETTING_L_CAPTUREDEVICE;
  280. }
  281. break;
  282. }
  283. case PSN_RESET:
  284. {
  285. // restore settings
  286. if ( dwNewQuality != dwOldQuality )
  287. {
  288. m_pRemote->SetImageQuality(dwOldQuality);
  289. }
  290. if ( dwNewFrameSize != dwOldFrameSize )
  291. {
  292. m_pLocal->SetFrameSize(dwOldFrameSize);
  293. }
  294. if (dwNewCapDevID != dwOldCapDevID)
  295. {
  296. // Set the capture device ID back to its old value
  297. RegEntry reVideo(VIDEO_KEY, HKEY_CURRENT_USER);
  298. reVideo.SetValue(REGVAL_CAPTUREDEVICEID, dwOldCapDevID);
  299. reVideo.SetValue(REGVAL_CAPTUREDEVICENAME, szOldCapDevName);
  300. m_pLocal->SetCurrCapDevID(dwOldCapDevID);
  301. }
  302. m_pLocal->SetMirror(fOldMirror);
  303. }
  304. }
  305. break;
  306. case WM_COMMAND:
  307. switch (LOWORD(wParam)) {
  308. case IDC_VIDEO_SOURCE:
  309. if ( HIWORD(wParam) == BN_CLICKED ) {
  310. m_pLocal->ShowDialog(NM_VIDEO_SOURCE_DIALOG);
  311. }
  312. break;
  313. case IDC_VIDEO_FORMAT:
  314. if ( HIWORD(wParam) == BN_CLICKED ) {
  315. m_pLocal->ShowDialog(NM_VIDEO_FORMAT_DIALOG);
  316. }
  317. break;
  318. case IDC_VIDEO_SQCIF:
  319. if (( HIWORD(wParam) == BN_CLICKED )
  320. && (dwNewFrameSize != FRAME_SQCIF))
  321. {
  322. dwNewFrameSize = FRAME_SQCIF;
  323. m_pLocal->SetFrameSize(dwNewFrameSize);
  324. }
  325. break;
  326. case IDC_VIDEO_CIF:
  327. if (( HIWORD(wParam) == BN_CLICKED )
  328. && (dwNewFrameSize != FRAME_CIF))
  329. {
  330. dwNewFrameSize = FRAME_CIF;
  331. m_pLocal->SetFrameSize(dwNewFrameSize);
  332. }
  333. break;
  334. case IDC_VIDEO_QCIF:
  335. if (( HIWORD(wParam) == BN_CLICKED )
  336. && (dwNewFrameSize != FRAME_QCIF))
  337. {
  338. dwNewFrameSize = FRAME_QCIF;
  339. m_pLocal->SetFrameSize(dwNewFrameSize);
  340. }
  341. break;
  342. case IDC_VIDEO_MIRROR:
  343. if ((HIWORD(wParam) == BN_CLICKED))
  344. {
  345. BOOL bRet;
  346. bRet = Button_GetCheck((HWND)lParam);
  347. if (m_pLocal)
  348. {
  349. m_pLocal->SetMirror(bRet);
  350. }
  351. }
  352. case IDC_COMBOCAP:
  353. if (LBN_SELCHANGE == HIWORD(wParam))
  354. {
  355. int index;
  356. RegEntry reVideo(VIDEO_KEY, HKEY_CURRENT_USER);
  357. index = (int)SendMessage(GetDlgItem(hDlg, IDC_COMBOCAP), CB_GETCURSEL, 0, 0);
  358. dwNewCapDevID = pdwCapDevIDs[index];
  359. reVideo.SetValue(REGVAL_CAPTUREDEVICEID, dwNewCapDevID);
  360. reVideo.SetValue(REGVAL_CAPTUREDEVICENAME, (LPSTR)(pszCapDevNames + index * nMaxCapDevNameLen));
  361. if (dwNewCapDevID != (DWORD)m_pLocal->GetCurrCapDevID())
  362. {
  363. m_pLocal->SetCurrCapDevID(dwNewCapDevID);
  364. // The dialog caps need to be reevaluated
  365. fHasSourceDialog = m_pLocal->IsXferEnabled() &&
  366. m_pLocal->HasDialog(NM_VIDEO_SOURCE_DIALOG);
  367. fHasFormatDialog = m_pLocal->IsXferEnabled() &&
  368. m_pLocal->HasDialog(NM_VIDEO_FORMAT_DIALOG);
  369. EnableWindow(GetDlgItem(hDlg, IDC_VIDEO_SOURCE), fAllowSend && fHasSourceDialog);
  370. EnableWindow(GetDlgItem(hDlg, IDC_VIDEO_FORMAT), fAllowSend && fHasFormatDialog);
  371. // Update the size buttons
  372. dwFrameSizes = m_pLocal->GetFrameSizes();
  373. EnableWindow(GetDlgItem(hDlg, IDC_VIDEO_SQCIF), fAllowSend && (dwFrameSizes & FRAME_SQCIF));
  374. if (dwNewFrameSize & FRAME_SQCIF)
  375. {
  376. if (dwFrameSizes & FRAME_SQCIF)
  377. CheckDlgButton(hDlg, IDC_VIDEO_SQCIF, TRUE);
  378. else
  379. {
  380. if (dwFrameSizes & FRAME_QCIF)
  381. dwNewFrameSize = FRAME_QCIF;
  382. else if (dwFrameSizes & FRAME_CIF)
  383. dwNewFrameSize = FRAME_CIF;
  384. CheckDlgButton(hDlg, IDC_VIDEO_SQCIF, FALSE);
  385. }
  386. }
  387. else
  388. {
  389. CheckDlgButton(hDlg, IDC_VIDEO_SQCIF, FALSE);
  390. }
  391. EnableWindow(GetDlgItem(hDlg, IDC_VIDEO_QCIF), fAllowSend && (dwFrameSizes & FRAME_QCIF));
  392. if (dwNewFrameSize & FRAME_QCIF)
  393. {
  394. if (dwFrameSizes & FRAME_QCIF)
  395. CheckDlgButton(hDlg, IDC_VIDEO_QCIF, TRUE);
  396. else
  397. {
  398. if (dwFrameSizes & FRAME_SQCIF)
  399. {
  400. dwNewFrameSize = FRAME_SQCIF;
  401. CheckDlgButton(hDlg, IDC_VIDEO_SQCIF, TRUE);
  402. }
  403. else if (dwFrameSizes & FRAME_CIF)
  404. dwNewFrameSize = FRAME_CIF;
  405. CheckDlgButton(hDlg, IDC_VIDEO_QCIF, FALSE);
  406. }
  407. }
  408. else
  409. {
  410. CheckDlgButton(hDlg, IDC_VIDEO_QCIF, FALSE);
  411. }
  412. EnableWindow(GetDlgItem(hDlg, IDC_VIDEO_CIF), fAllowSend && (dwFrameSizes & FRAME_CIF));
  413. if (dwNewFrameSize & FRAME_CIF)
  414. {
  415. if (dwFrameSizes & FRAME_CIF)
  416. CheckDlgButton(hDlg, IDC_VIDEO_CIF, TRUE);
  417. else
  418. {
  419. if (dwFrameSizes & FRAME_QCIF)
  420. {
  421. dwNewFrameSize = FRAME_QCIF;
  422. CheckDlgButton(hDlg, IDC_VIDEO_QCIF, TRUE);
  423. }
  424. else if (dwFrameSizes & FRAME_SQCIF)
  425. {
  426. dwNewFrameSize = FRAME_SQCIF;
  427. CheckDlgButton(hDlg, IDC_VIDEO_SQCIF, TRUE);
  428. }
  429. CheckDlgButton(hDlg, IDC_VIDEO_CIF, FALSE);
  430. }
  431. }
  432. else
  433. {
  434. CheckDlgButton(hDlg, IDC_VIDEO_CIF, FALSE);
  435. }
  436. m_pLocal->SetFrameSize(dwNewFrameSize);
  437. }
  438. }
  439. break;
  440. }
  441. break;
  442. case WM_HSCROLL:
  443. if (TB_ENDTRACK == LOWORD(wParam))
  444. {
  445. DWORD dwValue = (DWORD)SendDlgItemMessage( hDlg, IDC_VIDEO_QUALITY,
  446. TBM_GETPOS, 0, 0 );
  447. if ( dwValue != dwNewQuality ) {
  448. dwNewQuality = dwValue;
  449. m_pRemote->SetImageQuality(dwNewQuality);
  450. }
  451. }
  452. break;
  453. case WM_DESTROY:
  454. if (pdwCapDevIDs)
  455. {
  456. LocalFree(pdwCapDevIDs);
  457. pdwCapDevIDs = (DWORD *)NULL;
  458. }
  459. if (szOldCapDevName)
  460. {
  461. LocalFree(szOldCapDevName);
  462. szOldCapDevName = (LPSTR)NULL;
  463. }
  464. break;
  465. case WM_CONTEXTMENU:
  466. DoHelpWhatsThis(wParam, aContextHelpIds);
  467. break;
  468. case WM_HELP:
  469. DoHelp(lParam, aContextHelpIds);
  470. break;
  471. }
  472. return (FALSE);
  473. }
  474.