Given Terminal Services, Fast User Switch, Remote Desktop Protocol, it is a very bad idea to do this from a security perspective. You should not have access to another user's session (or desktop). For the security consideration, it is almost always a good idea to have a helper application, likely invisible and likely run from one of the "Run" keys in the registry that does your enumeration and uses some IPC technique to communicate the list to the server. If your application rely on FindWindow, rewrite it to use other IPC techniques.
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货