简体   繁体   中英

Get Child window using ProcessID or Window Handle?

My program A launched program B (both are separate exe's). Now my program B need to find if A have any modal/child window open using A's processID.

Is there any way to do so?

Thanks a lot for your help.

您也许可以使用该问题的一些建议(如果您不介意使用Win32调用)。

I found the soln.
1. Get handle of parent window A.
PerformanceCounter perId = new PerformanceCounter("Process", "Creating Process ID", Process.GetCurrentProcess().ProcessName);

2. Use GetLastActivePopup method to get last active popup (Last popup works in my case :) ) .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM