BringWindowToTop和SetForegroundWindow这两个API函数有什么区别?

解决方案 »

  1.   

    The BringWindowToTop function brings the specified window to the top of the Z order. If the window is a top-level window, it is activated. If the window is a child window, the top-level parent window associated with the child window is activated. The SetForegroundWindow function puts the thread that created the specified window into the foreground and activates the window. Keyboard input is directed to the window, and various visual cues are changed for the user. The system assigns a slightly higher priority to the thread that created the foreground window than it does to other threads.
      

  2.   

    1.什么是top-level window,怎么样的窗口才能算top-level window?
    2.我查到一段英文
          Use the BringWindowToTop function to uncover any window that is partially or completely obscured by other windows. 
    Calling this function is similar to calling the SetWindowPos function to change a window's position in the Z order. BringWindowToTop does not make a window a top-level window. 
          If an application is not in the foreground and wants to be in the foreground, it should call the SetForegroundWindow function. 
    问题:"an application is in the foreground"和"an application is not in the foreground"这两种应用程序有什么区别?