narzoul / DDrawCompat

DirectDraw and Direct3D 1-7 compatibility, performance and visual enhancements for Windows Vista, 7, 8, 10 and 11
BSD Zero Clause License
885 stars 67 forks source link

Windows 11 taskbar preview is all black #231

Closed ewrogers closed 7 months ago

ewrogers commented 1 year ago

Running an old MMO Game DarkAges, which uses DirectDraw 7. I am pretty familiar with the game's internals as I have reversed many parts of the game client.

The original issue is that the mouse cursor flickers which can be very visually distracting. This library does indeed fix the issue but now the mouse-over DWM preview of client window contents is all black.

The game itself runs fine windowed and no issues otherwise. It can be difficult when running multiple clients to "multi-box" and not being able to see each at a glance.

Here are the settings I am using for it:

ConfigHotkey = none
DisplayFilter = point
DpiAwareness = gdiscaled
LogLevel = none

Computer is AMD Ryzen 7800X 3D + RT 6950 XT on Windows 11 (x64).

Is this expected behavior from how the library works, or is this specific to the game itself?

narzoul commented 11 months ago

Yes, it is a side effect of how DDrawCompat works, not really game specific. Output is redirected from the original window to a WS_EX_LAYERED window on top of it, which doesn't show up in the taskbar preview. But I found out that the reason it doesn't show is that it also has the WS_EX_TOOLWINDOW style, which I originally added to prevent it from showing up as a separate button in the task bar. But it turns out this isn't necessary for owned windows, and removing that flag makes this window also show up in the preview, as long as the parent window is not minimized.

The minimized window case is a bit more tricky. I didn't find a good workaround other than to generate the thumbnail myself, but this functionality is not available on Windows Vista, so I guess it still won't work correctly there.

I'll add these fixes in the next release. As a bonus, this also seems to fix Window Capture in OBS, since removing the WS_EX_TOOLWINDOW flag makes the window show up in OBS, so it can be captured instead of the empty owner window.

narzoul commented 7 months ago

Should be fixed in v0.5.0, at least in recent Windows versions (10, 11). Not sure about older ones, but if they're still broken, I probably can't fix them anyway.