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 dont 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 | #include "FilterGraphSpy.h" |
---|
19 | #include "FilterMapperSpy.h" |
---|
20 | #include "SystemDeviceEnumeratorSpy.h" |
---|
21 | |
---|
22 | //////////////////////////////////////////////////////////// |
---|
23 | // DoGraphBuilderCallbackPropertySheetModal |
---|
24 | |
---|
25 | #include "GraphBuilderCallbackPropertySheet.h" |
---|
26 | |
---|
27 | #if defined(_WIN64) |
---|
28 | extern "C" __declspec(dllexport) |
---|
29 | #else |
---|
30 | #pragma comment(linker, "/EXPORT:DoGraphBuilderCallbackPropertySheetModal=_DoGraphBuilderCallbackPropertySheetModal@0,PRIVATE") |
---|
31 | extern "C" // __declspec(dllexport) |
---|
32 | #endif // defined(_WIN64) |
---|
33 | |
---|
34 | HRESULT STDMETHODCALLTYPE DoGraphBuilderCallbackPropertySheetModal() |
---|
35 | { |
---|
36 | _ATLTRY |
---|
37 | { |
---|
38 | CSingleThreadedApartment SingleThreadedApartment; |
---|
39 | _W(AtlInitCommonControls(ICC_WIN95_CLASSES | ICC_COOL_CLASSES | ICC_STANDARD_CLASSES)); |
---|
40 | CGraphBuilderCallbackPropertySheet PropertySheet; |
---|
41 | PropertySheet.DoModal(GetActiveWindow()); |
---|
42 | } |
---|
43 | _ATLCATCH(Exception) |
---|
44 | { |
---|
45 | _C(Exception); |
---|
46 | } |
---|
47 | return S_OK; |
---|
48 | } |
---|
49 | |
---|
50 | //////////////////////////////////////////////////////////// |
---|
51 | // DoFilterGraphListPropertySheetModal |
---|
52 | |
---|
53 | #include "FilterGraphList.h" |
---|
54 | |
---|
55 | #if defined(_WIN64) |
---|
56 | extern "C" __declspec(dllexport) |
---|
57 | #else |
---|
58 | #pragma comment(linker, "/EXPORT:DoFilterGraphListPropertySheetModal=_DoFilterGraphListPropertySheetModal@0,PRIVATE") |
---|
59 | extern "C" // __declspec(dllexport) |
---|
60 | #endif // defined(_WIN64) |
---|
61 | |
---|
62 | HRESULT STDMETHODCALLTYPE DoFilterGraphListPropertySheetModal() |
---|
63 | { |
---|
64 | _ATLTRY |
---|
65 | { |
---|
66 | CSingleThreadedApartment SingleThreadedApartment; |
---|
67 | _W(AtlInitCommonControls(ICC_WIN95_CLASSES | ICC_COOL_CLASSES | ICC_STANDARD_CLASSES)); |
---|
68 | CFilterGraphListPropertySheet PropertySheet; |
---|
69 | PropertySheet.DoModal(GetActiveWindow()); |
---|
70 | } |
---|
71 | _ATLCATCH(Exception) |
---|
72 | { |
---|
73 | _C(Exception); |
---|
74 | } |
---|
75 | return S_OK; |
---|
76 | } |
---|
77 | |
---|
78 | //////////////////////////////////////////////////////////// |
---|
79 | // DoGraphBuilderCallbackPropertySheetModal |
---|
80 | |
---|
81 | #include "MediaSampleTrace.h" |
---|
82 | |
---|
83 | #if defined(_WIN64) |
---|
84 | extern "C" __declspec(dllexport) |
---|
85 | #else |
---|
86 | #pragma comment(linker, "/EXPORT:DoMediaSampleTracePropertySheetModal=_DoMediaSampleTracePropertySheetModal@0,PRIVATE") |
---|
87 | extern "C" // __declspec(dllexport) |
---|
88 | #endif // defined(_WIN64) |
---|
89 | |
---|
90 | HRESULT STDMETHODCALLTYPE DoMediaSampleTracePropertySheetModal() |
---|
91 | { |
---|
92 | _ATLTRY |
---|
93 | { |
---|
94 | CSingleThreadedApartment SingleThreadedApartment; |
---|
95 | _W(AtlInitCommonControls(ICC_WIN95_CLASSES | ICC_COOL_CLASSES | ICC_STANDARD_CLASSES)); |
---|
96 | CMediaSampleTracePropertySheet PropertySheet; |
---|
97 | PropertySheet.DoModal(GetActiveWindow()); |
---|
98 | } |
---|
99 | _ATLCATCH(Exception) |
---|
100 | { |
---|
101 | _C(Exception); |
---|
102 | } |
---|
103 | return S_OK; |
---|
104 | } |
---|
105 | |
---|