Installable drivers that do not have plug and play capability can supply a configuration dialog box for users to access through the Drivers option in the Control Panel. The Drivers option sends the DRV_CONFIGURE message to your driver to display the dialog box.
The dialog box should display the name and version number of your device driver. If your device driver supports different interrupt-level and port assignments, it should also support user configuration through the Drivers option in the Control Panel.
Installable drivers that do not have plug and play capability can store interrupt-level and port assignments, and any other hardware-related settings, in a section with the same name as the driver in the user's SYSTEM.INI file. For example, the following SYSTEM.INI section created by the Bravado example driver specifies interrupt level 9 and memory base E:
[Bravado.drv]
Interrupt=9
MemoryBase=E
Alternatively, your driver might use its own INI file for this information.
Hardware related settings for plug and play devices is stored in the registry.
Configuring the Channels of a Video Capture Driver
In addition to the configuration dialog box displayed for the DRV_CONFIGURE message, video capture drivers can display a dialog box for each channel. These dialog boxes are the primary means of setting parameters in your device driver. The DVM_DIALOG message requests that the device driver display a dialog box.
When your device driver first gets this message, use the handle in lParam1 to determine which channel is being configured. The sample driver determines the channel from the flags used to open it. It saves these flags as part of its instance data created when it was opened.
The dialog box displayed for each channel sets the characteristics for each channel. If a channel does not support configuration, return DV_ERR_NOTSUPPORTED. The following table suggests the contents of each dialog box:
Channel | Dialog box description |
---|---|
VIDEO_EXTERNALIN | Displays a dialog box controlling how video (either analog or digital) is captured. The dialog box might set attributes such as contrast, brightness, NTSC,. PAL, .and input source |
VIDEO_EXTERNALOUT | Displays a dialog box controlling how video is displayed on a second monitor or video adapter such as a video overlay card. |
VIDEO_IN | Displays a dialog box controlling how video is transferred from the frame buffer. This includes options such as the format of the video, bit rate, and compression format. |
VIDEO_OUT | Displays a dialog box controlling how video is transferred to the frame buffer. |
When processing the DVM_DIALOG message, check lParam2 for the VIDEO_DLG_QUERY flag prior to displaying the dialog box. If an application uses this flag, it is only determining if a video channel supports a dialog box. For this flag, return DV_ERR_OK if the video channel supports a dialog box. If not, return DV_ERR_NOTSUPPORTED in response to the message.
Video capture drivers might save the settings from these dialog boxes in the section reserved for your device driver in the SYSTEM.INI file. Your driver should append this information to the entries created for the DVR_CONFIGURE messages to this section. For example, the Bravado driver might have this section in the SYSTEM.INI file:
[Bravado.drv]
Interrupt=9
MemoryBase=E
Hue=10
Saturation=6
InputChannel=2
Contrast=24
Alternatively, a device driver might implement its own method of storing configuration information for each channel.