-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathPrgLnch.ahk
17845 lines (14538 loc) · 584 KB
/
PrgLnch.ahk
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
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
#SingleInstance, force
#NoEnv ; Performance and compatibility with future AHK releases.
;#Warn, All ; Enable warnings for a debugger to display to assist with detecting common errors.
;#Warn UseUnsetLocal, OutputDebug ; Warn when a local variable is used before it's set; send to OutputDebug
#MaxMem 256
#MaxThreads 10 ; default
#Persistent
#Include %A_ScriptDir%
AutoTrim, Off ; traditional assignments off
ListLines Off ;A_ListLines default is on: history of lines most recently executed
SendMode Input ; Recommended for new scripts due to superior speed & reliability.
FileSetAttrib, -RH, % A_ScriptDir . "`\*.*", 1
SetWinDelay, 100 ; Default
; ListVars for debugging
SetBatchLines, 20ms ; too fast? A_BatchLines is 10ms
SetTitleMatchMode, 2 ;window's title can contain WinTitle anywhere inside it to be a match
OnMessage(0x112, "WM_SYSCOMMAND")
OnMessage(0x0053, "WM_Help")
OnMessage(0x201, "WM_LBUTTONDOWN")
OnMessage(0x0205, "WM_RBUTTONUP")
if (!(InStr(PrgLnch.Title . ".ahk", A_ScriptName) || InStr(PrgLnch.Title . ".exe", A_ScriptName)))
{
MsgBox, 8208, Launching PrgLnch, % "PrgLnch cannot be run from a copy like " """" A_ScriptName """" "!"
ExitApp
}
PrgLnchPID := DllCall("GetCurrentProcessId")
Process, priority, %PrgLnchPID%, A
;Issues:
; Virtual screen: https://msdn.microsoft.com/en-us/library/vs/alm/dd145136(v=vs.85).aspx
Class Splashy
{
spr := 0
spr1 := 0
spr2 := 0
; HTML Colours (RGB- no particular order)
STATIC HTML := {CYAN: "0X00FFFF", AQUAMARINE : "0X7FFFD4", BLACK: "0X000000", BLUE: "0X0000FF", FUCHSIA: "0XFF00FF", GRAY: "0X808080", AUBURN: "0X2A2AA5"
, LIME: "0X00FF00", MAROON: "0X800000", NAVY: "0X000080", OLIVE: "0X808000", PURPLE: "0X800080", INDIGO: "0X4B0082", LAVENDER: "0XE6E6FA", DKSALMON: "0X7A96E9"
, SILVER: "0XC0C0C0", TEAL: "0X008080", WHITE: "0XFFFFFF", YELLOW: "0XFFFF00", WHEAT: "0xF5DEB3", ORANGE: "0XFFA500", BEIGE: "0XF5F5DC", CELADON: "0XACE1AF"
, CHESTNUT: "0X954535", TAN: "0xD2B48C", CHOCOLATE: "0X7B3F00", TAUPE: "0X483C32", SALMON: "0XFA8072", VIOLET: "0X7F00FF", GRAPE: "0X6F2DA8", STEINGRAU: "0X485555"
, PEACH: "0XFFE5B4", CORAL: "0XFF7F50", CRIMSON: "0XDC143C", VERMILION: "0XE34234", CERULEAN: "0X007BA7", TURQUOISE: "0X40E0D0", VIRIDIAN: "0X40826D", RED: "0XFF0000"
, PLUM: "0X8E4585", MAGENTA: "0XF653A6", GOLD: "0XFFD700", GOLDENROD: "0XDAA520", GREEN: "0X008000", ONYX: "0X353839", KHAKIGRAU: "0X746643", FELDGRAU: "0X3D5D5D"}
Static MaxGuis := 1000 ; arbitrary limit
Static parentHWnd := 0
Static updateFlag := -1
Static procEnd := 0
Static parentClip := 0
Static firstInstanceParent := []
Static downloadedPathNames := []
Static downloadedUrlNames := []
Static NewWndObj := {}
Static vImgType := 0
Static hWndSaved := []
Static parent := 0
Static release := 0
Static hDCWin := 0
Static instance := 1
Static oldInstance := 1
Static hBitmap := 0
Static hIcon := 0
Static vImgTxtSize := 0
Static vPosX := "c"
Static vPosY := "c"
Static vMgnX := 0
Static vMgnY := 0
Static vImgX := 0
Static vImgY := 0
Static inputVImgW := ""
Static inputVImgH := ""
Static vImgW := 0
Static vImgH := 0
Static oldVImgW := 0
Static oldVImgH := 0
Static actualVImgW := 0
Static actualVImgH := 0
Static oldPicInScript := 0
Static picInScript := 0
Static ImageName := ""
Static oldImagePath := ""
Static imageUrl := ""
Static oldImageUrl := ""
Static bkgdColour := ""
Static transCol := 0
Static vHide := 0
Static noHWndActivate := ""
Static vBorder := 0
Static voldBorder := 0
Static vOnTop := 0
Static mainTextHWnd := []
Static mainText := ""
Static mainBkgdColour := ""
Static mainFontName := ""
Static mainFontSize := 0
Static mainFontWeight := 0
Static mainFontColour := ""
Static mainFontQuality := 0
Static mainFontItalic := ""
Static mainFontStrike := ""
Static mainFontUnderline := ""
Static mainMarquee := 0
Static subTextHWnd := []
Static subText := ""
Static subBkgdColour := ""
Static subFontName := ""
Static subFontSize := 0
Static subFontWeight := 0
Static subFontColour := ""
Static subFontQuality := 0
Static subFontItalic := ""
Static subFontStrike := ""
Static subFontUnderline := ""
Static subMarquee := 0
Class NewWndProc
{
Static clbk := []
Static wndProcOld := 0
Static WM_PAINT := 0x000F
Static WM_NCHITTEST := 0x84
Static WM_ERASEBKGND := 0x0014
Static WM_CTLCOLORSTATIC := 0x0138
Static WM_ENTERSIZEMOVE := 0x0231
Static WM_EXITSIZEMOVE := 0x0232
__New(instance)
{
Static SetWindowLong := A_PtrSize == 8 ? "SetWindowLongPtr" : "SetWindowLong"
Static wndProcNew := 0
if (!(wndProcNew := This.clbk[instance].addr)) ; called once only from the caller- this is extra security
{
This.clbk[instance] := new This.BoundFuncCallback( ObjBindMethod(This, "WndProc"), 4 )
wndProcNew := This.clbk[instance].addr
if (wndProcNew)
{
if (!(This.wndProcOld := DllCall(SetWindowLong, "Ptr", Splashy.hWnd(), "Int", GWL_WNDPROC := -4, "Ptr", wndProcNew, "Ptr")))
msgbox, 8208, WndProc, Bad return!
}
else
msgbox, 8208, WndProc, No address!
}
}
__Delete(instance)
{
This.clbk[instance] := "" ; triggers clbk.__Delete()
}
class BoundFuncCallback
{
; https://www.autohotkey.com/boards/viewtopic.php?f=76&t=88704&p=390706
__New(BoundFuncObj, paramCount, options := "")
{
This.pInfo := Object( {BoundObj: BoundFuncObj, paramCount: paramCount} )
This.addr := RegisterCallback(This.__Class . "._Callback", options, paramCount, This.pInfo)
}
__Delete()
{
ObjRelease(This.pInfo)
if (DllCall("GlobalFree", "Ptr", This.addr, "Ptr"))
msgbox, 8208, GlobalFree, Memory could not be released for BoundFuncCallback!
}
_Callback(Params*)
{
Info := Object(A_EventInfo), Args := []
Loop % Info.paramCount
Args.Push( NumGet(Params + A_PtrSize*(A_Index - 2)) )
Return Info.BoundObj.Call(Args*)
}
}
WndProc(hwnd, uMsg, wParam, lParam)
{
;Critical
Switch uMsg
{
case % This.WM_CTLCOLORSTATIC:
{
return This.CtlColorStaticProc(wParam, lParam)
}
case % This.WM_PAINT:
{
This.PaintProc()
return 0
}
case % This.WM_ENTERSIZEMOVE:
{
; For WM_Move: revert the parent for the window move
Splashy.CheckParentStat()
return 0
}
case % This.WM_EXITSIZEMOVE:
{
; Revert to Splashy
Splashy.CheckParentStat(1)
This.PaintProc()
return 0
}
case % This.WM_NCHITTEST:
{
return This.NcHitTestProc(hWnd, uMsg, wParam, lParam)
}
Default:
return DllCall("CallWindowProc", "Ptr", This.wndProcOld, "Ptr", hWnd, "UInt", uMsg, "Ptr", wParam, "Ptr", lParam)
}
}
NcHitTestProc(hWnd, uMsg, wParam, lParam)
{
Static HTCLIENT := 1, HTCAPTION := 2
; Makes form movable
if (Splashy.vMovable)
{
lResult := DllCall("DefWindowProc", "Ptr", hWnd, "UInt", uMsg, "UPtr", wParam, "Ptr", lParam)
if (lResult == HTCLIENT)
lResult := HTCAPTION
return % lResult
}
else
return % HTCLIENT
}
CtlColorStaticProc(wParam, lParam)
{
static DC_BRUSH := 0x12
if (lparam == Splashy.subTextHWnd[Splashy.instance]) ; && This.hDCWin == wParam)
This.SetColour(wParam, Splashy.subBkgdColour, Splashy.subFontColour)
else
{
if (lParam == Splashy.mainTextHWnd[Splashy.instance])
This.SetColour(wParam, Splashy.mainBkgdColour, Splashy.mainFontColour)
}
return DllCall("Gdi32.dll\GetStockObject", "UInt", DC_BRUSH, "UPtr")
}
SetColour(textDC, bkgdColour, fontColour)
{
static NULL_BRUSH := 0x5, TRANSPARENT := 0X1, OPAQUE := 0X2, CLR_INVALID := 0xFFFFFFFF
DllCall("Gdi32.dll\SetBkMode", "Ptr", textDC, "UInt", (Splashy.transCol)? TRANSPARENT: OPAQUE)
if (DllCall("Gdi32.dll\SetBkColor", "Ptr", textDC, "UInt", bkgdColour) == CLR_INVALID)
msgbox, 8208, SetBkColor, Cannot set background colour for text!
if (DllCall("Gdi32.dll\SetTextColor", "Ptr", textDC, "UInt", fontColour) == CLR_INVALID)
msgbox, 8208, SetTextColor, Cannot set colour for text!
if (DllCall("SetDCBrushColor", "Ptr", textDC, "UInt", bkgdColour) == CLR_INVALID)
msgbox, 8208, SetDCBrushColor, Cannot set colour for brush!
}
PaintProc(hWnd := 0)
{
spr := 0
if (!Splashy.procEnd)
{
;DllCall("UpdateWindow", "Ptr", hWnd) ;Too many paints ==> Instability & Crash!
if (Splashy.firstInstanceParent[Splashy.instance])
return
else
{
if (Splashy.parent && (!Splashy.mainTextHWnd[Splashy.instance] && !Splashy.subTextHWnd[Splashy.instance]))
spr := 1
}
}
if (!hWnd)
hWnd := Splashy.hWnd()
if (VarSetCapacity(PAINTSTRUCT, A_PtrSize + A_PtrSize + 56, 0)) ; hdc, rcPaint are pointers
{
; DC validated
; Invalidating PAINTSTRUCT and returning- the above is superior
if (DllCall("User32.dll\BeginPaint", "Ptr", hWnd, "Ptr", &PAINTSTRUCT, "UPtr"))
{
if (!spr)
{
static vDoDrawImg := 1 ;set This to 0 and the image won't be redrawn
static vDoDrawBgd := 1 ;set This to 0 and the background won't be redrawn
;return ;uncomment This line and the window will be blank
if (vDoDrawImg)
Splashy.PaintDC()
if (vDoDrawBgd)
Splashy.DrawBackground()
}
}
DllCall("User32.dll\EndPaint", "Ptr", hWnd, "Ptr", &PAINTSTRUCT, "UPtr")
}
else
msgbox, 8208, PAINTSTRUCT, Cannot paint!
}
SubClassTextCtl(ctlHWnd, release := 0)
{
Static SubProcFunc := 0
if (release)
{
This.subClbk := "" ; triggers subClbk.__Delete()
SubProcFunc := 0
}
else
{
if (!ctlHWnd)
return
; This only works for one window atm
if (SubProcFunc)
return
else
{
This.subClbk := new This.BoundFuncCallback(ObjBindMethod(This, "SubClassTextProc"), 6)
SubProcFunc := This.subClbk.addr
}
if !DllCall("Comctl32.dll\SetWindowSubclass", "Ptr", ctlHWnd, "Ptr", SubProcFunc, "Ptr", ctlHWnd, "Ptr", 0)
msgbox, 8208, Text Control, SubClassing failed!
}
}
SubClassTextProc(hWnd, uMsg, wParam, lParam, IdSubclass, RefData)
{
;THis subclass for marquee code
; WM_PAINT is required to paint the scrolled text.
; BeginPaint in WM_PAINT will erase the content already set in the DC of the control.
;
;To prevent, temporarily modify AHK's own hbrBackground in its WNDCLASSEX
; hbrBackground := DllCall(GetStockObject(NULL_BRUSH))
;
;Which means we have to create our own class and window for the control anyway,
; Then use Pens & Brushes & DrawTextEx et al.
Critical
static DC_BRUSH := 0x12
/*
if (uMsg == This.WM_ERASEBKGND)
{
return 1
}
if (uMsg == This.WM_PAINT)
{
VarSetCapacity(PAINTSTRUCT, A_PtrSize + A_PtrSize + 56, 0)
if (!(hDC := DllCall("User32.dll\BeginPaint", "Ptr", hWnd, "Ptr", &PAINTSTRUCT, "UPtr")))
return 0
spr := This.ToBase(hWnd, 16)
spr1 := InStr(spr, This.mainTextHWnd[This.instance])
spr2 := InStr(spr, This.subTextHWnd[This.instance])
if (spr1 || spr2)
{
if (This.mainMarquee && spr1)
{
}
else
{
if (This.mainMarquee && spr1)
{
}
else
{
if (spr1)
This.SetColour(This.mainBkgdColour, hDC)
else
This.SetColour(This.subBkgdColour, hDC)
}
}
}
DllCall("User32.dll\EndPaint", "Ptr", hWnd, "Ptr", &PAINTSTRUCT, "UPtr")
return 0
}
;Marquee code in an outside function
;RECT rectControls := {wd + xCurrentScroll, yCurrentScroll, xNewSize + xCurrentScroll, yNewSize + yCurrentScroll};
;if (!ScrollDC(hdcWinCl, -xDelta, 0, (CONST RECT*) &rectControls, (CONST RECT*) &rectControls, (HRGN)NULL, (RECT*) &rectControls))
;ReportErr(L"HORZ_SCROLL: ScrollD Failed!");
*/
Return DllCall("Comctl32.dll\DefSubclassProc", "Ptr", hWnd, "UInt", uMsg, "Ptr", wParam, "Ptr", lParam)
}
}
SplashImg(argList*)
{
parentOut := ""
imagePathOut := ""
imageUrlOut := ""
bkgdColourOut := ""
transColOut := ""
vHideOut := 0
noHWndActivateOut := ""
vImgTxtSizeOut := 0
vMovableOut := 0
vBorderOut := ""
vOnTopOut := 0
vPosXOut := ""
vPosYOut := ""
vMgnXOut := 0
vMgnYOut := 0
vImgWOut := 0
vImgHOut := 0
mainTextOut := ""
mainBkgdColourOut := ""
mainFontNameOut := ""
mainFontSizeOut := 0
mainFontWeightOut := 0
mainFontColourOut := -1
mainFontQualityOut := -1
mainFontItalicOut := 0
mainFontStrikeOut := 0
mainFontUnderlineOut := 0
subTextOut := ""
subBkgdColourOut := ""
subFontNameOut := ""
subFontSizeOut := 0
subFontWeightOut := 0
subFontColourOut := -1
subFontQualityOut := -1
subFontItalicOut := 0
subFontStrikeOut := 0
subFontUnderlineOut := 0
This.SaveRestoreUserParms()
StringCaseSense, Off
SetWorkingDir %A_ScriptDir%
if (argList["release"])
{
This.Destroy()
return
}
if (argList.HasKey("instance"))
{
if (key := argList["instance"])
{
if key is not number
key := 1
}
else
key := 1
key := Floor(key) ; 0 defaults to 1
if (This.hWndSaved[key])
{
This.instance := key
if (This.instance != This.oldInstance)
{
; Ensures current postion is not reset
This.vPosX := ""
This.vPosY := ""
}
}
else
{
if (key < 0)
{
key := -key
if (This.hWndSaved[key])
{
;WinClose, % "ahk_id " This.hWndSaved[This.instance]
This.hWndSaved[key] := 0
This.mainTextHWnd[key] := 0
This.subTextHWnd[key] := 0
spr := "Splashy" . key
Gui, %spr%: Destroy
Splashy.NewWndProc.clbk[key] := ""
;Now reset This.instance for next call
if (This.hWndSaved.Length() == 1)
This.instance := 1
else
{
if (This.hWndSaved.Length() == key)
This.instance -= 1
else
This.instance := This.hWndSaved.MaxIndex()
}
This.oldInstance := This.instance
}
This.SaveRestoreUserParms(1)
return
}
else
{
if (key > This.MaxGuis)
{
This.SaveRestoreUserParms(1)
return
}
else
This.instance := key
}
}
}
if (This.hWndSaved[This.instance])
{
if (argList.HasKey("initSplash"))
{
if (argList["initSplash"])
This.updateFlag := 0
else
This.updateFlag := 1
}
else
This.updateFlag := 1
}
else
{
; init the parent hWnd
if (!This.parentHWnd)
{
if (This.parentHWnd := This.SetParentFlag())
{
if (This.parentHWnd == "Error")
{
;msgbox, 8192, Parent Script, Warning: Parent script is not AHK, or the window handle cannot be obtained!
This.parentHWnd := 0
}
}
}
}
For key, value in argList
{
; An alternative: https://www.autohotkey.com/boards/viewtopic.php?f=6&t=9656
if (key)
{
; Validate values
Switch key
{
Case "parent":
{
if (This.updateFlag > 0)
This.parent := value
else
parentOut := value
}
Case "imagePath":
{
if (This.updateFlag > 0)
This.imagePath := This.ValidateText(value)
else
imagePathOut := value
if ((InStr(This.imagePath, "*")))
This.picInScript := 1
else
This.picInScript := 0
}
Case "imageUrl":
{
value := Trim(Value)
if (This.updateFlag > 0)
{
This.imageUrl := This.ValidateText(value)
if (This.imagePath == A_AhkPath)
This.imagePath := ""
}
else
imageUrlOut := value
}
Case "bkgdColour":
{
if (This.updateFlag > 0)
This.bkgdColour := (value == "")?This.GetDefaultGUIColour():This.ValidateColour(value)
else
bkgdColourOut := value
}
Case "transCol":
{
if (This.transCol)
{
if (!value && This.hWndSaved[This.instance])
{
WinSet, TransColor, Off, % "ahk_id" . This.hWndSaved[This.instance]
if (This.subTextHWnd[This.instance])
WinSet, TransColor, Off, % "ahk_id" . This.subTextHWnd[This.instance]
if (This.mainTextHWnd[This.instance])
WinSet, TransColor, Off, % "ahk_id" . This.mainTextHWnd[This.instance]
}
}
if (This.updateFlag > 0)
This.transCol := value
else
transColOut := value
}
Case "vHide":
{
if (This.updateFlag > 0)
This.vHide := value
else
vHideOut := value
}
Case "noHWndActivate":
{
if (This.updateFlag > 0)
This.noHWndActivate := (value)? "NoActivate ": ""
else
noHWndActivateOut := value
}
Case "vOnTop":
{
if (This.updateFlag > 0)
This.vOnTop := value
else
vOnTopOut := value
}
Case "vMovable":
{
if (This.updateFlag > 0)
This.vMovable := value
else
vMovableOut := value
}
Case "vBorder":
{
if (InStr(value, "b"))
spr := "b"
else
{
spr := ""
if (InStr(value, "w"))
spr .= "w"
if (InStr(value, "s"))
spr .= "s"
if (InStr(value, "c"))
spr .= "c"
if (InStr(value, "d"))
spr .= "d"
if (value && !spr)
spr := "dlgframe"
}
if (This.updateFlag > 0)
This.vBorder := spr
else
vBorderOut := spr
}
Case "vImgTxtSize":
{
if (This.updateFlag > 0)
This.vImgTxtSize := value
else
vImgTxtSizeOut := value
}
Case "vPosX":
{
if value is number
{
if (value)
spr := Floor(value)
else
spr := "zero"
}
else
spr := (Instr(value, "c"))? "c": ""
if (This.updateFlag > 0)
This.vPosX := spr
else
vPosXOut := spr
}
Case "vPosY":
{
if value is number
{
if (value)
spr := Floor(value)
else
spr := "zero"
}
else
spr := (Instr(value, "c"))? "c": ""
if (This.updateFlag > 0)
This.vPosY := spr
else
vPosYOut := spr
}
Case "vMgnX":
{
if (value >= 0)
{
spr := Instr(value, "d")? "d": Floor(value)
if (This.updateFlag > 0)
This.vMgnX := spr
else
vMgnXOut := spr
}
}
Case "vMgnY":
{
if (value >= 0)
{
spr := Instr(value, "d")? "d": Floor(value)
if (This.updateFlag > 0)
This.vMgnY := spr
else
vMgnYOut := spr
}
}
Case "vImgW":
{
spr := (This.actualVImgW)?This.ProcImgWHVal(value):value
if (This.updateFlag > 0)
This.inputVImgW := spr
else
vImgWOut := spr
}
Case "vImgH":
{
spr := (This.actualVImgH)?This.ProcImgWHVal(value, 1):value
if (This.updateFlag > 0)
This.inputVImgH := spr
else
vImgHOut := spr
}
Case "mainText":
{
if (This.updateFlag > 0)
This.mainText := This.ValidateText(value)
else
mainTextOut := value
}
Case "mainBkgdColour":
{
if (This.updateFlag > 0)
This.mainBkgdColour := (value == "")?This.GetDefaultGUIColour():This.ValidateColour(value, 1)
else
mainBkgdColourOut := value
}
Case "mainFontName":
{
if (This.updateFlag > 0)
This.mainFontName := (value)?This.ValidateText(value):"Verdana"
else
mainFontNameOut := value
}
Case "mainFontSize":
{
value := abs(value) ; 200 arbitrary limit
if (This.updateFlag > 0)
This.mainFontSize := (0 < value <= 200)?Floor(value):10
else
mainFontSizeOut := value
}
Case "mainFontWeight":
{
value := abs(value)
if (This.updateFlag > 0)
This.mainFontWeight := (0 < value <= 1000)?Floor(value):400
else
mainFontWeightOut := value
}
Case "mainFontColour":
{
if (value != -1)
{
if (This.updateFlag > 0)
This.mainFontColour := This.ValidateColour(value, 1)
else
mainFontColourOut := value
}
}
Case "mainFontQuality":
{
value := abs(value) ; 0 := DEFAULT_QUALITY
if (This.updateFlag > 0)
This.mainFontQuality := (0 <= value <= 5)?Floor(value):1
else
mainFontQualityOut := value
}
Case "mainFontItalic":
{
if (This.updateFlag > 0)
This.mainFontItalic := (value)? " Italic": ""
else
mainFontItalicOut := value
}
Case "mainFontStrike":
{
if (This.updateFlag > 0)
This.mainFontStrike := (value)? " Strike": ""
else
mainFontStrikeOut := value
}
Case "mainFontUnderline":
{
if (This.updateFlag > 0)
This.mainFontUnderline := (value)? " Underline": ""
else
mainFontUnderlineOut := value
}
Case "subText":
{
if (This.updateFlag > 0)
This.subText := This.ValidateText(value)
else
subTextOut := value
}
Case "subBkgdColour":
{
if (This.updateFlag > 0)
This.subBkgdColour := (value == "")?This.GetDefaultGUIColour():This.ValidateColour(value, 1)
else
subBkgdColourOut := value
}
Case "subFontName":
{
if (This.updateFlag > 0)
This.subFontName := (value)?This.ValidateText(value):"Verdana"
else
subFontNameOut := value
}
Case "subFontSize":
{
value := abs(value) ; 200 arbitrary limit
if (This.updateFlag > 0)
This.subFontSize := (0 < value <= 200)?Floor(value):10
else
subFontSizeOut := value
}
Case "subFontWeight":
{
value := abs(value)
if (This.updateFlag > 0)
This.subFontWeight := (0 < value <= 1000)?Floor(value):400
else
subFontWeightOut := value
}
Case "subFontColour":
{
if (value != -1)
{
if (This.updateFlag > 0)
This.subFontColour := This.ValidateColour(value, 1)
else
subFontColourOut := value
}
}
Case "subFontQuality":
{
value := abs(value)
if (This.updateFlag > 0)
This.subFontQuality := (0 <= value <= 5)?Floor(value):1
else
subFontQualityOut := value
}
Case "subFontItalic":
{
if (This.updateFlag > 0)
This.subFontItalic := (value)? " Italic": ""
else
subFontItalicOut := value
}
Case "subFontStrike":
{
if (This.updateFlag > 0)
This.subFontStrike := (value)? " Strike": ""
else
subFontStrikeOut := value
}
Case "subFontUnderline":
{
if (This.updateFlag > 0)
This.subFontUnderline := (value)? " Underline": ""
else
subFontUnderlineOut := value
}
}
}
}
This.SplashImgInit(parentOut, imagePathOut, imageUrlOut
, bkgdColourOut, transColOut, vHideOut, noHWndActivateOut
, vOnTopOut, vMovableOut, vBorderOut, vImgTxtSizeOut
, vPosXOut, vPosYOut, vMgnXOut, vMgnYOut, vImgWOut, vImgHOut
, mainTextOut, mainBkgdColourOut
, mainFontNameOut, mainFontSizeOut, mainFontWeightOut, mainFontColourOut
, mainFontQualityOut, mainFontItalicOut, mainFontStrikeOut, mainFontUnderlineOut
, subTextOut, subBkgdColourOut
, subFontNameOut, subFontSizeOut, subFontWeightOut, subFontColourOut
, subFontQualityOut, subFontItalicOut, subFontStrikeOut, subFontUnderlineOut)
}
SplashImgInit(parentIn, imagePathIn, imageUrlIn
, bkgdColourIn, transColIn, vHideIn, noHWndActivateIn
, vOnTopIn, vMovableIn, vBorderIn, vImgTxtSizeIn
, vPosXIn, vPosYIn, vMgnXIn, vMgnYIn, vImgWIn, vImgHIn
, mainTextIn, mainBkgdColourIn
, mainFontNameIn, mainFontSizeIn, mainFontWeightIn, mainFontColourIn
, mainFontQualityIn, mainFontItalicIn, mainFontStrikeIn, mainFontUnderlineIn
, subTextIn, subBkgdColourIn
, subFontNameIn, subFontSizeIn, subFontWeightIn, subFontColourIn
, subFontQualityIn, subFontItalicIn, subFontStrikeIn, subFontUnderlineIn)
/*
; Future expansion for vertical text:
, rightText := "", rightFontNameIn := "", rightFontSizeIn := 0, rightFontWeightIn := 0, rightFontColourIn := -1
, leftText := "", leftFontNameIn := "", leftFontSizeIn := 0, leftFontWeightIn := 0, leftFontColourIn := -1
; also consider transparency
*/
{
vWinW := 0, vWinH := 0, parentW := 0, parentH := 0, init := 0
mainTextSize := [0, 0], subTextSize := [0, 0]
currVPos := {x: "", y: ""}
static splashyInst := ""
; Border constants
Static WS_DLGFRAME := 0x400000, WS_CAPTION := 0xC00000, WS_POPUP := 0x80000000, WS_CHILD := 0x40000000, WS_EX_COMPOSITED := 0X2000000
Static WS_EX_WINDOWEDGE := 0x100, WS_EX_STATICEDGE := 0x20000, WS_EX_CLIENTEDGE := 0x200, WS_EX_DLGMODALFRAME := 0x1
; Determines redraw of Splashy window (placeholder)
diffPicOrDiffDims := 0
This.procEnd := 0
if (This.updateFlag <= 0)
{
;Set defaults
if (parentIn != "")
This.parent := parentIn
if (imagePathIn == "")
{
if (!This.imagePath && imageUrlIn == "")
This.imagePath := A_AhkPath ; default icon. Ist of 5
}
else
This.imagePath := imagePathIn
if (imageUrlIn == "")
{
if (!This.imageUrl)
This.imageUrl := "https://www.autohotkey.com/assets/images/features-why.png"
}
else