如何在不打开属性对话框的情况下动态更改过滤器属性? [英] How to change the filter property dynamically without opening the property dialog box?

查看:85
本文介绍了如何在不打开属性对话框的情况下动态更改过滤器属性?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

使用directshow创建视频播放器应用程序,我需要通过我的应用程序对filter属性进行一些更改。我知道如何从我的应用程序中显示属性页面。使用此链接[ http://msdn.microsoft.com/en-us/library/windows/desktop/dd375480(v = vs.85).aspx [ ^ ]]我显示了它当按下控制按钮时。但我不想向最终用户显示属性页面。通过从用户获取值,属性页的特定字段必须更改而不显示属性对话框。我需要做什么!?



感谢你,

Am creating the video player application using directshow and i need to make some changes in the filter property through my application. I know how to display the property page from my application. Using this link [http://msdn.microsoft.com/en-us/library/windows/desktop/dd375480(v=vs.85).aspx[^]] i displayed it when the button contol was pressed. But i don''t want to display the property page to the end user. By getting the value from the user, the particular field of the property page has to change without displaying the property dialog box. What i need to do!?

Thanking you,

推荐答案

我已经知道你了应该知道用于控制其属性的过滤器接口。查询后,界面会过滤您的过滤器对象并使用它来修改过滤器设置。

I already anwering you abt that you should know filter interface which used to control it properties. After query that interface froom your filter object and use it methods to modify filter settings.
IBaseFilter * _filter; // initialized by CoCreateInstance
IFilterControl * _interface;
// Query filter interface
if (S_OK == _filter->QueryInterface(__uuidof(IFilterControl),(void**)&_interface))
{
// Call inerface methods to setup the filter
_interface->SomeMethod("some arg");
_interface->Release(); // release instance
}



所以对你的问题 - 你知道接口guid和它的方法声明,如果它是第三方过滤器吗?

如果你使用自己的过滤器然后只是decalre你自己的界面添加方法并配置你的过滤器。



如果你不知道供应商的界面你可以做的有点棘手:

1 。如果过滤器支持 IPersistStream inerface - 您可以配置过滤器并调用保存方法,该方法将保存所有属性流和初始化期间,您可以使用预设中的设置调用加载

2.另一种方法是在对话框中嵌入OLE属性框但隐藏并通过 SendMessage 手动操作UI以配置设置然后执行应用

3.如果过滤器包含调试信息甚至调试DA tabase里面你可以拆解它并查看界面信息 - 但这可能不合法,你应该检查过滤器的许可证。



问候,

Maxim。


So the question to you - do you know the interface guid and it methods declarations in case if it''s 3rd party filter?
In case if you are using your own filter then just decalre you own interface add methods and configure your filter.

In case if you not knowing the vendor interface you can do it bit tricky:
1. If the filter supports IPersistStream inerface - you can configure filter and call Save method which will do saving all properties to that stream and during initialization you can call Load with settings from your presets.
2. Another method is to embed OLE property frame in your dialog but hiddenly and manually operate with UI via SendMessage to configre settings and then do "Apply"
3. In case of filter consist of debug information or even debug database inside you can disassemble it and see the interface informaion - but this may not be legal and you should check the license of the filter.

Regards,
Maxim.


这篇关于如何在不打开属性对话框的情况下动态更改过滤器属性?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