alwaysontop.bas

来自「邮件提醒程序」· BAS 代码 · 共 44 行

BAS
44
字号
Attribute VB_Name = "AlwaysOnTop"
'*************************************************************
'亮子lion
'名  称:All Seeing Eye
'描  述:电子邮件自动检查
'日  期:06/02/12
'QQ: 474366445
'E-mail/MSN: wowlion@163.com
'博  客: http://wowlion.blog.163.com

'本源代码只可用于个人用途。绝对禁止用于商业用途。
'These works is only for personal use.
'It is forbidden to use it for business purpose.
'**************************************************************
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
Public Const HWND_TOPMOST = -1
Public Const HWND_NOTOPMOST = -2



Public Sub AlwaysOnTop(myfrm As Form, SetOnTop As Boolean)
    If SetOnTop Then
    lFlag = HWND_TOPMOST
    Else
    lFlag = HWND_NOTOPMOST
    End If
    SetWindowPos myfrm.hwnd, lFlag, _
    myfrm.Left / Screen.TwipsPerPixelX, _
    myfrm.Top / Screen.TwipsPerPixelY, _
    myfrm.Width / Screen.TwipsPerPixelX, _
    myfrm.Height / Screen.TwipsPerPixelY, _
    SWP_NOACTIVATE Or SWP_SHOWWINDOW
End Sub



⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?