为什么application.BringToFront有时不能真正把窗口切换到最前面?(100分)

  • 主题发起人 主题发起人 wulianmin
  • 开始时间 开始时间
W

wulianmin

Unregistered / Unconfirmed
GUEST, unregistred user!
有时只是在开始栏闪烁.
我搜索了一遍论坛,没有能真正解决此问题的方法:(
 
你找setwindowlong就可以找到解决办法啦
 
听课……
 
有其他窗口的属性是fsStayOnTop。这样另外非fsStayOnTop的就无法显示到最前面了。
 
没有其他窗口的属性是fsStayOnTop也这样
 
BringToFront是调用API函数SetForegroundWindow,
而SetForegroundWindow函数对本进程好象不能调用成功,
设另一个进程的窗口句柄可以激活!

此问题我也不知道怎么解决!好象得问盖子去了
 

可以自己定义一个函数,效率是一样的,我已经试验过,100%行:
Procedure MyBringToFront;
Begin
With Form1 Do
Begin
FormStyle:=fsNormal;
Show;
FormStyle:=fsStayOnTop;
Show;
End;
End;
 
The foreground window is the window at the top of the Z order.
It is the window that the user is working with.
In a preemptive multitasking environment,
you should generally let the user control which window is the foreground window.

Windows NT 5.0 and later: An application cannot force a window to the
foreground while the user is working with another window. Instead,
SetForegroundWindow will activate the window (see SetActiveWindow) and
call theFlashWindowEx function to notify the user.
 
多人接受答案了。
 
后退
顶部