Dulappy
Freshman Member
Posts: 30
OS: Windows 10
Theme: Custom
CPU: Ryzen 5 2600
RAM: 16GB DDR4 3200MHz
GPU: GeForce GTX 1650 SUPER
|
Post by Dulappy on Sept 17, 2023 13:25:07 GMT -8
I am creating this thread as a means to allow people to share minor, insignificant discoveries, that wouldn't otherwise be worth sharing on this forum.
Starting off, you all know that in Windows 8 and up when explorer.exe is not running, instead of showing the desktop background, Windows displays just a solid color. Today, while playing around with DWM, I discovered that this color is actually just a rectangle drawn by a solid color MIL/Direct2D brush, meaning that if solid color rectangles are completely prevented from being drawn onto the screen by removing the function that would draw them, we instead get an interesting effect, similar to the one present in unresponsive windows when DWM is disabled.
I'd like to also note that it may be possible to reinstate the pre-Windows 8 behavior eventually (no promises), by finding out where this color brush is created, creating an image brush instead, setting the image to the desktop wallpaper, then just drawing it onto the screen. Then again, maybe the brush is created outside of DWM, who knows?
Additionally, while testing I realized that when explorer isn't running, the accent color doesn't update properly; when switching to the Ctrl+Alt+Del menu and back, the color behind the caption text (which is calculated using the accent color) remains the same as it was on that screen, rather than reverting back to what it should be for my user account.
|
|
|
Post by anixx on Sept 17, 2023 15:57:30 GMT -8
|
|
Souper
Freshman Member
Posts: 63
OS: Manjaro | Windows 10 (2021)
Theme: Placeholder | Aero / Luna
|
Post by Souper on Sept 17, 2023 20:39:33 GMT -8
In our experience, with DWM disabled, it instead just draws a solid black color. Still doesn't pull from the desktop wallpaper. Not sure what would draw that.
|
|
|
Post by ephemeralViolette on Sept 18, 2023 16:21:15 GMT -8
In our experience, with DWM disabled, it instead just draws a solid black color. Still doesn't pull from the desktop wallpaper. Not sure what would draw that. In Windows 7 and prior, without DWM on (or maybe with it on, I'm not entirely sure about the architecture), the desktop was drawn by the kernel driver win32k.sys (Windows User), which implements most of the actual Windows user environment. The desktop itself is actually just a window, but it's window procedure is stored in this kernel-mode code, so there's no practical way to modify it.
|
|
|
Post by ephemeralViolette on Sept 18, 2023 16:24:36 GMT -8
By the way, it's important to note that the desktop itself is not the same thing as the desktop GUI provided by Explorer. The actual Windows desktop is basically just the top-level window of the window manager.
|
|
|
Post by ephemeralViolette on Sept 21, 2023 12:36:09 GMT -8
Fun quick post because of the anniversary of NT 3.5!
I've been looking into the history of the Windows window manager for a while now, and one thing that is peculiar is how they changed the storage of window manager icons in Windows NT 3.5.
If you didn't know, Windows 3.1 stores all window manager icons (including the mouse cursor, window caption buttons, scroll buttons, etc.) in each video driver, which is why changing these icons involved modifying the video driver. Supposedly, this was a feature to allow OEMs to use custom icons by shipping a custom video driver with different icons.
NT 3.1 does the exact same thing, but NT 3.5 seems to have changed the storage a little bit. I'm not sure if 3.5 supported custom OEM icons at all, but it is certainly true that the default icons were moved from being stored multiple times in each default video driver to only one time in winsrv.exe. NT 4.0 changed this architecture once more: when pretty much all of winsrv was moved to kernel-mode code in win32k, all icons that were previously stored in winsrv.exe were moved over to user32.dll, where they remain today.
It's also fun how the Windows 2.0 (or OS/2 Presentation Manager? There is an MDI state for the system menu button, which I don't think should have existed when Windows 2.0 was designed...) caption button bitmaps persisted through Windows 3.1 and Windows NT 3.51. You can see them pretty easily if you open up NT 3.1 VGA.DLL or NT 3.5x WINSRV.EXE in Resource Hacker. Speaking of which, I don't actually know anything like Resource Hacker for Win16 or OS/2 NE binaries, only for Win32 PE binaries.
I intend on writing more on this subject in the future, but this is all that I'm really comfortable saying on the subject for now.
|
|
Dulappy
Freshman Member
Posts: 30
OS: Windows 10
Theme: Custom
CPU: Ryzen 5 2600
RAM: 16GB DDR4 3200MHz
GPU: GeForce GTX 1650 SUPER
|
Post by Dulappy on Sept 21, 2023 13:32:09 GMT -8
I find it interesting how they went from using bitmaps in Windows NT 3.1/3.5x to GDI and a font in NT4 (at least from what I know), back to bitmaps in XP and up. I guess this whole OEM icon thing in 3.1 could be considered a primitive version of uxtheme in a way.
|
|
|
Post by ephemeralViolette on Sept 21, 2023 14:26:50 GMT -8
I find it interesting how they went from using bitmaps in Windows NT 3.1/3.5x to GDI and a font in NT4 (at least from what I know), back to bitmaps in XP and up. I guess this whole OEM icon thing in 3.1 could be considered a primitive version of uxtheme in a way. Apart from OEM bitmaps, the Windows 3.0 window manager (which NT 3.x inherited) seems to originate from the OS/2 Presentation Manager for the most part, and is functionally just a high-colour (VGA) reskin of the Windows 2.x window manager (which was designed for lower colour video cards such as EGA), so it makes sense that they would use bitmaps for historical reasons. This was still GDI though. Since Windows 3.x supported more than 96 DPI scale, however, there were multiple fixed size bitmaps as well as variations designed for any other non-standard scale.
95 and NT 4.0 replaced these with real-time-rasterised vector buttons which have scalable glyphs drawn by the Marlett vector font; fonts were the most effective way to implement scalable vector graphics at the time. XP obviously went back to bitmaps because of the desire to have more visually complex themes. NeXT-style 3D buttons like what Windows 95 introduced are very simple to draw compared to rounded corners and complex gradients.
|
|
|
Post by ephemeralViolette on Oct 4, 2023 8:36:07 GMT -8
Another minor discovery:
Although it may be tempting to say that the translucent marquee selection outline style was introduced with Windows Vista, it actually already existed by Windows XP. This effect even appears in regular explorer windows in XP. However, you will notice that this effect did not appear on the desktop view until Vista.
I decided to look into this, but it turns out that there actually isn't much to it. There are a few cases where the translucent style will not be used, including low colour depths, user preference, and if the list view is double buffered. This third case is, surprisingly, actually documented by Microsoft in their documentation for extended list view styles, for the style LVS_EX_DOUBLEBUFFER. Any list view that isn't double buffered (presumably, including the desktop view in Windows XP), will not have the translucent selection style.
Thus, it is possible to get the XP-style grid-line marquee selection outline style on the desktop and translucent in the file browser. I submitted the necessary code to achieve this effect to aubymori, for her to merge in with her Classic Desktop Icons Windhawk mod.
|
|