Changeset 155 for trunk/DirectShowSpy/Configuration.h
- Timestamp:
- Dec 27, 2012, 10:53:03 AM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/DirectShowSpy/Configuration.h
r150 r155 237 237 238 238 //////////////////////////////////////////////////////// 239 // CProppageRegistrationPropertyPage 240 241 class CProppageRegistrationPropertyPage : 242 public CPropertyPageT<CProppageRegistrationPropertyPage>, 243 //public CDialogResize<CProppageRegistrationPropertyPage>, 244 public CWindowWithPrivateMessagesT<CProppageRegistrationPropertyPage> 245 { 246 public: 247 enum { IDD = IDD_REGISTRATION_PROPPAGEREGISTRATION_PROPERTYPAGE }; 248 249 BEGIN_MSG_MAP_EX(CProppageRegistrationPropertyPage) 239 // CModuleRegisrtationPropertyPageT 240 241 template <typename T> 242 class CModuleRegisrtationPropertyPageT : 243 public CPropertyPageT<T>, 244 //public CDialogResize<T>, 245 public CWindowWithPrivateMessagesT<T> 246 { 247 protected: 248 typedef CModuleRegisrtationPropertyPageT<T> CModuleRegisrtationPropertyPage; 249 250 public: 251 252 BEGIN_MSG_MAP_EX(CProppageRegistrationPropertyPagCModuleRegisrtationPropertyPage) 250 253 CHAIN_MSG_MAP(CPropertyPage) 251 //CHAIN_MSG_MAP(CDialogResize< CProppageRegistrationPropertyPage>)254 //CHAIN_MSG_MAP(CDialogResize<T>) 252 255 CHAIN_MSG_MAP(CWindowWithPrivateMessages) 253 256 MSG_WM_INITDIALOG(OnInitDialog) 254 COMMAND_ID_HANDLER_EX( IDC_REGISTRATION_PROPPAGEREGISTRATION_REGISTER, OnRegister)255 COMMAND_ID_HANDLER_EX( IDC_REGISTRATION_PROPPAGEREGISTRATION_UNREGISTER, OnUnregister)256 COMMAND_ID_HANDLER_EX( IDC_REGISTRATION_PROPPAGEREGISTRATION_USERREGISTER, OnUserRegister)257 COMMAND_ID_HANDLER_EX( IDC_REGISTRATION_PROPPAGEREGISTRATION_USERUNREGISTER, OnUserUnregister)257 COMMAND_ID_HANDLER_EX(T::IDD + IDC_REGISTER, OnRegister) 258 COMMAND_ID_HANDLER_EX(T::IDD + IDC_UNREGISTER, OnUnregister) 259 COMMAND_ID_HANDLER_EX(T::IDD + IDC_USERREGISTER, OnUserRegister) 260 COMMAND_ID_HANDLER_EX(T::IDD + IDC_USERUNREGISTER, OnUserUnregister) 258 261 REFLECT_NOTIFICATIONS() 259 262 END_MSG_MAP() 260 263 264 public: 265 266 //////////////////////////////////////////////////// 267 // Resource Identifiers 268 269 enum 270 { 271 //IDD_PROPERTYPAGE, 272 IDC_STATUS = 10, 273 IDC_PATH = 11, 274 IDC_REGISTER = 12, 275 IDC_UNREGISTER = 13, 276 IDC_USERSTATUS = 14, 277 IDC_USERPATH = 21, 278 IDC_USERREGISTER = 22, 279 IDC_USERUNREGISTER = 23, 280 IDC_USERNOTE = 24, 281 }; 282 261 283 private: 284 CPath m_sLocalPath; 262 285 CRegistrationPropertySheet& m_PropertySheet; 263 286 CRoEdit m_StatusEdit; … … 275 298 276 299 public: 277 // C ProppageRegistrationPropertyPage278 C ProppageRegistrationPropertyPage(CRegistrationPropertySheet* pPropertySheet) throw() :300 // CModuleRegisrtationPropertyPageT 301 CModuleRegisrtationPropertyPageT(CRegistrationPropertySheet* pPropertySheet) throw() : 279 302 m_PropertySheet(*pPropertySheet) 280 303 { 281 304 } 305 VOID SetLocalPath(const CPath& sLocalPath) 306 { 307 _A(!_tcslen(m_sLocalPath) && _tcslen(sLocalPath)); 308 m_sLocalPath = sLocalPath; 309 } 282 310 VOID UpdateControls() 283 311 { 284 class __declspec(uuid("92A3A302-DA7C-4A1F-BA7E-1802BB5D2D02")) PSFactoryBuffer;285 312 _A(_pAtlModule); 286 const CPath& sLocalPath = m_PropertySheet.m_sPropPagePath; 313 const CPath& sLocalPath = m_sLocalPath; 314 _A(_tcslen(m_sLocalPath)); 315 _A(m_sLocalPath.FileExists()); 287 316 #pragma region System 288 317 //CPath sPath = FindTypeLibraryPath(HKEY_LOCAL_MACHINE); 289 CPath sPath = FindClassPath(HKEY_LOCAL_MACHINE, __uuidof(PSFactoryBuffer));318 CPath sPath = FindClassPath(HKEY_LOCAL_MACHINE, T::GetSampleClassIdentifier()); 290 319 const BOOL bPathEmpty = _tcslen(sPath) == 0; 291 320 m_StatusEdit.SetValue(m_StatusArray[bPathEmpty ? 0 : 1]); … … 318 347 { 319 348 CWaitCursor WaitCursor; 320 m_StatusEdit = GetDlgItem( IDC_REGISTRATION_PROPPAGEREGISTRATION_STATUS);321 m_PathEdit = GetDlgItem( IDC_REGISTRATION_PROPPAGEREGISTRATION_PATH);322 m_RegisterButton = GetDlgItem( IDC_REGISTRATION_PROPPAGEREGISTRATION_REGISTER);323 m_UnregisterButton = GetDlgItem( IDC_REGISTRATION_PROPPAGEREGISTRATION_UNREGISTER);324 m_UserStatusEdit = GetDlgItem( IDC_REGISTRATION_PROPPAGEREGISTRATION_USERSTATUS);325 m_UserPathEdit = GetDlgItem( IDC_REGISTRATION_PROPPAGEREGISTRATION_USERPATH);326 m_UserRegisterButton = GetDlgItem( IDC_REGISTRATION_PROPPAGEREGISTRATION_USERREGISTER);327 m_UserUnregisterButton = GetDlgItem( IDC_REGISTRATION_PROPPAGEREGISTRATION_USERUNREGISTER);328 //_W(m_UserNoteStatic.SubclassWindow(GetDlgItem( IDC_REGISTRATION_PROPPAGEREGISTRATION_USERNOTE)));349 m_StatusEdit = GetDlgItem(T::IDD + IDC_STATUS); 350 m_PathEdit = GetDlgItem(T::IDD + IDC_PATH); 351 m_RegisterButton = GetDlgItem(T::IDD + IDC_REGISTER); 352 m_UnregisterButton = GetDlgItem(T::IDD + IDC_UNREGISTER); 353 m_UserStatusEdit = GetDlgItem(T::IDD + IDC_USERSTATUS); 354 m_UserPathEdit = GetDlgItem(T::IDD + IDC_USERPATH); 355 m_UserRegisterButton = GetDlgItem(T::IDD + IDC_USERREGISTER); 356 m_UserUnregisterButton = GetDlgItem(T::IDD + IDC_USERUNREGISTER); 357 //_W(m_UserNoteStatic.SubclassWindow(GetDlgItem(T::IDD + IDC_USERNOTE))); 329 358 //m_UserNoteStatic.SetIdealHeight(); 330 359 if(GetOsVersion() >= 0x00060000) // Windows Vista or Windows Server 2008 … … 336 365 } 337 366 } 338 _StringHelper::GetCommaSeparatedItems(AtlLoadString( IDC_REGISTRATION_PROPPAGEREGISTRATION_STATUS), m_StatusArray);367 _StringHelper::GetCommaSeparatedItems(AtlLoadString(T::IDD + IDC_STATUS), m_StatusArray); 339 368 _A(m_StatusArray.GetCount() == 2); 340 369 UpdateControls(); … … 372 401 CWaitCursor WaitCursor; 373 402 const BOOL bSilent = !(GetKeyState(VK_SCROLL) & 1); 374 const DWORD nExitCode = ExecuteWait(AtlFormatString(_T("%s \"%s\""), bSilent ? _T("/s") : _T(""), m_ PropertySheet.m_sPropPagePath), TRUE);403 const DWORD nExitCode = ExecuteWait(AtlFormatString(_T("%s \"%s\""), bSilent ? _T("/s") : _T(""), m_sLocalPath), TRUE); 375 404 if(bSilent) 376 405 MessageBeep(nExitCode ? MB_ICONERROR : MB_OK); … … 390 419 CWaitCursor WaitCursor; 391 420 const BOOL bSilent = !(GetKeyState(VK_SCROLL) & 1); 392 const CPath& sPath = m_sPath; //m_ PropertySheet.m_sPropPagePath421 const CPath& sPath = m_sPath; //m_sLocalPath 393 422 const DWORD nExitCode = ExecuteWait(AtlFormatString(_T("%s /u \"%s\""), bSilent ? _T("/s") : _T(""), sPath), TRUE); 394 423 if(bSilent) … … 409 438 CWaitCursor WaitCursor; 410 439 const BOOL bSilent = !(GetKeyState(VK_SCROLL) & 1); 411 const DWORD nExitCode = ExecuteWait(AtlFormatString(_T("%s /i:user /n \"%s\""), bSilent ? _T("/s") : _T(""), m_ PropertySheet.m_sPropPagePath));440 const DWORD nExitCode = ExecuteWait(AtlFormatString(_T("%s /i:user /n \"%s\""), bSilent ? _T("/s") : _T(""), m_sLocalPath)); 412 441 if(bSilent) 413 442 MessageBeep(nExitCode ? MB_ICONERROR : MB_OK); … … 427 456 CWaitCursor WaitCursor; 428 457 const BOOL bSilent = !(GetKeyState(VK_SCROLL) & 1); 429 const DWORD nExitCode = ExecuteWait(AtlFormatString(_T("%s /i:user /n /u \"%s\""), bSilent ? _T("/s") : _T(""), m_PropertySheet.m_sPropPagePath)); 430 if(bSilent) 431 MessageBeep(nExitCode ? MB_ICONERROR : MB_OK); 432 CancelToClose(); 433 } 434 _ATLCATCH(Exception) 435 { 436 AtlExceptionMessageBox(m_hWnd, Exception); 437 } 438 UpdateControls(); 439 return 0; 440 } 458 const DWORD nExitCode = ExecuteWait(AtlFormatString(_T("%s /i:user /n /u \"%s\""), bSilent ? _T("/s") : _T(""), m_sLocalPath)); 459 if(bSilent) 460 MessageBeep(nExitCode ? MB_ICONERROR : MB_OK); 461 CancelToClose(); 462 } 463 _ATLCATCH(Exception) 464 { 465 AtlExceptionMessageBox(m_hWnd, Exception); 466 } 467 UpdateControls(); 468 return 0; 469 } 470 }; 471 472 //////////////////////////////////////////////////////// 473 // CProppageRegistrationPropertyPage 474 475 class CProppageRegistrationPropertyPage : 476 public CModuleRegisrtationPropertyPageT<CProppageRegistrationPropertyPage> 477 { 478 public: 479 enum { IDD = IDD_REGISTRATION_PROPPAGEREGISTRATION_PROPERTYPAGE }; 480 481 BEGIN_MSG_MAP_EX(CProppageRegistrationPropertyPage) 482 CHAIN_MSG_MAP(CModuleRegisrtationPropertyPage) 483 END_MSG_MAP() 484 485 public: 486 // CProppageRegistrationPropertyPage 487 CProppageRegistrationPropertyPage(CRegistrationPropertySheet* pPropertySheet) throw() : 488 CModuleRegisrtationPropertyPageT<CProppageRegistrationPropertyPage>(pPropertySheet) 489 { 490 } 491 static CLSID GetSampleClassIdentifier() throw() 492 { 493 class __declspec(uuid("92A3A302-DA7C-4A1F-BA7E-1802BB5D2D02")) PSFactoryBuffer; 494 return __uuidof(PSFactoryBuffer); 495 } 496 497 // Window message handlers 498 }; 499 500 //////////////////////////////////////////////////////// 501 // CEvrpropRegistrationPropertyPage 502 503 class CEvrpropRegistrationPropertyPage : 504 public CModuleRegisrtationPropertyPageT<CEvrpropRegistrationPropertyPage> 505 { 506 public: 507 enum { IDD = IDD_REGISTRATION_EVRPROPREGISTRATION_PROPERTYPAGE }; 508 509 BEGIN_MSG_MAP_EX(CEvrpropRegistrationPropertyPage) 510 CHAIN_MSG_MAP(CModuleRegisrtationPropertyPage) 511 END_MSG_MAP() 512 513 public: 514 // CEvrpropRegistrationPropertyPage 515 CEvrpropRegistrationPropertyPage(CRegistrationPropertySheet* pPropertySheet) throw() : 516 CModuleRegisrtationPropertyPageT<CEvrpropRegistrationPropertyPage>(pPropertySheet) 517 { 518 } 519 static CLSID GetSampleClassIdentifier() throw() 520 { 521 class __declspec(uuid("7C737B87-2760-4183-B5B4-ACA7C64DD720")) EvrMixerControl; 522 return __uuidof(EvrMixerControl); 523 } 524 525 // Window message handlers 441 526 }; 442 527 … … 444 529 CRegistrationPropertyPage m_RegistrationPropertyPage; 445 530 CProppageRegistrationPropertyPage m_ProppageRegistrationPropertyPage; 446 CPath m_sPropPagePath; 531 CEvrpropRegistrationPropertyPage m_EvrpropRegistrationPropertyPage; 532 CPath m_sProppagePath; 533 CPath m_sEvrpropPath; 447 534 448 535 public: … … 451 538 CPropertySheetT<CRegistrationPropertySheet>(IDS_REGISTRATION_PROPERTYSHEETCAPTION), 452 539 m_RegistrationPropertyPage(this), 453 m_ProppageRegistrationPropertyPage(this) 540 m_ProppageRegistrationPropertyPage(this), 541 m_EvrpropRegistrationPropertyPage(this) 454 542 { 455 543 AddPage(m_RegistrationPropertyPage); 456 544 CPath sDirectory = GetPath(); 457 545 sDirectory.RemoveFileSpec(); 458 m_sPropPagePath.Combine(sDirectory, _T("proppage.dll")); 459 if(m_sPropPagePath.FileExists()) 546 m_sProppagePath.Combine(sDirectory, _T("proppage.dll")); 547 if(m_sProppagePath.FileExists()) 548 { 549 m_ProppageRegistrationPropertyPage.SetLocalPath(m_sProppagePath); 460 550 AddPage(m_ProppageRegistrationPropertyPage); 551 } 552 m_sEvrpropPath.Combine(sDirectory, _T("evrprop.dll")); 553 if(m_sEvrpropPath.FileExists()) 554 { 555 m_EvrpropRegistrationPropertyPage.SetLocalPath(m_sEvrpropPath); 556 AddPage(m_EvrpropRegistrationPropertyPage); 557 } 461 558 } 462 559 BOOL SetInitialPosition()
Note: See TracChangeset
for help on using the changeset viewer.