Current News Archived News Search News Discussion Forum Old Forum Install Programs More Downloads... Troubleshooting Source Code Format Specs. Misc. Information Non-SF Stuff Links Small banner for links to this site: |
1 VERSION 4.00
2 Begin VB.Form Options
3 BorderStyle = 3 'Fixed Dialog
4 Caption = "Options"
5 ClientHeight = 4695
6 ClientLeft = 1575
7 ClientTop = 1815
8 ClientWidth = 5415
9 Height = 5100
10 Icon = "Options.frx":0000
11 KeyPreview = -1 'True
12 Left = 1515
13 LinkTopic = "Form1"
14 MaxButton = 0 'False
15 MinButton = 0 'False
16 ScaleHeight = 4695
17 ScaleWidth = 5415
18 ShowInTaskbar = 0 'False
19 Top = 1470
20 Width = 5535
21 Begin VB.CommandButton Command2
22 Caption = "&Cancel"
23 Height = 375
24 Left = 3120
25 TabIndex = 1
26 Top = 4200
27 Width = 1335
28 End
29 Begin VB.CommandButton Command1
30 Caption = "O&k"
31 Height = 375
32 Left = 960
33 TabIndex = 0
34 Top = 4200
35 Width = 1335
36 End
37 Begin VB.PictureBox TabDisps
38 BorderStyle = 0 'None
39 Height = 3495
40 Index = 1
41 Left = 240
42 ScaleHeight = 3495
43 ScaleWidth = 4995
44 TabIndex = 34
45 TabStop = 0 'False
46 Top = 480
47 Width = 4995
48 Begin VB.TextBox Text1
49 Height = 285
50 Left = 0
51 MaxLength = 6
52 TabIndex = 3
53 Text = "1024"
54 Top = 600
55 Width = 1215
56 End
57 Begin VB.TextBox Text2
58 Height = 285
59 Left = 0
60 TabIndex = 4
61 Text = "0"
62 Top = 1200
63 Width = 1215
64 End
65 Begin VB.CheckBox Check2
66 Caption = "&Associate WinMPQ with MPQ Archives"
67 Height = 255
68 Left = 0
69 TabIndex = 5
70 Top = 1680
71 Value = 2 'Grayed
72 Width = 3375
73 End
74 Begin VB.CheckBox Check4
75 Caption = "Use &wildcards in filenames for drag and drop"
76 Height = 255
77 Left = 0
78 TabIndex = 7
79 Top = 2400
80 Value = 2 'Grayed
81 Width = 3735
82 End
83 Begin VB.CheckBox Check5
84 Caption = "Automatically update &modified files"
85 Height = 255
86 Left = 0
87 TabIndex = 6
88 Top = 2160
89 Value = 2 'Grayed
90 Width = 3015
91 End
92 Begin VB.Label Label1
93 AutoSize = -1 'True
94 Caption = "Maximum files for new archives: (this cannot be changed for an existing archive)"
95 Height = 495
96 Left = 0
97 TabIndex = 37
98 Top = 120
99 Width = 4335
100 WordWrap = -1 'True
101 End
102 Begin VB.Label Label2
103 AutoSize = -1 'True
104 Caption = "Locale ID for adding files"
105 Height = 195
106 Left = 0
107 TabIndex = 36
108 Top = 960
109 Width = 1755
110 End
111 Begin VB.Label Label3
112 Caption = $"Options.frx":000C
113 Height = 855
114 Left = 0
115 TabIndex = 35
116 Top = 2640
117 Width = 4935
118 End
119 End
120 Begin VB.PictureBox TabDisps
121 BorderStyle = 0 'None
122 Height = 3495
123 Index = 2
124 Left = 240
125 ScaleHeight = 3495
126 ScaleWidth = 4935
127 TabIndex = 40
128 TabStop = 0 'False
129 Top = 480
130 Visible = 0 'False
131 Width = 4935
132 Begin VB.CommandButton cmdAddFolder
133 Caption = "Add &Folder..."
134 Height = 375
135 Left = 3480
136 TabIndex = 10
137 Top = 1320
138 Width = 1335
139 End
140 Begin VB.CheckBox Check8
141 Caption = "Do not use above lists when one is found by above option"
142 Height = 375
143 Left = 0
144 TabIndex = 13
145 Top = 2880
146 Value = 2 'Grayed
147 Width = 3375
148 End
149 Begin VB.CheckBox Check7
150 Caption = "Use file lists for similarly named archives"
151 Height = 195
152 Left = 0
153 TabIndex = 12
154 Top = 2640
155 Width = 3375
156 End
157 Begin VB.CommandButton cmdDelList
158 Caption = "&Remove"
159 Height = 375
160 Left = 3480
161 TabIndex = 11
162 Top = 1920
163 Width = 1335
164 End
165 Begin VB.ListBox FileLists
166 Height = 2205
167 Left = 0
168 TabIndex = 8
169 Top = 360
170 Width = 3375
171 End
172 Begin VB.CommandButton cmdAddList
173 Caption = "&Add List File..."
174 Height = 375
175 Left = 3480
176 TabIndex = 9
177 Top = 720
178 Width = 1335
179 End
180 Begin VB.Label Label11
181 Caption = "Note: Each file list added will increase the load time for archives."
182 Height = 255
183 Left = 0
184 TabIndex = 51
185 Top = 3240
186 Width = 4815
187 End
188 Begin VB.Label Label10
189 AutoSize = -1 'True
190 Caption = "File Lists:"
191 Height = 195
192 Left = 0
193 TabIndex = 50
194 Top = 120
195 Width = 645
196 End
197 End
198 Begin VB.PictureBox TabDisps
199 BorderStyle = 0 'None
200 Height = 3495
201 Index = 5
202 Left = 240
203 ScaleHeight = 3495
204 ScaleWidth = 4935
205 TabIndex = 38
206 TabStop = 0 'False
207 Top = 480
208 Visible = 0 'False
209 Width = 4935
210 Begin VB.CommandButton Command4
211 Caption = "&Reset size/position"
212 Height = 375
213 Left = 360
214 TabIndex = 16
215 Top = 840
216 Width = 1695
217 End
218 Begin VB.CheckBox Check3
219 Caption = "Display &confirmation boxes"
220 Height = 255
221 Left = 0
222 TabIndex = 14
223 Top = 120
224 Value = 2 'Grayed
225 Width = 2415
226 End
227 Begin VB.CheckBox Check1
228 Caption = "&Save last window size and position"
229 Height = 255
230 Left = 0
231 TabIndex = 15
232 Top = 480
233 Value = 2 'Grayed
234 Width = 3015
235 End
236 Begin VB.Frame Frame1
237 Caption = "Startup Path"
238 Height = 1215
239 Left = 0
240 TabIndex = 39
241 Top = 2280
242 Width = 4935
243 Begin VB.OptionButton Option1
244 Caption = "Last &open folder"
245 Height = 255
246 Index = 0
247 Left = 120
248 TabIndex = 17
249 Top = 240
250 Value = -1 'True
251 Width = 1575
252 End
253 Begin VB.OptionButton Option1
254 Caption = "A&pplication folder"
255 Height = 255
256 Index = 1
257 Left = 1680
258 TabIndex = 18
259 Top = 240
260 Width = 1695
261 End
262 Begin VB.OptionButton Option1
263 Caption = "&User-defined folder"
264 Height = 255
265 Index = 2
266 Left = 120
267 TabIndex = 19
268 Top = 480
269 Width = 1695
270 End
271 Begin VB.TextBox Text3
272 Enabled = 0 'False
273 Height = 285
274 Left = 120
275 TabIndex = 20
276 Top = 840
277 Width = 3615
278 End
279 Begin VB.CommandButton Command5
280 Caption = "&Folder..."
281 Enabled = 0 'False
282 Height = 285
283 Left = 3840
284 TabIndex = 21
285 Top = 840
286 Width = 975
287 End
288 End
289 End
290 Begin VB.PictureBox TabDisps
291 BorderStyle = 0 'None
292 Height = 3495
293 Index = 4
294 Left = 240
295 ScaleHeight = 3495
296 ScaleWidth = 4935
297 TabIndex = 42
298 TabStop = 0 'False
299 Top = 480
300 Visible = 0 'False
301 Width = 4935
302 Begin VB.ListBox Actions
303 Height = 1215
304 IntegralHeight = 0 'False
305 Left = 3120
306 TabIndex = 23
307 Top = 2280
308 Width = 1815
309 End
310 Begin MSComctlLib.ListView FileTypes
311 Height = 2535
312 Left = 0
313 TabIndex = 22
314 Top = 960
315 Width = 3015
316 _ExtentX = 5318
317 _ExtentY = 4471
318 View = 3
319 LabelEdit = 1
320 Sorted = -1 'True
321 MultiSelect = -1 'True
322 LabelWrap = -1 'True
323 HideSelection = -1 'True
324 _Version = 393217
325 ForeColor = -2147483640
326 BackColor = -2147483643
327 BorderStyle = 1
328 Appearance = 1
329 NumItems = 1
330 BeginProperty ColumnHeader(1) {BDD1F052-858B-11D1-B16A-00C0F0283628}
331 Text = "Registered file types:"
332 Object.Width = 2540
333 EndProperty
334 End
335 Begin VB.Label Label9
336 AutoSize = -1 'True
337 Caption = "File extensions:"
338 Height = 195
339 Left = 3120
340 TabIndex = 49
341 Top = 960
342 Width = 1080
343 End
344 Begin VB.Label Label7
345 AutoSize = -1 'True
346 Caption = "Default action:"
347 Height = 195
348 Left = 3120
349 TabIndex = 47
350 Top = 2040
351 Width = 1035
352 End
353 Begin VB.Label Label8
354 Height = 855
355 Left = 3120
356 TabIndex = 48
357 Top = 1200
358 Width = 1755
359 End
360 Begin VB.Label Label6
361 AutoSize = -1 'True
362 Caption = $"Options.frx":00F6
363 Height = 855
364 Left = 0
365 TabIndex = 46
366 Top = 120
367 Width = 4935
368 WordWrap = -1 'True
369 End
370 End
371 Begin VB.PictureBox TabDisps
372 BorderStyle = 0 'None
373 Height = 3495
374 Index = 3
375 Left = 240
376 ScaleHeight = 3495
377 ScaleWidth = 4935
378 TabIndex = 41
379 TabStop = 0 'False
380 Top = 480
381 Visible = 0 'False
382 Width = 4935
383 Begin VB.ComboBox Combo3
384 Height = 315
385 ItemData = "Options.frx":01CE
386 Left = 2880
387 List = "Options.frx":01F3
388 Style = 2 'Dropdown List
389 TabIndex = 33
390 Top = 3120
391 Width = 1815
392 End
393 Begin VB.ComboBox Combo2
394 Height = 315
395 ItemData = "Options.frx":0245
396 Left = 1200
397 List = "Options.frx":024F
398 Style = 2 'Dropdown List
399 TabIndex = 32
400 Top = 3120
401 Width = 1455
402 End
403 Begin VB.ListBox List1
404 Height = 1815
405 ItemData = "Options.frx":0266
406 Left = 0
407 List = "Options.frx":0268
408 Sorted = -1 'True
409 TabIndex = 26
410 Top = 720
411 Width = 1575
412 End
413 Begin VB.TextBox Text4
414 Height = 285
415 Left = 0
416 TabIndex = 24
417 Top = 360
418 Width = 855
419 End
420 Begin VB.CommandButton cmdAdd
421 Caption = "&Add"
422 Height = 285
423 Left = 960
424 TabIndex = 25
425 Top = 360
426 Width = 615
427 End
428 Begin VB.CommandButton Command6
429 Caption = "&Remove"
430 Height = 255
431 Left = 0
432 TabIndex = 27
433 Top = 2640
434 Width = 1095
435 End
436 Begin VB.ComboBox Combo1
437 Enabled = 0 'False
438 Height = 315
439 ItemData = "Options.frx":026A
440 Left = 1800
441 List = "Options.frx":027A
442 Style = 2 'Dropdown List
443 TabIndex = 28
444 Top = 720
445 Width = 2535
446 End
447 Begin VB.Frame Frame2
448 Caption = "Audio Compression"
449 Height = 1335
450 Left = 1800
451 TabIndex = 43
452 Top = 1200
453 Visible = 0 'False
454 Width = 2535
455 Begin VB.OptionButton AudioC
456 Caption = "Medium"
457 Height = 255
458 Index = 0
459 Left = 120
460 TabIndex = 30
461 Top = 600
462 Value = -1 'True
463 Width = 2175
464 End
465 Begin VB.OptionButton AudioC
466 Caption = "Highest (Least space)"
467 Height = 255
468 Index = 1
469 Left = 120
470 TabIndex = 31
471 Top = 960
472 Width = 2175
473 End
474 Begin VB.OptionButton AudioC
475 Caption = "Lowest (Best quality)"
476 Height = 255
477 Index = 2
478 Left = 120
479 TabIndex = 29
480 Top = 240
481 Width = 2175
482 End
483 End
484 Begin VB.Label ZLibLabel
485 AutoSize = -1 'True
486 Caption = "Deflate Compression Level"
487 Height = 195
488 Left = 2880
489 TabIndex = 53
490 Top = 2880
491 Width = 1890
492 End
493 Begin VB.Label Label12
494 AutoSize = -1 'True
495 Caption = "Default Compression"
496 Height = 195
497 Left = 1200
498 TabIndex = 52
499 Top = 2880
500 Width = 1455
501 End
502 Begin VB.Label Label5
503 Caption = "Compression type"
504 Height = 255
505 Left = 1800
506 TabIndex = 45
507 Top = 480
508 Width = 1935
509 End
510 Begin VB.Label Label4
511 Caption = "File Extension"
512 Height = 255
513 Left = 0
514 TabIndex = 44
515 Top = 120
516 Width = 1215
517 End
518 End
519 Begin MSComctlLib.TabStrip Tabs
520 Height = 3975
521 Left = 120
522 TabIndex = 2
523 Top = 120
524 Width = 5175
525 _ExtentX = 9128
526 _ExtentY = 7011
527 HotTracking = -1 'True
528 _Version = 393216
529 BeginProperty Tabs {1EFB6598-857C-11D1-B16A-00C0F0283628}
530 NumTabs = 5
531 BeginProperty Tab1 {1EFB659A-857C-11D1-B16A-00C0F0283628}
532 Caption = "General"
533 ImageVarType = 2
534 EndProperty
535 BeginProperty Tab2 {1EFB659A-857C-11D1-B16A-00C0F0283628}
536 Caption = "File Lists"
537 ImageVarType = 2
538 EndProperty
539 BeginProperty Tab3 {1EFB659A-857C-11D1-B16A-00C0F0283628}
540 Caption = "Compression Auto-Selection"
541 ImageVarType = 2
542 EndProperty
543 BeginProperty Tab4 {1EFB659A-857C-11D1-B16A-00C0F0283628}
544 Caption = "File Associations"
545 ImageVarType = 2
546 EndProperty
547 BeginProperty Tab5 {1EFB659A-857C-11D1-B16A-00C0F0283628}
548 Caption = "Other"
549 ImageVarType = 2
550 EndProperty
551 EndProperty
552 End
553 End
554 Attribute VB_Name = "Options"
555 Attribute VB_Creatable = False
556 Attribute VB_Exposed = False
557 Option Explicit
559 Dim OldFileName As String, NewListFile As String
560 Dim NewExtNames() As String, NewExtComp() As Integer
561 Dim ActID() As String
563 Private Sub Check8_Click()
564 If Check8.Value = 1 Then Check8.Value = 2
565 End Sub
566 Private Sub cmdAdd_Click()
567 Dim xNum As Integer
568 If Text4 <> "" Then
569 If Left(Text4, 1) <> "." Then Text4 = "." + Text4
570 For xNum = 1 To UBound(NewExtNames)
571 If Text4 = NewExtNames(xNum) Then Exit Sub
572 Next xNum
573 List1.AddItem Text4
574 ReDim Preserve NewExtNames(UBound(NewExtNames) + 1) As String
575 NewExtNames(UBound(NewExtNames)) = Text4
576 ReDim Preserve NewExtComp(UBound(NewExtComp) + 1) As Integer
577 NewExtComp(UBound(NewExtComp)) = -1
578 Text4 = ""
579 End If
580 End Sub
582 Private Sub cmdAddFolder_Click()
583 Dim lNum As Long
584 Dim Path As String
585 PathInput.hwndOwner = hWnd
586 Path = PathInputBox(PathInput, "Add Listfile Folder", "")
587 If Path = "" Then GoTo Cancel
588 FileLists.AddItem Path
589 If FileLists.ListCount > 0 Then
590 NewListFile = FileLists.List(0)
591 Else
592 NewListFile = ""
593 End If
594 For lNum = 1 To FileLists.ListCount - 1
595 NewListFile = NewListFile + vbCrLf + FileLists.List(lNum)
596 Next lNum
597 Cancel:
598 End Sub
599 Private Sub cmdAddList_Click()
600 Dim lNum As Long
601 CD.Flags = &H1000 Or &H4 Or &H2
602 CD.Filter = "Text Files (*.txt)|*.txt|All Files (*.*)|*.*"
603 CD.hwndOwner = hWnd
604 If ShowOpen(CD) = False Then GoTo Cancel
605 FileLists.AddItem CD.FileName
606 If FileLists.ListCount > 0 Then
607 NewListFile = FileLists.List(0)
608 Else
609 NewListFile = ""
610 End If
611 For lNum = 1 To FileLists.ListCount - 1
612 NewListFile = NewListFile + vbCrLf + FileLists.List(lNum)
613 Next lNum
614 Cancel:
615 End Sub
616 Private Sub cmdDelList_Click()
617 Dim lNum As Long
618 If FileLists.ListIndex > -1 Then
619 FileLists.RemoveItem FileLists.ListIndex
620 If FileLists.ListCount > 0 Then
621 NewListFile = FileLists.List(0)
622 Else
623 NewListFile = ""
624 End If
625 For lNum = 1 To FileLists.ListCount - 1
626 NewListFile = NewListFile + vbCrLf + FileLists.List(lNum)
627 Next lNum
628 End If
629 End Sub
630 Private Sub Combo1_Click()
631 Dim xNum As Integer
632 For xNum = 1 To UBound(NewExtNames)
633 If List1.List(List1.ListIndex) = NewExtNames(xNum) Then Exit For
634 Next xNum
635 If UBound(NewExtNames) = 0 Then xNum = 0
636 If Combo1.ListIndex = 3 Then
637 Frame2.Visible = True
638 NewExtComp(xNum) = Combo1.ListIndex - 3
639 Else
640 Frame2.Visible = False
641 If Combo1.ListIndex < 2 Then
642 NewExtComp(xNum) = Combo1.ListIndex - 2
643 Else
644 NewExtComp(xNum) = -3
645 End If
646 End If
647 End Sub
648 Private Sub AudioC_Click(Index As Integer)
649 Dim xNum As Integer
650 For xNum = 1 To UBound(NewExtNames)
651 If List1.List(List1.ListIndex) = NewExtNames(xNum) Then Exit For
652 Next xNum
653 If UBound(NewExtNames) = 0 Then xNum = 0
654 NewExtComp(xNum) = Index
655 End Sub
656 Private Sub Check1_Click()
657 If Check1.Value = 1 Then Check1.Value = 2
658 End Sub
660 Private Sub Check2_Click()
661 If Check2.Value = 1 Then Check2.Value = 2
662 End Sub
664 Private Sub Check3_Click()
665 If Check3.Value = 1 Then Check3.Value = 2
666 End Sub
668 Private Sub Check4_Click()
669 If Check4.Value = 1 Then Check4.Value = 2
670 End Sub
672 Private Sub Check5_Click()
673 If Check5.Value = 1 Then Check5.Value = 2
674 End Sub
675 Private Sub Command1_Click()
676 Dim Path As String, BatKey As String
677 Dim xNum As Integer, ExtList As String
678 Dim dItem As String, ndItem As String, aNum As Long
679 Path = App.Path
680 If Right(Path, 1) <> "\" Then Path = Path + "\"
681 Text1_LostFocus
682 Text2_LostFocus
683 DefaultMaxFiles = Text1
684 LocaleID = Text2
685 SFileSetLocale (LocaleID)
686 NewKey AppKey
687 SetReg AppKey + "DefaultMaxFiles", Text1, REG_DWORD
688 SetReg AppKey + "LocaleID", Text2, REG_DWORD
689 If Check1.Value > 0 Then
690 SetReg AppKey + "SaveWindowStatus", 1, REG_DWORD
691 Else
692 SetReg AppKey + "SaveWindowStatus", 0, REG_DWORD
693 End If
694 If Check3.Value > 0 Then
695 SetReg AppKey + "ShowConfirmation", 1, REG_DWORD
696 Else
697 SetReg AppKey + "ShowConfirmation", 0, REG_DWORD
698 End If
699 If Check4.Value > 0 Then
700 SetReg AppKey + "UseDragDropWildcards", 1, REG_DWORD
701 Else
702 SetReg AppKey + "UseDragDropWildcards", 0, REG_DWORD
703 End If
704 If Check5.Value > 0 Then
705 SetReg AppKey + "CheckModDateTime", 1, REG_DWORD
706 Else
707 SetReg AppKey + "CheckModDateTime", 0, REG_DWORD
708 MpqEx.Timer1.Enabled = False
709 End If
710 If Check7.Value > 0 Then
711 SetReg AppKey + "AutofindFileLists", 1, REG_DWORD
712 Else
713 SetReg AppKey + "AutofindFileLists", 0, REG_DWORD
714 End If
715 If Check8.Value > 0 Then
716 SetReg AppKey + "UseOnlyAutofindLists", 1, REG_DWORD
717 Else
718 SetReg AppKey + "UseOnlyAutofindLists", 0, REG_DWORD
719 End If
720 If Check2.Value > 0 Then
721 NewKey "HKEY_CLASSES_ROOT\.mpq\", "Mpq.Archive"
722 NewKey "HKEY_CLASSES_ROOT\.mpq\ShellNew\"
723 SetReg "HKEY_CLASSES_ROOT\.mpq\ShellNew\NullFile", ""
724 NewKey "HKEY_CLASSES_ROOT\Mpq.Archive\", "MPQ Archive"
725 NewKey "HKEY_CLASSES_ROOT\Mpq.Archive\DefaultIcon\", Path + App.EXEName + ".exe,1"
726 NewKey "HKEY_CLASSES_ROOT\Mpq.Archive\shell\"
727 NewKey "HKEY_CLASSES_ROOT\Mpq.Archive\shell\open\"
728 NewKey "HKEY_CLASSES_ROOT\Mpq.Archive\shell\open\command\", Chr(34) + Path + App.EXEName + ".exe" + Chr(34) + " " + Chr(34) + "%1" + Chr(34)
729 BatKey = "HKEY_CLASSES_ROOT\" + GetReg("HKEY_CLASSES_ROOT\.bat\", "batfile") + "\"
730 NewKey "HKEY_CLASSES_ROOT\.mscript\", "Mpq.Script"
731 NewKey "HKEY_CLASSES_ROOT\.mbat\", "Mpq.Script"
732 NewKey "HKEY_CLASSES_ROOT\.mscript\ShellNew\"
733 SetReg "HKEY_CLASSES_ROOT\.mscript\ShellNew\NullFile", ""
734 NewKey "HKEY_CLASSES_ROOT\Mpq.Script\", "Mo'PaQ 2000 Script"
735 NewKey "HKEY_CLASSES_ROOT\Mpq.Script\DefaultIcon\", GetReg(BatKey + "DefaultIcon\", "C:\WINDOWS\SYSTEM\shell32.dll,-153")
736 NewKey "HKEY_CLASSES_ROOT\Mpq.Script\shell\"
737 NewKey "HKEY_CLASSES_ROOT\Mpq.Script\shell\open\"
738 NewKey "HKEY_CLASSES_ROOT\Mpq.Script\shell\open\command\", GetReg(BatKey + "shell\edit\command\", "C:\WINDOWS\NOTEPAD.EXE %1")
739 NewKey "HKEY_CLASSES_ROOT\Mpq.Script\shell\"
740 NewKey "HKEY_CLASSES_ROOT\Mpq.Script\shell\run\", "&Run"
741 NewKey "HKEY_CLASSES_ROOT\Mpq.Script\shell\run\command\", Chr(34) + Path + App.EXEName + ".exe" + Chr(34) + " script " + Chr(34) + "%1" + Chr(34)
742 Else
743 If GetReg("HKEY_CLASSES_ROOT\.mpq\") = "Mpq.Archive" Then
744 DelKey "HKEY_CLASSES_ROOT\.mpq\ShellNew\"
745 DelKey "HKEY_CLASSES_ROOT\.mpq\"
746 SetReg "HKEY_CLASSES_ROOT\Mpq.Archive\shell\open\command\", "not used"
747 DelKey "HKEY_CLASSES_ROOT\.mscript\ShellNew\"
748 DelKey "HKEY_CLASSES_ROOT\.mscript\"
749 DelKey "HKEY_CLASSES_ROOT\.mbat\"
750 End If
751 End If
752 SHChangeNotify SHCNE_ASSOCCHANGED, SHCNF_IDLIST, vbNullString, vbNullString
753 If Option1(0).Value = True Then
754 SetReg AppKey + "StartupPathType", 0, REG_DWORD
755 Text3 = CurDir
756 ElseIf Option1(1).Value = True Then
757 SetReg AppKey + "StartupPathType", 1, REG_DWORD
758 Text3 = App.Path
759 ElseIf Option1(2).Value = True Then
760 SetReg AppKey + "StartupPathType", 2, REG_DWORD
761 End If
762 Path = Text3
763 If Right(Path, 1) <> "\" Then Path = Path + "\"
764 If IsDir(Path) Then
765 SetReg AppKey + "StartupPath", Text3
766 ChDir Text3
767 End If
768 Select Case Combo2.ListIndex
769 Case 0
770 DefaultCompressID = -1
771 DefaultCompress = MAFA_COMPRESS_STANDARD
772 Case 1
773 DefaultCompressID = -3
774 DefaultCompress = MAFA_COMPRESS_DEFLATE
775 End Select
776 DefaultCompressLevel = Combo3.ListIndex - 1
777 SetReg AppKey + "DefaultCompress", DefaultCompressID, REG_DWORD
778 SetReg AppKey + "DefaultZlibLevel", DefaultCompressLevel, REG_DWORD
779 DelKey AppKey + "Compression\"
780 NewKey AppKey + "Compression\"
781 For xNum = 1 To UBound(NewExtNames)
782 ExtList = ExtList + NewExtNames(xNum)
783 SetReg AppKey + "Compression\" + NewExtNames(xNum), CStr(NewExtComp(xNum))
784 Next xNum
785 SetReg AppKey + "Compression\List", ExtList
786 NewKey SharedAppKey + "FileDefaultActions\"
787 For aNum = 1 To FileTypes.ListItems.Count
788 dItem = GetReg("HKEY_CLASSES_ROOT\" + FileTypes.ListItems.Item(aNum).Key + "\shell\", "open")
789 dItem = GetReg(SharedAppKey + "FileDefaultActions\" + FileTypes.ListItems.Item(aNum).Key, dItem)
790 ndItem = FileTypes.ListItems.Item(aNum).Tag
791 If LCase(dItem) <> LCase(ndItem) And ndItem <> "" Then
792 SetReg SharedAppKey + "FileDefaultActions\" + FileTypes.ListItems.Item(aNum).Key, ndItem
793 End If
794 Next aNum
795 Hide
796 If LCase(ListFile) <> LCase(NewListFile) Then
797 ListFile = NewListFile
798 SetReg AppKey + "ListFile", ListFile
799 CD.FileName = OldFileName
800 If FileExists(OldFileName) Then MpqEx.OpenMpq
801 End If
802 Unload Me
803 End Sub
804 Private Sub Command2_Click()
805 Unload Me
806 End Sub
807 Private Sub Command4_Click()
808 DelReg AppKey + "Status\WindowState"
809 DelReg AppKey + "Status\WindowHeight"
810 DelReg AppKey + "Status\WindowLeft"
811 DelReg AppKey + "Status\WindowTop"
812 DelReg AppKey + "Status\WindowWidth"
813 Check1.Value = 0
814 End Sub
815 Private Sub Command5_Click()
816 Dim Path As String
817 PathInput.hwndOwner = hWnd
818 Path = PathInputBox(PathInput, "WinMPQ Startup Path", Text3)
819 If Path <> "" Then Text3 = Path
820 End Sub
821 Private Sub Command6_Click()
822 Dim xNum As Integer
823 If List1.ListIndex > -1 Then
824 For xNum = 1 To UBound(NewExtNames)
825 If List1.List(List1.ListIndex) = NewExtNames(xNum) Then Exit For
826 Next xNum
827 If xNum < UBound(NewExtNames) Then
828 For xNum = xNum To UBound(NewExtNames) - 1
829 NewExtNames(xNum) = NewExtNames(xNum + 1)
830 NewExtComp(xNum) = NewExtComp(xNum + 1)
831 Next xNum
832 End If
833 ReDim Preserve NewExtNames(UBound(NewExtNames) - 1) As String
834 ReDim Preserve NewExtComp(UBound(NewExtComp) - 1) As Integer
835 On Error Resume Next
836 List1.RemoveItem List1.ListIndex
837 End If
838 End Sub
839 Private Sub Form_Load()
840 Dim Path As String, PathType As Integer, NewFileListNames As String
841 Dim ExtList As String
842 Dim aExt As String, aName As String, aNum As Long, DCompType As Long
843 On Error Resume Next
844 Left = MpqEx.Left + 330
845 If Left < 0 Then Left = 0
846 If Left + Width > Screen.Width Then Left = Screen.Width - Width
847 Top = MpqEx.Top + 315
848 If Top < 0 Then Top = 0
849 If Top + Height > Screen.Height Then Top = Screen.Height - Height
850 Path = App.Path
851 If Right(Path, 1) <> "\" Then Path = Path + "\"
852 Text1 = DefaultMaxFiles
853 Text2 = LocaleID
854 OldFileName = CD.FileName
855 CD.FileName = ""
856 NewListFile = GetReg(AppKey + "ListFile", Path + "mpq_data.txt")
857 For aNum = 1 To Len(NewListFile)
858 If InStr(aNum, NewListFile, vbCrLf) Then
859 aName = Mid(NewListFile, aNum, InStr(aNum, NewListFile, vbCrLf) - aNum)
860 If FileExists(aName) Or IsDir(aName) Then
861 FileLists.AddItem aName
862 NewFileListNames = NewFileListNames + aName + vbCrLf
863 End If
864 aNum = InStr(aNum, NewListFile, vbCrLf) + 1
865 Else
866 aName = Mid(NewListFile, aNum)
867 If FileExists(aName) Or IsDir(aName) Then
868 FileLists.AddItem aName
869 NewFileListNames = NewFileListNames + aName
870 End If
871 Exit For
872 End If
873 Next aNum
874 NewListFile = NewFileListNames
875 If Right(NewListFile, 2) = vbCrLf Then NewListFile = Left(NewListFile, Len(NewListFile) - 2)
876 If GetReg(AppKey + "SaveWindowStatus", 1) > 0 Then Check1.Value = 1 Else Check1.Value = 0
877 If GetReg(AppKey + "ShowConfirmation", 1) > 0 Then Check3.Value = 1 Else Check3.Value = 0
878 If GetReg(AppKey + "UseDragDropWildcards", 1) > 0 Then Check4.Value = 1 Else Check4.Value = 0
879 If GetReg(AppKey + "CheckModDateTime", 1) > 0 Then Check5.Value = 1 Else Check5.Value = 0
880 If GetReg(AppKey + "AutofindFileLists", 0) > 0 Then Check7.Value = 1 Else Check7.Value = 0
881 If GetReg(AppKey + "UseOnlyAutofindLists", 1) > 0 Then Check8.Value = 1 Else Check8.Value = 0
882 If GetReg("HKEY_CLASSES_ROOT\.mpq\", "Mpq.Archive") = "Mpq.Archive" And InStr(1, GetReg("HKEY_CLASSES_ROOT\Mpq.Archive\shell\open\command\", Chr(34) + Path + App.EXEName + ".exe" + Chr(34) + " " + Chr(34) + "%1" + Chr(34)), App.EXEName + ".exe", 1) > 0 Then Check2.Value = 1 Else Check2.Value = 0
883 Text3 = GetReg(AppKey + "StartupPath", CurDir)
884 PathType = GetReg(AppKey + "StartupPathType", 0)
885 If PathType < 0 Then PathType = 0
886 If PathType > 2 Then PathType = 2
887 Option1(PathType).Value = True
888 If PathType = 0 Then
889 Text3 = CurDir
890 ElseIf PathType = 1 Then
891 Text3 = App.Path
892 End If
893 ReDim NewExtNames(0) As String
894 ReDim NewExtComp(0) As Integer
895 Combo1.ListIndex = 1
896 DCompType = GetReg(AppKey + "DefaultCompress", -1)
897 Select Case DCompType
898 Case -3
899 Combo2.ListIndex = 1
900 Case Else
901 Combo2.ListIndex = 0
902 End Select
903 Combo3.ListIndex = GetReg(AppKey + "DefaultZlibLevel", Z_DEFAULT_COMPRESSION) + 1
904 ExtList = GetReg(AppKey + "Compression\List", ".bik.smk.mp3.mpq.w3m.wav")
905 If InStr(1, ExtList, ".") > 0 And Len(ExtList) > 1 Then
906 Do
907 ReDim Preserve NewExtNames(UBound(NewExtNames) + 1) As String
908 ReDim Preserve NewExtComp(UBound(NewExtComp) + 1) As Integer
909 If InStr(2, ExtList, ".") > 0 Then
910 NewExtNames(UBound(NewExtNames)) = Left(ExtList, InStr(2, ExtList, ".") - 1)
911 Else
912 NewExtNames(UBound(NewExtNames)) = ExtList
913 End If
914 ExtList = Mid(ExtList, Len(NewExtNames(UBound(NewExtNames))) + 1)
915 List1.AddItem NewExtNames(UBound(NewExtNames))
916 If LCase(NewExtNames(UBound(NewExtNames))) = ".bik" Then
917 NewExtComp(UBound(NewExtComp)) = CInt(GetReg(AppKey + "Compression\.bik", "-2"))
918 ElseIf LCase(NewExtNames(UBound(NewExtNames))) = ".smk" Then
919 NewExtComp(UBound(NewExtComp)) = CInt(GetReg(AppKey + "Compression\.smk", "-2"))
920 ElseIf LCase(NewExtNames(UBound(NewExtNames))) = ".mp3" Then
921 NewExtComp(UBound(NewExtComp)) = CInt(GetReg(AppKey + "Compression\.mp3", "-2"))
922 ElseIf LCase(NewExtNames(UBound(NewExtNames))) = ".mpq" Then
923 NewExtComp(UBound(NewExtComp)) = CInt(GetReg(AppKey + "Compression\.mpq", "-2"))
924 ElseIf LCase(NewExtNames(UBound(NewExtNames))) = ".w3m" Then
925 NewExtComp(UBound(NewExtComp)) = CInt(GetReg(AppKey + "Compression\.w3m", "-2"))
926 ElseIf LCase(NewExtNames(UBound(NewExtNames))) = ".wav" Then
927 NewExtComp(UBound(NewExtComp)) = CInt(GetReg(AppKey + "Compression\.wav", "0"))
928 Else
929 NewExtComp(UBound(NewExtComp)) = CInt(GetReg(AppKey + "Compression\" + NewExtNames(UBound(NewExtNames)), "-1"))
930 End If
931 Loop Until ExtList = ""
932 End If
933 Do
934 aExt = EnumKey("HKEY_CLASSES_ROOT\", aNum)
935 If Left(aExt, 1) = "." Then
936 aName = GetReg("HKEY_CLASSES_ROOT\" + aExt + "\")
937 If aName <> "" Then
938 On Error GoTo AlreadyExists
939 FileTypes.ListItems.Add(, aName, GetReg("HKEY_CLASSES_ROOT\" + aName + "\", UCase(Mid(aExt, 2)) + " File")).ToolTipText = UCase(aExt)
940 On Error Resume Next
941 End If
942 ElseIf LCase(aExt) = "unknown" Then
943 FileTypes.ListItems.Add(, aExt, GetReg("HKEY_CLASSES_ROOT\" + aExt + "\")).ToolTipText = ""
944 If FileTypes.ListItems.Item(aExt).Text = "" Then FileTypes.ListItems.Item(aExt).Text = " Unknown File"
945 End If
946 aNum = aNum + 1
947 Loop Until aExt = ""
948 Exit Sub
949 AlreadyExists:
950 FileTypes.ListItems.Item(aName).ToolTipText = FileTypes.ListItems.Item(aName).ToolTipText + " " + UCase(aExt)
951 Resume Next
952 End Sub
953 Private Sub Form_Resize()
954 FileTypes.ColumnHeaders.Item(1).Width = FileTypes.Width - 30 * Screen.TwipsPerPixelX
955 End Sub
957 Private Sub Form_Unload(Cancel As Integer)
958 CD.FileName = OldFileName
959 End Sub
961 Private Sub List1_Click()
962 Dim xNum As Integer, OldExtComp As Integer
963 If List1.ListIndex > -1 Then
964 Combo1.Enabled = True
965 For xNum = 1 To UBound(NewExtNames)
966 If List1.List(List1.ListIndex) = NewExtNames(xNum) Then Exit For
967 Next xNum
968 Select Case NewExtComp(xNum)
969 Case -2
970 AudioC(0).Value = True
971 Combo1.ListIndex = 0
972 Case -1
973 AudioC(0).Value = True
974 Combo1.ListIndex = 1
975 Case -3
976 AudioC(0).Value = True
977 Combo1.ListIndex = 2
978 Case 0, 1, 2
979 OldExtComp = NewExtComp(xNum)
980 Combo1.ListIndex = 3
981 AudioC(OldExtComp).Value = True
982 Case Else
983 AudioC(0).Value = True
984 Combo1.ListIndex = 1
985 End Select
986 Else
987 Combo1.ListIndex = 1
988 Combo1.Enabled = False
989 End If
990 End Sub
991 Private Sub Option1_Click(Index As Integer)
992 If Index = 2 Then
993 Text3.Enabled = True
994 Command5.Enabled = True
995 Else
996 Text3.Enabled = False
997 Command5.Enabled = False
998 End If
999 End Sub
1001 Private Sub Tabs_Click()
1002 Dim TabDisp As PictureBox
1003 For Each TabDisp In TabDisps
1004 TabDisp.Visible = False
1005 Next TabDisp
1006 TabDisps(Tabs.SelectedItem.Index).Visible = True
1007 End Sub
1008 Private Sub Text1_KeyPress(KeyAscii As Integer)
1009 If (KeyAscii < 48 Or KeyAscii > 57) And KeyAscii <> 8 Then KeyAscii = 0
1010 End Sub
1011 Private Sub Text1_LostFocus()
1012 If Text1 = "" Then Text1 = 0
1013 'If Text1 < 16 Then Text1 = 16
1014 'If Text1 > 262144 Then Text1 = 262144
1015 End Sub
1016 Private Sub Text2_KeyPress(KeyAscii As Integer)
1017 Dim NewValue As Long
1018 If (KeyAscii < 48 Or KeyAscii > 57) And KeyAscii <> 8 And KeyAscii <> Asc("-") Then KeyAscii = 0
1019 On Error GoTo TooBig
1020 If (KeyAscii >= 48 And KeyAscii <= 57) Or KeyAscii = Asc("-") Then NewValue = CLng(Text2 + Chr(KeyAscii))
1021 On Error GoTo 0
1022 Exit Sub
1023 TooBig:
1024 KeyAscii = 0
1025 End Sub
1026 Private Sub Text2_LostFocus()
1027 If Text2 = "" Then Text2 = 0
1028 End Sub
1029 Private Sub Text4_GotFocus()
1030 cmdAdd.Default = True
1031 End Sub
1032 Private Sub Text4_LostFocus()
1033 Command1.Default = True
1034 End Sub
1035 Private Sub Actions_Click()
1036 On Error GoTo NotSelected
1037 FileTypes.SelectedItem.Tag = FileTypes.SelectedItem.Tag
1038 On Error GoTo 0
1039 If FileTypes.SelectedItem.Selected = True Then
1040 FileTypes.SelectedItem.Tag = ActID(Actions.ListIndex + 1)
1041 End If
1042 NotSelected:
1043 End Sub
1044 Private Sub FileTypes_ItemClick(ByVal Item As ListItem)
1045 Dim aNum As Long, aItem As String, aName As String, bNum As Long, dItem As String
1046 Label8 = Item.ToolTipText
1047 Actions.Clear
1048 ReDim ActID(0) As String
1049 aName = Item.Key
1050 Do
1051 aItem = EnumKey("HKEY_CLASSES_ROOT\" + aName + "\shell\", aNum)
1052 If aItem <> "" Then
1053 If LCase(aItem) = "openas" And IsEmpty(GetReg("HKEY_CLASSES_ROOT\" + aName + "\shell\" + aItem + "\")) Then
1054 Actions.AddItem "Open with..."
1055 Else
1056 Actions.AddItem GetReg("HKEY_CLASSES_ROOT\" + aName + "\shell\" + aItem + "\", UCase(Left(aItem, 1)) + Mid(aItem, 2))
1057 End If
1058 ReDim Preserve ActID(UBound(ActID) + 1) As String
1059 ActID(UBound(ActID)) = aItem
1060 aNum = aNum + 1
1061 End If
1062 Loop Until aItem = ""
1063 If Item.Tag = "" Then
1064 dItem = GetReg("HKEY_CLASSES_ROOT\" + aName + "\shell\", "open")
1065 dItem = GetReg(SharedAppKey + "FileDefaultActions\" + aName, dItem)
1066 Else
1067 dItem = Item.Tag
1068 End If
1069 If Actions.ListCount > 0 Then Actions.ListIndex = 0
1070 For bNum = 0 To Actions.ListCount - 1
1071 If LCase(ActID(bNum + 1)) = LCase(dItem) Then
1072 Actions.ListIndex = bNum
1073 End If
1074 Next bNum
1075 Item.Tag = dItem
1076 End Sub
|