诸如EnumWindows()之类的函数,都只能枚举到当前会话的窗口,我想在一个session中枚举当前服务器所有会话的所有窗口,这个该怎么做?

解决方案 »

  1.   

    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.
      

  2.   

    感谢jiangsheng(蒋晟.Net[MVP]) 的回复,差不多知道该如何做了