source: trunk/DirectShowSpy/FilterGraphSpy.cpp @ 440

Last change on this file since 440 was 440, checked in by roman, 7 years ago

Added media sample trace API and UI

  • Property svn:keywords set to Id
File size: 3.3 KB
Line 
1////////////////////////////////////////////////////////////
2// Copyright (C) Roman Ryltsov, 2008-2015
3// Created by Roman Ryltsov roman@alax.info, http://alax.info
4//
5// This source code is published to complement DirectShowSpy developer powertoy
6// and demonstrate the internal use of APIs and tricks powering the tool. It is
7// allowed to freely re-use the portions of the code in other projects, commercial
8// or otherwise (provided that you don’t pretend that you wrote the original tool).
9//
10// Please keep in mind that DirectShowSpy is a developer tool, it is strongly recommended
11// that it is not shipped with release grade software. It is allowed to distribute
12// DirectShowSpy if only it is not registered with Windows by default and either
13// used privately, or registered on specific throubleshooting request. The advice applies
14// to hooking methods used by DirectShowSpy in general as well.
15
16#include "stdafx.h"
17#include "resource.h"
18
19////////////////////////////////////////////////////////////
20// DoGraphBuilderCallbackPropertySheetModal
21
22#include "GraphBuilderCallbackPropertySheet.h"
23
24#if defined(_WIN64)
25        extern "C" __declspec(dllexport) 
26#else
27        #pragma comment(linker, "/EXPORT:DoGraphBuilderCallbackPropertySheetModal=_DoGraphBuilderCallbackPropertySheetModal@0,PRIVATE")
28        extern "C" // __declspec(dllexport)
29#endif // defined(_WIN64)
30
31HRESULT STDMETHODCALLTYPE DoGraphBuilderCallbackPropertySheetModal()
32{
33        _ATLTRY
34        {
35                CSingleThreadedApartment SingleThreadedApartment;
36                _W(AtlInitCommonControls(ICC_WIN95_CLASSES | ICC_COOL_CLASSES | ICC_STANDARD_CLASSES));
37                CGraphBuilderCallbackPropertySheet PropertySheet;
38                PropertySheet.DoModal(GetActiveWindow());
39        }
40        _ATLCATCH(Exception)
41        {
42                _C(Exception);
43        }
44        return S_OK;
45}
46
47////////////////////////////////////////////////////////////
48// DoFilterGraphListPropertySheetModal
49
50#include "FilterGraphList.h"
51
52#if defined(_WIN64)
53        extern "C" __declspec(dllexport) 
54#else
55        #pragma comment(linker, "/EXPORT:DoFilterGraphListPropertySheetModal=_DoFilterGraphListPropertySheetModal@0,PRIVATE")
56        extern "C" // __declspec(dllexport)
57#endif // defined(_WIN64)
58
59HRESULT STDMETHODCALLTYPE DoFilterGraphListPropertySheetModal()
60{
61        _ATLTRY
62        {
63                CSingleThreadedApartment SingleThreadedApartment;
64                _W(AtlInitCommonControls(ICC_WIN95_CLASSES | ICC_COOL_CLASSES | ICC_STANDARD_CLASSES));
65                CFilterGraphListPropertySheet PropertySheet;
66                PropertySheet.DoModal(GetActiveWindow());
67        }
68        _ATLCATCH(Exception)
69        {
70                _C(Exception);
71        }
72        return S_OK;
73}
74
75////////////////////////////////////////////////////////////
76// DoGraphBuilderCallbackPropertySheetModal
77
78#include "MediaSampleTrace.h"
79
80#if defined(_WIN64)
81        extern "C" __declspec(dllexport) 
82#else
83        #pragma comment(linker, "/EXPORT:DoMediaSampleTracePropertySheetModal=_DoMediaSampleTracePropertySheetModal@0,PRIVATE")
84        extern "C" // __declspec(dllexport)
85#endif // defined(_WIN64)
86
87HRESULT STDMETHODCALLTYPE DoMediaSampleTracePropertySheetModal()
88{
89        _ATLTRY
90        {
91                CSingleThreadedApartment SingleThreadedApartment;
92                _W(AtlInitCommonControls(ICC_WIN95_CLASSES | ICC_COOL_CLASSES | ICC_STANDARD_CLASSES));
93                CMediaSampleTracePropertySheet PropertySheet;
94                PropertySheet.DoModal(GetActiveWindow());
95        }
96        _ATLCATCH(Exception)
97        {
98                _C(Exception);
99        }
100        return S_OK;
101}
102
Note: See TracBrowser for help on using the repository browser.