Пример #1
0
/***********************************************************************
 *      GetThemeString                                      (UXTHEME.@)
 */
HRESULT WINAPI GetThemeString(HTHEME hTheme, int iPartId, int iStateId,
                              int iPropId, LPWSTR pszBuff, int cchMaxBuffChars)
{
    PTHEME_PROPERTY tp;

    TRACE("(%d, %d, %d)\n", iPartId, iStateId, iPropId);
    if(!hTheme)
        return E_HANDLE;

    if(!(tp = MSSTYLES_FindProperty(hTheme, iPartId, iStateId, TMT_FILENAME, iPropId)))
        return E_PROP_ID_UNSUPPORTED;
    return MSSTYLES_GetPropertyString(tp, pszBuff, cchMaxBuffChars);
}
Пример #2
0
/***********************************************************************
 *      GetThemeSysString                                   (UXTHEME.@)
 */
HRESULT WINAPI GetThemeSysString(HTHEME hTheme, int iStringID,
                                 LPWSTR pszStringBuff, int cchMaxStringChars)
{
    PTHEME_PROPERTY tp;

    TRACE("(%p, %d)\n", hTheme, iStringID);
    if(!hTheme)
        return E_HANDLE;
    if(iStringID < TMT_FIRSTSTRING || iStringID > TMT_LASTSTRING) {
        WARN("Unknown StringID: %d\n", iStringID);
        return STG_E_INVALIDPARAMETER;
    }
    if((tp = MSSTYLES_FindMetric(TMT_STRING, iStringID)))
        return MSSTYLES_GetPropertyString(tp, pszStringBuff, cchMaxStringChars);
    return E_PROP_ID_UNSUPPORTED;
}
Пример #3
0
/***********************************************************************
 *      GetThemeEnumValue                                   (UXTHEME.@)
 */
HRESULT WINAPI GetThemeEnumValue(HTHEME hTheme, int iPartId, int iStateId,
                                 int iPropId, int *piVal)
{
    HRESULT hr;
    WCHAR val[60];
    PTHEME_PROPERTY tp;

    TRACE("(%d, %d, %d)\n", iPartId, iStateId, iPropId);
    if(!hTheme)
        return E_HANDLE;

    if(!(tp = MSSTYLES_FindProperty(hTheme, iPartId, iStateId, TMT_ENUM, iPropId)))
        return E_PROP_ID_UNSUPPORTED;

    hr = MSSTYLES_GetPropertyString(tp, val, sizeof(val)/sizeof(val[0]));
    if(FAILED(hr))
        return hr;
    if(!MSSTYLES_LookupEnum(val, iPropId, piVal))
        return E_PROP_ID_UNSUPPORTED;
    return S_OK;
}
Пример #4
0
/***********************************************************************
 *      GetThemeMetric                                      (UXTHEME.@)
 */
HRESULT WINAPI GetThemeMetric(HTHEME hTheme, HDC hdc, int iPartId,
                              int iStateId, int iPropId, int *piVal)
{
    PTHEME_PROPERTY tp;
    WCHAR val[60];
    HRESULT hr;

    TRACE("(%d, %d, %d)\n", iPartId, iStateId, iPropId);
    if(!hTheme)
        return E_HANDLE;

    if(!(tp = MSSTYLES_FindProperty(hTheme, iPartId, iStateId, 0, iPropId)))
        return E_PROP_ID_UNSUPPORTED;
    switch(tp->iPrimitiveType) {
        case TMT_POSITION: /* Only the X coord is retrieved */
        case TMT_MARGINS: /* Only the cxLeftWidth member is retrieved */
        case TMT_INTLIST: /* Only the first int is retrieved */
        case TMT_SIZE:
        case TMT_INT:
            return MSSTYLES_GetPropertyInt(tp, piVal);
        case TMT_BOOL:
            return MSSTYLES_GetPropertyBool(tp, piVal);
        case TMT_COLOR:
            return MSSTYLES_GetPropertyColor(tp, (COLORREF*)piVal);
        case TMT_ENUM:
            hr = MSSTYLES_GetPropertyString(tp, val, sizeof(val)/sizeof(val[0]));
            if(FAILED(hr))
                return hr;
            if(!MSSTYLES_LookupEnum(val, iPropId, piVal))
                return E_PROP_ID_UNSUPPORTED;
            return S_OK;
         case TMT_FILENAME:
             /* Windows does return a value for this, but its value doesn't make sense */
             FIXME("Filename\n");
             break;
    }
    return E_PROP_ID_UNSUPPORTED;
}