📄 frmfloat.frm
字号:
VERSION 5.00
Begin VB.Form frmFloat
BorderStyle = 1 'Fixed Single
ClientHeight = 1695
ClientLeft = 15
ClientTop = 15
ClientWidth = 1170
ControlBox = 0 'False
LinkTopic = "Form1"
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 1695
ScaleWidth = 1170
ShowInTaskbar = 0 'False
Begin VB.Timer m_oTimer
Left = 480
Top = 960
End
End
Attribute VB_Name = "frmFloat"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Private Const GWL_EXSTYLE = (-20)
Private Const WS_EX_TOPMOST = &H8&
Private Declare Function SetWindowLong Lib "user32" Alias "SetWindowLongA" (ByVal hwnd As Long, ByVal nIndex As Long, ByVal dwNewLong As Long) As Long
Private Declare Function GetWindowLong Lib "user32" Alias "GetWindowLongA" (ByVal hwnd As Long, ByVal nIndex As Long) As Long
Public m_nMaxWidth As Single
Private Sub Form_Load()
Dim nEX As Long
nEX = GetWindowLong(hwnd, GWL_EXSTYLE)
SetWindowLong hwnd, GWL_EXSTYLE, nEX + WS_EX_TOPMOST
Me.ZOrder 0
Dim osv As OSVERSIONINFO
osv.dwOSVersionInfoSize = Len(osv)
GetVersionEx osv
If osv.dwPlatformId = VER_PLATFORM_WIN32_NT Then
SetHook AddressOf MouseProc
m_oTimer.Interval = 10
m_oTimer.Enabled = True
End If
End Sub
Private Sub Form_Unload(Cancel As Integer)
m_oTimer.Enabled = False
End Sub
Private Function IsOnMe() As Boolean
Dim pnt As POINTAPI
Dim x As Single, y As Single
pnt.x = g_x
pnt.y = g_y
ScreenToClient frmMain.hwnd, pnt
x = pnt.x * Screen.TwipsPerPixelX
y = pnt.y * Screen.TwipsPerPixelY + Me.Top
If x >= 0 And x <= Me.Left + Me.Width Then
IsOnMe = True
Else
IsOnMe = False
End If
End Function
Private Sub m_oTimer_Timer()
If IsOnMe Then
If Me.Width < m_nMaxWidth Then
Me.Width = Me.Width + 200
Me.Refresh
End If
Else
Me.Width = 1 * Screen.TwipsPerPixelX
End If
'Me.ZOrder 0
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -