home
products
contribute
download
documentation
forum
Home
Forums
New posts
Search forums
What's new
New posts
All posts
Latest activity
Members
Registered members
Current visitors
Donate
Log in
Register
What's new
Search
Search
Search titles only
By:
New posts
Search forums
Search titles only
By:
Menu
Log in
Register
Navigation
Install the app
Install
More options
Contact us
Close Menu
Forums
MediaPortal 1
Development
General Development (no feature request here!)
Access DirectShow Filter Property Page?
Contact us
RSS
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
<blockquote data-quote="CHli" data-source="post: 74331" data-attributes="member: 13587"><p>Are you using DirectShowNet Library ?</p><p></p><p>Edit : Anyway here is the included sample.</p><p></p><p>You can grab the IPropertyPages from the IBaseFilter no need to have a GraphBuilder.</p><p></p><p>[code]</p><p></p><p>//Some Interop !</p><p>//A (modified) definition of OleCreatePropertyFrame found here: http://groups.google.no/group/microsoft.public.dotnet.languages.csharp/browse_thread/thread/db794e9779144a46/55dbed2bab4cd772?lnk=st&q=[DllImport(%22olepro32.dll%22)]&rnum=1&hl=no#55dbed2bab4cd772</p><p> [DllImport("olepro32.dll")]</p><p> public static extern int OleCreatePropertyFrame(</p><p> IntPtr hwndOwner,</p><p> int x,</p><p> int y,</p><p> [MarshalAs(UnmanagedType.LPWStr)] string lpszCaption,</p><p> int cObjects,</p><p> [MarshalAs(UnmanagedType.Interface, ArraySubType=UnmanagedType.IUnknown)]</p><p> ref object ppUnk,</p><p> int cPages,</p><p> IntPtr lpPageClsID,</p><p> int lcid,</p><p> int dwReserved,</p><p> IntPtr lpvReserved); </p><p></p><p></p><p> /// <summary></p><p> /// Displays a property page for a filter</p><p> /// </summary></p><p> /// <param name="dev">The filter for which to display a property page</param></p><p> private void DisplayPropertyPage(IBaseFilter dev)</p><p> {</p><p> //Get the ISpecifyPropertyPages for the filter</p><p> ISpecifyPropertyPages pProp = dev as ISpecifyPropertyPages;</p><p> int hr = 0;</p><p></p><p> if (pProp == null)</p><p> {</p><p> //If the filter doesn't implement ISpecifyPropertyPages, try displaying IAMVfwCompressDialogs instead!</p><p> IAMVfwCompressDialogs compressDialog = dev as IAMVfwCompressDialogs;</p><p> if (compressDialog != null)</p><p> {</p><p></p><p> hr = compressDialog.ShowDialog(VfwCompressDialogs.Config, IntPtr.Zero);</p><p> DsError.ThrowExceptionForHR(hr);</p><p> }</p><p> return;</p><p> }</p><p></p><p> //Get the name of the filter from the FilterInfo struct</p><p> FilterInfo filterInfo;</p><p> hr = dev.QueryFilterInfo(out filterInfo);</p><p> DsError.ThrowExceptionForHR(hr);</p><p></p><p> // Get the propertypages from the property bag</p><p> DsCAUUID caGUID;</p><p> hr = pProp.GetPages(out caGUID);</p><p> DsError.ThrowExceptionForHR(hr);</p><p></p><p> //Create and display the OlePropertyFrame</p><p> object oDevice = (object)dev;</p><p> hr = OleCreatePropertyFrame(this.Handle, 0, 0, filterInfo.achName, 1, ref oDevice, caGUID.cElems, caGUID.pElems, 0, 0, IntPtr.Zero);</p><p> DsError.ThrowExceptionForHR(hr);</p><p></p><p> // Release COM objects</p><p> Marshal.FreeCoTaskMem(caGUID.pElems);</p><p> Marshal.ReleaseComObject(pProp);</p><p> Marshal.ReleaseComObject(filterInfo.pGraph);</p><p> } [/code]</p></blockquote><p></p>
[QUOTE="CHli, post: 74331, member: 13587"] Are you using DirectShowNet Library ? Edit : Anyway here is the included sample. You can grab the IPropertyPages from the IBaseFilter no need to have a GraphBuilder. [code] //Some Interop ! //A (modified) definition of OleCreatePropertyFrame found here: http://groups.google.no/group/microsoft.public.dotnet.languages.csharp/browse_thread/thread/db794e9779144a46/55dbed2bab4cd772?lnk=st&q=[DllImport(%22olepro32.dll%22)]&rnum=1&hl=no#55dbed2bab4cd772 [DllImport("olepro32.dll")] public static extern int OleCreatePropertyFrame( IntPtr hwndOwner, int x, int y, [MarshalAs(UnmanagedType.LPWStr)] string lpszCaption, int cObjects, [MarshalAs(UnmanagedType.Interface, ArraySubType=UnmanagedType.IUnknown)] ref object ppUnk, int cPages, IntPtr lpPageClsID, int lcid, int dwReserved, IntPtr lpvReserved); /// <summary> /// Displays a property page for a filter /// </summary> /// <param name="dev">The filter for which to display a property page</param> private void DisplayPropertyPage(IBaseFilter dev) { //Get the ISpecifyPropertyPages for the filter ISpecifyPropertyPages pProp = dev as ISpecifyPropertyPages; int hr = 0; if (pProp == null) { //If the filter doesn't implement ISpecifyPropertyPages, try displaying IAMVfwCompressDialogs instead! IAMVfwCompressDialogs compressDialog = dev as IAMVfwCompressDialogs; if (compressDialog != null) { hr = compressDialog.ShowDialog(VfwCompressDialogs.Config, IntPtr.Zero); DsError.ThrowExceptionForHR(hr); } return; } //Get the name of the filter from the FilterInfo struct FilterInfo filterInfo; hr = dev.QueryFilterInfo(out filterInfo); DsError.ThrowExceptionForHR(hr); // Get the propertypages from the property bag DsCAUUID caGUID; hr = pProp.GetPages(out caGUID); DsError.ThrowExceptionForHR(hr); //Create and display the OlePropertyFrame object oDevice = (object)dev; hr = OleCreatePropertyFrame(this.Handle, 0, 0, filterInfo.achName, 1, ref oDevice, caGUID.cElems, caGUID.pElems, 0, 0, IntPtr.Zero); DsError.ThrowExceptionForHR(hr); // Release COM objects Marshal.FreeCoTaskMem(caGUID.pElems); Marshal.ReleaseComObject(pProp); Marshal.ReleaseComObject(filterInfo.pGraph); } [/code] [/QUOTE]
Insert quotes…
Verification
Post reply
Forums
MediaPortal 1
Development
General Development (no feature request here!)
Access DirectShow Filter Property Page?
Contact us
RSS
Top
Bottom