SetForegroundWindow与BringWindowToTop有什么不同, 前台窗口、活动窗口、顶层的TOP窗口三者有什么区别?

解决方案 »

  1.   

    功能类似,但有一点小区别
    bringwindowtotop 如果窗口为顶层窗口,则该窗口被激活;如果窗口为子窗口,则相应的顶级
    SetForegroundWindow 该函数将创建指定窗口的线程设置到前台,并且激活该窗口。键盘输入转向该窗口,并为用户改各种可视的记号。系统给创建前台窗口的线程分配的权限稍高于其他线程。 
    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.   SetForegroundWindow 该函数将创建指定窗口的线程设置到前台,并且激活该窗口。键盘输入转向该窗口,并为用户改各种可视的记号。系统给创建前台窗口的线程分配的权限稍高于其他线程。 
    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.   

    妹的,csdn回帖复制功能也越来越乱了
    bringwindowtotop 如果窗口为顶层窗口,则该窗口被激活;如果窗口为子窗口,则相应的顶级父窗口被激活。
      

  3.   

    一般情况下,Windows系统把刚刚创建的窗口放在Z次序的顶部,Windows总是把活动的窗口放在Z次序的顶部,应用程序可以用函数BringWindowToTop把一个窗口放置到Z次序的顶部活动窗口:活动窗口是应用程序的顶层窗口,也是当前使用的窗口。只有一个顶层窗口可以是活动窗口,如果用户使用的是一个子窗口,Windows系统就激活与这个子窗口相应的顶层窗口。
    任何时候系统中只能有一个顶层窗口是活动的。用户通过单击窗口(或其中的一个子窗口)前台窗口和后台窗口:
    在Windows系统中,每个进程可运行多个线程,每个线程都能创建窗口。创建正在使用的窗口的线程称之为前台线程,这个窗口也称之为前台窗口。所有其他的线程都是后台线程,由后台线程所创建的窗口叫做后台窗口。