Mode Property of MCIWNDX.VBX Returns Localized StringsLast reviewed: June 21, 1995Article ID: Q126990 |
The information in this article applies to:
- Professional Edition of Microsoft Visual Basic for Windows, version 3.0 - Microsoft Video for Windows Development Kit, version 1.1 SUMMARY The MCIWNDX.VBX control distributed with the Video for Windows Development Kit version 1.1, has a Mode property containing a localized string that tells you the current state of the control. When this control is used on versions of Windows other than those that use the English language, such as German or French, the Mode is automatically translated into that language. Because of this feature, you must not use a hard coded string literal when checking the Mode property. As an alternative, you can call the Multimedia API mciSendCommand() function. This article shows you how.
MORE INFORMATIONTo determine the state of the MCIWNDX control, you can check the Mode property. However, both the Mode property and the Mode argument to the ModeChange event are represented as localized strings. For example, if the control were playing back a video clip and the Mode property was displayed in the US version of Windows, the word "running" would be displayed. However, in the German version of Windows, the word "Wiedergabe" would be displayed. This makes it impossible to write code like the following that works in all versions of Windows:
If MCIWnd1.Mode = "playing" Then ... End IfThe solution is to use the multimedia API mciSendCommand() function to get the current mode of the MCI device associated with the MCIWndx control. The mciSendCommand() function returns the state of the device as a number instead of a string. The numbers returned by mciSendCommand are constant across all versions of Windows. An example of calling mciSendCommand is shown below.
Step-by-Step Example
|
Additional reference words: 3.00 localize foreign
© 1998 Microsoft Corporation. All rights reserved. Terms of Use. |