-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix issue with LPTSTR #7
base: master
Are you sure you want to change the base?
Conversation
@@ -16,15 +17,15 @@ Napi::Boolean Method(const Napi::CallbackInfo& info) { | |||
|
|||
#ifdef _WIN32 | |||
HKEY hKey; | |||
LPTSTR lpValueName = "NOC_GLOBAL_SETTING_TOASTS_ENABLED"; | |||
std::string lpValueName = "NOC_GLOBAL_SETTING_TOASTS_ENABLED"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It ought to be
- LPTSTR lpValueName = "NOC_GLOBAL_SETTING_TOASTS_ENABLED";
+ LPCTSTR lpValueName = TEXT("NOC_GLOBAL_SETTING_TOASTS_ENABLED");
but do not worry. It's not gonna work even if you fix it:
Since a recent major update to Windows 10, "Quiet Hours" has changed to "Focus Assist" - and it seems to work differently, so previous answers don't apply any more.
A replacement https://github.com/bitdisaster/windows-focus-assist is available, but:
This native node module uses an unsupported/undocumented API to get the status of the Focus Assist. …
⚠ The API used by windows-focus-assist can change/break at any time in the future. ⚠
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the point is to make this work for people who still use OS version that supports this
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Focus assist was introduced back in 2018. Multiple OS upgrades have been released since then. Not only that, Windows 10 will reach EoL the next year.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh interesting, I didn't realize this wasn't a thing in Windows anymore. Sounds like we should just remove this check entirely, and let the OS mute the notifications if it wants to? Thank you!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems like it can still be enabled? But I am not Windows user so I don't know: https://windowsreport.com/enable-or-disable-quiet-hours/
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fix issue with newer electron and node #6 .
Seems to work fine for me, but not C dev here 😕