How can I detect properties of other windows forms open that are foreign to my application in C#? If not able to detect properties is there a way to identify a unique form? My goal is to be able to trigger an event based on if certain forms are opened and perform action on that event. I don't care if the process is open as there could be multiple processes open. Is there a way to identify foreign windows forms that are open?
Asked
Active
Viewed 53 times
0
-
Check if foreign, i take it you mean external, applications are open. Have you tried googling a 4 worded query to get this? : https://stackoverflow.com/questions/262280/how-can-i-know-if-a-process-is-running – someguy76 Aug 23 '17 at 14:09
-
yes external. I wouldn't post here if I didn't try google. May be wording incorrectly – JMIII Aug 23 '17 at 14:11
-
I said I don't care about process? – JMIII Aug 23 '17 at 14:11
-
So what did you find? Why didnt it work? Wheres your code that isnt working? – someguy76 Aug 23 '17 at 14:11
-
1[*UiAutomation*](https://msdn.microsoft.com/en-us/library/windows/desktop/ee684009.aspx) is the best way to interact with external UI components. There are sinkable window creation events also. – Alex K. Aug 23 '17 at 14:12
-
I want to be able to identify forms open. I won't be able to trigger event off process as process can be started multiple times and depending if it is opened first or second time the first form is different. This is just one example where it would break looking at the process. – JMIII Aug 23 '17 at 14:13
-
Ill look at UiAutomation. – JMIII Aug 23 '17 at 14:14
-
Ok that explained it a little better. I advice @AlexK. comment – someguy76 Aug 23 '17 at 14:14
-
Thanks Alex I never even knew that library existed. I didn't think about searching in that manner as I am not trying to automate the ui but just trigger other events based off of certain forms or ui elements. – JMIII Aug 23 '17 at 14:18