-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathcommon2.bas
727 lines (536 loc) · 29.2 KB
/
common2.bas
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
Attribute VB_Name = "common2"
'------------------------------------------------------------
' common2.bas
'
' Public procedures that appear in just two of the programs as an included module common2.bas,
' specifically, dock settings and steamy dock itself.
'
' Note: If you make a change here it affects the two programs dynamically
'------------------------------------------------------------
' .01 common2.bas DAEB 27/01/2021 Changed validation of the popup delay parameter used for fading the dock back in, now 1 second.
' .02 DAEB 01/02/2021 common2.bas always use the dockAppPath so it works on both docks
' .03 DAEB 03/03/2021 common2.bas bugfix - bottom position 0 is top
' .04 DAEB 11/03/2021 common2 added validation for the continuous hide value
' .05 DAEB 12/07/2021 common2.bas Add the BounceZone as a configurable variable.
Option Explicit
' Rocketdock global configuration variables START
Public rDOptionsTabIndex As String
Public rDStartupRun As String
Public rdStartupRunString As String
Public rDIconQuality As String
Public rDIconOpacity As String
Public rDZoomOpaque As String
Public rDIconMin As String
Public rDHoverFX As String
Public rdIconMax As String
Public rDZoomWidth As String
Public rDZoomTicks As String
Public rDMonitor As String
Public rDSide As String
Public rDzOrderMode As String
Public rDOffset As String
Public rDvOffset As String
Public rDtheme As String
Public rDThemeOpacity As String
Public rDHideLabels As String
Public rDFontName As String
Public rDFontColor As String
Public rDFontSize As String
Public rDFontCharSet As String
Public rDFontFlags As String
'Public rDFontStrength As Boolean
'Public rDFontItalics As Boolean
Public rDFontShadowColor As String
Public rDFontOutlineColor As String
Public rDFontOutlineOpacity As String
Public rDFontShadowOpacity As String
Public rDIconActivationFX As String
Public rDSoundSelection As String
Public rDAutoHide As String
Public rDAutoHideTicks As String
Public rDAutoHideDelay As String
Public rDMouseActivate As String
Public rDPopupDelay As String
Public rDVersion As String
'Public rDCustomIconFolder As String
Public rDHotKeyToggle As String
Public rDLangID As String
Public rDAnimationInterval As String
Public rDSkinSize As String
Public sDSkinSize As Long ' the Steamydock version
Public sDSplashStatus As String
Public sDFontOpacity As String
Public sDAutoHideType As String
Public sDShowLblBacks As String ' 25/10/2020 docksettings .02 DAEB add the logic for saving/reading icon label background string to configuration files
Public sDContinuousHide As String 'nn
Public sDBounceZone As String ' .05 DAEB 12/07/2021 common2.bas Add the BounceZone as a configurable variable.
' development
Public sDDebugFlg As String
Public sDDefaultEditor As String
Public Const SM_CMONITORS = 80
'API to test the system, specifically the number of monitors
Public Declare Function GetSystemMetrics Lib "user32" (ByVal nIndex As Long) As Long
' Rocketdock global configuration variables END
'---------------------------------------------------------------------------------------
' Procedure : readDockSettingsFile
' Author : beededea
' Date : 12/05/2020
' Purpose : read
'---------------------------------------------------------------------------------------
'
Public Sub readDockSettingsFile(ByVal location As String, ByVal settingsFile As String)
'SteamyDock settings only
On Error GoTo readDockSettingsFile_Error
If debugflg = 1 Then debugLog "% sub readDockSettingsFile"
If fFExists(dockSettingsFile) Then
rDGeneralReadConfig = GetINISetting("Software\SteamyDock\DockSettings", "GeneralReadConfig", dockSettingsFile)
rDGeneralWriteConfig = GetINISetting("Software\SteamyDock\DockSettings", "GeneralWriteConfig", dockSettingsFile)
rDRunAppInterval = GetINISetting("Software\SteamyDock\DockSettings", "RunAppInterval", dockSettingsFile)
' rDAlwaysAsk = GetINISetting("Software\SteamyDock\DockSettings", "AlwaysAsk", dockSettingsFile)
rDDefaultDock = GetINISetting("Software\SteamyDock\DockSettings", "DefaultDock", dockSettingsFile)
rDAnimationInterval = GetINISetting("Software\SteamyDock\DockSettings", "AnimationInterval", dockSettingsFile)
rDSkinSize = GetINISetting("Software\SteamyDock\DockSettings", "SkinSize", dockSettingsFile)
sDSplashStatus = GetINISetting("Software\SteamyDock\DockSettings", "SplashStatus", dockSettingsFile)
sDShowIconSettings = GetINISetting("Software\SteamyDock\DockSettings", "ShowIconSettings", dockSettingsFile) '' .14 DAEB 01/05/2021 docksettings added checkbox and values to show icon settings utility when adding an icon to the dock
sDFontOpacity = GetINISetting("Software\SteamyDock\DockSettings", "FontOpacity", settingsFile)
sDAutoHideType = GetINISetting("Software\SteamyDock\DockSettings", "AutoHideType", settingsFile)
sDShowLblBacks = GetINISetting("Software\SteamyDock\DockSettings", "ShowLblBacks", settingsFile) ' 25/10/2020 docksettings .02 DAEB add the logic for saving/reading icon label background string to configuration files
sDContinuousHide = GetINISetting("Software\SteamyDock\DockSettings", "ContinuousHide", settingsFile) ' 25/10/2020 docksettings .02 DAEB add the logic for saving/reading icon label background string to configuration files ' nn
sDBounceZone = GetINISetting("Software\SteamyDock\DockSettings", "BounceZone", settingsFile) ' .05 DAEB 12/07/2021 common2.bas Add the BounceZone as a configurable variable.
' development
sDDefaultEditor = GetINISetting(location, "dockDefaultEditor", settingsFile)
sDDebugFlg = GetINISetting(location, "debugFlg", settingsFile)
debugflg = Val(sDDebugFlg)
End If
sDSkinSize = Val(rDSkinSize)
'if the above settings do not exist in the older RD settings file then no error is thrown so it works for both
'RocketDock compatible settings only
rDVersion = GetINISetting(location, "Version", settingsFile)
rDHotKeyToggle = GetINISetting(location, "HotKey-Toggle", settingsFile)
rDtheme = GetINISetting(location, "Theme", settingsFile)
rDThemeOpacity = GetINISetting(location, "ThemeOpacity", settingsFile)
rDIconOpacity = GetINISetting(location, "IconOpacity", settingsFile)
rDFontSize = GetINISetting(location, "FontSize", settingsFile)
rDFontFlags = GetINISetting(location, "FontFlags", settingsFile)
rDFontName = GetINISetting(location, "FontName", settingsFile)
rDFontColor = GetINISetting(location, "FontColor", settingsFile)
rDFontCharSet = GetINISetting(location, "FontCharSet", settingsFile)
rDFontOutlineColor = GetINISetting(location, "FontOutlineColor", settingsFile)
rDFontOutlineOpacity = GetINISetting(location, "FontOutlineOpacity", settingsFile)
rDFontShadowColor = GetINISetting(location, "FontShadowColor", settingsFile)
rDFontShadowOpacity = GetINISetting(location, "FontShadowOpacity", settingsFile)
rDIconMin = GetINISetting(location, "IconMin", settingsFile)
rdIconMax = GetINISetting(location, "IconMax", settingsFile)
rDZoomWidth = GetINISetting(location, "ZoomWidth", settingsFile)
rDZoomTicks = GetINISetting(location, "ZoomTicks", settingsFile)
rDAutoHide = GetINISetting(location, "AutoHide", settingsFile) ' 26/10/2020 docksettings .03 DAEB fixed a previous find/replace bug causing the autohide setting to fail to both save and read
rDAutoHideTicks = GetINISetting(location, "AutoHideTicks", settingsFile)
rDAutoHideDelay = GetINISetting(location, "AutoHideDelay", settingsFile)
rDPopupDelay = GetINISetting(location, "PopupDelay", settingsFile)
rDIconQuality = GetINISetting(location, "IconQuality", settingsFile)
rDLangID = GetINISetting(location, "LangID", settingsFile)
rDHideLabels = GetINISetting(location, "HideLabels", settingsFile)
rDZoomOpaque = GetINISetting(location, "ZoomOpaque", settingsFile)
rDLockIcons = GetINISetting(location, "LockIcons", settingsFile)
rDRetainIcons = GetINISetting(location, "RetainIcons", settingsFile) ' .18 DAEB 07/09/2022 docksettings save and restore the chkRetainIcons checkbox value
rDManageWindows = GetINISetting(location, "ManageWindows", settingsFile)
rDDisableMinAnimation = GetINISetting(location, "DisableMinAnimation", settingsFile)
rDShowRunning = GetINISetting(location, "ShowRunning", settingsFile)
rDOpenRunning = GetINISetting(location, "OpenRunning", settingsFile)
rDHoverFX = GetINISetting(location, "HoverFX", settingsFile)
rDzOrderMode = GetINISetting(location, "zOrderMode", settingsFile)
rDMouseActivate = GetINISetting(location, "MouseActivate", settingsFile)
rDIconActivationFX = GetINISetting(location, "IconActivationFX", settingsFile)
rDSoundSelection = GetINISetting(location, "SoundSelection", settingsFile)
rDMonitor = GetINISetting(location, "Monitor", settingsFile)
rDSide = GetINISetting(location, "Side", settingsFile)
rDOffset = GetINISetting(location, "Offset", settingsFile)
rDvOffset = GetINISetting(location, "vOffset", settingsFile)
rDOptionsTabIndex = GetINISetting("Software\DockSettings", "OptionsTabIndex", toolSettingsFile)
'= GetINISetting("Software\SteamyDock\DockSettings\WindowFilters", "Count", 0, settingsFile)
On Error GoTo 0
Exit Sub
readDockSettingsFile_Error:
MsgBox "Error " & Err.Number & " (" & Err.Description & ") in procedure readDockSettingsFile of Module common2"
End Sub
'
'---------------------------------------------------------------------------------------
' Procedure : readRegistryBehaviour
' Author : beededea
' Date : 21/08/2020
' Purpose :
'---------------------------------------------------------------------------------------
'
Public Sub readRegistryBehaviour()
' read the settings from the registry
'general items
' IconActivationFX ' Icon Activation Effect
' AutoHide ' AutoHide
' AutoHideTicks ' AutoHide Duration
' AutoHideDelay ' AutoHide Delay
' MouseActivate ' Pop-up on Mouseover
' PopupDelay ' PopupDelay
On Error GoTo readRegistryBehaviour_Error
rDIconActivationFX = getstring(HKEY_CURRENT_USER, "Software\RocketDock", "IconActivationFX")
rDAutoHide = getstring(HKEY_CURRENT_USER, "Software\RocketDock", "AutoHide")
rDAutoHideTicks = getstring(HKEY_CURRENT_USER, "Software\RocketDock", "AutoHideTicks")
rDAutoHideDelay = getstring(HKEY_CURRENT_USER, "Software\RocketDock", "AutoHideDelay")
rDMouseActivate = getstring(HKEY_CURRENT_USER, "Software\RocketDock", "MouseActivate")
rDPopupDelay = getstring(HKEY_CURRENT_USER, "Software\RocketDock", "PopupDelay")
Call validateRegistryBehaviour
'dock.autoHideChecker.Interval = Val(rDAutoHideDelay)
On Error GoTo 0
Exit Sub
readRegistryBehaviour_Error:
MsgBox "Error " & Err.Number & " (" & Err.Description & ") in procedure readRegistryBehaviour of Module common2"
End Sub
'---------------------------------------------------------------------------------------
' Procedure : validateRegistryBehaviour
' Author : beededea
' Date : 17/06/2020
' Purpose :
'---------------------------------------------------------------------------------------
'
Public Sub validateRegistryBehaviour()
' testing and adjusting the values to the ranges allowed, preventing corrupt values
' this is required as running the program from within the IDE without admin rights results in corrupt data from the registry
' when Rocketdock is restarted
On Error GoTo validateRegistryBehaviour_Error
If Val(rDIconActivationFX) <= 0 And Val(rDIconActivationFX) > 2 Then rDIconActivationFX = "2"
If Val(rDAutoHide) <= 0 And Val(rDAutoHide) > 1 Then rDAutoHide = "1"
If Val(rDAutoHideTicks) <= 0 And Val(rDAutoHideTicks) > 5000 Then rDAutoHideTicks = "200"
If Val(rDAutoHideDelay) <= 0 And Val(rDAutoHideDelay) > 5000 Then rDAutoHideDelay = "200"
If Val(rDMouseActivate) <= 0 And Val(rDMouseActivate) > 1 Then rDMouseActivate = "1"
If Val(rDPopupDelay) <= 0 And Val(rDPopupDelay) > 5000 Then rDPopupDelay = "1000" ' ' .01 STARTS DAEB 27/01/2021 Changed validation of the popup delay parameter used for fading the dock back in, now 1 second.
If Val(rDAnimationInterval) <= 0 And Val(rDAnimationInterval) > 20 Then rDAnimationInterval = "1"
If Val(sDAutoHideType) <= 0 And Val(sDAutoHideType) > 2 Or sDAutoHideType = vbNullString Then sDAutoHideType = "0"
If rDHotKeyToggle = vbNullString Then rDHotKeyToggle = "F11" ' .02 STARTS DAEB 27/01/2021 Added validation of the function key used for fading the dock back in.
If Val(sDContinuousHide) <= 1 And Val(sDContinuousHide) >= 120 Then sDContinuousHide = "10" '.04 DAEB 11/03/2021 common2 added validation for the continuous hide value
If Val(sDBounceZone) <= 1 And Val(sDBounceZone) >= 120 Then sDBounceZone = "75" ' .05 DAEB 12/07/2021 common2.bas Add the BounceZone as a configurable variable.
On Error GoTo 0
Exit Sub
validateRegistryBehaviour_Error:
MsgBox "Error " & Err.Number & " (" & Err.Description & ") in procedure validateRegistryBehaviour of Module common2"
End Sub
'---------------------------------------------------------------------------------------
' Procedure : validateInputs
' Author : beededea
' Date : 17/06/2020
' Purpose :
'---------------------------------------------------------------------------------------
'
Public Sub validateInputs()
On Error GoTo validateInputs_Error
If Val(rDRunAppInterval) * 1000 >= 65536 Then rDRunAppInterval = "65"
' validate the relevant entries from whichever source
validateRegistryGeneral
validateRegistryIcons
validateRegistryBehaviour
validateRegistryStyle
validateRegistryPosition
' sDSplashStatus = "1"
' chkSplashStatus.Value = Val(sDSplashStatus)
On Error GoTo 0
Exit Sub
validateInputs_Error:
MsgBox "Error " & Err.Number & " (" & Err.Description & ") in procedure validateInputs of Module common2"
End Sub
'---------------------------------------------------------------------------------------
' Procedure : validateRegistryStyle
' Author : beededea
' Date : 17/06/2020
' Purpose :
'---------------------------------------------------------------------------------------
'
Public Sub validateRegistryStyle()
' testing and adjusting the values to the ranges allowed, preventing corrupt values
' this is required as running the program from within the IDE without admin rights results in corrupt data from the registry
' when Rocketdock is restarted
' read the skins available from the rocketdock folder
'Dim MyFile As String
'Dim themePresent As Boolean
'Dim myName As String
Dim MyPath As String: MyPath = ""
Dim i As Integer: i = 0
Dim fontPresent As Boolean: fontPresent = False
On Error GoTo validateRegistryStyle_Error
' .02 DAEB 01/02/2021 common2.bas always use the dockAppPath so it works on both docks
MyPath = dockAppPath & "\Skins\" '"E:\Program Files (x86)\RocketDock\Skins\"
'themePresent = False
If Not fDirExists(MyPath) Then
MsgBox "WARNING - The skins folder is not present in the correct location " & dockAppPath
End If
' rDFontColor - difficult to check validity of a colour but some code is coming to ensure no corruption *1
If Val(rDThemeOpacity) < 1 Or Val(rDThemeOpacity) > 100 Then rDThemeOpacity = "100" '
If Val(rDHideLabels) < 0 Or Val(rDHideLabels) > 1 Then rDHideLabels = "0" '
If Val(sDShowLblBacks) < 0 Or Val(sDShowLblBacks) > 1 Then sDShowLblBacks = "0" ' 25/10/2020 docksettings .02 DAEB add the logic for saving/reading icon label background string to configuration files
fontPresent = False
For i = 0 To Screen.FontCount - 1 ' Determine number of fonts.
If rDFontName = Screen.Fonts(i) Then fontPresent = True
Next i
If fontPresent = False Then rDFontName = "Times New Roman" '
If Abs(Val(rDFontSize)) < 2 Or Abs(Val(rDFontSize)) > 29 Then rDFontSize = "-29" '
' rDFontCharSet = getstring(HKEY_CURRENT_USER, "Software\RocketDock\", "FontCharSet")
' how to validate a character set? - not supported
' validate font flags
' 0 - no qualifiers or alterations
' 1 - bold
' 2 - light italics
' 3 - bold italics
' 4 - strikeout & light
' 6 - underline and italics
' 7 - bold, italics & underline
' 10 - strikeout & italics
' 11 - bold, italics & strikeout
' 13 - strikeout & italics
' 14 - underline, strikeout and italics
' 15 - bold, underline, strikeout and italics
If rDFontFlags <= 0 Or rDFontFlags > 15 Then rDFontFlags = 0
If Not IsNumeric(rDFontShadowColor) Then
rDFontShadowColor = 0
End If
If Not IsNumeric(rDFontOutlineColor) Then
rDFontOutlineColor = 0
End If
' how to validate colour?
If Val(rDFontOutlineOpacity) <= 0 Or Val(rDFontOutlineOpacity) > 100 Then rDFontOutlineOpacity = "100" '
If Val(rDFontShadowOpacity) <= 0 Or Val(rDFontShadowOpacity) > 100 Then rDFontShadowOpacity = "100" '
If Val(sDFontOpacity) <= 0 Or Val(sDFontOpacity) > 100 Then sDFontOpacity = "100" '
'validation ends
On Error GoTo 0
Exit Sub
validateRegistryStyle_Error:
MsgBox "Error " & Err.Number & " (" & Err.Description & ") in procedure validateRegistryStyle of Module common2"
End Sub
'---------------------------------------------------------------------------------------
' Procedure : readRegistryStyle
' Author : beededea
' Date : 21/08/2020
' Purpose : read the settings from the registry
'---------------------------------------------------------------------------------------
'
Public Sub readRegistryStyle()
'style items
' Theme 'Theme
' ThemeOpacity
' HideLabels
' FontName
' FontShadowColor
' FontOutlineColor
' FontOutlineOpacity
' FontShadowOpacity
On Error GoTo readRegistryStyle_Error
rDtheme = getstring(HKEY_CURRENT_USER, "Software\RocketDock\", "Theme")
rDThemeOpacity = getstring(HKEY_CURRENT_USER, "Software\RocketDock\", "ThemeOpacity")
rDHideLabels = getstring(HKEY_CURRENT_USER, "Software\RocketDock\", "HideLabels")
rDFontName = getstring(HKEY_CURRENT_USER, "Software\RocketDock\", "FontName")
rDFontColor = getstring(HKEY_CURRENT_USER, "Software\RocketDock\", "FontColor")
rDFontSize = getstring(HKEY_CURRENT_USER, "Software\RocketDock\", "FontSize")
rDFontCharSet = getstring(HKEY_CURRENT_USER, "Software\RocketDock\", "FontCharSet")
rDFontFlags = getstring(HKEY_CURRENT_USER, "Software\RocketDock\", "FontFlags")
rDFontShadowColor = getstring(HKEY_CURRENT_USER, "Software\RocketDock\", "FontShadowColor")
rDFontOutlineColor = getstring(HKEY_CURRENT_USER, "Software\RocketDock\", "FontOutlineColor")
rDFontOutlineOpacity = getstring(HKEY_CURRENT_USER, "Software\RocketDock\", "FontOutlineOpacity")
rDFontShadowOpacity = getstring(HKEY_CURRENT_USER, "Software\RocketDock\", "FontShadowOpacity")
Call validateRegistryStyle
On Error GoTo 0
Exit Sub
readRegistryStyle_Error:
MsgBox "Error " & Err.Number & " (" & Err.Description & ") in procedure readRegistryStyle of Module common2"
End Sub
'---------------------------------------------------------------------------------------
' Procedure : validateRegistryPosition
' Author : beededea
' Date : 17/06/2020
' Purpose :
'---------------------------------------------------------------------------------------
'
Public Sub validateRegistryPosition()
' testing and adjusting the values to the ranges allowed, preventing corrupt values
' this is required as running the program from within the IDE without admin rights results in corrupt data from the registry
' when Rocketdock is restarted
On Error GoTo validateRegistryPosition_Error
If Val(rDMonitor) < 0 Or Val(rDMonitor) > 10 Then rDMonitor = "0" 'monitor 0 is the default meaning the first monitor
If Val(rDSide) < 0 Or Val(rDSide) > 3 Then rDSide = "1" ' .03 DAEB 03/03/2021 common2.bas bugfix - bottom position 0 is top
If Val(rDzOrderMode) < 1 Or Val(rDzOrderMode) > 10 Then rDzOrderMode = "0" ' always on top
If Val(rDOffset) < -100 Or Val(rDOffset) > 100 Then rDOffset = "0" ' in the middle
If Val(rDvOffset) < -15 Or Val(rDvOffset) > 128 Then rDvOffset = "0" ' at the bottom edge
On Error GoTo 0
Exit Sub
validateRegistryPosition_Error:
MsgBox "Error " & Err.Number & " (" & Err.Description & ") in procedure validateRegistryPosition of Module common2"
End Sub
'
'---------------------------------------------------------------------------------------
' Procedure : readRegistryPosition
' Author : beededea
' Date : 17/06/2020
' Purpose :
'---------------------------------------------------------------------------------------
'
Public Sub readRegistryPosition()
'style items
' Monitor 'Monitor
' Side ' Side
' zOrderMode ' zOrderMode
' Offset ' Offset
' vOffset ' vOffset
On Error GoTo readRegistryPosition_Error
rDMonitor = getstring(HKEY_CURRENT_USER, "Software\RocketDock\", "Monitor")
rDSide = getstring(HKEY_CURRENT_USER, "Software\RocketDock\", "Side")
rDzOrderMode = getstring(HKEY_CURRENT_USER, "Software\RocketDock\", "zOrderMode")
rDOffset = getstring(HKEY_CURRENT_USER, "Software\RocketDock\", "Offset")
rDvOffset = getstring(HKEY_CURRENT_USER, "Software\RocketDock\", "vOffset")
Call validateRegistryPosition
On Error GoTo 0
Exit Sub
readRegistryPosition_Error:
MsgBox "Error " & Err.Number & " (" & Err.Description & ") in procedure readRegistryPosition of Module common2"
End Sub
'---------------------------------------------------------------------------------------
' Procedure : validateRegistryIcons
' Author : beededea
' Date : 17/06/2020
' Purpose :
'---------------------------------------------------------------------------------------
'
Public Sub validateRegistryIcons()
' testing and adjusting the values to the ranges allowed, preventing corrupt values
' this is required as running the program from within the IDE without admin rights results in corrupt data from the registry
' when Rocketdock is restarted
On Error GoTo validateRegistryIcons_Error
'If Val(rDMonitor) < 0 Or Val(rDMonitor) > 10 Then rDMonitor = "0" 'monitor 1
If Val(rDIconOpacity) < 50 Or Val(rDIconOpacity) > 100 Then rDIconOpacity = "100" 'fully opaque
If Val(rDZoomOpaque) <= 0 Or Val(rDZoomOpaque) > 1 Then rDZoomOpaque = "1" 'zooms opaque
If Val(rDIconMin) < 16 Or Val(rDIconMin) > 128 Then rDIconMin = "16" 'small
If Val(rDHoverFX) <= 0 Or Val(rDHoverFX) > 4 Then rDHoverFX = "1" 'bounce ' .14 DAEB 29/04/2021 docksettings Set the default zoom types available to the type of dock selected
If Val(rdIconMax) < 1 Or Val(rdIconMax) > 256 Then rdIconMax = "256" 'largest size
'MsgBox "icnomax = " & rdIconMax
If Val(rDZoomWidth) < 2 Or Val(rDZoomWidth) > 10 Then rDZoomWidth = "4" ' just a few expanded
If Val(rDZoomTicks) < 100 Or Val(rDZoomTicks) > 500 Then rDZoomTicks = "100" ' 100ms
On Error GoTo 0
Exit Sub
validateRegistryIcons_Error:
MsgBox "Error " & Err.Number & " (" & Err.Description & ") in procedure validateRegistryIcons of Module common2"
End Sub
'---------------------------------------------------------------------------------------
' Procedure : readRegistryIcons
' Author : beededea
' Date : 17/06/2020
' Purpose :
'---------------------------------------------------------------------------------------
'
Public Sub readRegistryIcons()
' read the icon configuration settings from the registry
'icon items
' IconQuality ' Icon Quality
' IconOpacity ' Icon Opacity
' ZoomOpaque ' Zoom Opaque
' IconMin ' Size
' HoverFX ' Hover Effect
' IconMax ' Zoom
' ZoomWidth ' Zoom Width
' ZoomTicks ' Duration
On Error GoTo readRegistryIcons_Error
rDIconQuality = getstring(HKEY_CURRENT_USER, "Software\RocketDock\", "IconQuality")
rDIconOpacity = getstring(HKEY_CURRENT_USER, "Software\RocketDock\", "IconOpacity")
rDZoomOpaque = getstring(HKEY_CURRENT_USER, "Software\RocketDock\", "ZoomOpaque")
rDIconMin = getstring(HKEY_CURRENT_USER, "Software\RocketDock\", "IconMin")
rDHoverFX = getstring(HKEY_CURRENT_USER, "Software\RocketDock\", "HoverFX")
rdIconMax = getstring(HKEY_CURRENT_USER, "Software\RocketDock\", "IconMax")
rDZoomWidth = getstring(HKEY_CURRENT_USER, "Software\RocketDock\", "ZoomWidth")
rDZoomTicks = getstring(HKEY_CURRENT_USER, "Software\RocketDock\", "ZoomTicks")
Call validateRegistryIcons
On Error GoTo 0
Exit Sub
readRegistryIcons_Error:
MsgBox "Error " & Err.Number & " (" & Err.Description & ") in procedure readRegistryIcons of Module common2"
End Sub
'---------------------------------------------------------------------------------------
' Procedure : validateRegistryGeneral
' Author : beededea
' Date : 17/06/2020
' Purpose :
'---------------------------------------------------------------------------------------
'
Public Sub validateRegistryGeneral()
' testing and adjusting the values to the ranges allowed, preventing corrupt values
' this is required as running the program from within the IDE without admin rights results in corrupt data from the registry
' when Rocketdock is restarted
On Error GoTo validateRegistryGeneral_Error
If Val(rDLockIcons) <= 0 And Val(rDLockIcons) > 1 Then rDLockIcons = "1" '
If Val(rDRetainIcons) <= 0 And Val(rDRetainIcons) > 1 Then rDRetainIcons = "1" ' .18 DAEB 07/09/2022 docksettings save and restore the chkRetainIcons checkbox value
If Val(rDOpenRunning) <= 0 And Val(rDOpenRunning) > 1 Then rDOpenRunning = "1" '
If Val(rDShowRunning) <= 0 And Val(rDShowRunning) > 1 Then rDShowRunning = "1" '
If Val(rDManageWindows) <= 0 And Val(rDManageWindows) > 1 Then rDManageWindows = "1" '
If Val(rDDisableMinAnimation) <= 0 And Val(rDDisableMinAnimation) > 1 Then rDDisableMinAnimation = "1" '
' development
If sDDebugFlg = vbNullString Then sDDebugFlg = "0"
If sDDefaultEditor = vbNullString Then sDDefaultEditor = vbNullString
On Error GoTo 0
Exit Sub
validateRegistryGeneral_Error:
MsgBox "Error " & Err.Number & " (" & Err.Description & ") in procedure validateRegistryGeneral of Module common2"
End Sub
'---------------------------------------------------------------------------------------
' Procedure : readRegistryGeneral
' Author : beededea
' Date : 17/06/2020
' Purpose :
'---------------------------------------------------------------------------------------
'
Public Sub readRegistryGeneral()
'general items
' LockIcons ' lock items
' OpenRunning 'Open Running Application Instance
' ShowRunning 'Running Application Indicators
' ManageWindows' Minimise Windows to the Dock
' DisableMinAnimation 'Disable Minimise Animations
'HKEY_USERS\Software\Microsoft\Windows\CurrentVersion\Explorer\StartupApproved\Run
' 02 00 00 00 00 00 00
'Dim rdStartupRunString As String
On Error GoTo readRegistryGeneral_Error
rdStartupRunString = getstring(HKEY_CURRENT_USER, "Software\Microsoft\Windows\CurrentVersion\Run", "RocketDock")
If rdStartupRunString <> vbNullString Then
rDStartupRun = "1"
End If
rDLockIcons = getstring(HKEY_CURRENT_USER, "Software\RocketDock\", "LockIcons")
'rDRetainIcons unused by Rocketdock
rDOpenRunning = getstring(HKEY_CURRENT_USER, "Software\RocketDock\", "OpenRunning")
rDShowRunning = getstring(HKEY_CURRENT_USER, "Software\RocketDock\", "ShowRunning")
rDManageWindows = getstring(HKEY_CURRENT_USER, "Software\RocketDock\", "ManageWindows")
rDDisableMinAnimation = getstring(HKEY_CURRENT_USER, "Software\RocketDock\", "DisableMinAnimation")
Call validateRegistryGeneral
On Error GoTo 0
Exit Sub
readRegistryGeneral_Error:
MsgBox "Error " & Err.Number & " (" & Err.Description & ") in procedure readRegistryGeneral of Module common2"
End Sub
'---------------------------------------------------------------------------------------
' Procedure : readRegistry
' Author : beededea
' Date : 09/05/2020
' Purpose :
'---------------------------------------------------------------------------------------
'
Public Sub readRegistry()
Dim useloop As Integer: useloop = 0
On Error GoTo readRegistry_Error
'If debugflg = 1 Then debugLog "%readRegistry"
rDOptionsTabIndex = getstring(HKEY_CURRENT_USER, "Software\RocketDock", "OptionsTabIndex")
' get items from the registry that are required to 'default' the dock but aren't controlled by the dock settings utility
rdIconCount = getstring(HKEY_CURRENT_USER, "Software\RocketDock\Icons", "Count")
rDVersion = getstring(HKEY_CURRENT_USER, "Software\RocketDock\Icons", "Version")
rDCustomIconFolder = getstring(HKEY_CURRENT_USER, "Software\RocketDock\Icons", "CustomIconFolder")
rDHotKeyToggle = getstring(HKEY_CURRENT_USER, "Software\RocketDock\Icons", "HotKeyToggle")
' get the relevant entries from the registry
readRegistryGeneral
readRegistryIcons
readRegistryBehaviour
readRegistryStyle
readRegistryPosition
On Error GoTo 0
Exit Sub
readRegistry_Error:
MsgBox "Error " & Err.Number & " (" & Err.Description & ") in procedure readRegistry of Module common2"
End Sub