📄 form1.frm
字号:
VERSION 5.00
Begin VB.Form Form1
BorderStyle = 3 'Fixed Dialog
Caption = "灰色按钮克星"
ClientHeight = 2610
ClientLeft = 45
ClientTop = 435
ClientWidth = 6810
LinkTopic = "Form1"
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 2610
ScaleWidth = 6810
ShowInTaskbar = 0 'False
StartUpPosition = 3 '窗口缺省
Begin VB.Timer Timer2
Interval = 100
Left = 4860
Top = 3900
End
Begin VB.Timer Timer1
Interval = 100
Left = 690
Top = 3990
End
Begin VB.CheckBox Check1
Caption = "在最上面"
Height = 345
Left = 5550
TabIndex = 4
Top = 2130
Width = 1035
End
Begin VB.ListBox List1
Height = 2040
Left = 60
TabIndex = 3
Top = 60
Width = 5325
End
Begin VB.CommandButton Command3
Caption = "退出"
Height = 405
Left = 5550
TabIndex = 2
Top = 1440
Width = 1065
End
Begin VB.CommandButton Command2
Caption = "取消"
Height = 405
Left = 5550
TabIndex = 1
Top = 825
Width = 1065
End
Begin VB.CommandButton Command1
Caption = "激活"
Height = 405
Left = 5550
TabIndex = 0
Top = 210
Width = 1065
End
Begin VB.Label Label3
Caption = "可以激活最上层操作窗口灰色(不可点击的按钮)"
Height = 405
Left = 2970
TabIndex = 6
Top = 2160
Width = 2340
End
Begin VB.Label Label2
Caption = "Label2"
Height = 255
Left = 90
TabIndex = 5
Top = 2190
Width = 2655
End
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
'★★★★★****************************★★★★★**********************★★★★★
'金诺VB园-收藏整理
'本站是专注于VB和VBNET编程的源码下载站
'发布日期:2008-3-27 8:22:57
'网 站:http://www.vbget.com/ (金诺VB园)
'网 站:http://www.vbget.com/daohan/ (VB编程网址导航)
'E-Mail :vbget@yahoo.cn
'QQ :158676144
'源码作者:如果您有VB商业源码需要获得收益,本站将有VIP收费下载频道可供你发布!
' 您有权定价;改价;删除;及即时查看下载量(即收益),所有收益全部归您!
' 本站将在双方协商的一个金额周期内打款到作者帐户中,您只需负责打款费用!
' 本站只作为一个平台提供最新VB源码咨讯和源码下载!
'本注释由<站长工具之智能注释>软件自动添加!金诺VB园有此软件下载!
'★★★★★****************************★★★★★**********************★★★★★
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 = "金诺VB园 www.vbget.com "
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)
Label2.FontUnderline = False
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 = "激活灰色按钮-----" & 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 + -