ReactOS 0.4.15-dev-7906-g1b85a5f
uxundoc.h File Reference
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  tagTHEMENAMES
 

Macros

#define DNCP_ACTIVEWINDOW   0x1
 
#define DNCP_INACTIVEWINDOW   0x2
 
#define DNCP_DIALOGWINDOW   0x4
 
#define DNCP_DRAW_ALL   DNCP_ACTIVEWINDOW | DNCP_INACTIVEWINDOW | DNCP_DIALOGWINDOW
 

Typedefs

typedef HANDLE HTHEMEFILE
 
typedef BOOL(CALLBACKENUMTHEMEPROC) (LPVOID lpReserved, LPCWSTR pszThemeFileName, LPCWSTR pszThemeName, LPCWSTR pszToolTip, LPVOID lpReserved2, LPVOID lpData)
 
typedef BOOL(CALLBACKPARSETHEMEINIFILEPROC) (DWORD dwType, LPWSTR pszParam1, LPWSTR pszParam2, LPWSTR pszParam3, DWORD dwParam, LPVOID lpData)
 
typedef struct tagTHEMENAMES THEMENAMES
 
typedef struct tagTHEMENAMESPTHEMENAMES
 

Functions

DWORD WINAPI QueryThemeServices (void)
 
HRESULT WINAPI OpenThemeFile (LPCWSTR pszThemeFileName, LPCWSTR pszColorName, LPCWSTR pszSizeName, HTHEMEFILE *hThemeFile, DWORD unknown)
 
HRESULT WINAPI CloseThemeFile (HTHEMEFILE hThemeFile)
 
HRESULT WINAPI ApplyTheme (HTHEMEFILE hThemeFile, char *unknown, HWND hWnd)
 
HRESULT WINAPI GetThemeDefaults (LPCWSTR pszThemeFileName, LPWSTR pszColorName, DWORD dwColorNameLen, LPWSTR pszSizeName, DWORD dwSizeNameLen)
 
HRESULT WINAPI EnumThemes (LPCWSTR pszThemePath, ENUMTHEMEPROC callback, LPVOID lpData)
 
HRESULT WINAPI EnumThemeColors (LPWSTR pszThemeFileName, LPWSTR pszSizeName, DWORD dwColorNum, PTHEMENAMES pszColorNames)
 
HRESULT WINAPI EnumThemeSizes (LPWSTR pszThemeFileName, LPWSTR pszColorName, DWORD dwSizeNum, PTHEMENAMES pszColorNames)
 
HRESULT WINAPI ParseThemeIniFile (LPCWSTR pszIniFileName, LPWSTR pszUnknown, PARSETHEMEINIFILEPROC callback, LPVOID lpData)
 
HTHEME WINAPI OpenThemeDataFromFile (HTHEMEFILE hThemeFile, HWND hwnd, LPCWSTR pszClassList, DWORD flags)
 
HRESULT WINAPI DrawNCPreview (HDC hDC, DWORD DNCP_Flag, LPRECT prcPreview, LPCWSTR pszThemeFileName, LPCWSTR pszColorName, LPCWSTR pszSizeName, PNONCLIENTMETRICSW pncMetrics, COLORREF *lpaRgbValues)
 
BOOL WINAPI ThemeHooksInstall (VOID)
 
BOOL WINAPI ThemeHooksRemove (VOID)
 

Macro Definition Documentation

◆ DNCP_ACTIVEWINDOW

#define DNCP_ACTIVEWINDOW   0x1

Definition at line 103 of file uxundoc.h.

◆ DNCP_DIALOGWINDOW

#define DNCP_DIALOGWINDOW   0x4

Definition at line 105 of file uxundoc.h.

◆ DNCP_DRAW_ALL

Definition at line 106 of file uxundoc.h.

◆ DNCP_INACTIVEWINDOW

#define DNCP_INACTIVEWINDOW   0x2

Definition at line 104 of file uxundoc.h.

Typedef Documentation

◆ ENUMTHEMEPROC

typedef BOOL(CALLBACK * ENUMTHEMEPROC) (LPVOID lpReserved, LPCWSTR pszThemeFileName, LPCWSTR pszThemeName, LPCWSTR pszToolTip, LPVOID lpReserved2, LPVOID lpData)

Definition at line 21 of file uxundoc.h.

◆ HTHEMEFILE

typedef HANDLE HTHEMEFILE

Definition at line 3 of file uxundoc.h.

