WMEncoderApp.SetProperty
The SetProperty method specifies a property that identifies the display state of a UI panel, property page, or window.
Syntax
void WMEncoderApp.SetProperty(
WMENCAPP_PROP_CLASS enumClass,
string bstrProperty,
object Value
);
Parameters
enumClass
[in] Member of a WMENCAPP_PROP_CLASS enumeration type identifying the property class.
bstrProperty
[in] String containing the property.
Value
[in] Object containing the display state.
Return Values
If this method fails, it returns an error number.
Number | Description |
0x80070057 | You must specify the property class as WMENCAPP_PROP_USER. |
Remarks
Any change to the UI by an end user causes the property to change appropriately. The following table lists the properties that are currently defined for Windows Media Encoder.
Property | Type | Description |
View\SesProperties | Boolean | Specifies the display state of the Session Properties panel. |
View\Sources | Boolean | Specifies the display state of the Sources panel. |
View\Audio | Boolean | Specifies the display state of the Audio panel. |
View\Monitor | Boolean | Specifies the display state of the Monitor panel. |
View\Script | Boolean | Specifies the display state of the Annotation panel. |
View\Archive | Boolean | Specifies the display state of the Archive panel. |
View\Video1 | Boolean | Specifies the display state of the Video window. |
View\MonitorPage | Integer | Specifies the property page in the Monitor panel. The varValue parameter can take the following values:
100 = General page. 300 = Display Information page. 600 = Connections page. |
Video1\Zoom | Integer | Identifies the zoom factor for the video window. For example, use 200 to specify 200%. |
Video1\Display | Integer | Identifies the display style of the video window:
0 = Input. 1 = Output. 2 = Both. 3 = Next. 4 = Split. |
Example Code
using WMEncoderLib;
try
{
// Create a WMEncoderApp object.
WMEncoderApp EncoderApp;
EncoderApp = new WMEncoderApp();
// Display the predefined user interface.
EncoderApp.Visible = true;
// Retrieve the user interface properties.
int lHeight;
int lWidth;
int lTop;
int lLeft;
bool bUILock;
object vSourceState;
// Retrieve the height and width, in pixels.
lHeight = EncoderApp.Height;
lWidth = EncoderApp.Width;
// Retrieve the top offset of the user interface.
lTop = EncoderApp.Top;
if (lTop <> 0)
{
lTop = 0;
}
// Retrieve the left offset of the user interface.
lLeft = EncoderApp.Left;
if (lLeft <> 0)
{
lLeft = 0;
}
// Determine whether the user interface is locked.
bUILock = EncoderApp.UILock;
// Display the sources panel.
EncoderApp.SetProperty(WMENCAPP_PROP_CLASS.WMENCAPP_PROP_USER, "View\Sources", true);
// Verify that the sources panel is displayed.
vSourceState = EncoderApp.GetProperty(WMENCAPP_PROP_CLASS.WMENCAPP_PROP_USER, "View\Sources");
EncoderApp.SaveProperties(WMENCAPP_PROP_CLASS.WMENCAPP_PROP_USER);
}
catch (Exception e)
{
// TODO: Handle exceptions.
}
Requirements
Reference: Windows Media Encoder
Namespace: WMEncoderLib
Assembly: Interop.WMEncoderLib.dll
Library: WMEncoderLib.dll
See Also