Share via


GetInputScopeSRGS (Compact 7)

3/12/2014

Returns the Speech Recognition Grammar Specification (SRGS) xml string that defines speech recognition rules for an input field.

Syntax

HRESULT GetInputScopeSRGS(
    HWND hwnd,
    LPWSTR *pszSrgs
);

Parameters

  • hwnd
    [in] The handle of the input field to query.
  • pszSrgs
    [out] Returns an SRGS xml string.

Return Value

Returns S_OK if the SRGS data is returned successfully.

Returns ERROR_INVALID_WINDOW_HANDLE if hwnd is NULL, or E_INVALIDARG if hwnd is not a valid handle in the current process.

Returns E_OUTOFMEMORY if it cannot allocate enough memory for the SRGS data to be returned.

Remarks

If the input field does not have a Phrase List set, GetInputScopeSrgs returns NULL in pszSrgs.

Code Example

The following code illustrates how to get SRGS data from a window.

LPWSTR lpWstrSRGS = NULL;
Get InputScopeSrgs(hwnd, &lpWstrSRGS);

Requirements

Header

inputscope.h

See Also

Reference

Input Scope Functions
InputScope
Input Method Editor Reference