-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathfrmHiddenWins.frm
174 lines (154 loc) · 5.17 KB
/
frmHiddenWins.frm
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
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
VERSION 5.00
Begin VB.Form frmHiddenWins
BorderStyle = 1 'Fixed Single
Caption = "Hidden Windows"
ClientHeight = 3225
ClientLeft = 45
ClientTop = 330
ClientWidth = 2940
BeginProperty Font
Name = "Tahoma"
Size = 8.25
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Icon = "frmHiddenWins.frx":0000
LinkTopic = "Form1"
LockControls = -1 'True
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 3225
ScaleWidth = 2940
StartUpPosition = 3 'Windows Default
Begin VB.CommandButton cmdKillWin
Caption = "Kill Window"
Height = 345
Left = 1500
TabIndex = 2
Top = 2790
Width = 1245
End
Begin VB.CommandButton cmdShowWin
Caption = "Show Window"
Height = 345
Left = 270
TabIndex = 1
Top = 2790
Width = 1245
End
Begin VB.ListBox lstWins
Appearance = 0 'Flat
Height = 1980
Left = 90
TabIndex = 0
Top = 720
Width = 2775
End
Begin VB.Label Label1
Caption = "Click an item to show its information in the main screen. Double-click it to show the window again."
Height = 585
Left = 90
TabIndex = 3
Top = 60
Width = 2745
End
End
Attribute VB_Name = "frmHiddenWins"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
'##################################
' Kill Window
'##################################
Private Sub cmdKillWin_Click()
Dim DataSplit() As String, ListData As String
Dim Response
If lstWins.Text = "" Then
MsgBox "There is no window to kill!", vbExclamation, "Window Tools Professional"
Else
If frmMain.chkKill = 1 Then
Response = MsgBox("Are you sure you want to kill this parent/window?", vbYesNo, "Window Tools Professional")
If Response = vbYes Then
ListData = lstWins.Text
DataSplit = Split(ListData, " ")
Call SendMessage(DataSplit(0), WM_CLOSE, 0&, 0&)
RemoveListItem lstWins.Text
If frmMain.lblhwnd.Caption = DataSplit(0) Then
ClearMain
End If
ElseIf Response = vbNo Then
Exit Sub
Else
Exit Sub
End If
Else
ListData = lstWins.Text
DataSplit = Split(ListData, " ")
Call SendMessage(DataSplit(0), WM_CLOSE, 0&, 0&)
RemoveListItem lstWins.Text
If frmMain.lblhwnd.Caption = DataSplit(0) Then
ClearMain
End If
End If
End If
End Sub
'##################################
' Show Hidden Window
'##################################
Private Sub cmdShowWin_Click()
Dim DataSplit() As String, ListData As String
If lstWins.Text = "" Then
MsgBox "There is no window to show! If you have a list, you must select one first.", vbExclamation, "Window Tools Professional"
Else
ListData = lstWins.Text
DataSplit = Split(ListData, " ")
ShowWin (CLng(DataSplit(0)))
RemoveListItem lstWins.Text
End If
End Sub
Private Sub lstWins_Click()
' This function will show the specs of a window someone has hidden
' on the main screen.
Dim DataSplit() As String, ListData As String
If lstWins.Text = "" Then
Exit Sub
End If
ListData = lstWins.Text
DataSplit = Split(ListData, " ") ' split up our text to get the right data
WindowSpyUpdate (CLng(DataSplit(0))) ' update main screen
End Sub
Private Sub lstWins_DblClick()
' the person can also double-click an item to un-hide it!!!
Dim DataSplit() As String, ListData As String
If lstWins.Text = "" Then
MsgBox "There is no window to show! If you have a list, you must select one first.", vbExclamation, "Window Tools Professional"
Else
ListData = lstWins.Text
DataSplit = Split(ListData, " ")
ShowWin (CLng(DataSplit(0)))
RemoveListItem lstWins.Text
End If
End Sub
Public Sub ShowWin(hWnd As Long)
' obvious...
Call ShowWindow(hWnd, SW_SHOW)
End Sub
Public Sub ClearMain()
frmMain.lblhwnd.Caption = "[none]"
frmMain.lblText.Caption = "[none]"
frmMain.lblClass.Caption = "[none]"
frmMain.lblParent.Caption = "[none]"
frmMain.lblParentText.Caption = "[none]"
frmMain.lblParenthWnd.Caption = "[none]"
End Sub
Private Sub Form_Terminate()
frmMain.chkHiddenWins = 0
End Sub
Private Sub Form_Unload(Cancel As Integer)
frmMain.chkHiddenWins = 0
End Sub