[UXTHEME] DrawNCPreview: Do not draw the icon for inactive/active windows

This is how preview works in Windows. Addendum to 118869f69. CORE-5991
This commit is contained in:
Stanislav Motylkov
2024-09-08 21:30:03 +03:00
parent 3bda42114a
commit 9dae161631

View File

@@ -1239,7 +1239,7 @@ HRESULT WINAPI DrawNCPreview(HDC hDC,
if (!RegisterClassExW(&DummyPreviewWindowClass))
return E_FAIL;
hwndDummy = CreateWindowExW(0, L"DummyPreviewWindowClass", NULL, WS_OVERLAPPEDWINDOW | WS_VSCROLL, 30, 30, 300, 150, 0, 0, hDllInst, NULL);
hwndDummy = CreateWindowExW(WS_EX_DLGMODALFRAME, L"DummyPreviewWindowClass", NULL, WS_OVERLAPPEDWINDOW | WS_VSCROLL, 30, 30, 300, 150, 0, 0, hDllInst, NULL);
if (!hwndDummy)
return E_FAIL;
@@ -1295,14 +1295,11 @@ HRESULT WINAPI DrawNCPreview(HDC hDC,
SetWindowResourceText(hwndDummy, IDS_MESSAGEBOX);
DWORD dwStyleNew = WS_OVERLAPPED | WS_CAPTION | WS_SYSMENU | WS_DLGFRAME;
SetWindowLongPtr(hwndDummy, GWL_STYLE, dwStyleNew);
DWORD dwExStyleNew = WS_EX_DLGMODALFRAME;
SetWindowLongPtr(hwndDummy, GWL_EXSTYLE, dwExStyleNew);
if (!GetWindowInfo(hwndDummy, &context.wi))
return E_FAIL;
context.wi.dwStyle = WS_VISIBLE | dwStyleNew;
context.wi.dwExStyle = dwExStyleNew;
INT msgBoxHCenter = rcAdjPreview.left + (previewWidth / 2);
INT msgBoxVCenter = rcAdjPreview.top + (previewHeight / 2);