vortesys / ntstyle Goto Github PK
View Code? Open in Web Editor NEWVintage window borders for modern Windows.
License: MIT License
Vintage window borders for modern Windows.
License: MIT License
Press start and it doesn't work
In Photoshop CS2, both MDI child windows and the main window appear to be correctly themed, but on resize they will flicker with the windows 95 window theme, then flicker back to NTStyle's 3.1 theme - this will only occour if bottom right gripper is used to resize the window, and if you pull the gripper left or up (WTF?):
Please add screenshots off NTStyle running on multiple Windows versions to README.md.
Hello, I was looking through the code in srchook/ntsdlfn.c
, which temporarily loads a few DWM API functions in during runtime, and have a few questions about the existing design. Notably, I believe that the existing code has a tiny resource leak in successful instances.
Current code is structured something like this for both function imports:
HMODULE hLib = LoadLibrary(L"Dwmapi.dll");
HRESULT hRet = 0;
if (hLib)
{
FARPROC fLib = GetProcAddress(hLib, <FUNCTION>);
if (hRet = (HRESULT)fLib(<ARGUMENTS>))
{
FreeLibrary(hLib);
return hRet;
}
}
return 0;
I believe that the FreeLibrary
call should be ran in both cases. Otherwise, what would happen here is that the library is loaded by the application and never freed. Note that S_OK (a successful HRESULT) is equal to 0, so the if condition is passed and the function always returns successful if hRet
is 0, without freeing the library. In general, the macros SUCCEEDED()
or FAILED()
should be used for HRESULTs, for clarity.
If this is the intended behaviour, then it'd be good to add a comment documenting this. Otherwise, appropriate adjustments should be made.
When I try to open the executable (ntstyle.exe), the process appears in the task manager for a second, then disappears.
I used Visual Studio Build Tool 2022 for the compilation; the compilation did not encounter any errors, but there may be a parameter that I forget to enter.
This isn't particularly a priority issue, but it's a small bug with some default Windows programs that can be corrected.
In UIRibbon applications, there is a visual error that can be seen on NTStyle (from the README.md document):
This bug occurs due to UIRibbon expecting extended frames under DWM. Because NTStyle forcefully disables DWM on the application, extended frames don't work correctly and the extra allocated space is clearly seen in the client area for the window. This bug also occurs on Windows 8+ versions of UIRibbon, regardless of whether or not DWM is running. It is also observed with official implements of client-side decorations, such as Win32k (classic theme) and UxTheme (XP/Aero Basic theme engine).
To recap, here are the following cases this may occur:
DwmSetWindowAttribute
.DwmSetWindowAttribute
.Since you can detect the presence of UIRibbon in an application easily (via current application image name, loaded module image names, child window class name searching, or even a combination of all three), and because the extraneous space is highly predictable (it's the same size as DWM titlebars), a hack can be used for UIRibbon applications to crop this space from the window via custom handlers for window messages like WM_NCCALCSIZE
, WM_NCHITTEST
, and WM_NCPAINT
.
The following information may useful for implementing a system to detect the presence of UIRibbon in a program or window:
EnumProcessModules
from psapi.h
can be used to search for UIRibbon.dll
in all supported operating systems (Windows NT 4.0+, not supported in 9x).UIRibbonCommandBarDock
for its UI.%SystemRoot%\System32\mspaint.exe
(+ x86 copy in SysWOW64)%ProgramFiles%\Windows NT\Accessories\wordpad.exe
(+ x86 copy)%SystemRoot%\explorer.exe
(since Windows 8, only for some windows)This may not seem a desirable solution (it is really hacky, after all), but it's the easiest solution that I can think of for this case. Another solution is to hook UIRibbon, but this is:
The links in README.md that should open up the releases and issues page return error 404.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.