-
Notifications
You must be signed in to change notification settings - Fork 3
/
ucWeb.ctl
825 lines (793 loc) · 28.1 KB
/
ucWeb.ctl
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
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
VERSION 5.00
Object = "{EAB22AC0-30C1-11CF-A7EB-0000C05BAE0B}#1.1#0"; "ieframe.dll"
Begin VB.UserControl ucWeb
ClientHeight = 3615
ClientLeft = 0
ClientTop = 0
ClientWidth = 4470
ScaleHeight = 3615
ScaleWidth = 4470
Begin VB.PictureBox picNav
BackColor = &H00FEDCC0&
BorderStyle = 0 'None
CausesValidation= 0 'False
Height = 2775
Left = 0
ScaleHeight = 2775
ScaleWidth = 3315
TabIndex = 5
TabStop = 0 'False
Top = 0
Visible = 0 'False
Width = 3315
Begin VB.PictureBox picAddWeb
Appearance = 0 'Flat
BackColor = &H80000005&
CausesValidation= 0 'False
ForeColor = &H80000008&
Height = 2895
Left = 2160
ScaleHeight = 2865
ScaleWidth = 5025
TabIndex = 6
TabStop = 0 'False
Top = 1800
Visible = 0 'False
Width = 5055
Begin VB.TextBox txtAddUrl
Appearance = 0 'Flat
CausesValidation= 0 'False
BeginProperty Font
Name = "微软雅黑"
Size = 9
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 240
TabIndex = 9
TabStop = 0 'False
Top = 720
Width = 4575
End
Begin Magnifier.ucCmdBtn cmdCnl
CausesValidation= 0 'False
Height = 495
Left = 240
TabIndex = 7
TabStop = 0 'False
Top = 2040
Width = 4575
_ExtentX = 8070
_ExtentY = 873
Caption = "取消"
End
Begin Magnifier.ucCmdBtn cmdAddTxt
CausesValidation= 0 'False
Height = 495
Left = 240
TabIndex = 8
TabStop = 0 'False
Top = 1560
Width = 4575
_ExtentX = 8070
_ExtentY = 873
Caption = "添加"
End
Begin VB.Label lblShow
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "添加页面至导航"
BeginProperty Font
Name = "微软雅黑"
Size = 15
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 405
Index = 2
Left = 240
TabIndex = 10
Top = 120
Width = 2100
End
End
Begin VB.PictureBox picWeb
Appearance = 0 'Flat
AutoRedraw = -1 'True
BackColor = &H00FFCB9B&
CausesValidation= 0 'False
ForeColor = &H80000008&
Height = 1935
Index = 0
Left = 0
ScaleHeight = 1905
ScaleWidth = 2865
TabIndex = 27
TabStop = 0 'False
ToolTipText = "点击右键编辑导航"
Top = 0
Width = 2895
Begin VB.Label lblWeb
Alignment = 2 'Center
BackColor = &H00FFCB9B&
BeginProperty Font
Name = "微软雅黑"
Size = 9
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 255
Index = 0
Left = 0
TabIndex = 28
Top = 1440
Width = 2895
End
End
Begin VB.PictureBox picWeb
Appearance = 0 'Flat
AutoRedraw = -1 'True
BackColor = &H00FFCB9B&
CausesValidation= 0 'False
ForeColor = &H80000008&
Height = 1935
Index = 1
Left = 3240
ScaleHeight = 1905
ScaleWidth = 2865
TabIndex = 25
TabStop = 0 'False
ToolTipText = "点击右键编辑导航"
Top = 0
Width = 2895
Begin VB.Label lblWeb
Alignment = 2 'Center
BackColor = &H00FFCB9B&
BeginProperty Font
Name = "微软雅黑"
Size = 9
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 255
Index = 1
Left = 0
TabIndex = 26
Top = 1440
Width = 2895
End
End
Begin VB.PictureBox picWeb
Appearance = 0 'Flat
AutoRedraw = -1 'True
BackColor = &H00FFCB9B&
CausesValidation= 0 'False
ForeColor = &H80000008&
Height = 1935
Index = 2
Left = 6480
ScaleHeight = 1905
ScaleWidth = 2865
TabIndex = 23
TabStop = 0 'False
ToolTipText = "点击右键编辑导航"
Top = 0
Width = 2895
Begin VB.Label lblWeb
Alignment = 2 'Center
BackColor = &H00FFCB9B&
BeginProperty Font
Name = "微软雅黑"
Size = 9
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 255
Index = 2
Left = 0
TabIndex = 24
Top = 1440
Width = 2895
End
End
Begin VB.PictureBox picWeb
Appearance = 0 'Flat
AutoRedraw = -1 'True
BackColor = &H00FFCB9B&
CausesValidation= 0 'False
ForeColor = &H80000008&
Height = 1935
Index = 3
Left = 0
ScaleHeight = 1905
ScaleWidth = 2865
TabIndex = 21
TabStop = 0 'False
ToolTipText = "点击右键编辑导航"
Top = 2280
Width = 2895
Begin VB.Label lblWeb
Alignment = 2 'Center
BackColor = &H00FFCB9B&
BeginProperty Font
Name = "微软雅黑"
Size = 9
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 255
Index = 3
Left = 0
TabIndex = 22
Top = 1440
Width = 2895
End
End
Begin VB.PictureBox picWeb
Appearance = 0 'Flat
AutoRedraw = -1 'True
BackColor = &H00FFCB9B&
CausesValidation= 0 'False
ForeColor = &H80000008&
Height = 1935
Index = 4
Left = 3240
ScaleHeight = 1905
ScaleWidth = 2865
TabIndex = 19
TabStop = 0 'False
ToolTipText = "点击右键编辑导航"
Top = 2280
Width = 2895
Begin VB.Label lblWeb
Alignment = 2 'Center
BackColor = &H00FFCB9B&
BeginProperty Font
Name = "微软雅黑"
Size = 9
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 255
Index = 4
Left = 0
TabIndex = 20
Top = 1440
Width = 2895
End
End
Begin VB.PictureBox picWeb
Appearance = 0 'Flat
AutoRedraw = -1 'True
BackColor = &H00FFCB9B&
CausesValidation= 0 'False
ForeColor = &H80000008&
Height = 1935
Index = 5
Left = 6480
ScaleHeight = 1905
ScaleWidth = 2865
TabIndex = 17
TabStop = 0 'False
ToolTipText = "点击右键编辑导航"
Top = 2280
Width = 2895
Begin VB.Label lblWeb
Alignment = 2 'Center
BackColor = &H00FFCB9B&
BeginProperty Font
Name = "微软雅黑"
Size = 9
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 255
Index = 5
Left = 0
TabIndex = 18
Top = 1440
Width = 2895
End
End
Begin VB.PictureBox picWeb
Appearance = 0 'Flat
AutoRedraw = -1 'True
BackColor = &H00FFCB9B&
CausesValidation= 0 'False
ForeColor = &H80000008&
Height = 1935
Index = 6
Left = 0
ScaleHeight = 1905
ScaleWidth = 2865
TabIndex = 15
TabStop = 0 'False
Top = 4560
Width = 2895
Begin VB.Label lblWeb
Alignment = 2 'Center
BackColor = &H00FFCB9B&
BeginProperty Font
Name = "微软雅黑"
Size = 9
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 255
Index = 6
Left = 0
TabIndex = 16
ToolTipText = "点击右键编辑导航"
Top = 1440
Width = 2895
End
End
Begin VB.PictureBox picWeb
Appearance = 0 'Flat
AutoRedraw = -1 'True
BackColor = &H00FFCB9B&
CausesValidation= 0 'False
ForeColor = &H80000008&
Height = 1935
Index = 7
Left = 3240
ScaleHeight = 1905
ScaleWidth = 2865
TabIndex = 13
TabStop = 0 'False
ToolTipText = "点击右键编辑导航"
Top = 4560
Width = 2895
Begin VB.Label lblWeb
Alignment = 2 'Center
BackColor = &H00FFCB9B&
BeginProperty Font
Name = "微软雅黑"
Size = 9
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 255
Index = 7
Left = 0
TabIndex = 14
Top = 1440
Width = 2895
End
End
Begin VB.PictureBox picWeb
Appearance = 0 'Flat
AutoRedraw = -1 'True
BackColor = &H00FFCB9B&
CausesValidation= 0 'False
ForeColor = &H80000008&
Height = 1935
Index = 8
Left = 6480
ScaleHeight = 1905
ScaleWidth = 2865
TabIndex = 11
TabStop = 0 'False
ToolTipText = "点击右键编辑导航"
Top = 4560
Width = 2895
Begin VB.Label lblWeb
Alignment = 2 'Center
BackColor = &H00FFCB9B&
BeginProperty Font
Name = "微软雅黑"
Size = 9
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 255
Index = 8
Left = 0
TabIndex = 12
Top = 1440
Width = 2895
End
End
Begin VB.Image imgBG
Height = 2055
Left = 0
Stretch = -1 'True
Top = 0
Width = 3015
End
End
Begin VB.PictureBox picError
BackColor = &H00FEDCC0&
BorderStyle = 0 'None
CausesValidation= 0 'False
Height = 3015
Left = 0
ScaleHeight = 3015
ScaleWidth = 3135
TabIndex = 1
TabStop = 0 'False
Top = 0
Visible = 0 'False
Width = 3135
Begin VB.Label lblShow
Alignment = 2 'Center
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "*"
BeginProperty Font
Name = "微软雅黑"
Size = 14.25
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Index = 1
Left = 720
TabIndex = 3
Top = 2160
Width = 150
End
Begin VB.Label lblShow
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "糟糕,出了点小问题..."
BeginProperty Font
Name = "微软雅黑"
Size = 21.75
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 570
Index = 0
Left = 600
TabIndex = 2
Top = 1080
Width = 4230
End
Begin VB.Image imgWhale
Height = 2955
Left = 0
Picture = "ucWeb.ctx":0000
Top = 0
Width = 3510
End
End
Begin SHDocVwCtl.WebBrowser Wb
Height = 2655
Left = -23
TabIndex = 0
Top = -23
Width = 4215
ExtentX = 7435
ExtentY = 4683
ViewMode = 0
Offline = 0
Silent = 0
RegisterAsBrowser= 1
RegisterAsDropTarget= 0
AutoArrange = 0 'False
NoClientEdge = 0 'False
AlignLeft = 0 'False
NoWebView = 0 'False
HideFileNames = 0 'False
SingleClick = 0 'False
SingleSelection = 0 'False
NoFolders = 0 'False
Transparent = 0 'False
ViewID = "{0057D0E0-3573-11CF-AE69-08002B2E1262}"
Location = "http:///"
End
Begin VB.PictureBox picWebImg
Appearance = 0 'Flat
BackColor = &H80000005&
ForeColor = &H80000008&
Height = 1335
Left = 0
OLEDropMode = 1 'Manual
ScaleHeight = 87
ScaleMode = 3 'Pixel
ScaleWidth = 94
TabIndex = 4
Top = 0
Width = 1440
End
End
Attribute VB_Name = "ucWeb"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = True
Attribute VB_PredeclaredId = False
Attribute VB_Exposed = False
Option Explicit
Dim m_hMod As Long, m_hMod2 As Long 'WebBrowser Style Setting
Dim WebError As Boolean, MobSwi As Boolean, IsNav As Boolean, NowTitle As String, PageSecure As Long
Event StaTxtChange(ByVal Text As String)
Event BfrNav2(ByVal pDisp As Object, URL As Variant, flags As Variant, TargetFrameName As Variant, PostData As Variant, Headers As Variant, Cancel As Boolean)
Event DocComplete(ByVal pDisp As Object, URL As Variant)
Event DwnComplete()
Event FilDwn(ByVal URL As String, FileName As String)
Event NavComplete2(ByVal pDisp As Object, URL As Variant)
Event ProChange(ByVal Percent As Long)
Event NewWndw2(ppDisp As Object, Cancel As Boolean)
Event TtlChange(ByVal Text As String)
Event SetScrLckIcon(ByVal SecureVal As Long)
Private Sub cmdAddTxt_Click()
If txtAddUrl.Text <> "" Then
lblWeb(picAddWeb.Tag).Tag = txtAddUrl.Text
lblWeb(picAddWeb.Tag).Caption = txtAddUrl.Text
picWeb(picAddWeb.Tag).Tag = ""
picWeb(picAddWeb.Tag).Picture = LoadPicture()
WriteString "Nav", "n" & picAddWeb.Tag + 1, txtAddUrl.Text & "@@" & txtAddUrl.Text & "@@", MyPath & "Data\MagNav.ini"
Else
lblWeb(picAddWeb.Tag).Tag = ""
lblWeb(picAddWeb.Tag).Caption = ""
picWeb(picAddWeb.Tag).Tag = ""
picWeb(picAddWeb.Tag).Picture = LoadPicture()
WriteString "Nav", "n" & picAddWeb.Tag + 1, "", MyPath & "Data\MagNav.ini"
End If
picAddWeb.Visible = False
End Sub
Private Sub cmdCnl_Click()
picAddWeb.Visible = False
End Sub
Private Sub lblWeb_MouseDown(Index As Integer, Button As Integer, Shift As Integer, X As Single, Y As Single)
picWeb_MouseDown Index, Button, Shift, X, Y
End Sub
Private Sub picWeb_MouseDown(Index As Integer, Button As Integer, Shift As Integer, X As Single, Y As Single)
If Button = 1 Then
If lblWeb(Index).Tag <> "" Then
Wb.Navigate lblWeb(Index).Tag
IsNav = True
Else
GoTo Add
End If
Else
Add:
picAddWeb.Tag = Index
picAddWeb.Visible = True
End If
End Sub
Private Sub UserControl_Initialize()
Wb.Silent = True
Dim iccex As tagInitCommonControlsEx
iccex.lngSize = LenB(iccex)
iccex.lngICC = ICC_USEREX_CLASSES
InitCommonControlsEx iccex
m_hMod = LoadLibrary("shell32.dll")
m_hMod2 = LoadLibrary("explorer.exe")
End Sub
Private Sub UserControl_Resize()
Wb.Move -23, -23, UserControl.ScaleWidth + 46, UserControl.ScaleHeight + 46
picNav.Move 0, 0, UserControl.ScaleWidth, UserControl.ScaleHeight
imgBG.Move 0, 0, picNav.Width, picNav.Height
picError.Move 0, 0, picNav.Width, picNav.Height
picAddWeb.Move (picNav.Width - picAddWeb.Width) / 2, (picNav.Height - picAddWeb.Height) / 2
'===MoveNavWeb===
Dim I As Long
For I = 0 To 2
picWeb(I).Move (picNav.Width / 3 - picWeb(I).Width) / 2 + picNav.Width / 3 * I, (picNav.Height / 3 - picWeb(I).Height) / 2 + picNav.Height / 3 * 0
Next I
For I = 3 To 5
picWeb(I).Move (picNav.Width / 3 - picWeb(I).Width) / 2 + picNav.Width / 3 * (I - 3), (picNav.Height / 3 - picWeb(I).Height) / 2 + picNav.Height / 3 * 1
Next I
For I = 6 To 8
picWeb(I).Move (picNav.Width / 3 - picWeb(I).Width) / 2 + picNav.Width / 3 * (I - 6), (picNav.Height / 3 - picWeb(I).Height) / 2 + picNav.Height / 3 * 2
Next I
'======End=======
imgWhale.Move picNav.Width - imgWhale.Width, picNav.Height - imgWhale.Height
lblShow(0).Move (picNav.Width - lblShow(0).Width) / 2
lblShow(1).Move (picNav.Width - lblShow(1).Width) / 2
End Sub
Private Sub UserControl_Terminate()
If m_hMod Then FreeLibrary m_hMod
If m_hMod2 Then FreeLibrary m_hMod2
End Sub
Private Sub Wb_BeforeNavigate2(ByVal pDisp As Object, URL As Variant, flags As Variant, TargetFrameName As Variant, PostData As Variant, Headers As Variant, Cancel As Boolean)
On Error Resume Next
RaiseEvent BfrNav2(pDisp, URL, flags, TargetFrameName, PostData, Headers, Cancel) '
If URL = "about:nav" Then picNav.Visible = True: LoadNav
If picError.Visible = True Then picError.Visible = False: WebError = False
If ReadCon("MobileMode") <> 0 Then
If MobSwi = True Then Exit Sub
MobSwi = True
Wb.Navigate URL, , , , "User-Agent: " & ReadCon("UA")
Cancel = True
End If
PageSecure = 0
End Sub
Private Sub Wb_DocumentComplete(ByVal pDisp As Object, URL As Variant)
On Error Resume Next
RaiseEvent DocComplete(pDisp, URL)
If URL <> "about:nav" Then picNav.Visible = False: picAddWeb.Visible = False
If IsNav And Not (WebError) Then IsNav = False: GetNavPic
MobSwi = False
End Sub
Private Sub Wb_DownloadComplete()
RaiseEvent DwnComplete
End Sub
Private Sub Wb_FileDownload(ByVal ActiveDocument As Boolean, Cancel As Boolean)
Dim sFile As String, URL As String
On Error GoTo errH:
URL = Wb.LocationURL
If Wb.Document.activeElement.href <> "" Then URL = Wb.Document.activeElement.href
sFile = DownloadUrlToName(URL)
RaiseEvent FilDwn(URL, sFile)
errH:
End Sub
Private Sub Wb_NavigateComplete2(ByVal pDisp As Object, URL As Variant)
On Error Resume Next
RaiseEvent NavComplete2(pDisp, URL)
End Sub
Private Sub Wb_NavigateError(ByVal pDisp As Object, URL As Variant, Frame As Variant, StatusCode As Variant, Cancel As Boolean)
If InStr(LCase(URL), "java") = 0 And InStr(LCase(URL), "eiv.baidu.com") = 0 Then
lblShow(1).Caption = "这个页面暂时无法显示,您可以尝试刷新页面" & vbCrLf & "或者从搜索引擎检索该网站的相关信息" & vbCrLf & vbCrLf & "错误代码 " & StatusCode
picError.BackColor = ThmClr.MainColor
picError.Visible = True
picError.ZOrder 0
WebError = True
End If
End Sub
Private Sub Wb_NewWindow2(ppDisp As Object, Cancel As Boolean)
On Error Resume Next
RaiseEvent NewWndw2(ppDisp, Cancel)
End Sub
Private Sub Wb_ProgressChange(ByVal Progress As Long, ByVal ProgressMax As Long)
On Error Resume Next
RaiseEvent ProChange(Progress / ProgressMax)
End Sub
Private Sub Wb_SetSecureLockIcon(ByVal SecureLockIcon As Long)
If PageSecure = 0 And SecureLockIcon <> 0 Then PageSecure = SecureLockIcon
RaiseEvent SetScrLckIcon(SecureLockIcon)
End Sub
Private Sub Wb_StatusTextChange(ByVal Text As String)
On Error Resume Next
RaiseEvent StaTxtChange(Text)
End Sub
Private Sub Wb_TitleChange(ByVal Text As String)
If WebError Then
NowTitle = "Magnifier 无法载入页面"
Else
NowTitle = Text
End If
If Text = "about:nav" Then NowTitle = "Magnifier 导航"
RaiseEvent TtlChange(NowTitle)
End Sub
Public Property Get LocationName() As String
LocationName = NowTitle
End Property
Public Property Get LocationURL() As String
LocationURL = Wb.LocationURL
End Property
Public Property Get wObject() As Object
Set wObject = Wb.Object
End Property
Public Property Let wObject(ByVal New_wObject As Object)
Set Wb.Object = New_wObject
PropertyChanged "wObject"
End Property
Public Property Get Docoment() As HTMLDocument
On Error Resume Next
Set Docoment = Wb.Document
End Property
Public Property Let Document(ByVal New_Document As HTMLDocument)
Set Wb.Document = New_Document
PropertyChanged "Document"
End Property
Public Property Get SecureVal() As Long
SecureVal = PageSecure
End Property
Sub GoURL(ByVal URL As String, Optional flags As Variant = "", Optional TargetFrameName As Variant = "", Optional PostData As Variant = "", Optional Headers As Variant = "")
On Error Resume Next
Wb.Navigate URL, flags, TargetFrameName, PostData, Headers
End Sub
Sub DoCommand(ByVal lCommand As Long, Optional flags As Long = 100)
On Error Resume Next
With Wb
Select Case lCommand
Case 0
.GoBack
Case 1
.GoForward
Case 2
.Stop
Case 3
.Refresh
Case 4
.GoHome
Case 5
.Document.body.Style.Zoom = CStr(flags) & "%"
Case 6
.ExecWB 4, 1 'Save Page
Case 7
.ExecWB 6, 1 'Print Page
End Select
End With
End Sub
Private Sub LoadNav()
On Error Resume Next
Dim navstr As String, strs() As String, I As Long
For I = 0 To 8
picWeb(I).BackColor = ThmClr.ToolBar
lblWeb(I).BackColor = picWeb(I).BackColor
navstr = ReadString("Nav", "n" & I + 1, MyPath & "Data\MagNav.ini")
If navstr <> "" Then
strs = Split(navstr, "@@")
lblWeb(I).Tag = strs(0)
lblWeb(I).Caption = strs(1)
lblWeb(I).ToolTipText = strs(1)
picWeb(I).Tag = strs(2)
picWeb(I).PaintPicture LoadPicture(MyPath & picWeb(I).Tag), 0, 0, picWeb(I).Width, picWeb(I).Height
Else
picWeb(I).Tag = ""
picWeb(I).Picture = LoadPicture()
lblWeb(I).Tag = ""
lblWeb(I).Caption = ""
lblWeb(I).ToolTipText = ""
End If
Next I
picNav.BackColor = ThmClr.MainColor
If Dir(GetThmFolder & "NavBG.jpg") <> "" Then imgBG.Picture = LoadPicture(GetThmFolder & "NavBG.jpg")
End Sub
Private Sub GetNavPic()
On Error Resume Next
Dim I As Long
For I = 0 To 8
If Replace(Replace(lblWeb(I).Tag, "http:", ""), "/", "") = Replace(Replace(Wb.LocationURL, "http:", ""), "/", "") Then
picWeb(I).Tag = "Data\NavPic\n" & I + 1 & ".bmp"
SavePicture GetWebImg, MyPath & picWeb(I).Tag
WriteString "Nav", "n" & I + 1, Wb.LocationURL & "@@" & NowTitle & "@@" & picWeb(I).Tag, MyPath & "Data\MagNav.ini"
Exit For
End If
Next I
End Sub
Function GetWebImg() As stdole.StdPicture
On Error Resume Next
With picWebImg
.Width = Wb.Width - 20 * Screen.TwipsPerPixelX '减20像素,避免滚动条
.Height = Wb.Height - 20 * Screen.TwipsPerPixelX
Set .Picture = LoadPicture() '清除旧的图像
.AutoRedraw = True
PrintWindow UserControl.hWnd, .hDC, 0
DoEvents
Set GetWebImg = .Image
End With
End Function