◆ PARSETHEMEINIFILEPROC

typedef BOOL(CALLBACK * PARSETHEMEINIFILEPROC) (DWORD dwType, LPWSTR pszParam1, LPWSTR pszParam2, LPWSTR pszParam3, DWORD dwParam, LPVOID lpData)

Definition at line 44 of file uxundoc.h.

◆ PTHEMENAMES

◆ THEMENAMES

Function Documentation

◆ ApplyTheme()

HRESULT WINAPI ApplyTheme ( HTHEMEFILE  hThemeFile,
char unknown,
HWND  hWnd 
)

Definition at line 1158 of file system.c.

1159{
1160 HRESULT hr;
1161 TRACE("(%p,%s,%p)\n", hThemeFile, unknown, hWnd);
1162 hr = UXTHEME_ApplyTheme(hThemeFile);
1164 return hr;
1165}
HWND hWnd
Definition: settings.c:17
#define NULL
Definition: types.h:112
static WCHAR unknown[MAX_STRING_RESOURCE_LEN]
Definition: object.c:1605
BOOL CALLBACK UXTHEME_broadcast_theme_changed(HWND hWnd, LPARAM enable)
Definition: system.c:68
PTHEME_FILE g_ActiveThemeFile
Definition: system.c:54
static HRESULT UXTHEME_ApplyTheme(PTHEME_FILE tf)
Definition: system.c:512
HRESULT hr
Definition: shlfolder.c:183
#define TRACE(s)
Definition: solgame.cpp:4

Referenced by ActivateTheme().

◆ CloseThemeFile()

HRESULT WINAPI CloseThemeFile ( HTHEMEFILE  hThemeFile)

Definition at line 1127 of file system.c.

1128{
1129 TRACE("(%p)\n", hThemeFile);
1130 MSSTYLES_CloseThemeFile(hThemeFile);
1131 return S_OK;
1132}
#define S_OK
Definition: intsafe.h:52
void MSSTYLES_CloseThemeFile(PTHEME_FILE tf)
Definition: msstyles.c:179

Referenced by ActivateTheme().

◆ DrawNCPreview()

HRESULT WINAPI DrawNCPreview ( HDC  hDC,
DWORD  DNCP_Flag,
LPRECT  prcPreview,
LPCWSTR  pszThemeFileName,
LPCWSTR  pszColorName,
LPCWSTR  pszSizeName,
PNONCLIENTMETRICSW  pncMetrics,
COLORREF lpaRgbValues 
)

Definition at line 1218 of file nonclient.c.

1226{
1227 WNDCLASSEXW DummyPreviewWindowClass;
1228 HWND hwndDummy;
1229 HRESULT hres;
1230 HTHEMEFILE hThemeFile;
1232 LPWSTR szText;
1233 int len;
1234
1235 /* Create a dummy window that will be used to trick the paint funtions */
1236 memset(&DummyPreviewWindowClass, 0, sizeof(DummyPreviewWindowClass));
1237 DummyPreviewWindowClass.cbSize = sizeof(DummyPreviewWindowClass);
1238 DummyPreviewWindowClass.lpszClassName = L"DummyPreviewWindowClass";
1239 DummyPreviewWindowClass.hbrBackground = (HBRUSH)(COLOR_WINDOW+1);
1240 DummyPreviewWindowClass.hInstance = hDllInst;
1241 DummyPreviewWindowClass.lpfnWndProc = DefWindowProcW;
1242 if (!RegisterClassExW(&DummyPreviewWindowClass))
1243 return E_FAIL;
1244
1245 hwndDummy = CreateWindowExW(0, L"DummyPreviewWindowClass", NULL, WS_OVERLAPPEDWINDOW | WS_VSCROLL, 30, 30, 300, 150, 0, 0, hDllInst, NULL);
1246 if (!hwndDummy)
1247 return E_FAIL;
1248
1249 hres = OpenThemeFile(pszThemeFileName, pszColorName, pszSizeName, &hThemeFile,0);
1250 if (FAILED(hres))
1251 return hres;
1252
1253 /* Initialize the special draw context for the preview */
1254 context.hDC = hDC;
1255 context.hWnd = hwndDummy;
1256 context.theme = OpenThemeDataFromFile(hThemeFile, hwndDummy, L"WINDOW", 0);
1257 if (!context.theme)
1258 return E_FAIL;
1259 context.scrolltheme = OpenThemeDataFromFile(hThemeFile, hwndDummy, L"SCROLLBAR", 0);
1260 if (!context.scrolltheme)
1261 return E_FAIL;
1262 context.wi.cbSize = sizeof(context.wi);
1263 if (!GetWindowInfo(hwndDummy, &context.wi))
1264 return E_FAIL;
1265 context.wi.dwStyle |= WS_VISIBLE;
1266
1267 context.hRgn = CreateRectRgnIndirect(&context.wi.rcWindow);
1268 RECT rcAdjPreview = { prcPreview->left, prcPreview->top, prcPreview->right, prcPreview->bottom };
1269 INT previewWidth = rcAdjPreview.right - rcAdjPreview.left;
1270 INT previewHeight = rcAdjPreview.bottom - rcAdjPreview.top;
1271
1272 /* Draw inactive preview window */
1273 context.Active = FALSE;
1275 DrawWindowForNCPreview(hDC, &context, rcAdjPreview.left, rcAdjPreview.top, rcAdjPreview.right - 17, rcAdjPreview.bottom - 20, TRUE, NULL);
1276
1277 /* Draw active preview window */
1278 context.Active = TRUE;
1280
1281 DWORD textDrawFlags = DT_NOPREFIX | DT_SINGLELINE | DT_WORDBREAK;
1282 RECT rcWindowClient;
1283 DrawWindowForNCPreview(hDC, &context, rcAdjPreview.left + 10, rcAdjPreview.top + 22, rcAdjPreview.right, rcAdjPreview.bottom, TRUE, &rcWindowClient);
1284 LOGFONTW lfText;
1285 HFONT textFont = NULL;
1286 if (SUCCEEDED(GetThemeSysFont(context.theme, TMT_MSGBOXFONT, &lfText)))
1287 textFont = CreateFontIndirectW(&lfText);
1288
1289 if (textFont)
1290 SelectFont(hDC, textFont);
1291
1293 len = LoadStringW(hDllInst, IDS_WINTEXT, (LPWSTR)&szText, 0);
1294 if (len > 0)
1295 DrawThemeText(context.theme, hDC, WP_DIALOG, 0, szText, len, DT_LEFT | DT_TOP | textDrawFlags, 0, &rcWindowClient);
1296
1297 /* Draw preview dialog window */
1300 SetWindowLongPtr(hwndDummy, GWL_STYLE, dwStyleNew);
1301 DWORD dwExStyleNew = WS_EX_DLGMODALFRAME;
1302 SetWindowLongPtr(hwndDummy, GWL_EXSTYLE, dwExStyleNew);
1303
1304 if (!GetWindowInfo(hwndDummy, &context.wi))
1305 return E_FAIL;
1306
1307 context.wi.dwStyle = WS_VISIBLE | dwStyleNew;
1308 context.wi.dwExStyle = dwExStyleNew;
1309
1310 INT msgBoxHCenter = rcAdjPreview.left + (previewWidth / 2);
1311 INT msgBoxVCenter = rcAdjPreview.top + (previewHeight / 2);
1312
1313 DrawWindowForNCPreview(hDC, &context, msgBoxHCenter - NC_PREVIEW_MSGBOX_HALF_WIDTH, msgBoxVCenter + NC_PREVIEW_MSGBOX_OFFSET_X, msgBoxHCenter + NC_PREVIEW_MSGBOX_HALF_WIDTH, msgBoxVCenter + NC_PREVIEW_MSGBOX_OFFSET_Y, FALSE, &rcWindowClient);
1314 DrawThemeBackground(context.theme, hDC, WP_DIALOG, 0, &rcWindowClient, NULL);
1315
1316 /* Draw preview dialog button */
1317 HTHEME hBtnTheme = OpenThemeDataFromFile(hThemeFile, hwndDummy, L"BUTTON", OTD_NONCLIENT);
1318 if (hBtnTheme)
1319 {
1320 INT btnCenterH = rcWindowClient.left + ((rcWindowClient.right - rcWindowClient.left) / 2);
1321 INT btnCenterV = rcWindowClient.top + ((rcWindowClient.bottom - rcWindowClient.top) / 2);
1322 RECT rcBtn = {btnCenterH - 40, btnCenterV - 15, btnCenterH + 40, btnCenterV + 15};
1323 int btnPart = BP_PUSHBUTTON;
1324 int btnState = PBS_DEFAULTED;
1325 DrawThemeBackground(hBtnTheme, hDC, btnPart, btnState, &rcBtn, NULL);
1326 MARGINS btnContentMargins;
1327 if (GetThemeMargins(hBtnTheme, hDC, btnPart, btnState, TMT_CONTENTMARGINS, NULL, &btnContentMargins) == S_OK)
1328 {
1329 rcBtn.left += btnContentMargins.cxLeftWidth;
1330 rcBtn.top += btnContentMargins.cyTopHeight;
1331 rcBtn.right -= btnContentMargins.cxRightWidth;
1332 rcBtn.bottom -= btnContentMargins.cyBottomHeight;
1333 }
1334
1335 LOGFONTW lfBtn;
1336 if ((GetThemeFont(hBtnTheme, hDC, btnPart, btnState, TMT_FONT, &lfBtn) != S_OK) && textFont)
1337 SelectFont(hDC, textFont);
1338
1339 len = LoadStringW(hDllInst, IDS_OK, (LPWSTR)&szText, 0);
1340 if (len > 0)
1341 DrawThemeText(hBtnTheme, hDC, btnPart, btnState, szText, len, DT_CENTER | DT_VCENTER | textDrawFlags, 0, &rcBtn);
1342 CloseThemeData(hBtnTheme);
1343 }
1344
1345 context.hDC = NULL;
1346 CloseThemeData (context.theme);
1347 CloseThemeData (context.scrolltheme);
1349
1350 /* Cleanup */
1351 DestroyWindow(hwndDummy);
1352 UnregisterClassW(L"DummyPreviewWindowClass", hDllInst);
1353
1354 return S_OK;
1355}
static HDC hDC
Definition: 3dtext.c:33
#define IDS_OK
Definition: resource.h:19
#define E_FAIL
Definition: ddrawi.h:102
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
#define IDS_WINTEXT
Definition: resource.h:107
HRESULT WINAPI DrawThemeBackground(HTHEME hTheme, HDC hdc, int iPartId, int iStateId, const RECT *pRect, const RECT *pClipRect)
Definition: draw.c:128
HRESULT WINAPI DrawThemeText(HTHEME hTheme, HDC hdc, int iPartId, int iStateId, LPCWSTR pszText, int iCharCount, DWORD dwTextFlags, DWORD dwTextFlags2, const RECT *pRect)
Definition: draw.c:1377
COLORREF WINAPI GetThemeSysColor(HTHEME hTheme, int iColorID)
Definition: metric.c:58
HRESULT WINAPI GetThemeSysFont(HTHEME hTheme, int iFontID, LOGFONTW *plf)
Definition: metric.c:91
static void DrawWindowForNCPreview(_In_ HDC hDC, _In_ PDRAW_CONTEXT pcontext, _In_ INT left, _In_ INT top, _In_ INT right, _In_ INT bottom, _In_ BOOL drawClientAreaColor, _Out_opt_ LPRECT prcClient)
Definition: nonclient.c:1088
void ThemeCleanupDrawContext(PDRAW_CONTEXT pcontext)
Definition: nonclient.c:182
#define NC_PREVIEW_MSGBOX_HALF_WIDTH
Definition: nonclient.c:11
#define NC_PREVIEW_MSGBOX_OFFSET_Y
Definition: nonclient.c:13
VOID SetWindowResourceText(_In_ HWND hwnd, _In_ UINT uID)
Definition: nonclient.c:1197
#define NC_PREVIEW_MSGBOX_OFFSET_X
Definition: nonclient.c:12
HRESULT WINAPI GetThemeFont(HTHEME hTheme, HDC hdc, int iPartId, int iStateId, int iPropId, LOGFONTW *pFont)
Definition: property.c:108
HRESULT WINAPI GetThemeMargins(HTHEME hTheme, HDC hdc, int iPartId, int iStateId, int iPropId, RECT *prc, MARGINS *pMargins)
Definition: property.c:216
#define IDS_INACTIVEWIN
Definition: resource.h:14
#define IDS_MESSAGEBOX
Definition: resource.h:12
#define IDS_ACTIVEWIN
Definition: resource.h:13
HINSTANCE hDllInst
Definition: system.c:45
HTHEME WINAPI OpenThemeDataFromFile(HTHEMEFILE hThemeFile, HWND hwnd, LPCWSTR pszClassList, DWORD flags)
Definition: system.c:827
HRESULT WINAPI OpenThemeFile(LPCWSTR pszThemeFileName, LPCWSTR pszColorName, LPCWSTR pszSizeName, HTHEMEFILE *hThemeFile, DWORD unknown)
Definition: system.c:1101
HRESULT WINAPI CloseThemeData(HTHEME hTheme)
Definition: system.c:950
unsigned long DWORD
Definition: ntddk_ex.h:95
GLenum GLsizei len
Definition: glext.h:6722
#define SUCCEEDED(hr)
Definition: intsafe.h:50
#define FAILED(hr)
Definition: intsafe.h:51
static DWORD *static HFONT(WINAPI *pCreateFontIndirectExA)(const ENUMLOGFONTEXDVA *)
HRESULT hres
Definition: protocol.c:465
static HTHEME(WINAPI *pOpenThemeDataEx)(HWND
#define L(x)
Definition: ntvdm.h:50
#define WS_CAPTION
Definition: pedump.c:624
#define WS_OVERLAPPEDWINDOW
Definition: pedump.c:637
#define WS_OVERLAPPED
Definition: pedump.c:615
#define WS_EX_DLGMODALFRAME
Definition: pedump.c:645
#define WS_SYSMENU
Definition: pedump.c:629
#define WS_VSCROLL
Definition: pedump.c:627
#define WS_VISIBLE
Definition: pedump.c:620
#define WS_DLGFRAME
Definition: pedump.c:626
#define memset(x, y, z)
Definition: compat.h:39
Definition: misc.c:279
int cyBottomHeight
Definition: misc.c:283
int cyTopHeight
Definition: misc.c:282
int cxRightWidth
Definition: misc.c:281
int cxLeftWidth
Definition: misc.c:280
LPCWSTR lpszClassName
Definition: winuser.h:3226
HBRUSH hbrBackground
Definition: winuser.h:3224
WNDPROC lpfnWndProc
Definition: winuser.h:3218
UINT cbSize
Definition: winuser.h:3216
HINSTANCE hInstance
Definition: winuser.h:3221
Definition: http.c:7252
LONG right
Definition: windef.h:308
LONG bottom
Definition: windef.h:309
LONG top
Definition: windef.h:307
LONG left
Definition: windef.h:306
#define SetWindowLongPtr
Definition: treelist.c:70
int32_t INT
Definition: typedefs.h:58
@ PBS_DEFAULTED
Definition: vsstyle.h:90
@ BP_PUSHBUTTON
Definition: vsstyle.h:74
@ WP_DIALOG
Definition: vsstyle.h:1639
#define TMT_CONTENTMARGINS
Definition: vssym32.h:324
#define TMT_WINDOWTEXT
Definition: vssym32.h:207
#define TMT_FONT
Definition: vssym32.h:144
#define TMT_MSGBOXFONT
Definition: vssym32.h:168
#define SelectFont(hdc, hfont)
Definition: windowsx.h:516
HFONT WINAPI CreateFontIndirectW(_In_ const LOGFONTW *)
COLORREF WINAPI SetTextColor(_In_ HDC, _In_ COLORREF)
Definition: text.c:918
HRGN WINAPI CreateRectRgnIndirect(_In_ LPCRECT)
#define DT_NOPREFIX
Definition: winuser.h:537
#define COLOR_WINDOW
Definition: winuser.h:918
#define DT_CENTER
Definition: winuser.h:527
LRESULT WINAPI DefWindowProcW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
BOOL WINAPI GetWindowInfo(_In_ HWND, _Inout_ PWINDOWINFO)
int WINAPI LoadStringW(_In_opt_ HINSTANCE hInstance, _In_ UINT uID, _Out_writes_to_(cchBufferMax, return+1) LPWSTR lpBuffer, _In_ int cchBufferMax)
#define DT_SINGLELINE
Definition: winuser.h:540
#define DT_LEFT
Definition: winuser.h:534
#define DT_TOP
Definition: winuser.h:542
HWND WINAPI CreateWindowExW(_In_ DWORD dwExStyle, _In_opt_ LPCWSTR lpClassName, _In_opt_ LPCWSTR lpWindowName, _In_ DWORD dwStyle, _In_ int X, _In_ int Y, _In_ int nWidth, _In_ int nHeight, _In_opt_ HWND hWndParent, _In_opt_ HMENU hMenu, _In_opt_ HINSTANCE hInstance, _In_opt_ LPVOID lpParam)
#define DT_WORDBREAK
Definition: winuser.h:544
ATOM WINAPI RegisterClassExW(_In_ CONST WNDCLASSEXW *)
#define DT_VCENTER
Definition: winuser.h:543
BOOL WINAPI UnregisterClassW(_In_ LPCWSTR, HINSTANCE)
#define GWL_STYLE
Definition: winuser.h:852
BOOL WINAPI DestroyWindow(_In_ HWND)
#define GWL_EXSTYLE
Definition: winuser.h:851
WCHAR * LPWSTR
Definition: xmlstorage.h:184

Referenced by DrawThemePreview().

◆ EnumThemeColors()

HRESULT WINAPI EnumThemeColors ( LPWSTR  pszThemeFileName,
LPWSTR  pszSizeName,
DWORD  dwColorNum,
PTHEMENAMES  pszColorNames 
)

Definition at line 1310 of file system.c.

1312{
1314 HRESULT hr;
1315 LPWSTR tmp;
1316 UINT resourceId = dwColorNum + 1000;
1317 TRACE("(%s,%s,%d)\n", debugstr_w(pszThemeFileName),
1318 debugstr_w(pszSizeName), dwColorNum);
1319
1321 return E_FAIL;
1322
1323 hr = MSSTYLES_OpenThemeFile(pszThemeFileName, NULL, pszSizeName, &pt);
1324 if(FAILED(hr)) return hr;
1325
1326 tmp = pt->pszAvailColors;
1327 while(dwColorNum && *tmp) {
1328 dwColorNum--;
1329 tmp += lstrlenW(tmp)+1;
1330 }
1331 if(!dwColorNum && *tmp) {
1332 TRACE("%s\n", debugstr_w(tmp));
1333 lstrcpyW(pszColorNames->szName, tmp);
1334 LoadStringW (pt->hTheme, resourceId,
1335 pszColorNames->szDisplayName,
1336 sizeof (pszColorNames->szDisplayName) / sizeof (WCHAR));
1337 LoadStringW (pt->hTheme, resourceId+1000,
1338 pszColorNames->szTooltip,
1339 sizeof (pszColorNames->szTooltip) / sizeof (WCHAR));
1340 }
1341 else
1343
1345 return hr;
1346}
#define lstrcpyW
Definition: compat.h:749
#define lstrlenW
Definition: compat.h:750
#define pt(x, y)
Definition: drawing.c:79
#define debugstr_w
Definition: kernel32.h:32
HRESULT MSSTYLES_OpenThemeFile(LPCWSTR lpThemeFile, LPCWSTR pszColorName, LPCWSTR pszSizeName, PTHEME_FILE *tf)
Definition: msstyles.c:54
unsigned int UINT
Definition: ndis.h:50
WCHAR szDisplayName[MAX_PATH+1]
Definition: uxundoc.h:53
WCHAR szName[MAX_PATH+1]
Definition: uxundoc.h:52
WCHAR szTooltip[MAX_PATH+1]
Definition: uxundoc.h:54
BOOL g_bThemeHooksActive
Definition: themehooks.c:15
#define E_PROP_ID_UNSUPPORTED
Definition: vfwmsgs.h:173
ActualNumberDriverObjects * sizeof(PDRIVER_OBJECT)) PDRIVER_OBJECT *DriverObjectList
__wchar_t WCHAR
Definition: xmlstorage.h:180

Referenced by LoadTheme().

◆ EnumThemes()

HRESULT WINAPI EnumThemes ( LPCWSTR  pszThemePath,
ENUMTHEMEPROC  callback,
LPVOID  lpData 
)

Definition at line 1221 of file system.c.

1223{
1224 WCHAR szDir[MAX_PATH];
1226 static const WCHAR szStar[] = {'*','.','*','\0'};
1227 static const WCHAR szFormat[] = {'%','s','%','s','\\','%','s','.','m','s','s','t','y','l','e','s','\0'};
1228 static const WCHAR szDisplayName[] = {'d','i','s','p','l','a','y','n','a','m','e','\0'};
1229 static const WCHAR szTooltip[] = {'t','o','o','l','t','i','p','\0'};
1230 WCHAR szName[60];
1231 WCHAR szTip[60];
1232 HANDLE hFind;
1233 WIN32_FIND_DATAW wfd;
1234 HRESULT hr;
1235 size_t pathLen;
1236
1237 TRACE("(%s,%p,%p)\n", debugstr_w(pszThemePath), callback, lpData);
1238
1239 if(!pszThemePath || !callback)
1240 return E_POINTER;
1241
1242 lstrcpyW(szDir, pszThemePath);
1243 pathLen = lstrlenW (szDir);
1244 if ((pathLen > 0) && (pathLen < MAX_PATH-1) && (szDir[pathLen - 1] != '\\'))
1245 {
1246 szDir[pathLen] = '\\';
1247 szDir[pathLen+1] = 0;
1248 }
1249
1250 lstrcpyW(szPath, szDir);
1251 lstrcatW(szPath, szStar);
1252 TRACE("searching %s\n", debugstr_w(szPath));
1253
1254 hFind = FindFirstFileW(szPath, &wfd);
1255 if(hFind != INVALID_HANDLE_VALUE) {
1256 do {
1257 if(wfd.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY
1258 && !(wfd.cFileName[0] == '.' && ((wfd.cFileName[1] == '.' && wfd.cFileName[2] == 0) || wfd.cFileName[1] == 0))) {
1259 wsprintfW(szPath, szFormat, szDir, wfd.cFileName, wfd.cFileName);
1260
1261 hr = GetThemeDocumentationProperty(szPath, szDisplayName, szName, sizeof(szName)/sizeof(szName[0]));
1262 if(FAILED(hr))
1263 {
1264 ERR("Failed to get theme name from %S\n", szPath);
1265 continue;
1266 }
1267
1268 hr = GetThemeDocumentationProperty(szPath, szTooltip, szTip, sizeof(szTip)/sizeof(szTip[0]));
1269 if (FAILED(hr))
1270 szTip[0] = 0;
1271
1272 TRACE("callback(%s,%s,%s,%p)\n", debugstr_w(szPath), debugstr_w(szName), debugstr_w(szTip), lpData);
1273 if(!callback(NULL, szPath, szName, szTip, NULL, lpData)) {
1274 TRACE("callback ended enum\n");
1275 break;
1276 }
1277 }
1278 } while(FindNextFileW(hFind, &wfd));
1279 FindClose(hFind);
1280 }
1281 return S_OK;
1282}
#define ERR(fmt,...)
Definition: debug.h:110
#define INVALID_HANDLE_VALUE
Definition: compat.h:731
#define MAX_PATH
Definition: compat.h:34
HANDLE WINAPI FindFirstFileW(IN LPCWSTR lpFileName, OUT LPWIN32_FIND_DATAW lpFindFileData)
Definition: find.c:320
BOOL WINAPI FindClose(HANDLE hFindFile)
Definition: find.c:502
BOOL WINAPI FindNextFileW(IN HANDLE hFindFile, OUT LPWIN32_FIND_DATAW lpFindFileData)
Definition: find.c:382
HRESULT WINAPI GetThemeDocumentationProperty(LPCWSTR pszThemeName, LPCWSTR pszPropertyName, LPWSTR pszValueBuff, int cchMaxValChars)
Definition: system.c:1010
LPWSTR WINAPI lstrcatW(LPWSTR lpString1, LPCWSTR lpString2)
Definition: lstring.c:274
LPCWSTR szPath
Definition: env.c:37
static IPrintDialogCallback callback
Definition: printdlg.c:326
#define FILE_ATTRIBUTE_DIRECTORY
Definition: nt_native.h:705
static const WCHAR szName[]
Definition: powrprof.c:45
#define E_POINTER
Definition: winerror.h:2365
int WINAPIV wsprintfW(_Out_ LPWSTR, _In_ _Printf_format_string_ LPCWSTR,...)

Referenced by LoadThemes().

◆ EnumThemeSizes()

HRESULT WINAPI EnumThemeSizes ( LPWSTR  pszThemeFileName,
LPWSTR  pszColorName,
DWORD  dwSizeNum,
PTHEMENAMES  pszColorNames 
)

Definition at line 1373 of file system.c.

1375{
1377 HRESULT hr;
1378 LPWSTR tmp;
1379 UINT resourceId = dwSizeNum + 3000;
1380 TRACE("(%s,%s,%d)\n", debugstr_w(pszThemeFileName),
1381 debugstr_w(pszColorName), dwSizeNum);
1382
1384 return E_FAIL;
1385
1386 hr = MSSTYLES_OpenThemeFile(pszThemeFileName, pszColorName, NULL, &pt);
1387 if(FAILED(hr)) return hr;
1388
1389 tmp = pt->pszAvailSizes;
1390 while(dwSizeNum && *tmp) {
1391 dwSizeNum--;
1392 tmp += lstrlenW(tmp)+1;
1393 }
1394 if(!dwSizeNum && *tmp) {
1395 TRACE("%s\n", debugstr_w(tmp));
1396 lstrcpyW(pszSizeNames->szName, tmp);
1397 LoadStringW (pt->hTheme, resourceId,
1398 pszSizeNames->szDisplayName,
1399 sizeof (pszSizeNames->szDisplayName) / sizeof (WCHAR));
1400 LoadStringW (pt->hTheme, resourceId+1000,
1401 pszSizeNames->szTooltip,
1402 sizeof (pszSizeNames->szTooltip) / sizeof (WCHAR));
1403 }
1404 else
1406
1408 return hr;
1409}

