The information in this article applies to:
SUMMARYIn Word for Windows, there is no intrinsic setting for a password-style edit control. However, you can generate code to perform this function using the existing edit control. To create a dialog box that prompts for a password, use SendMessage (Windows API function call) with the constant of EM_SETPASSWORDCHAR. MORE INFORMATIONMicrosoft provides programming examples for illustration only, without warranty
either expressed or implied, including, but not limited to, the implied warranties of
merchantability and/or fitness for a particular purpose. This article assumes that you
are familiar with the programming language being demonstrated and the tools used to
create and debug procedures. Microsoft support professionals can help explain the functionality
of a particular procedure, but they will not modify these examples to provide added
functionality or construct procedures to meet your specific needs. If you have limited
programming experience, you may want to contact a Microsoft Certified Solution Provider
or the Microsoft fee-based consulting line at (800) 936-5200. For more information about
Microsoft Certified Solution Providers, please see the following page on the World Wide Web:
http://www.microsoft.com/mcsp/For more information about the support options available from Microsoft, please see the following page on the World Wide Web: http://www.microsoft.com/support/supportnet/overview/overview.aspThe following example demonstrates how to design a text box that accepts a user's password as input. It displays an asterisk (*) for each character entered. Use the SendMessage API function call to create this dialog box. After you set the focus to the edit control you want, you must send a message to the window's message queue that resets the displayed character for the control. The argument EM_SETPASSWORDCHAR, as the second parameter to SendMessage, sets the text character you want to display based on the value specified by the third argument. The SendMessage function requires the following parameters for setting the password character:
where:
hWnd Specifies the handle to the edit control. wMsg Specifies the window's message. wParam Specifies the password character to display. lParam Is not used. ExampleWord 7.0
Word 6.0
REFERENCES"Microsoft Software Development Kit (SDK) for Microsoft Windows Operating System Version 3.1" Additional query words: 6.00a winword wordbasic word6 word7 6.00c word95 masked api macro asterisk
Keywords : |
Last Reviewed: July 14, 1999 © 2000 Microsoft Corporation. All rights reserved. Terms of Use. |