Win98 2000 XP下,SetForegroundWindow 已经被 FlashWindowEx 取代。<br>也就是说,任务条上的按钮只闪几下完事,要想把它提到前端,的试试下面的代码了。<br><br>procedure SwitchWindowToTop(wh: THandle);<br>var<br> hCurrWnd: THandle;<br> iMyTID, iCurrTID: integer;<br>begin<br> hCurrWnd := GetForegroundWindow;<br> iMyTID := GetCurrentThreadId;<br> iCurrTID := GetWindowThreadProcessId(hCurrWnd, nil);<br> AttachThreadInput(iMyTID, iCurrTID, True);<br> SetForegroundWindow(wh);<br> AttachThreadInput(iMyTID, iCurrTID, False);<br>end;