GetStateText function
Retrieves a localized string that describes an object's state for a single predefined state bit flag. Because state values are a combination of one or more bit flags, clients call this function more than once to retrieve all state strings.
Syntax
UINT GetStateText( _In_ DWORD dwStateBit, _Out_ LPTSTR lpszStateBit, _In_ UINT cchStateBitMax );
Parameters
- dwStateBit [in]
-
Type: DWORD
One of the object state constants.
- lpszStateBit [out]
-
Type: LPTSTR
Address of a buffer that receives the state text string. If this parameter is NULL, the function returns the state string's length, not including the null character.
- cchStateBitMax [in]
-
Type: UINT
The size of the buffer that is pointed to by the lpszStateBit parameter. For ANSI strings, this value is measured in bytes; for Unicode strings, it is measured in characters.
Return value
Type: UINT
If successful, and if lpszStateBit is non-NULL, the return value is the number of bytes (ANSI strings) or characters (Unicode strings) that are copied into the buffer, not including the null-terminated character. If lpszStateBit is NULL, the return value represents the string's length, not including the null character.
If the string resource does not exist, or if the lpszStateBit parameter is not a valid pointer, the return value is zero (0). To get extended error information, call GetLastError.
Remarks
This function accepts only one state bit at a time, not a bitmask.
Requirements
|
Minimum supported client |
Windows 2000 Professional [desktop apps only] |
|---|---|
|
Minimum supported server |
Windows Server 2003 [desktop apps only] |
|
Redistributable |
Active Accessibility 1.3 RDK on Windows NT 4.0 with SP6 and later and Windows 95 |
|
Header |
|
|
Library |
|
|
DLL |
|
|
Unicode and ANSI names |
GetStateTextW (Unicode) and GetStateTextA (ANSI) |