Skip to content
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: Unspecified error when registering tray #116

Closed
wants to merge 1 commit into from
Closed

fix: Unspecified error when registering tray #116

wants to merge 1 commit into from

Conversation

joelcho
Copy link
Contributor

@joelcho joelcho commented May 25, 2024

see #111

result
}
}
.ok()
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do you think a delay of 2 seconds is enough? Shouldn't it be repeated several times?

If Shell_NotifyIconW works in thread, after the first failure, it is better to open another thread and try again in it. It should not block the main thread, and the lack of trayicon does not affect its use.

ok() will call getLastError internally, and you have called it yourself. Won't this cause problems?
Recommand to only use ok() to obtain the execution result and do not call GetLastError manually.

Copy link
Contributor Author

@joelcho joelcho May 26, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. According to the Failed to add trayicon, Unspecified error (0x80004005) #111 discussion, if the tray window of the device is not ready after 2 secs, then it is certain that the device is too behind.
  2. I don’t think anyone will switch windows within 2-5 secs after booting or login. so There is no need to process it asynchronously.
  3. Calling GetLastError multiple times in the same thread will always get the same value until a new error occurs.

The only thing worth discussing is the number of secs of delay, it could be one of 2,3,4,5, but should not be more than 5.

We don't have to consider it works on devices that should be eliminated.

@sigoden
Copy link
Owner

sigoden commented May 26, 2024

#117 is a more reasonable solution.

@joelcho joelcho closed this May 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants