-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathfrmMain.frm
More file actions
80 lines (67 loc) · 2.4 KB
/
frmMain.frm
File metadata and controls
80 lines (67 loc) · 2.4 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
VERSION 5.00
Begin VB.Form frmMain
BorderStyle = 1 'Fixed Single
Caption = "Find Start Button"
ClientHeight = 930
ClientLeft = 45
ClientTop = 330
ClientWidth = 3135
BeginProperty Font
Name = "Tahoma"
Size = 8.25
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
LinkTopic = "Form1"
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 930
ScaleWidth = 3135
StartUpPosition = 2 'CenterScreen
Begin VB.ListBox List1
Height = 255
Left = 120
TabIndex = 1
Top = 90
Width = 2895
End
Begin VB.CommandButton btnStatus
Caption = "Disable Start button"
Height = 375
Left = 120
TabIndex = 0
Top = 480
Width = 2895
End
End
Attribute VB_Name = "frmMain"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Private Declare Function EnableWindow Lib "user32" (ByVal hwnd As Long, ByVal fEnable As Long) As Long
' if fEnable=0 then you disable the window. if 1, you enable it.
Private Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As Long
Private Declare Function FindWindowEx Lib "user32" Alias "FindWindowExA" (ByVal hWnd1 As Long, ByVal hWnd2 As Long, ByVal lpsz1 As String, ByVal lpsz2 As String) As Long
Private xText(1) As String
Private Toggle As Long
Private StartButtonHandle As Long
Private Sub btnStatus_Click()
Dim Funk As Long
Toggle = (Toggle + 1) Mod 2
btnStatus.Caption = xText(Toggle)
Funk = EnableWindow(StartButtonHandle, Toggle)
End Sub
Private Sub Form_Load()
Dim hWParent As Long
Toggle = 1
hWParent = FindWindow("Shell_TrayWnd", vbNullString)
StartButtonHandle = FindWindowEx(hWParent, 0&, "Button", vbNullString)
List1.AddItem "Start button handle : " + Trim(Str(StartButtonHandle))
xText(1) = "Disable Start button"
xText(0) = "Enable Start button"
End Sub