# Re: 请问如何可以令我自制的小程式 always on top 呢? thank you :)

Posted by 小v on June 25, 1999 at 12:55:20:

In Reply to: 请问如何可以令我自制的小程式 always on top 呢? thank you :) posted by Ar 邦 on June 24, 1999 at 21:22:43:

: nt

Declare Function SetWindowPos Lib "user32" (ByVal hwnd As Long, ByVal hWndInsertAfter As Long, ByVal X As Long, ByVal Y As Long, ByVal cx As Long, ByVal cy As Long, ByVal wFlags As Long) As Long

设定from1为always on top:
Call SetWindowPos(Form1.Hwnd, -1, 0, 0, 0, 0, &H2 Or &H1)

取消:
Call SetWindowPos(Form1.Hwnd, -2, 0, 0, 0, 0, &H2 Or &H1)

Follow Ups: