How can I refer to active Window of WPF application in C#, using something like ActiveForm property in WinForms?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
One possible way would be to scan the list of open windows in the application and check which one of them has
IsActive = true:Not sure if there may be more than one active window if, for example, there’s a modal dialog showing, in which case, the owner of the dialog and the dialog itself might be active.