最理想是用SetWindowPos,以下是代码及几个类似API的定义
FUNCTION ulong SetForegroundWindow(ulong hwnd) LIBRARY "user32.dll"
FUNCTION BOOLean BringWindowToTop(ulong hWnd) LIBRARY "user32.dll" // handle to window
FUNCTION BOOLean SetWindowPos( ulong hWnd,ulong hWndInsertAfter, int X,int Y, int cx, int cy,UINT uFlags ) LIBRARY "user32.dll"
ll_winhandle=handle(this)
if ll_winhandle >0 then
SetWindowPos(ll_winhandle,- 1,0,0,0,0,1)
end if