PrivateDeclareFunctionSetWindowPosLib"user32"(ByValhwndAsLong,ByValhWndInsertAfterAsLong,ByValxAsLong,ByValyAsLong,ByValcxAsLong,ByValcyAsLong,ByValwFlagsAsLong)AsLong
ConstSWP_NOMOVE=&H2'不更動目前視窗位置
ConstSWP_NOSIZE=&H1'不更動目前視窗大小
ConstHWND_TOPMOST=-1'設定為最上層
ConstHWND_NOTOPMOST=-2'取消最上層設定
ConstFLAGS=SWP_NOMOVEOrSWP_NOSIZE
'將APP視窗設定成永遠保持在最上層
SetWindowPosMe.hwnd,HWND_TOPMOST,0,0,0,0,FLAGS
'取消最上層設定
SetWindowPosMe.hwnd,HWND_NOTOPMOST,0,0,0,0,FLAGS->