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

Denying a Window Focus #29

Open
ghost opened this issue Jan 11, 2019 · 0 comments
Open

Denying a Window Focus #29

ghost opened this issue Jan 11, 2019 · 0 comments
Labels
non-project-scope--msdn-api Items more related to the actual windows api surface, the docs of which can be found on MSDN question

Comments

@ghost
Copy link

ghost commented Jan 11, 2019

I have a use case where I need to select the handle for a window (external to my app) and affirmatively keep it from gaining focus until certain conditions in my app are met. Simply forcing my app's main form to the forefront does not work since my app has other dialogs which need to get focus, obtain user input, and evaluate the input to determine that the required state exists to allow the external target window to get and keep focus.

So I guess the question is how to use WinApi in C# to "attach" to the target window and recognize when it gets focus, immediately taking focus back until the desired state in my app exists.

@prasannavl prasannavl added question non-project-scope--msdn-api Items more related to the actual windows api surface, the docs of which can be found on MSDN labels Mar 3, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
non-project-scope--msdn-api Items more related to the actual windows api surface, the docs of which can be found on MSDN question
Projects
None yet
Development

No branches or pull requests

1 participant