Skip to content

Make it clearer where GetForegroundWindow method comes from #49414

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

afscrome
Copy link
Contributor

Contributing to the Azure SDK

The sample makes use of GetForegroundWindow(), but doesn't show where the method comes from.

Added the DllImport for that method to show where the windows handle comes from.

The sample makes use of `GetForegroundWindow()`, but doesn't show where the method comes from.

Added the DllImport for that method to show where the windows handle comes from.
@afscrome afscrome requested review from schaabs, christothes and a team as code owners April 15, 2025 09:22
@github-actions github-actions bot added Azure.Identity Community Contribution Community members are working on the issue customer-reported Issues that are reported by GitHub users external to the Azure organization. labels Apr 15, 2025
Copy link

Thank you for your contribution @afscrome! We will review the pull request and get back to you soon.

@azure-sdk
Copy link
Collaborator

API change check

API changes are not detected in this pull request.

Comment on lines +59 to +60
[DllImport("user32.dll")]
static extern IntPtr GetForegroundWindow();
Copy link
Member

Choose a reason for hiding this comment

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

Thanks for the contribution!

This is failing the build because the exact same code needs to be placed in this file in the same location. However, the file in question already contains this code, just outside the snippet, so for this to build, you'll need to add it to the .cs file as so:

#if SNIPPET
[DllImport("user32.dll")]
static extern IntPtr GetForegroundWindow();
#endif

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Azure.Identity Community Contribution Community members are working on the issue customer-reported Issues that are reported by GitHub users external to the Azure organization.
Projects
Status: Untriaged
Development

Successfully merging this pull request may close these issues.

3 participants