-
-
Notifications
You must be signed in to change notification settings - Fork 86
Description
Is there an existing issue for this?
- I have searched the existing issues
What happened?
Issue Overview
Some critical WinAPI calls such as RegisterClass and DwmSetWindowAttribute are used without checking their return values. This can make debugging difficult if these calls fail silently.
Steps to Reproduce
Inspect the implementation of WindowClassRegistrar::GetWindowClass()
Observe that RegisterClass is called without checking its return value
Inspect Win32Window::UpdateTheme()
Observe that DwmSetWindowAttribute is called without verifying success
Expected Behavior
WinAPI calls should have their return values checked
Failures should be logged or handled appropriately
Actual Behavior
Failures in these API calls are not detected
Debugging issues related to window creation or theme updates becomes difficult
Suggested Improvements
Add minimal error handling for these calls:
if (!RegisterClass(&window_class)) {
OutputDebugString(L"Failed to register window class\n");
}
HRESULT hr = DwmSetWindowAttribute(...);
if (FAILED(hr)) {
OutputDebugString(L"Failed to set dark mode attribute\n");
}
Record
- I agree to follow this project's Code of Conduct
- I want to work on this issue