I have a process which opens a form and a tray icon on startup. I want to discover from a c# application what is the handle of the form and tray icon of the exe process above, and what are the handles of all child windows of this exe.
Thanks.
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.
For the window handle it is easiest to use
System.Diagnostics.Processand theMainWindowHandleproperty. You don’t state how you want to identify the other process but theProcessclass has lots of options for that.Regarding the notification area icon, there is no API for what you are asking. You’d need to either hook the
Shell_NotifyIconAPI or modify the other process to cooperate.