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

Do not throw from Win32Helper.GetFocusedWindowHandle() #58

Merged
merged 1 commit into from
Apr 26, 2018

Conversation

lanfeust69
Copy link
Contributor

This function is called during initialization, from a background thread.
An exception there will crash Excel if not handled.

Note that there is at least one case where this happens :
when Excel launches on a locked desktop (typically through a scheduled task).

Since there are already some cases where this function will return IntPtr.Zero,
it makes sense to default to this, rather than catch at the calling site.

This function is called during initialization, from a background thread.
An exception there will crash Excel if not handled.

Note that there is at least one case where this happens :
when Excel launches on a locked desktop (typically through a scheduled task).

Since there are already some cases where this function will return IntPtr.Zero,
it makes sense to default to this, rather than catch at the calling site.
@govert govert merged commit e739f4e into Excel-DNA:master Apr 26, 2018
@govert
Copy link
Member

govert commented Apr 26, 2018

Cool - thanks!

@lanfeust69 lanfeust69 deleted the fix-unhandled-exception branch April 26, 2018 17:38
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