希米日志


主页 归档 留言 友人 关于


27 0

    Private 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
    Const SWP_NOMOVE = &H2 '不更动目前视窗位置
    Const SWP_NOSIZE = &H1 '不更动目前视窗大小
    Const HWND_TOPMOST = -1 '设定为最上层
    Const HWND_NOTOPMOST = -2 '取消最上层设定
    Const FLAGS = SWP_NOMOVE Or SWP_NOSIZE

    Private Sub Command1_Click()
    SetWindowPos Me.hwnd, HWND_TOPMOST, 0, 0, 0, 0, FLAGS  '置顶
    End Sub

    Private Sub Command2_Click()
    SetWindowPos Me.hwnd, HWND_NOTOPMOST, 0, 0, 0, 0, FLAGS '取消置顶
    End Sub

 2024-04-25 02:07:00

二维码

 评论: 0

正在加载验证码......

请先完成验证

目 录