📄 form1.frm
字号:
VERSION 5.00
Begin VB.Form Form1
BorderStyle = 1 'Fixed Single
Caption = "灰色按钮克星1.0"
ClientHeight = 3675
ClientLeft = 45
ClientTop = 330
ClientWidth = 5895
Icon = "Form1.frx":0000
LinkTopic = "Form1"
LockControls = -1 'True
MaxButton = 0 'False
ScaleHeight = 3675
ScaleWidth = 5895
StartUpPosition = 2 '屏幕中心
Begin VB.PictureBox Picture3
Appearance = 0 'Flat
BorderStyle = 0 'None
ForeColor = &H80000008&
Height = 1935
Left = 5760
ScaleHeight = 1935
ScaleWidth = 255
TabIndex = 11
Top = 0
Width = 255
End
Begin VB.PictureBox Picture2
Appearance = 0 'Flat
BorderStyle = 0 'None
ForeColor = &H80000008&
Height = 135
Left = 4560
ScaleHeight = 135
ScaleWidth = 1215
TabIndex = 10
Top = 600
Width = 1215
End
Begin VB.PictureBox Picture1
Appearance = 0 'Flat
BorderStyle = 0 'None
ForeColor = &H80000008&
Height = 135
Left = 4560
ScaleHeight = 135
ScaleWidth = 1215
TabIndex = 9
Top = 1200
Width = 1215
End
Begin VB.Timer Timer2
Interval = 200
Left = 3240
Top = 3720
End
Begin VB.CheckBox Check1
Caption = "设置最前"
Height = 375
Left = 4560
TabIndex = 5
Top = 1800
Value = 1 'Checked
Width = 1215
End
Begin VB.CommandButton Command3
Caption = "退出"
Height = 495
Left = 4560
TabIndex = 4
Top = 1320
Width = 1215
End
Begin VB.CommandButton Command2
Caption = "停止"
Enabled = 0 'False
Height = 495
Left = 4560
TabIndex = 3
Top = 720
Width = 1215
End
Begin VB.Frame Frame1
Caption = "最上层活动窗口控件列表"
Height = 2775
Left = 0
TabIndex = 1
Top = 0
Width = 4335
Begin VB.ListBox List1
Height = 2400
Left = 120
TabIndex = 2
Top = 240
Width = 4095
End
End
Begin VB.CommandButton Command1
Caption = "激活"
Height = 495
Left = 4560
TabIndex = 0
Top = 120
Width = 1215
End
Begin VB.Timer Timer1
Enabled = 0 'False
Interval = 2000
Left = 3480
Top = 2280
End
Begin VB.Label Label3
BackStyle = 0 'Transparent
Caption = "mailto:hcl163@163.com"
BeginProperty Font
Name = "宋体"
Size = 14.25
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00C00000&
Height = 375
Left = 120
MouseIcon = "Form1.frx":08CA
MousePointer = 2 'Cross
TabIndex = 8
ToolTipText = "联系我的QQ,可以给你原代码。欢迎与大家交流VB!"
Top = 3240
Width = 3495
End
Begin VB.Label Label2
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "何成林 QQ:80956275"
BeginProperty Font
Name = "宋体"
Size = 14.25
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H000000FF&
Height = 285
Left = 120
TabIndex = 7
Top = 2880
Width = 3240
End
Begin VB.Label Label1
BackStyle = 0 'Transparent
Caption = "此小工具可以激活最上层操作窗口灰色(不可点击的按钮),可以用于安装时需要输入序列号的地方,功能自己去发现吧。"
ForeColor = &H00800080&
Height = 1575
Left = 4560
TabIndex = 6
Top = 2160
Width = 1335
End
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim window, child As Long
Private Declare Function ShellExecute Lib "shell32.dll" Alias _
"ShellExecuteA" (ByVal hwnd As Long, ByVal lpOperation As _
String, ByVal lpFile As String, ByVal lpParameters As String, _
ByVal lpDirectory As String, ByVal nShowCmd As Long) As Long
Const str1 = "何成林 QQ:80956275 "
Private Sub Check1_Click()
If Check1.Value = 1 Then
SetWindowPos Me.hwnd, HWND_TOPMOST, 0, 0, 0, 0, 1
Else
SetWindowPos Me.hwnd, 0, 0, 0, 0, 0, 1
End If
End Sub
Private Sub Check1_MouseMove(Button As Integer, Shift As Integer, x As Single, y As Single)
If GetForegroundWindow = Me.hwnd Then Check1.SetFocus
End Sub
Private Sub Command1_Click()
Timer1.Enabled = True
Command1.Enabled = False
Command2.Enabled = True
End Sub
Private Sub Command1_MouseMove(Button As Integer, Shift As Integer, x As Single, y As Single)
If GetForegroundWindow = Me.hwnd Then Command1.SetFocus
End Sub
Private Sub Command2_Click()
Timer1.Enabled = False
Command1.Enabled = True
Command2.Enabled = False
End Sub
Private Sub Command2_MouseMove(Button As Integer, Shift As Integer, x As Single, y As Single)
If GetForegroundWindow = Me.hwnd Then Command2.SetFocus
End Sub
Private Sub Command3_Click()
Timer1.Enabled = False
End
End Sub
Private Sub Command3_MouseMove(Button As Integer, Shift As Integer, x As Single, y As Single)
If GetForegroundWindow = Me.hwnd Then Command3.SetFocus
End Sub
Private Sub Form_Load()
SetWindowPos Me.hwnd, HWND_TOPMOST, 0, 0, 0, 0, 1
End Sub
Private Sub Form_MouseMove(Button As Integer, Shift As Integer, x As Single, y As Single)
Label3.FontUnderline = False
End Sub
Private Sub Label3_Click()
ShellExecute hwnd, "open", Label3.Caption, "", App.Path, 1
End Sub
Private Sub Label3_MouseMove(Button As Integer, Shift As Integer, x As Single, y As Single)
Label3.FontUnderline = True
End Sub
Private Sub Timer1_Timer()
Dim oldW As Long
Dim temp As String * 50
oldW = window
window = GetForegroundWindow
If oldW = window Then Exit Sub
If window = Me.hwnd Then Exit Sub
GetWindowText window, temp, 50
Me.Caption = "灰色按钮克星1.0-----" & temp
icount = 1
List1.Clear
window = EnumChildWindows(window, AddressOf WndEnumChildProc, List1)
End Sub
Private Sub Timer2_Timer()
Static k
k = k + 1
If k > Len(str1) Then k = 1
Label2.Caption = Left(str1, k)
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -