-
Notifications
You must be signed in to change notification settings - Fork 33
/
Copy pathFindWeb.frm
449 lines (387 loc) · 13 KB
/
FindWeb.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
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
VERSION 5.00
Begin VB.Form frmFindWeb
BorderStyle = 4 'Fixed ToolWindow
Caption = "Search the Web using VBDiamond"
ClientHeight = 2130
ClientLeft = 45
ClientTop = 285
ClientWidth = 5490
ControlBox = 0 'False
Icon = "FindWeb.frx":0000
LinkTopic = "Form1"
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 2130
ScaleWidth = 5490
ShowInTaskbar = 0 'False
StartUpPosition = 1 'CenterOwner
Begin VB.CommandButton mnuAbout
Caption = "&About"
Height = 375
Left = 4200
TabIndex = 6
ToolTipText = "Do you want to know more about us?"
Top = 1680
Width = 1215
End
Begin VB.ComboBox cbFind
Height = 315
Left = 1200
TabIndex = 0
ToolTipText = "Search code, tips, file... on the web, and all this related to VB"
Top = 120
Width = 2895
End
Begin VB.CommandButton cmdCancel
Cancel = -1 'True
Caption = "&Cancel"
Height = 375
Left = 4200
TabIndex = 2
ToolTipText = "Cancel it, go back to the editor"
Top = 600
Width = 1215
End
Begin VB.CommandButton cmdFindNext
Caption = "&Find"
Default = -1 'True
Enabled = 0 'False
Height = 375
Left = 4200
TabIndex = 1
ToolTipText = "Start the search"
Top = 120
Width = 1215
End
Begin VB.Label Label4
Caption = $"FindWeb.frx":058A
BeginProperty Font
Name = "MS Sans Serif"
Size = 8.25
Charset = 0
Weight = 400
Underline = 0 'False
Italic = -1 'True
Strikethrough = 0 'False
EndProperty
ForeColor = &H00C00000&
Height = 1095
Left = 120
TabIndex = 7
Top = 1080
Width = 3975
End
Begin VB.Label Label3
AutoSize = -1 'True
Caption = "Sample :"
Height = 195
Left = 120
TabIndex = 5
Top = 600
Width = 615
End
Begin VB.Label Label1
Caption = "(wav or bmp) and resource file Print+Preview"
ForeColor = &H00000080&
Height = 375
Left = 1200
TabIndex = 4
Top = 600
Width = 2895
End
Begin VB.Label Label2
AutoSize = -1 'True
Caption = "&Search What : "
Height = 195
Left = 120
TabIndex = 3
Top = 160
Width = 1080
End
End
Attribute VB_Name = "frmFindWeb"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
' #VBIDEUtils#************************************************************
' * Programmer Name : removed
' * Web Site : http://www.ppreview.net
' * E-Mail : removed
' * Date : 08/11/1999
' * Time : 10:56
' * Module Name : frmFindWeb
' * Module Filename :
' **********************************************************************
' * Comments :
' *
' *
' **********************************************************************
Option Explicit
Private clsTooltips As New class_Tooltips
Private m_nCurrentFindRow As Long
Private m_bFound As Boolean
Private Sub cbFind_Click()
' #VBIDEUtils#************************************************************
' * Programmer Name : removed
' * Web Site : http://www.ppreview.net
' * E-Mail : removed
' * Date : 08/11/1999
' * Time : 10:56
' * Module Name : frmFindWeb
' * Module Filename :
' * Procedure Name : cbFind_Click
' * Parameters :
' **********************************************************************
' * Comments :
' *
' *
' **********************************************************************
' *** Enable the button
cmdFindNext.Enabled = True
End Sub
Private Sub cbFind_KeyPress(KeyAscii As Integer)
' #VBIDEUtils#************************************************************
' * Programmer Name : removed
' * Web Site : http://www.ppreview.net
' * E-Mail : removed
' * Date : 08/11/1999
' * Time : 10:56
' * Module Name : frmFindWeb
' * Module Filename :
' * Procedure Name : cbFind_KeyPress
' * Parameters :
' * KeyAscii As Integer
' **********************************************************************
' * Comments :
' *
' *
' **********************************************************************
' *** Enable the button
cmdFindNext.Enabled = True
End Sub
Private Sub cmdCancel_Click()
' #VBIDEUtils#************************************************************
' * Programmer Name : removed
' * Web Site : http://www.ppreview.net
' * E-Mail : removed
' * Date : 08/11/1999
' * Time : 10:56
' * Module Name : frmFindWeb
' * Module Filename :
' * Procedure Name : cmdCancel_Click
' * Parameters :
' **********************************************************************
' * Comments :
' *
' *
' **********************************************************************
Call UnloadEffect(Me)
Unload Me
End Sub
Public Sub cmdFindNext_Click()
' #VBIDEUtils#************************************************************
' * Programmer Name : removed
' * Web Site : http://www.ppreview.net
' * E-Mail : removed
' * Date : 08/11/1999
' * Time : 10:56
' * Module Name : frmFindWeb
' * Module Filename :
' * Procedure Name : cmdFindNext_Click
' * Parameters :
' **********************************************************************
' * Comments :
' * Search the Web
' *
' **********************************************************************
Dim sFind As String
Dim sURL As String
Dim sMatch As String
Dim cHourglass As class_Hourglass
Set cHourglass = New class_Hourglass
' *** Keep the text to search
sFind = cbFind.Text
If sFind = "" Then Exit Sub
' *** Add the value to search in the combo
If (CBLFind(cbFind, cbFind.Text, 0) = -1) Then
If gcolFind Is Nothing Then
Set gcolFind = New Collection
End If
gcolFind.Add sFind, sFind
End If
Me.Visible = False
' *** Replace all blanks
sFind = Replace(sFind, " and ", "+")
sFind = Replace(sFind, " ", "+")
sFind = Replace(sFind, "(", "%28")
sFind = Replace(sFind, ")", "%29")
' *** Create the URL
'sURL = "http://www.codehound.com/vb/results/results.asp?S=1&Q=" & sFind
If InStr(sFind, "+") > 0 Then
sMatch = "allwords"
Else
sMatch = "anywords"
End If
sFind = Replace(sFind, "+", " ")
sURL = "http://www.ppreview.net/Sources/SourcesSearch.asp?tbsearch=" & sFind & "&optSearch=title&cbMatch=" & sMatch
' *** Launch the search
ShellExecute 0&, "", sURL, "", "", vbNormalFocus
Call UnloadEffect(Me)
Unload Me
End Sub
Public Sub Form_Activate()
' #VBIDEUtils#************************************************************
' * Programmer Name : removed
' * Web Site : http://www.ppreview.net
' * E-Mail : removed
' * Date : 08/11/1999
' * Time : 10:56
' * Module Name : frmFindWeb
' * Module Filename :
' * Procedure Name : Form_Activate
' * Parameters :
' **********************************************************************
' * Comments :
' *
' *
' **********************************************************************
' *** Give the focus to the find combo
On Error Resume Next
cbFind.SetFocus
End Sub
Private Sub Form_Load()
' #VBIDEUtils#************************************************************
' * Programmer Name : removed
' * Web Site : http://www.ppreview.net
' * E-Mail : removed
' * Date : 08/11/1999
' * Time : 10:56
' * Module Name : frmFindWeb
' * Module Filename :
' * Procedure Name : Form_Load
' * Parameters :
' **********************************************************************
' * Comments :
' *
' *
' **********************************************************************
' *** fill the fields ***
On Error Resume Next
Dim nI As Integer
Dim prjProject As VBProject
Dim cpCodePane As CodePane
Dim nStartLine As Long
Dim nStartColumn As Long
Dim nEndline As Long
Dim nEndColumn As Long
Dim sCode As String
Dim sTmp As String
Call InitTooltips
sTmp = ""
' *** Get the active project
Set prjProject = VBInstance.ActiveVBProject
' *** If we couldn't get it, quit
If Not (prjProject Is Nothing) Then
' *** Try to find the active code pane
Set cpCodePane = VBInstance.ActiveCodePane
' *** If we couldn't get it, quit
If Not (cpCodePane Is Nothing) Then
cpCodePane.GetSelection nStartLine, nStartColumn, nEndline, nEndColumn
sCode = cpCodePane.CodeModule.Lines(nStartLine, IIf(nEndline - nStartLine = 0, 1, nEndline - nStartLine))
sCode = Replace(sCode, ".", " ")
sCode = Replace(sCode, "(", " ")
sCode = Replace(sCode, ")", " ")
sCode = Replace(sCode, ",", " ")
sCode = Replace(sCode, ":", " ")
nI = nStartColumn
Do While nI > 0
If Mid$(sCode, nI, 1) <> " " Then
sTmp = Mid$(sCode, nI, 1) & sTmp
Else
Exit Do
End If
nI = nI - 1
Loop
nI = nStartColumn + 1
Do While nI < Len(sCode) + 1
If Mid$(sCode, nI, 1) <> " " Then
sTmp = sTmp & Mid$(sCode, nI, 1)
Else
Exit Do
End If
nI = nI + 1
Loop
End If
End If
' *** Continue
cbFind.Clear
If Not (gcolFind Is Nothing) Then
For nI = 1 To gcolFind.Count
cbFind.AddItem gcolFind(nI)
Next
End If
' *** Empty the find combo
cbFind.Text = sTmp
cmdFindNext.Enabled = True
End Sub
Private Sub Form_Unload(Cancel As Integer)
' #VBIDEUtils#************************************************************
' * Programmer Name : removed
' * Web Site : http://www.ppreview.net
' * E-Mail : removed
' * Date : 08/11/1999
' * Time : 10:56
' * Module Name : frmFindWeb
' * Module Filename :
' * Procedure Name : Form_Unload
' * Parameters :
' * Cancel As Integer
' **********************************************************************
' * Comments :
' *
' *
' **********************************************************************
On Error Resume Next
Set clsTooltips = Nothing
End Sub
Private Sub mnuAbout_Click()
frmAbout.bAbout = True
frmAbout.Show vbModal
End Sub
Private Sub InitTooltips(Optional Flags As TooltipFlagConstants)
' #VBIDEUtils#************************************************************
' * Programmer Name : removed
' * Web Site : http://www.ppreview.net
' * E-Mail : removed
' * Date : 29/11/1999
' * Time : 11:15
' * Module Name : frmDependency
' * Module Filename : Dependency.frm
' * Procedure Name : InitTooltips
' * Parameters :
' * Optional Flags As TooltipFlagConstants
' **********************************************************************
' * Comments :
' *
' *
' **********************************************************************
Dim nI As Integer
On Error Resume Next
With clsTooltips
.Create Me, ttfBalloon
.MaxTipWidth = 70
.Icon = itInfoIcon
.Title = "VBIDEUtils"
For nI = 0 To Me.Controls.Count
If Trim$(Me.Controls(nI).ToolTipText) <> "" Then
If err = 0 Then
.AddTool Me.Controls(nI), tfTransparent, Me.Controls(nI).ToolTipText
Me.Controls(nI).ToolTipText = ""
Else
err.Clear
End If
End If
Next
End With
End Sub