Modifying the Echo Dialog Resource
[The feature associated with this page, Windows Media Player SDK, is a legacy feature. It has been superseded by MediaPlayer. MediaPlayer has been optimized for Windows 10 and Windows 11. Microsoft strongly recommends that new code use MediaPlayer instead of Windows Media Player SDK, when possible. Microsoft suggests that existing code that uses the legacy APIs be rewritten to use the new APIs if possible.]
You need to change the dialog resource that is the user interface for the property page object. You can first change the existing edit box and label to be useful for the delay time property and then add a second edit box and label for the wet mix property.
To edit the dialog resource in Visual C++:
- Click the ResourceView tab in the Project Workspace.
- Expand the resources tree by opening the top level folder.
- Open the Dialog folder.
- Double-click the dialog resource name, IDD_ECHOPROPPAGE. The resource editor appears in the right pane.
Changing the Existing Resources
To change the existing property page resources for the delay time property:
First, change the text in the existing static text control. Right-click the control and then choose Properties. In the Caption field, type the new caption:
Delay time (0 to 2000):
Close the Text Properties dialog box.
Now, change the name of the edit box control. To do this, right-click the control and then choose Properties. In the ID field, type a new name for the control:
IDC_DELAYTIME
Close the Edit Properties dialog box.
Save the resource.
Answer Yes if prompted to reload the file resource.h.
Click the FileView tab in the Project Workspace. Open resource.h
Locate the #define for the scale factor edit box resource (IDC_SCALEFACTOR) and delete it. It should have the same id number as IDC_DELAYTIME.
Adding the New Resources
To add the new property page resources for the wet mix property:
Click the ResourceView tab in the Project Workspace to select it.
Double-click the name of the property page dialog box, IDD_ECHOPROPPAGE. The resource editor appears in the right pane.
Use the toolbox to add a static text control and an edit box to the property page.
Right-click the static text control and choose Properties.
Type a new name for the static text control in the ID field:
IDC_MIXLABEL
Type a caption for the label:
Effect level (%):
Close the Text Properties dialog box.
Right-click the edit box and choose Properties.
Type a new name for the edit box in the ID field:
IDC_WETMIX
Close the Edit Properties dialog box.
When you save the project, you may be prompted to reload resource.h. Click Yes if this happens. The dialog box resource editor should add the resource names and id numbers to resource.h for the items you added. If for some reason this doesn't happen, you must open resource.h and type new entries for the label and edit box control, and assign each a unique id number.
Modifying and Adding the String Resources
The plug-in wizard sample code specifies a string resource named IDS_SCALERANGEERROR that contains a message to display when the user input is out of range. You can modify this resource to suit your needs for the delay time value by following these steps in Visual C++:
Click the ResourceView tab.
Open the String Table folder.
Double-click the String Table icon to open the resource editor.
Double-click the name of the resource you want to edit, in this case, IDS_SCALERANGEERROR. The String Properties dialog box appears.
Change the name in the ID field to IDS_DELAYRANGEERROR.
Change the text in the Caption field:
You must enter a delay time between 0 and 2000 milliseconds.
Close the String Properties dialog box.
Next, add a new string resource for the wet mix property error message.
Double-click the empty line at the bottom of the resource editor.
Change the name in the ID field to IDS_MIXRANGEERROR.
Add the following text to the Caption field:
You must enter an effect level between 0 and 100 percent.
Close the String Properties dialog box.
There are two other values you will want to change in the String Table. IDS_FRIENDLYNAME is the name that appears in the Windows Media Player user interface to identify the plug-in. IDS_DESCRIPTION lets you tell the user about your plug-in. Both of these strings are passed as parameters to the IWMPMediaPluginRegistrar::WMPRegisterPlayerPlugin function, which is called in the DllRegisterServer method in Echodll.cpp.
Related topics