Referenced by LoadTheme().

◆ GetThemeDefaults()

HRESULT WINAPI GetThemeDefaults ( LPCWSTR  pszThemeFileName,
LPWSTR  pszColorName,
DWORD  dwColorNameLen,
LPWSTR  pszSizeName,
DWORD  dwSizeNameLen 
)

Definition at line 1183 of file system.c.

1186{
1188 HRESULT hr;
1189 TRACE("(%s,%p,%d,%p,%d)\n", debugstr_w(pszThemeFileName),
1190 pszColorName, dwColorNameLen,
1191 pszSizeName, dwSizeNameLen);
1192
1194 return E_FAIL;
1195
1196 hr = MSSTYLES_OpenThemeFile(pszThemeFileName, NULL, NULL, &pt);
1197 if(FAILED(hr)) return hr;
1198
1199 lstrcpynW(pszColorName, pt->pszSelectedColor, dwColorNameLen);
1200 lstrcpynW(pszSizeName, pt->pszSelectedSize, dwSizeNameLen);
1201
1203 return S_OK;
1204}
#define lstrcpynW
Definition: compat.h:738

◆ OpenThemeDataFromFile()

HTHEME WINAPI OpenThemeDataFromFile ( HTHEMEFILE  hThemeFile,
HWND  hwnd,
LPCWSTR  pszClassList,
DWORD  flags 
)

Definition at line 827 of file system.c.

828{
829 return OpenThemeDataInternal((PTHEME_FILE)hThemeFile, hwnd, pszClassList, flags);
830}
static HTHEME WINAPI OpenThemeDataInternal(PTHEME_FILE ThemeFile, HWND hwnd, LPCWSTR pszClassList, DWORD flags)
Definition: system.c:735
GLbitfield flags
Definition: glext.h:7161
_In_ LONG _In_ HWND hwnd
Definition: winddi.h:4023

Referenced by DrawNCPreview(), and LoadSchemeFromTheme().

◆ OpenThemeFile()

HRESULT WINAPI OpenThemeFile ( LPCWSTR  pszThemeFileName,
LPCWSTR  pszColorName,
LPCWSTR  pszSizeName,
HTHEMEFILE hThemeFile,
DWORD  unknown 
)

Definition at line 1101 of file system.c.

1104{
1105 TRACE("(%s,%s,%s,%p,%d)\n", debugstr_w(pszThemeFileName),
1106 debugstr_w(pszColorName), debugstr_w(pszSizeName),
1107 hThemeFile, unknown);
1108
1110 return E_FAIL;
1111
1112 return MSSTYLES_OpenThemeFile(pszThemeFileName, pszColorName, pszSizeName, (PTHEME_FILE*)hThemeFile);
1113}

Referenced by ActivateTheme(), DrawNCPreview(), and LoadSchemeFromTheme().

◆ ParseThemeIniFile()

HRESULT WINAPI ParseThemeIniFile ( LPCWSTR  pszIniFileName,
LPWSTR  pszUnknown,
PARSETHEMEINIFILEPROC  callback,
LPVOID  lpData 
)

Definition at line 1430 of file system.c.

1432{
1433 FIXME("%s %s: stub\n", debugstr_w(pszIniFileName), debugstr_w(pszUnknown));
1434 return E_NOTIMPL;
1435}
#define FIXME(fmt,...)
Definition: debug.h:111
#define E_NOTIMPL
Definition: ddrawi.h:99

◆ QueryThemeServices()

DWORD WINAPI QueryThemeServices ( void  )

Definition at line 1079 of file system.c.

1080{
1081 FIXME("stub\n");
1082 return 3; /* This is what is returned under XP in most cases */
1083}

◆ ThemeHooksInstall()

BOOL WINAPI ThemeHooksInstall ( VOID  )

◆ ThemeHooksRemove()

BOOL WINAPI ThemeHooksRemove ( VOID  )