5 | #pragma comment(lib, "user32.lib")
6 |
7 | #define BUF_SIZE 256
8 | TCHAR szName[]=TEXT("\MyFileMappingObject");
9 |
10 | int _tmain()
11 | {
12 | HANDLE hMapFile;
13 | LPCTSTR pBuf;
14 |
15 | hMapFile = OpenFileMapping(
16 | FILE_MAP_ALL_ACCESS, // read/write access
17 | FALSE, // do not inherit the name
18 | szName); // name of mapping object
19 |
20 | if (hMapFile == NULL)
21 | {
22 | _tprintf(TEXT("Could not open file mapping object (%d).\n"),
23 | GetLastError());
24 | return 1;
25 | }
26 |
27 | pBuf = (LPTSTR) MapViewOfFile(hMapFile, // handle to map object
28 | FILE_MAP_ALL_ACCESS, // read/write permission
29 | 0,
30 | 0,
31 | BUF_SIZE);
32 |
33 | if (pBuf == NULL)
34 | {
35 | _tprintf(TEXT("Could not map view of file (%d).\n"),
36 | GetLastError());
37 |
38 | CloseHandle(hMapFile);
39 |
40 | return 1;
41 | }
42 |
43 | MessageBox(NULL, pBuf, TEXT("Process2"), MB_OK);
44 |
45 | UnmapViewOfFile(pBuf);
46 |
47 | CloseHandle(hMapFile);
48 |
49 | return 0;
50 | }
51 |
--------------------------------------------------------------------------------
/cmd/Adventure/Examples/HTML/Images/Script.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sxzxs/cherry-snippet/8e6b7c000a932380bb44eecb98fe4782f40003e1/cmd/Adventure/Examples/HTML/Images/Script.ico
--------------------------------------------------------------------------------
/cmd/Adventure/Examples/HTML/JavaScript Basics/Basics.htm:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 | JavaScript Basics
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
55 |
56 |
57 |
58 |
59 |
60 |
61 | JavaScript Basics
62 | Open the web developer console to examine the output
63 |
64 |
71 |
72 |
73 |
--------------------------------------------------------------------------------
/cmd/Adventure/Examples/HTML/JavaScript Basics/Evaluator.htm:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 | JavaScript Eval
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
55 |
56 |
74 |
75 |
76 |
77 |
78 | JavaScript Eval
79 | Enter JavaScript code and press the Execute button
80 |
81 |
103 |
104 |
105 |
106 |
107 |
108 |
--------------------------------------------------------------------------------
/cmd/Adventure/Help/AutoHotkey.chm:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sxzxs/cherry-snippet/8e6b7c000a932380bb44eecb98fe4782f40003e1/cmd/Adventure/Help/AutoHotkey.chm
--------------------------------------------------------------------------------
/cmd/Adventure/Help/Credits.htm:
--------------------------------------------------------------------------------
1 |
2 |
3 | Adventure - Credits
4 |
5 |
6 |
7 |
34 |
35 |
36 |
37 |
38 |

39 |
Developed by Alguimist (Gilberto Barbosa Babiretzki)
40 |
41 |
42 | Acknowledgements
43 | Adventure is not a "one man's war". To accomplish the alchemical work, pieces were gathered from a variety of sources, whose authors include:
44 |
45 | - Aleksandar Lekov
46 | - cocobelgica
47 | - Drugwash
48 | - Fanatic Guru
49 | - fincs
50 | - GeekDude
51 | - gwarble
52 | - jeeswg
53 | - jethrow
54 | - jNizM
55 | - just me
56 | - kczx3
57 | - lexikos
58 | - maestrith
59 | - majkinetor
60 | - MJs
61 | - Neil Hodgson
62 | - Rajat
63 | - RaptorX
64 | - Rorqual
65 | - Sean
66 | - Shengalts Aleksander
67 | - SKAN
68 | - Solar
69 | - szujeq
70 | - tmplinshi
71 |
72 | Thanks also to those who participate in the forum by reporting bugs, requesting features and providing feedback. Thanks to the AHK community.
73 | Icons
74 | Some icons by Yusuke Kamiyamane.
75 | Main icon by Supratim Nayak.
76 | Hosting
77 | Project hosted on SourceForge.
78 |
79 |
80 |
--------------------------------------------------------------------------------
/cmd/Adventure/Help/Images/Adventure.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sxzxs/cherry-snippet/8e6b7c000a932380bb44eecb98fe4782f40003e1/cmd/Adventure/Help/Images/Adventure.ico
--------------------------------------------------------------------------------
/cmd/Adventure/Help/Images/Windows.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sxzxs/cherry-snippet/8e6b7c000a932380bb44eecb98fe4782f40003e1/cmd/Adventure/Help/Images/Windows.ico
--------------------------------------------------------------------------------
/cmd/Adventure/Help/Keyboard.exe:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sxzxs/cherry-snippet/8e6b7c000a932380bb44eecb98fe4782f40003e1/cmd/Adventure/Help/Keyboard.exe
--------------------------------------------------------------------------------
/cmd/Adventure/Help/License.txt:
--------------------------------------------------------------------------------
1 | No portion of Adventure or any code derived from it can be used in any software that is sold/licensed commercially, except when otherwise noted.
--------------------------------------------------------------------------------
/cmd/Adventure/Icons/8x8.bmp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sxzxs/cherry-snippet/8e6b7c000a932380bb44eecb98fe4782f40003e1/cmd/Adventure/Icons/8x8.bmp
--------------------------------------------------------------------------------
/cmd/Adventure/Icons/A_Variables.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sxzxs/cherry-snippet/8e6b7c000a932380bb44eecb98fe4782f40003e1/cmd/Adventure/Icons/A_Variables.ico
--------------------------------------------------------------------------------
/cmd/Adventure/Icons/Adventure.icl:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sxzxs/cherry-snippet/8e6b7c000a932380bb44eecb98fe4782f40003e1/cmd/Adventure/Icons/Adventure.icl
--------------------------------------------------------------------------------
/cmd/Adventure/Icons/Adventure.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sxzxs/cherry-snippet/8e6b7c000a932380bb44eecb98fe4782f40003e1/cmd/Adventure/Icons/Adventure.ico
--------------------------------------------------------------------------------
/cmd/Adventure/Icons/AhkDirectives.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sxzxs/cherry-snippet/8e6b7c000a932380bb44eecb98fe4782f40003e1/cmd/Adventure/Icons/AhkDirectives.ico
--------------------------------------------------------------------------------
/cmd/Adventure/Icons/Auto-GUI.icl:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sxzxs/cherry-snippet/8e6b7c000a932380bb44eecb98fe4782f40003e1/cmd/Adventure/Icons/Auto-GUI.icl
--------------------------------------------------------------------------------
/cmd/Adventure/Icons/AutoTaskMan.icl:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sxzxs/cherry-snippet/8e6b7c000a932380bb44eecb98fe4782f40003e1/cmd/Adventure/Icons/AutoTaskMan.icl
--------------------------------------------------------------------------------
/cmd/Adventure/Icons/Breakpoint.xpm:
--------------------------------------------------------------------------------
1 | /* XPM */
2 | static char * x[] = {
3 | "15 15 64 1",
4 | " c None",
5 | ". c #860809",
6 | "+ c #740D13",
7 | "@ c #940E0B",
8 | "# c #7F1A20",
9 | "$ c #A21414",
10 | "% c #7F252B",
11 | "& c #9F2825",
12 | "* c #B22725",
13 | "= c #8E3138",
14 | "- c #B82D29",
15 | "; c #B5332C",
16 | "> c #BE3D36",
17 | ", c #934E54",
18 | "' c #C6433B",
19 | ") c #C34941",
20 | "! c #CE4B42",
21 | "~ c #A75558",
22 | "{ c #BF514C",
23 | "] c #D04D49",
24 | "^ c #985D61",
25 | "/ c #CD5249",
26 | "( c #A76264",
27 | "_ c #D85B52",
28 | ": c #A46A6E",
29 | "< c #DA5D59",
30 | "[ c #DA645C",
31 | "} c #C26C6B",
32 | "| c #D8695E",
33 | "1 c #AC7577",
34 | "2 c #E06961",
35 | "3 c #B77676",
36 | "4 c #DE6E62",
37 | "5 c #E2726C",
38 | "6 c #CD7C78",
39 | "7 c #E0786E",
40 | "8 c #C97F7B",
41 | "9 c #E47B71",
42 | "0 c #E67E79",
43 | "a c #E58174",
44 | "b c #C68C8E",
45 | "c c #D48985",
46 | "d c #E7857D",
47 | "e c #DD8A82",
48 | "f c #E88C82",
49 | "g c #EA8F8A",
50 | "h c #EB968E",
51 | "i c #D99D99",
52 | "j c #EF9A92",
53 | "k c #EFA096",
54 | "l c #DDA6A0",
55 | "m c #D9A7A6",
56 | "n c #F0A39E",
57 | "o c #F1ABA3",
58 | "p c #F3B3A9",
59 | "q c #F6B7B3",
60 | "r c #D8CED5",
61 | "s c #DFDAD8",
62 | "t c #E6E0DF",
63 | "u c #EFF2EE",
64 | "v c #F1F6F9",
65 | "w c #F7FDFF",
66 | "x c #F2FFFF",
67 | "y c #FEFFFC",
68 | " mc66m ",
69 | " lehhf0|{b ",
70 | " ihnokjgd4)3 ",
71 | " lhopponhd7[>3 ",
72 | " ekopqonhd92/& ",
73 | "mdkoppokhd92/*1",
74 | "8fjnoonjgd5[/-=",
75 | "}0ghkkjgd95[]-#",
76 | "}5dffgfd952_'*%",
77 | "b[79da0952_]>$:",
78 | " {[455522_]'*. ",
79 | " 3'<[[<<_!>;@^ ",
80 | " ~;!]]!'>-@, ",
81 | " (&*--*$., ",
82 | " :%+%^ "};
83 |
--------------------------------------------------------------------------------
/cmd/Adventure/Icons/BugBlue.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sxzxs/cherry-snippet/8e6b7c000a932380bb44eecb98fe4782f40003e1/cmd/Adventure/Icons/BugBlue.png
--------------------------------------------------------------------------------
/cmd/Adventure/Icons/BugRed.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sxzxs/cherry-snippet/8e6b7c000a932380bb44eecb98fe4782f40003e1/cmd/Adventure/Icons/BugRed.png
--------------------------------------------------------------------------------
/cmd/Adventure/Icons/COM Inspector.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sxzxs/cherry-snippet/8e6b7c000a932380bb44eecb98fe4782f40003e1/cmd/Adventure/Icons/COM Inspector.ico
--------------------------------------------------------------------------------
/cmd/Adventure/Icons/Constantine.icl:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sxzxs/cherry-snippet/8e6b7c000a932380bb44eecb98fe4782f40003e1/cmd/Adventure/Icons/Constantine.icl
--------------------------------------------------------------------------------
/cmd/Adventure/Icons/Constantine.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sxzxs/cherry-snippet/8e6b7c000a932380bb44eecb98fe4782f40003e1/cmd/Adventure/Icons/Constantine.ico
--------------------------------------------------------------------------------
/cmd/Adventure/Icons/DragMove.cur:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sxzxs/cherry-snippet/8e6b7c000a932380bb44eecb98fe4782f40003e1/cmd/Adventure/Icons/DragMove.cur
--------------------------------------------------------------------------------
/cmd/Adventure/Icons/Error.xpm:
--------------------------------------------------------------------------------
1 | /* XPM */
2 | static char * x[] = {
3 | "16 16 65 1",
4 | " c None",
5 | ". c #752724",
6 | "+ c #762825",
7 | "@ c #7D2827",
8 | "# c #812B2A",
9 | "$ c #882B2D",
10 | "% c #892C2E",
11 | "& c #8A2D2F",
12 | "* c #932D2E",
13 | "= c #8C2F30",
14 | "- c #942E2F",
15 | "; c #8F302D",
16 | "> c #952F2F",
17 | ", c #9A3333",
18 | "' c #9D3635",
19 | ") c #A33538",
20 | "! c #A83835",
21 | "~ c #A93A37",
22 | "{ c #B03939",
23 | "] c #B23A3A",
24 | "^ c #B33B3B",
25 | "/ c #B43C3C",
26 | "( c #BB3B3F",
27 | "_ c #B53D3D",
28 | ": c #BC3C40",
29 | "< c #BD3D41",
30 | "[ c #C03F43",
31 | "} c #C14143",
32 | "| c #BF4644",
33 | "1 c #C04745",
34 | "2 c #C14846",
35 | "3 c #C24947",
36 | "4 c #C34A48",
37 | "5 c #C44B4E",
38 | "6 c #C54C4F",
39 | "7 c #C25150",
40 | "8 c #C45251",
41 | "9 c #C55352",
42 | "0 c #C65452",
43 | "a c #C75553",
44 | "b c #C85654",
45 | "c c #C85D5D",
46 | "d c #C95E5E",
47 | "e c #CB5F5F",
48 | "f c #CC6060",
49 | "g c #CE6262",
50 | "h c #CA6768",
51 | "i c #CC6869",
52 | "j c #CD696A",
53 | "k c #CE6A6B",
54 | "l c #CF6B6D",
55 | "m c #CD6F6E",
56 | "n c #D07170",
57 | "o c #D17271",
58 | "p c #D0797A",
59 | "q c #D27B7C",
60 | "r c #D37C7D",
61 | "s c #D38280",
62 | "t c #D58482",
63 | "u c #D88F90",
64 | "v c #E29F9D",
65 | "w c #E4A8AA",
66 | "x c #E6B1B0",
67 | "y c #E8B3B2",
68 | "z c #FFFCFA",
69 | " zzzzzzzzzzzzzz ",
70 | "zxpkdb9674|}/)sz",
71 | "zpvuqokjgec91{%z",
72 | "zkutnjfyz861}^;z",
73 | "zfroic9zzz__/{-z",
74 | "zamkdb6|zzz{/]>z",
75 | "z9igc94|:zzz^]>z",
76 | "z2dzzzzzzzzzz^-z",
77 | "z|azzzzzzzzzz/-z",
78 | "z(7aa0865zzz}/;z",
79 | "z^189977zzz3|/&z",
80 | "z!<2655zzz75}{%z",
81 | "z'^:}}|wz321:!#z",
82 | "z*)~{{^/___^~,.z",
83 | "zq@#$$%%=&&$#+nz",
84 | " zzzzzzzzzzzzzz "};
85 |
--------------------------------------------------------------------------------
/cmd/Adventure/Icons/ErrorView.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sxzxs/cherry-snippet/8e6b7c000a932380bb44eecb98fe4782f40003e1/cmd/Adventure/Icons/ErrorView.ico
--------------------------------------------------------------------------------
/cmd/Adventure/Icons/Expressive.icl:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sxzxs/cherry-snippet/8e6b7c000a932380bb44eecb98fe4782f40003e1/cmd/Adventure/Icons/Expressive.icl
--------------------------------------------------------------------------------
/cmd/Adventure/Icons/Find in Files.icl:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sxzxs/cherry-snippet/8e6b7c000a932380bb44eecb98fe4782f40003e1/cmd/Adventure/Icons/Find in Files.icl
--------------------------------------------------------------------------------
/cmd/Adventure/Icons/Handpoint1.xpm:
--------------------------------------------------------------------------------
1 | /* XPM */
2 | static char * x[] = {
3 | "16 16 65 1",
4 | " c None",
5 | ". c #813F00",
6 | "+ c #854200",
7 | "@ c #894603",
8 | "# c #8C4700",
9 | "$ c #8D4800",
10 | "% c #944900",
11 | "& c #984B03",
12 | "* c #994C04",
13 | "= c #A05200",
14 | "- c #A75205",
15 | "; c #AC5600",
16 | "> c #B05902",
17 | ", c #B25B04",
18 | "' c #A95F18",
19 | ") c #B65E00",
20 | "! c #BF5F02",
21 | "~ c #C16105",
22 | "{ c #AF7033",
23 | "] c #C26D1A",
24 | "^ c #C87220",
25 | "/ c #CA7418",
26 | "( c #B47A3A",
27 | "_ c #CC894B",
28 | ": c #CA965F",
29 | "< c #D39E66",
30 | "[ c #D29E6C",
31 | "} c #D39F6D",
32 | "| c #D6A068",
33 | "1 c #D5A06E",
34 | "2 c #D6A16F",
35 | "3 c #D7A270",
36 | "4 c #D3A571",
37 | "5 c #D5A672",
38 | "6 c #DAA673",
39 | "7 c #DBA774",
40 | "8 c #D7A974",
41 | "9 c #DDA875",
42 | "0 c #D9AB76",
43 | "a c #DBAD78",
44 | "b c #E1AC79",
45 | "c c #E5AD6E",
46 | "d c #DEAF7A",
47 | "e c #E5AF7C",
48 | "f c #E1B27D",
49 | "g c #E3B47F",
50 | "h c #E5B580",
51 | "i c #E6B681",
52 | "j c #E8B883",
53 | "k c #EABB85",
54 | "l c #EEBE88",
55 | "m c #EFBF89",
56 | "n c #F0C08B",
57 | "o c #F1C18C",
58 | "p c #F4C38E",
59 | "q c #F1C790",
60 | "r c #F7C691",
61 | "s c #F2C891",
62 | "t c #F4CC9A",
63 | "u c #F8CF9D",
64 | "v c #F9D09E",
65 | "w c #FAD19F",
66 | "x c #FBD2A0",
67 | "y c #FFD6A3",
68 | "z c #FDDBA6",
69 | " ",
70 | " ~~ ",
71 | " /yz! ",
72 | " ^wv^ ",
73 | " ]qi'=>))))) ",
74 | " >]nootxxxxxxs>",
75 | " >cojhdiun***** ",
76 | " ;ohd81atttn; ",
77 | " -nfa5}0r|%%% ",
78 | " =kd04}8ppp_ ",
79 | " & c #3B5DC1",
17 | ", c #FAFAFA",
18 | "' c #395BBE",
19 | ") c #F9F9F9",
20 | "! c #F3F3F3",
21 | "~ c #5F79C3",
22 | "{ c #2D4FB3",
23 | "] c #F6F6F6",
24 | "^ c #2E50B4",
25 | "/ c #F0F0F0",
26 | "( c #EBEBEB",
27 | "_ c #E0E0E0",
28 | ": c #4F68B4",
29 | "< c #2446AB",
30 | "[ c #CECECE",
31 | "} c #D1D1D2",
32 | "| c #DDDDDE",
33 | "1 c #2648AC",
34 | "2 c #F4F4F4",
35 | "3 c #EEEEEE",
36 | "4 c #2244AD",
37 | "5 c #D0D0D2",
38 | "6 c #D6D6D7",
39 | "7 c #2244AB",
40 | "8 c #E5E5E7",
41 | "9 c #2648B7",
42 | "0 c #D4D4D8",
43 | "a c #D8D8DB",
44 | "b c #2345AF",
45 | "c c #EAEAED",
46 | "d c #DADAE1",
47 | "e c #EDEDF1",
48 | "f c #637CD5",
49 | "g c #2E50C5",
50 | "h c #E3E3E9",
51 | "i c #D9D9E0",
52 | "j c #DBDBE1",
53 | "k c #2749B8",
54 | "l c #E4E4EB",
55 | "m c #DFDFE7",
56 | "n c #617BDB",
57 | "o c #3759D6",
58 | "p c #E7E7EE",
59 | "q c #2D4FC5",
60 | "r c #E7E7F1",
61 | "s c #E4E4EF",
62 | "t c #3F61E5",
63 | "u c #EBEBF4",
64 | "v c #3456D2",
65 | "w c #D3D7F3",
66 | "x c #E8E8F7",
67 | "y c #F4F4FC",
68 | "z c #D1D5F2",
69 | "A c #3C5EDF",
70 | "B c #768DE9",
71 | "C c #D6DAF9",
72 | "D c #ECECFC",
73 | "E c #758CE9",
74 | "F c #4163E9",
75 | " ",
76 | " ............ ",
77 | " +@#$$$$$$$$#@+ ",
78 | " %&**********=% ",
79 | " -*;;;;>>;;;;,- ",
80 | " ')!!!!~{{!!!]' ",
81 | " ^]///(_:<<[}|^ ",
82 | " 12344444444561 ",
83 | " 7!8999999990a7 ",
84 | " bcdeeeefgghijb ",
85 | " klmmmmnoopmmmk ",
86 | " qrssssttussssq ",
87 | " vwxxxxyyxxxxzv ",
88 | " ABCDDDDDDDDCEA ",
89 | " FFFFFFFFFFFF ",
90 | " "};
91 |
--------------------------------------------------------------------------------
/cmd/Adventure/Icons/Handpoint3.xpm:
--------------------------------------------------------------------------------
1 | /* XPM */
2 | static char * x[] = {
3 | "16 16 90 1",
4 | " c None",
5 | ". c #0330BA",
6 | "+ c #032FB8",
7 | "@ c #335BD2",
8 | "# c #6E91F1",
9 | "$ c #7698F6",
10 | "% c #7698F5",
11 | "& c #7597F5",
12 | "* c #7496F5",
13 | "= c #6B8EF0",
14 | "- c #3159D1",
15 | "; c #032DB5",
16 | "> c #6C8FF0",
17 | ", c #5F81E7",
18 | "' c #5072D8",
19 | ") c #587AE0",
20 | "! c #6588EB",
21 | "~ c #032CB2",
22 | "{ c #6E90EF",
23 | "] c #5779DF",
24 | "^ c #4A6CD2",
25 | "/ c #FFFFFF",
26 | "( c #6587E8",
27 | "_ c #032AAF",
28 | ": c #688AE8",
29 | "< c #4E70D6",
30 | "[ c #496BD1",
31 | "} c #C8D1EA",
32 | "| c #5C7EE0",
33 | "1 c #0227AB",
34 | "2 c #6082E2",
35 | "3 c #4769CF",
36 | "4 c #4264CA",
37 | "5 c #2F51B8",
38 | "6 c #BFC7E1",
39 | "7 c #E7E7E7",
40 | "8 c #E1E1E1",
41 | "9 c #2446AD",
42 | "0 c #274AB0",
43 | "a c #3C5FC2",
44 | "b c #0225A7",
45 | "c c #5B7DDD",
46 | "d c #4466CC",
47 | "e c #F8F8F8",
48 | "f c #D5D5D5",
49 | "g c #D7D7D7",
50 | "h c #DCDCDC",
51 | "i c #E0E0E0",
52 | "j c #E4E4E4",
53 | "k c #E8E8E8",
54 | "l c #264AB4",
55 | "m c #3255BD",
56 | "n c #0223A3",
57 | "o c #5779DA",
58 | "p c #3B5FC8",
59 | "q c #D4D4D4",
60 | "r c #D3D3D3",
61 | "s c #ECECEC",
62 | "t c #2A50BE",
63 | "u c #3156C3",
64 | "v c #02209F",
65 | "w c #4B6FD8",
66 | "x c #3059CB",
67 | "y c #294FBC",
68 | "z c #B4BDD6",
69 | "A c #2F58CB",
70 | "B c #325BCC",
71 | "C c #021E9B",
72 | "D c #426CDE",
73 | "E c #3560D8",
74 | "F c #325CD2",
75 | "G c #B9C3E1",
76 | "H c #2C53C3",
77 | "I c #021B96",
78 | "J c #426EE8",
79 | "K c #3A67E5",
80 | "L c #345FD7",
81 | "M c #2F57C9",
82 | "N c #021790",
83 | "O c #3C69E7",
84 | "P c #3E6FF1",
85 | "Q c #315ACF",
86 | "R c #3865E6",
87 | "S c #010E80",
88 | "T c #1A33AB",
89 | "U c #3C69EC",
90 | "V c #4274FA",
91 | "W c #3B69EC",
92 | "X c #1832AB",
93 | "Y c #000572",
94 | " ",
95 | " ............ ",
96 | " +@#$$$$%&&*=-+ ",
97 | " ;>,,,,'),,,,!; ",
98 | " ~{]]]^//]]]](~ ",
99 | " _:<<<[}//<<<|_ ",
100 | " 123334567890a1 ",
101 | " bcde8fghijklmb ",
102 | " nopqrghijkstun ",
103 | " vwxyyyyzksyABv ",
104 | " CDEEEFGksHEEEC ",
105 | " IJKKKLksMKKKKI ",
106 | " NOPPPPQQPPPPRN ",
107 | " STUVVVVVVVVWXS ",
108 | " YYYYYYYYYYYY ",
109 | " "};
110 |
--------------------------------------------------------------------------------
/cmd/Adventure/Icons/Handpoint4.xpm:
--------------------------------------------------------------------------------
1 | /* XPM */
2 | static char * x[] = {
3 | "16 16 82 1",
4 | " c None",
5 | ". c #F7F7F7",
6 | "+ c #FCFCFC",
7 | "@ c #EFEFEF",
8 | "# c #D8D8D8",
9 | "$ c #E9F5E9",
10 | "% c #3AA638",
11 | "& c #3DA73B",
12 | "* c #F4FAF4",
13 | "= c #EBEBEB",
14 | "- c #9ED39D",
15 | "; c #038D00",
16 | "> c #249C21",
17 | ", c #F1F9F1",
18 | "' c #E3E3E3",
19 | ") c #C8C8C8",
20 | "! c #DEF0DE",
21 | "~ c #0E920B",
22 | "{ c #279D24",
23 | "] c #EAF6EA",
24 | "^ c #DEDEDE",
25 | "/ c #F2F2F2",
26 | "( c #F8F8F8",
27 | "_ c #F4F4F4",
28 | ": c #E8E8E8",
29 | "< c #FDFDFD",
30 | "[ c #199716",
31 | "} c #2C9F29",
32 | "| c #ECF7EC",
33 | "1 c #DDDDDD",
34 | "2 c #FFFFFF",
35 | "3 c #4EB752",
36 | "4 c #5CBD60",
37 | "5 c #61BF65",
38 | "6 c #73C676",
39 | "7 c #82CD85",
40 | "8 c #28A82D",
41 | "9 c #039909",
42 | "0 c #2CA931",
43 | "a c #E3F4E4",
44 | "b c #E6E6E6",
45 | "c c #02AB16",
46 | "d c #19B32B",
47 | "e c #FBFBFB",
48 | "f c #01BB22",
49 | "g c #19C137",
50 | "h c #FAFAFA",
51 | "i c #50D96D",
52 | "j c #61DD7B",
53 | "k c #65DE7E",
54 | "l c #76E18C",
55 | "m c #83E498",
56 | "n c #25D049",
57 | "o c #01C82B",
58 | "p c #2ED250",
59 | "q c #EBFBEE",
60 | "r c #D6D6D6",
61 | "s c #F1F1F1",
62 | "t c #E1E1E1",
63 | "u c #D3D3D3",
64 | "v c #F1FDF4",
65 | "w c #17D745",
66 | "x c #00D333",
67 | "y c #2ADA55",
68 | "z c #F0FCF3",
69 | "A c #BEBEBE",
70 | "B c #E1FBE8",
71 | "C c #17DE4B",
72 | "D c #00DB39",
73 | "E c #2AE15A",
74 | "F c #EBFCEF",
75 | "G c #9CF1B2",
76 | "H c #25E056",
77 | "I c #EEFDF2",
78 | "J c #BFBFBF",
79 | "K c #C1C1C1",
80 | "L c #E6FBEC",
81 | "M c #3CE368",
82 | "N c #3EE469",
83 | "O c #ECFCF0",
84 | "P c #CACACA",
85 | "Q c #C5C5C5",
86 | " ",
87 | " .++@ ",
88 | " #$%&*= ",
89 | " .-;;>,' ",
90 | " )!~;;{]^ ",
91 | " /+(_:<[;;}|1 ",
92 | " +23456789990ab ",
93 | " 2cccccccccccde ",
94 | " 2fffffffffffgh ",
95 | " .2ijklmnooopqr ",
96 | " #sbtuvwxxyzA ",
97 | " BCDDEFA ",
98 | " 'GDDHIJ ",
99 | " KLMNOP ",
100 | " :._Q ",
101 | " "};
102 |
--------------------------------------------------------------------------------
/cmd/Adventure/Icons/Keyboard.icl:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sxzxs/cherry-snippet/8e6b7c000a932380bb44eecb98fe4782f40003e1/cmd/Adventure/Icons/Keyboard.icl
--------------------------------------------------------------------------------
/cmd/Adventure/Icons/Keyboard.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sxzxs/cherry-snippet/8e6b7c000a932380bb44eecb98fe4782f40003e1/cmd/Adventure/Icons/Keyboard.ico
--------------------------------------------------------------------------------
/cmd/Adventure/Icons/MagicBox.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sxzxs/cherry-snippet/8e6b7c000a932380bb44eecb98fe4782f40003e1/cmd/Adventure/Icons/MagicBox.ico
--------------------------------------------------------------------------------
/cmd/Adventure/Icons/Search.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sxzxs/cherry-snippet/8e6b7c000a932380bb44eecb98fe4782f40003e1/cmd/Adventure/Icons/Search.ico
--------------------------------------------------------------------------------
/cmd/Adventure/Icons/SidePane.bmp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sxzxs/cherry-snippet/8e6b7c000a932380bb44eecb98fe4782f40003e1/cmd/Adventure/Icons/SidePane.bmp
--------------------------------------------------------------------------------
/cmd/Adventure/Icons/Sort Panel.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sxzxs/cherry-snippet/8e6b7c000a932380bb44eecb98fe4782f40003e1/cmd/Adventure/Icons/Sort Panel.ico
--------------------------------------------------------------------------------
/cmd/Adventure/Icons/Structor.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sxzxs/cherry-snippet/8e6b7c000a932380bb44eecb98fe4782f40003e1/cmd/Adventure/Icons/Structor.ico
--------------------------------------------------------------------------------
/cmd/Adventure/Icons/Verifier.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sxzxs/cherry-snippet/8e6b7c000a932380bb44eecb98fe4782f40003e1/cmd/Adventure/Icons/Verifier.ico
--------------------------------------------------------------------------------
/cmd/Adventure/Lib/AutoSize.ahk:
--------------------------------------------------------------------------------
1 | ; Original: http://ahkscript.org/boards/viewtopic.php?t=1079
2 | AutoSize(DimSize, cList*) {
3 | Static cInfo := {}
4 | Local
5 |
6 | If (DimSize = "reset") {
7 | Return cInfo := {}
8 | }
9 |
10 | For i, ctrl in cList {
11 | ctrlID := A_Gui . ":" . ctrl
12 | If (cInfo[ctrlID].x = "") {
13 | GuiControlGet i, %A_Gui%: Pos, %ctrl%
14 | MMD := InStr(DimSize, "*") ? "MoveDraw" : "Move"
15 | fx := fy := fw := fh := 0
16 | For i, dim in (a := StrSplit(RegExReplace(DimSize, "i)[^xywh]"))) {
17 | If (!RegExMatch(DimSize, "i)" . dim . "\s*\K[\d.-]+", f%dim%)) {
18 | f%dim% := 1
19 | }
20 | }
21 |
22 | If (InStr(DimSize, "t")) {
23 | GuiControlGet hWnd, %A_Gui%: hWnd, %ctrl%
24 | hWndParent := DllCall("GetParent", "Ptr", hWnd, "Ptr")
25 | VarSetCapacity(RECT, 16, 0)
26 | DllCall("GetWindowRect", "Ptr", hWndParent, "Ptr", &RECT)
27 | DllCall("MapWindowPoints", "Ptr", 0, "Ptr"
28 | , DllCall("GetParent", "Ptr", hWndParent, "Ptr"), "Ptr", &RECT, "UInt", 1)
29 | ix -= (NumGet(RECT, 0, "Int") * 96) // A_ScreenDPI
30 | iy -= (NumGet(RECT, 4, "Int") * 96) // A_ScreenDPI
31 | }
32 |
33 | cInfo[ctrlID] := {x: ix, fx: fx, y: iy, fy: fy, w: iw, fw: fw, h: ih, fh: fh, gw: A_GuiWidth, gh: A_GuiHeight, a: a, m: MMD}
34 |
35 | } Else If (cInfo[ctrlID].a.1) {
36 | dgx := dgw := A_GuiWidth - cInfo[ctrlID].gw
37 | dgy := dgh := A_GuiHeight - cInfo[ctrlID].gh
38 |
39 | Options := ""
40 | For i, dim in cInfo[ctrlID]["a"] {
41 | Options .= dim . (dg%dim% * cInfo[ctrlID]["f" . dim] + cInfo[ctrlID][dim]) . A_Space
42 | }
43 |
44 | GuiControl, % A_Gui ":" cInfo[ctrlID].m, % ctrl, % Options
45 | }
46 | }
47 | }
48 |
--------------------------------------------------------------------------------
/cmd/Adventure/Lib/AutoXYWH.ahk:
--------------------------------------------------------------------------------
1 | ; =================================================================================
2 | ; Function: AutoXYWH
3 | ; Move and resize controls automatically when the window is resized.
4 | ;
5 | ; Parameters:
6 | ; DimSize - Can be one or more of x/y/w/h, optionally followed by a fraction.
7 | ; The presence of an asterisk in this parameter indicates that the
8 | ; controls are to be moved/resized with 'MoveDraw' instead of 'Move'.
9 | ; This is recommended for GroupBoxes.
10 | ;
11 | ; cList - Variadic list of ControlIDs.
12 | ; ControlID can be a control HWND, associated variable name, ClassNN
13 | ; or displayed text. The latter (displayed text) may not be reliable.
14 | ; Examples:
15 | ; AutoXYWH("xy", "Btn1", "Btn2")
16 | ; AutoXYWH("w0.5 h 0.75", hEdit, "displayed text", "vLabel", "Button1")
17 | ; AutoXYWH("*w0.5 h 0.75", hGroupbox1, "GrbChoices")
18 | ; ---------------------------------------------------------------------------------
19 | ; Version: 2015-5-29 / Added 'reset' option (by tmplinshi)
20 | ; 2014-7-03 / toralf
21 | ; 2014-1-2 / tmplinshi
22 | ; Mininum AHK version: 1.1.13.01.
23 | ; Forum topic: https://www.autohotkey.com/boards/viewtopic.php?t=1079
24 | ; =================================================================================
25 |
26 | AutoXYWH(DimSize, cList*) {
27 | Static cInfo := {}
28 |
29 | If (DimSize = "reset") {
30 | Return cInfo := {}
31 | }
32 |
33 | For i, ctrl in cList {
34 | ctrlID := A_Gui ":" ctrl
35 | If (cInfo[ctrlID].x = "") {
36 | GuiControlGet i, %A_Gui%: Pos, %ctrl%
37 | MMD := InStr(DimSize, "*") ? "MoveDraw" : "Move"
38 | fx := fy := fw := fh := 0
39 | For i, dim in (a := StrSplit(RegExReplace(DimSize, "i)[^xywh]"))) {
40 | If (!RegExMatch(DimSize, "i)" . dim . "\s*\K[\d.-]+", f%dim%)) {
41 | f%dim% := 1
42 | }
43 | }
44 | cInfo[ctrlID] := {x: ix, fx: fx, y: iy, fy: fy, w: iw, fw: fw, h: ih, fh: fh, gw: A_GuiWidth, gh: A_GuiHeight, a: a, m: MMD}
45 | } Else If (cInfo[ctrlID].a.1) {
46 | dgx := dgw := A_GuiWidth - cInfo[ctrlID].gw, dgy := dgh := A_GuiHeight - cInfo[ctrlID].gh
47 | Options := ""
48 | For i, dim in cInfo[ctrlID]["a"] {
49 | Options .= dim . (dg%dim% * cInfo[ctrlID]["f" . dim] + cInfo[ctrlID][dim]) . A_Space
50 | }
51 | GuiControl, % A_Gui ":" cInfo[ctrlID].m, % ctrl, % Options
52 | }
53 | }
54 | }
55 |
--------------------------------------------------------------------------------
/cmd/Adventure/Lib/ControlColor.ahk:
--------------------------------------------------------------------------------
1 | ; http://www.autohotkey.com/board/topic/104539-controlcol-set-background-and-text-color-gui-controls/
2 |
3 | ControlColor(Control, Window, bc := "", tc := "", Redraw := True) {
4 | Local a := {}
5 | a["c"] := Control
6 | a["g"] := Window
7 | a["bc"] := (bc == "") ? "" : (((bc & 255) << 16) + (((bc >> 8) & 255) << 8) + (bc >> 16))
8 | a["tc"] := (tc == "") ? "" : (((tc & 255) << 16) + (((tc >> 8) & 255) << 8) + (tc >> 16))
9 |
10 | CC_WindowProc("Set", a, "", "")
11 |
12 | If (Redraw) {
13 | WinSet Redraw,, ahk_id %Control%
14 | }
15 | }
16 |
17 | CC_WindowProc(hWnd, uMsg, wParam, lParam) {
18 | Local tc, bc, a
19 | Static Win := {}
20 | ; Critical
21 |
22 | If uMsg Between 0x132 And 0x138 ; WM_CTLCOLOR(MSGBOX|EDIT|LISTBOX|BTN|DLG|SCROLLBAR|STATIC)
23 | If (Win[hWnd].HasKey(lParam)) {
24 | If (tc := Win[hWnd, lParam, "tc"]) {
25 | DllCall("gdi32.dll\SetTextColor", "Ptr", wParam, "UInt", tc)
26 | }
27 |
28 | If (bc := Win[hWnd, lParam, "bc"]) {
29 | DllCall("gdi32.dll\SetBkColor", "Ptr", wParam, "UInt", bc)
30 | }
31 |
32 | Return Win[hWnd, lParam, "Brush"] ; Return the HBRUSH to notify the OS that we altered the HDC.
33 | }
34 |
35 | If (hWnd == "Set") {
36 | a := uMsg
37 | Win[a.g, a.c] := a
38 |
39 | If ((Win[a.g, a.c, "tc"] == "") && (Win[a.g, a.c, "bc"] == "")) {
40 | Win[a.g].Remove(a.c, "")
41 | }
42 |
43 | If (!Win[a.g, "WindowProcOld"]) {
44 | Win[a.g,"WindowProcOld"] := DllCall("SetWindowLong" . (A_PtrSize == 8 ? "Ptr" : "")
45 | , "Ptr", a.g, "Int", -4, "Ptr", RegisterCallback("CC_WindowProc", "", 4), "UPtr")
46 | }
47 |
48 | If (Win[a.g, a.c, "bc"] != "") {
49 | Win[a.g, a.c, "Brush"] := DllCall("gdi32.dll\CreateSolidBrush", "UInt", a.bc, "UPtr")
50 | }
51 |
52 | Return
53 | }
54 |
55 | Return DllCall("CallWindowProc", "Ptr", Win[hWnd, "WindowProcOld"], "Ptr", hWnd, "UInt", uMsg, "Ptr", wParam, "Ptr", lParam, "Ptr")
56 | }
57 |
--------------------------------------------------------------------------------
/cmd/Adventure/Lib/CreateGradient.ahk:
--------------------------------------------------------------------------------
1 | ; https://www.autohotkey.com/boards/viewtopic.php?f=6&t=91899
2 |
3 | CreateGradient(W, H, V, aColors) {
4 | Local
5 |
6 | C := aColors.Length()
7 |
8 | xOFF := (X := V ? W : 0) ? 0 : Ceil(W / (C - 1))
9 | yOFF := (Y := V ? 0 : H) ? 0 : Ceil(H / (C - 1))
10 |
11 | VarSetCapacity(VERT, C * 16, 0)
12 | VarSetCapacity(MESH, C * 8, 0)
13 |
14 | Loop % (C, pVert := &VERT, pMesh := &MESH) {
15 | X := V ? (X == 0 ? W : X := 0) : X
16 | Y := !V ? (Y == 0 ? H : Y := 0) : Y
17 | Color := Format("{:06X}", aColors[A_Index] & 0xFFFFFF)
18 | Color := Format("0x{5:}{6:}00{3:}{4:}00{1:}{2:}00", StrSplit(Color)*)
19 | pVert := NumPut(Color, NumPut(Y, NumPut(X, pVert+0, "Int"), "Int"), "Int64")
20 | pMesh := NumPut(A_Index, NumPut(A_Index - 1, pMesh+0, "Int"), "Int")
21 | V ? (Y += yOFF) : (X += xOFF)
22 | }
23 |
24 | hBM := DllCall("Gdi32.dll\CreateBitmap", "Int", 1, "Int", 1, "Int", 0x1, "Int", 32, "Ptr*", 0, "Ptr")
25 | hBM := DllCall("User32.dll\CopyImage", "Ptr", hBM, "Int", 0x0, "Int", W, "Int", H, "Int", 0x8, "Ptr")
26 | mDC := DllCall("Gdi32.dll\CreateCompatibleDC", "Ptr", 0, "Ptr")
27 | DllCall("Gdi32.dll\SaveDC", "Ptr", mDC)
28 | DllCall("Gdi32.dll\SelectObject", "Ptr", mDC, "Ptr", hBM)
29 | DllCall("Msimg32.dll\GradientFill", "Ptr", mDC, "Ptr", &VERT, "Int", C, "Ptr", &MESH, "Int", C - 1, "Int", !!V)
30 | DllCall("Gdi32.dll\RestoreDC", "Ptr", mDC, "Int", -1)
31 | DllCall("Gdi32.dll\DeleteDC", "Ptr", mDC)
32 |
33 | Return hBM
34 | }
35 |
--------------------------------------------------------------------------------
/cmd/Adventure/Lib/ExecScript.ahk:
--------------------------------------------------------------------------------
1 | ExecScript(Script, Params := "", AhkPath := "") {
2 | Local Name, Pipe, Call, Shell, Exec
3 |
4 | Name := "AHK_CQT_" . A_TickCount
5 | Pipe := []
6 |
7 | Loop 2 {
8 | Pipe[A_Index] := DllCall("CreateNamedPipe"
9 | , "Str", "\\.\pipe\" . Name
10 | , "UInt", 2, "UInt", 0
11 | , "UInt", 255, "UInt", 0
12 | , "UInt", 0, "UPtr", 0
13 | , "UPtr", 0, "UPtr")
14 | }
15 |
16 | If (!FileExist(AhkPath)) {
17 | AhkPath := A_AhkPath
18 | }
19 |
20 | Call = "%AhkPath%" /CP65001 "\\.\pipe\%Name%"
21 | Shell := ComObjCreate("WScript.Shell")
22 | Exec := Shell.Exec(Call . " " . Params)
23 | DllCall("ConnectNamedPipe", "UPtr", Pipe[1], "UPtr", 0)
24 | DllCall("CloseHandle", "UPtr", Pipe[1])
25 | DllCall("ConnectNamedPipe", "UPtr", Pipe[2], "UPtr", 0)
26 | FileOpen(Pipe[2], "h", "UTF-8").Write(Script)
27 | DllCall("CloseHandle", "UPtr", Pipe[2])
28 |
29 | Return Exec
30 | }
31 |
--------------------------------------------------------------------------------
/cmd/Adventure/Lib/GuiButtonIcon.ahk:
--------------------------------------------------------------------------------
1 | ; GuiButtonIcon
2 | ; Function to assign an icon to a Gui Button
3 | ; By Fanatic Guru
4 | ; Version 2.0 (20140531)
5 | ;------------------------------------------------
6 | ;
7 | ; Signature:
8 | ; GuiButtonIcon(Handle, File, Index, Options)
9 | ;
10 | ; Parameters:
11 | ; 1) {Handle} Handle of the button
12 | ; 2) {File} Resource file containing the icon
13 | ; 3) {Index} Index of icon within the file
14 | ; 4) {Options} Single letter flag followed by a number with multiple options delimited by a space
15 | ; W = Width of the icon (default: 16)
16 | ; H = Height of the icon (default: 16)
17 | ; S = Size of the icon, value applied to both width and height
18 | ; L = Left margin
19 | ; T = Top margin
20 | ; R = Right margin
21 | ; B = Botton margin
22 | ; A = Alignment (0 = left, 1 = right, 2 = top, 3 = bottom, 4 = center; default: 4)
23 | ;
24 | ; Return value: true if the icon was succesfully added to the image list
25 | ;
26 | ; Example:
27 | ; Gui, Add, Button, w70 h38 hWndhBtn, Save
28 | ; GuiButtonIcon(hBtn, "shell32.dll", 259, "s30 a1 r2")
29 |
30 | GuiButtonIcon(Handle, File, Index := 1, Options := "") {
31 | Local W, H, S, L, T, R, B, A, IL
32 |
33 | RegExMatch(Options, "i)w\K\d+", W), (W="") ? W := 16 :
34 | RegExMatch(Options, "i)h\K\d+", H), (H="") ? H := 16 :
35 | RegExMatch(Options, "i)s\K\d+", S), S ? W := H := S :
36 | RegExMatch(Options, "i)l\K\d+", L), (L="") ? L := 0 :
37 | RegExMatch(Options, "i)t\K\d+", T), (T="") ? T := 0 :
38 | RegExMatch(Options, "i)r\K\d+", R), (R="") ? R := 0 :
39 | RegExMatch(Options, "i)b\K\d+", B), (B="") ? B := 0 :
40 | RegExMatch(Options, "i)a\K\d+", A), (A="") ? A := 4 :
41 |
42 | VarSetCapacity(button_il, 20 + A_PtrSize, 0)
43 | IL := DllCall("ImageList_Create", "UInt", W, "UInt", H, "UInt", 0x21, "UInt", 1, "UInt", 1)
44 | NumPut(IL, button_il, 0, "Ptr")
45 | NumPut(L, button_il, 0 + A_PtrSize, "UInt") ; Left margin
46 | NumPut(T, button_il, 4 + A_PtrSize, "UInt") ; Top margin
47 | NumPut(R, button_il, 8 + A_PtrSize, "UInt") ; Right margin
48 | NumPut(B, button_il, 12 + A_PtrSize, "UInt") ; Bottom margin
49 | NumPut(A, button_il, 16 + A_PtrSize, "UInt") ; Alignment
50 | SendMessage 0x1602, 0, &button_il,, AHK_ID %Handle% ; BCM_SETIMAGELIST
51 | Return IL_Add(IL, File, Index)
52 | }
53 |
--------------------------------------------------------------------------------
/cmd/Adventure/Lib/LV_GroupView.ahk:
--------------------------------------------------------------------------------
1 | LV_InsertGroup(hLV, GroupID, Header, Index := -1) {
2 | Local LVGROUP
3 | Static GroupIdOff := (A_PtrSize == 8) ? 36 : 24
4 | NumPut(VarSetCapacity(LVGROUP, 56, 0), LVGROUP, 0)
5 | NumPut(0x15, LVGROUP, 4, "UInt") ; mask: LVGF_HEADER|LVGF_STATE|LVGF_GROUPID
6 | NumPut(A_IsUnicode ? &Header : UTF16(Header, @), LVGROUP, 8, "Ptr") ; pszHeader
7 | NumPut(GroupID, LVGROUP, GroupIdOff, "Int") ; iGroupId
8 | NumPut(0x8, LVGROUP, GroupIdOff + 8, "Int") ; state: LVGS_COLLAPSIBLE
9 | SendMessage 0x1091, %Index%, % &LVGROUP,, ahk_id %hLV% ; LVM_INSERTGROUP
10 | Return ErrorLevel
11 | }
12 |
13 | LV_SetGroup(hLV, Row, GroupID) {
14 | Local LVITEM
15 | VarSetCapacity(LVITEM, 58, 0)
16 | NumPut(0x100, LVITEM, 0, "UInt") ; mask: LVIF_GROUPID
17 | NumPut(Row - 1, LVITEM, 4, "Int") ; iItem
18 | NumPut(GroupID, LVITEM, (A_PtrSize == 8) ? 52 : 40, "Int")
19 | SendMessage 0x1006, 0, &LVITEM,, ahk_id %HLV% ; LVM_SETITEMA
20 | Return ErrorLevel
21 | }
22 |
23 | LV_GetGroupId(hLV, Row) {
24 | Local LVITEM
25 | VarSetCapacity(LVITEM, A_PtrSize == 8 ? 88 : 60, 0)
26 | NumPut(0x100, LVITEM, 0, "UInt") ; mask: LVIF_GROUPID
27 | NumPut(Row - 1, LVITEM, 4, "Int")
28 | SendMessage 0x1005, 0, &LVITEM,, ahk_id %hLV% ; LVM_GETITEMA
29 | Return NumGet(LVITEM, A_PtrSize == 8 ? 52 : 40, "Int") ; iGroupId
30 | }
31 |
32 | LV_EnableGroupView(hLV, bEnable := True) {
33 | SendMessage 0x109D, %bEnable%, 0,, ahk_id %hLV% ; LVM_ENABLEGROUPVIEW
34 | }
35 |
36 | UTF16(String, ByRef Var) {
37 | VarSetCapacity(Var, StrPut(String, "UTF-16") * 2, 0)
38 | StrPut(String, &Var, "UTF-16")
39 | Return &Var
40 | }
41 |
--------------------------------------------------------------------------------
/cmd/Adventure/Lib/ResourceID.ahk:
--------------------------------------------------------------------------------
1 | ; https://autohotkey.com/board/topic/27668-how-to-get-the-icon-group-number/
2 |
3 | ResourceIdOfIcon(Filename, IconIndex) { ; 0-based index
4 | Local hMod, Loaded, EnumProc, Param
5 |
6 | hMod := DllCall("GetModuleHandle", "Str", Filename, "Ptr")
7 | ; If the DLL isn't already loaded, load it as a data file.
8 | Loaded := !hMod
9 | && hMod := DllCall("LoadLibraryEx", "Str", Filename, "UInt", 0, "UInt", 0x2, "Ptr")
10 |
11 | If (!hMod) {
12 | Return
13 | }
14 |
15 | EnumProc := RegisterCallback("ResourceIdOfIcon_EnumIconResources", "F")
16 |
17 | VarSetCapacity(Param, 16, 0)
18 | NumPut(IconIndex, Param, 0)
19 | ; Enumerate the icon group resources (RT_GROUP_ICON = 14).
20 | DllCall("kernel32.dll\EnumResourceNames", "Ptr", hMod, "UInt", 14, "Ptr", EnumProc, "Ptr", &Param)
21 | DllCall("GlobalFree", "Ptr", EnumProc)
22 |
23 | If (Loaded) {
24 | DllCall("FreeLibrary", "Ptr", hMod)
25 | }
26 |
27 | Return NumGet(Param, 0) ? NumGet(Param, A_PtrSize) : ""
28 | }
29 |
30 | ResourceIdOfIcon_EnumIconResources(hModule, lpszType, lpszName, lParam) {
31 | Local Index := NumGet(lParam + A_PtrSize)
32 |
33 | If (Index == NumGet(lParam + 0)) {
34 | NumPut(lpszName, lParam + A_PtrSize)
35 | NumPut(1, lParam + 0)
36 | Return False ; Break
37 | }
38 |
39 | NumPut(Index + 1, lParam + A_PtrSize)
40 | Return True
41 | }
42 |
--------------------------------------------------------------------------------
/cmd/Adventure/Lib/RunGetStdout.ahk:
--------------------------------------------------------------------------------
1 | RunGetStdOut(sCmd, sEncoding := "CP0", sDir := "", ByRef nExitCode := 0, Callback := "") {
2 | DllCall("CreatePipe", "Ptr*", hStdOutRd, "Ptr*", hStdOutWr, "Ptr", 0, "UInt", 0)
3 | DllCall("SetHandleInformation", "Ptr", hStdOutWr, "UInt", 1, "UInt", 1)
4 |
5 | ; STARTUPINFO
6 | NumPut(VarSetCapacity(si, A_PtrSize == 4 ? 68 : 104, 0), si, 0, "UInt")
7 | NumPut(0x100, si, A_PtrSize == 4 ? 44 : 60, "UInt") ; dwFlags: STARTF_USESTDHANDLES
8 | NumPut(hStdOutWr, si, A_PtrSize == 4 ? 60 : 88, "Ptr" ) ; hStdOutput
9 | NumPut(hStdOutWr, si, A_PtrSize == 4 ? 64 : 96, "Ptr" ) ; hStdError
10 |
11 | ; PROCESS_INFORMATION
12 | VarSetCapacity(pi, A_PtrSize == 4 ? 16 : 24, 0)
13 | ; CREATE_NO_WINDOW = 0x08000000
14 | If (!DllCall("CreateProcess", "Ptr", 0, "Ptr", &sCmd, "Ptr", 0, "Ptr", 0, "Int", True
15 | , "UInt", 0x08000000, "Ptr", 0, "Ptr", sDir ? &sDir : 0, "Ptr", &si, "Ptr", &pi)) {
16 | DllCall("CloseHandle", "Ptr", hStdOutWr)
17 | DllCall("CloseHandle", "Ptr", hStdOutRd)
18 | Return ""
19 | }
20 |
21 | DllCall("CloseHandle", "Ptr", hStdOutWr) ; The write pipe must be closed before reading stdout.
22 |
23 | sOutput := ""
24 | While (1) {
25 | ; Before reading, we check if the pipe has been written to, so we avoid freezings.
26 | If (!DllCall("PeekNamedPipe", "Ptr", hStdOutRd, "Ptr", 0, "UInt", 0, "Ptr", 0, "UInt*", nTot, "Ptr", 0)) {
27 | Break
28 | }
29 |
30 | If (!nTot) { ; If the pipe buffer is empty, sleep and continue checking.
31 | Sleep 100
32 | Continue
33 | }
34 |
35 | ; Pipe buffer is not empty, so we can read it.
36 | VarSetCapacity(sTemp, nTot + 1)
37 | DllCall("ReadFile", "Ptr", hStdOutRd, "Ptr", &sTemp, "UInt", nTot, "Ptr*", nSize, "Ptr", 0)
38 | sOutput .= sStdOut := StrGet(&sTemp, nSize, sEncoding)
39 | If (Callback != "") {
40 | %Callback%(sStdOut)
41 | }
42 | }
43 |
44 | DllCall("GetExitCodeProcess", "Ptr", NumGet(pi, 0), "UInt*", nExitCode)
45 | DllCall("CloseHandle", "Ptr", NumGet(pi, 0)) ; hProcess
46 | DllCall("CloseHandle", "Ptr", NumGet(pi, A_PtrSize)) ; hThread
47 | DllCall("CloseHandle", "Ptr", hStdOutRd)
48 | Return sOutput
49 | }
50 |
--------------------------------------------------------------------------------
/cmd/Adventure/SciLexer32.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sxzxs/cherry-snippet/8e6b7c000a932380bb44eecb98fe4782f40003e1/cmd/Adventure/SciLexer32.dll
--------------------------------------------------------------------------------
/cmd/Adventure/SciLexer64.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sxzxs/cherry-snippet/8e6b7c000a932380bb44eecb98fe4782f40003e1/cmd/Adventure/SciLexer64.dll
--------------------------------------------------------------------------------
/cmd/Adventure/ScreenToGif/Logs/22_01_15.txt:
--------------------------------------------------------------------------------
1 | ► Title -
2 | Improved Encoding
3 | ▬ Message -
4 | The process cannot access the file 'F:\gif\动画5.gif' because it is being used by another process.
5 | ○ Type -
6 | System.IO.IOException
7 | ♦ [Version] Date/Hour -
8 | [2.34.1] 01/15/2022 12:56:31
9 | ▲ Source -
10 | mscorlib
11 | ▼ TargetSite -
12 | Void WinIOError(Int32, System.String)
13 | ♠ StackTrace -
14 | at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
15 | at System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy, Boolean useLongPath, Boolean checkHost)
16 | at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize)
17 | at ScreenToGif.Util.EncodingManager.d__27.MoveNext()
18 |
19 | ----------------------------------
20 |
21 |
--------------------------------------------------------------------------------
/cmd/Adventure/Settings/AHK-Tools.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
--------------------------------------------------------------------------------
/cmd/Adventure/Settings/Adventure.ini:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sxzxs/cherry-snippet/8e6b7c000a932380bb44eecb98fe4782f40003e1/cmd/Adventure/Settings/Adventure.ini
--------------------------------------------------------------------------------
/cmd/Adventure/Settings/AutoTaskMan.ini:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sxzxs/cherry-snippet/8e6b7c000a932380bb44eecb98fe4782f40003e1/cmd/Adventure/Settings/AutoTaskMan.ini
--------------------------------------------------------------------------------
/cmd/Adventure/Settings/Constantine.ini:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sxzxs/cherry-snippet/8e6b7c000a932380bb44eecb98fe4782f40003e1/cmd/Adventure/Settings/Constantine.ini
--------------------------------------------------------------------------------
/cmd/Adventure/Settings/FileHistory.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/cmd/Adventure/Settings/FileHistory.xml.bak:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/cmd/Adventure/Settings/Structor.ini:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sxzxs/cherry-snippet/8e6b7c000a932380bb44eecb98fe4782f40003e1/cmd/Adventure/Settings/Structor.ini
--------------------------------------------------------------------------------
/cmd/Adventure/Settings/Templates.ini:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sxzxs/cherry-snippet/8e6b7c000a932380bb44eecb98fe4782f40003e1/cmd/Adventure/Settings/Templates.ini
--------------------------------------------------------------------------------
/cmd/Adventure/Settings/Tools.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/cmd/Adventure/Source/Scintilla-3.7.6.zip:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sxzxs/cherry-snippet/8e6b7c000a932380bb44eecb98fe4782f40003e1/cmd/Adventure/Source/Scintilla-3.7.6.zip
--------------------------------------------------------------------------------
/cmd/Adventure/Source/Scintilla.txt:
--------------------------------------------------------------------------------
1 | Scintilla 64-bit was compiled with MinGW-w64-dgn.
2 | URL: https://sourceforge.net/projects/mingw-w64-dgn/
3 | Original filename: mingw-w64-bin-x86_64-20180726.7z.
4 |
5 | The 32-bit version was compiled with MinGW-w64.
6 | URL: https://sourceforge.net/projects/mingw-w64/
7 | Original filename: i686-8.1.0-release-win32-sjlj-rt_v6-rev0.7z.
8 |
9 | In order to compile Scintilla, open a command prompt in the scintilla\win32 directory and set the PATH environment variable to the location of the compiler toolset. Then, run make.exe (64-bit) or mingw32-make.exe (32-bit). Resulting files (Scintilla.dll and SciLexer.dll) are output in the scintilla\bin directory.
10 |
11 | A batch file may facilitate this procedure: save a file called Build.bat (encoded as UTF-8 without BOM) in the scintilla\win32 directory with the following instructions:
12 |
13 | @ECHO OFF
14 | PATH = C:\MinGW-w64-dgn\bin\
15 | make.exe
16 | PAUSE
17 |
--------------------------------------------------------------------------------
/cmd/Adventure/Templates/AutoHotkey Script.ahk:
--------------------------------------------------------------------------------
1 | #NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases.
2 | ; #Warn ; Enable warnings to assist with detecting common errors.
3 | SendMode Input ; Recommended for new scripts due to its superior speed and reliability.
4 | SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory.
5 |
--------------------------------------------------------------------------------
/cmd/Adventure/Templates/AutoIt Basic GUI.au3:
--------------------------------------------------------------------------------
1 | #include
2 |
3 | Local $hGUI = GUICreate("Title", 800, 400)
4 | GUISetState(@SW_SHOW, $hGUI)
5 |
6 | Local $iMsg = 0
7 | While 1
8 | $iMsg = GUIGetMsg()
9 | Switch $iMsg
10 | Case $GUI_EVENT_CLOSE
11 | ExitLoop
12 | EndSwitch
13 | WEnd
14 |
15 | GUIDelete($hGUI)
16 |
--------------------------------------------------------------------------------
/cmd/Adventure/Templates/Bash Shell Script.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | echo "Hello, world!";
4 |
--------------------------------------------------------------------------------
/cmd/Adventure/Templates/Batch File.bat:
--------------------------------------------------------------------------------
1 | @ECHO OFF
2 |
3 | PAUSE > NUL
--------------------------------------------------------------------------------
/cmd/Adventure/Templates/C Console Application.c:
--------------------------------------------------------------------------------
1 | #include
2 | #include
3 |
4 | int main() {
5 | printf("Hi!\n");
6 | getch();
7 | return 0;
8 | }
9 |
--------------------------------------------------------------------------------
/cmd/Adventure/Templates/C MessageBox.c:
--------------------------------------------------------------------------------
1 | #define UNICODE
2 | #define WIN32_LEAN_AND_MEAN
3 | #include
4 | #include
5 |
6 | #pragma comment(lib, "user32")
7 |
8 | #pragma comment(linker,"\"/manifestdependency:type='win32' \
9 | name='Microsoft.Windows.Common-Controls' version='6.0.0.0' \
10 | processorArchitecture='*' publicKeyToken='6595b64144ccf1df' language='*'\"")
11 |
12 | int APIENTRY _tWinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow) {
13 |
14 | MessageBox(0, TEXT("Message"), TEXT("Title"), MB_OK | MB_ICONINFORMATION);
15 |
16 | return 0;
17 | }
18 |
--------------------------------------------------------------------------------
/cmd/Adventure/Templates/C MsgBoxPrintf.c:
--------------------------------------------------------------------------------
1 | #define UNICODE
2 | #include
3 | #include
4 |
5 | #pragma comment(lib, "user32")
6 |
7 | #pragma comment(linker,"\"/manifestdependency:type='win32' \
8 | name='Microsoft.Windows.Common-Controls' version='6.0.0.0' \
9 | processorArchitecture='*' publicKeyToken='6595b64144ccf1df' language='*'\"")
10 |
11 | int CDECL MsgBoxPrintf(wchar_t *szCaption, wchar_t *szFormat, ...)
12 | {
13 | wchar_t szBuffer[1024];
14 | va_list pArgList;
15 |
16 | va_start(pArgList, szFormat);
17 | vswprintf(szBuffer, sizeof(szBuffer) / sizeof(wchar_t), szFormat, pArgList);
18 | va_end(pArgList);
19 |
20 | return MessageBoxW(NULL, szBuffer, szCaption, 0);
21 | }
22 |
23 | int APIENTRY wWinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow)
24 | {
25 | MsgBoxPrintf(L"Title", L"%d", 1);
26 | return 0;
27 | }
28 |
--------------------------------------------------------------------------------
/cmd/Adventure/Templates/C Win32 GUI.c:
--------------------------------------------------------------------------------
1 | #include
2 |
3 | #pragma comment(lib, "user32")
4 |
5 | #pragma comment(linker,"\"/manifestdependency:type='win32' \
6 | name='Microsoft.Windows.Common-Controls' version='6.0.0.0' \
7 | processorArchitecture='*' publicKeyToken='6595b64144ccf1df' language='*'\"")
8 |
9 | LRESULT CALLBACK WndProc(HWND, UINT, WPARAM, LPARAM);
10 |
11 | int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPTSTR lpCmdLine, int nCmdShow) {
12 | static TCHAR szClassName[] = TEXT("WindowClass");
13 | HWND hWnd;
14 | MSG msg;
15 | WNDCLASSEX wc;
16 |
17 | wc.hInstance = hInstance;
18 | wc.lpszClassName = szClassName;
19 | wc.lpfnWndProc = WndProc;
20 | wc.style = CS_DBLCLKS;
21 | wc.cbSize = sizeof(WNDCLASSEX);
22 | wc.hIcon = LoadIcon(NULL, IDI_APPLICATION);
23 | wc.hIconSm = LoadIcon(NULL, IDI_APPLICATION);
24 | wc.hCursor = LoadCursor(NULL, IDC_ARROW);
25 | wc.lpszMenuName = NULL;
26 | wc.cbClsExtra = 0;
27 | wc.cbWndExtra = 0;
28 | wc.hbrBackground = (HBRUSH) COLOR_WINDOW;
29 |
30 | if (!RegisterClassEx (&wc)) {
31 | return 0;
32 | }
33 |
34 | hWnd = CreateWindowEx (
35 | 0,
36 | szClassName,
37 | "Title",
38 | WS_OVERLAPPEDWINDOW,
39 | CW_USEDEFAULT,
40 | CW_USEDEFAULT,
41 | 600,
42 | 420,
43 | HWND_DESKTOP,
44 | NULL,
45 | hInstance,
46 | NULL
47 | );
48 |
49 | ShowWindow(hWnd, nCmdShow);
50 |
51 | while (GetMessage(&msg, NULL, 0, 0)) {
52 | TranslateMessage(&msg);
53 | DispatchMessage(&msg);
54 | }
55 |
56 | return msg.wParam;
57 | }
58 |
59 | LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam) {
60 | switch (message) {
61 |
62 | case WM_KEYDOWN:
63 | switch (wParam) {
64 | case VK_ESCAPE:
65 | PostQuitMessage(0);
66 | break;
67 | }
68 |
69 | case WM_DESTROY:
70 | PostQuitMessage(0);
71 | break;
72 |
73 | default:
74 | return DefWindowProc(hWnd, message, wParam, lParam);
75 | }
76 |
77 | return 0;
78 | }
79 |
--------------------------------------------------------------------------------
/cmd/Adventure/Templates/C# Console Application.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 |
7 | namespace ConsoleApp1
8 | {
9 | class Program
10 | {
11 | static void Main(string[] args)
12 | {
13 | Console.WriteLine("Hello, world!");
14 | Console.ReadLine();
15 | }
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/cmd/Adventure/Templates/C# WinForms Application.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.ComponentModel;
3 | using System.Drawing;
4 | using System.Windows.Forms;
5 |
6 | namespace SampleApp
7 | {
8 | public class MainForm : Form
9 | {
10 | private Button btnHello;
11 |
12 | // The form's constructor: this initializes the form and its controls.
13 | public MainForm()
14 | {
15 | // Set the form's caption, which will appear in the title bar.
16 | this.Text = "WinForms GUI";
17 | this.Size = new Size(800, 600);
18 |
19 | // Create a button control and set its properties.
20 | btnHello = new Button();
21 | btnHello.Name = "btnHello";
22 | btnHello.Location = new Point(12, 12);
23 | btnHello.Size = new Size(84, 24);
24 | btnHello.Text = "Hello!";
25 |
26 | // Wire up an event handler to the button's "Click" event
27 | // (see the code in the btnHello_Click function below).
28 | btnHello.Click += new EventHandler(btnHello_Click);
29 |
30 | // Add the button to the form's control collection,
31 | // so that it will appear on the form.
32 | this.Controls.Add(btnHello);
33 | }
34 |
35 | // When the button is clicked, display a message.
36 | private void btnHello_Click(object sender, EventArgs e)
37 | {
38 | MessageBox.Show("Hello, World!", "Message");
39 | }
40 |
41 | // This is the main entry point for the application.
42 | // All C# applications have one and only one of these methods.
43 | [STAThread]
44 | static void Main()
45 | {
46 | Application.EnableVisualStyles();
47 | Application.Run(new MainForm());
48 | }
49 | }
50 | }
51 |
--------------------------------------------------------------------------------
/cmd/Adventure/Templates/C++ Console Application.cpp:
--------------------------------------------------------------------------------
1 | #include
2 |
3 | int main() {
4 | std::cout << "Hello, world!\n";
5 | return 0;
6 | }
7 |
--------------------------------------------------------------------------------
/cmd/Adventure/Templates/FreeBASIC Win32 GUI.bas:
--------------------------------------------------------------------------------
1 | ' FreeBASIC Win32 GUI
2 |
3 | #include once "windows.bi"
4 | '#include once "win/commctrl.bi"
5 |
6 | Dim Shared hInstance As HINSTANCE
7 | hInstance = GetModuleHandle(NULL)
8 |
9 | 'Dim iccx As INITCOMMONCONTROLSEX
10 | 'iccx.dwSize = Len(iccx)
11 | 'iccx.dwICC = ICC_DATE_CLASSES
12 | 'InitCommonControlsEx(@iccx)
13 |
14 | ' Window procedure handler
15 | Function WndProc(ByVal hWnd As HWND, _
16 | ByVal uMsg As UINT, _
17 | ByVal wParam As WPARAM, _
18 | ByVal lParam As LPARAM) As Integer
19 |
20 | Function = 0
21 |
22 | Select Case (uMsg)
23 | Case WM_CREATE
24 |
25 | Case WM_KEYDOWN
26 | If (LoByte(wParam) = VK_ESCAPE) Then
27 | PostMessage(hWnd, WM_CLOSE, 0, 0)
28 | End If
29 |
30 | Case WM_DESTROY
31 | PostQuitMessage(0)
32 | Exit Function
33 | End Select
34 |
35 | Function = DefWindowProc(hWnd, uMsg, wParam, lParam)
36 |
37 | End Function
38 |
39 | ' Program entry
40 | Dim wcls As WNDCLASSEX
41 | Dim hWnd As HWND
42 | Dim wMsg As MSG
43 |
44 | Dim appName As String
45 | appName = "FB_Win32GUI"
46 |
47 | With wcls
48 | .hInstance = hInstance
49 | .lpszClassName = StrPtr(appName)
50 | .lpfnWndProc = @WndProc
51 | .style = CS_HREDRAW or CS_VREDRAW or CS_DBLCLKS
52 | .cbSize = SizeOf(WNDCLASSEX)
53 | .hIcon = LoadIcon(NULL, IDI_APPLICATION)
54 | .hIconSm = LoadIcon(NULL, IDI_APPLICATION)
55 | .hCursor = LoadCursor(NULL, IDC_ARROW)
56 | .lpszMenuName = NULL
57 | .cbClsExtra = 0
58 | .cbWndExtra = 0
59 | .hbrBackground = Cast(HBRUSH, 5)
60 | End With
61 |
62 | If (RegisterClassEx(@wcls) = FALSE) Then
63 | MessageBox(NULL, "Failed to register window class!", appName, MB_ICONERROR)
64 | End 1
65 | End If
66 |
67 | hWnd = CreateWindowEx(0, appName, "Win32 GUI", _
68 | WS_OVERLAPPEDWINDOW or WS_VISIBLE or WS_CLIPCHILDREN, _
69 | CW_USEDEFAULT, CW_USEDEFAULT, 680, 480, _
70 | NULL, NULL, hInstance, NULL)
71 |
72 | ' Messages loop
73 | Do Until (GetMessage(@wMsg, NULL, 0, 0) = FALSE)
74 | TranslateMessage(@wMsg)
75 | DispatchMessage(@wMsg)
76 | Loop
77 |
78 | End 0
79 |
--------------------------------------------------------------------------------
/cmd/Adventure/Templates/HTML5 Template.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
--------------------------------------------------------------------------------
/cmd/Adventure/Templates/Java Console Application.java:
--------------------------------------------------------------------------------
1 | class HelloWorld
2 | {
3 | public static void main(String args[])
4 | {
5 | System.out.println("Hello, world!");
6 | }
7 | }
8 |
--------------------------------------------------------------------------------
/cmd/Adventure/Templates/PHP Script.php:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/cmd/Adventure/Templates/Pascal Console Application.pp:
--------------------------------------------------------------------------------
1 | program HelloWorld;
2 |
3 | begin
4 | writeln('Hello, world!');
5 | end.
6 |
--------------------------------------------------------------------------------
/cmd/Adventure/Templates/Pascal Win32 GUI.pp:
--------------------------------------------------------------------------------
1 | {$APPTYPE GUI}
2 | {$MODE DELPHI}
3 | program Win32GUI;
4 |
5 | uses
6 | Windows;
7 |
8 | const
9 | AppName = 'Win32GUI';
10 |
11 | function WindowProc(Window: HWnd; AMessage: UINT; WParam : WPARAM;
12 | LParam: LPARAM): LRESULT; stdcall; export;
13 |
14 | begin
15 | WindowProc := 0;
16 |
17 | case AMessage of
18 | wm_Destroy:
19 | begin
20 | PostQuitMessage(0);
21 | Exit;
22 | end;
23 | end;
24 |
25 | WindowProc := DefWindowProc(Window, AMessage, WParam, LParam);
26 | end;
27 |
28 | { Register the Window Class }
29 | function WinRegister: Boolean;
30 | var
31 | WindowClass: WndClass;
32 | begin
33 | WindowClass.Style := cs_hRedraw or cs_vRedraw;
34 | WindowClass.lpfnWndProc := WndProc(@WindowProc);
35 | WindowClass.cbClsExtra := 0;
36 | WindowClass.cbWndExtra := 0;
37 | WindowClass.hInstance := system.MainInstance;
38 | WindowClass.hIcon := LoadIcon(0, idi_Application);
39 | WindowClass.hCursor := LoadCursor(0, idc_Arrow);
40 | WindowClass.hbrBackground := GetStockObject(WHITE_BRUSH);
41 | WindowClass.lpszMenuName := nil;
42 | WindowClass.lpszClassName := AppName;
43 |
44 | Result := RegisterClass(WindowClass) <> 0;
45 | end;
46 |
47 | { Create the Window Class }
48 | function WinCreate: HWnd;
49 | var
50 | hWindow: HWnd;
51 | begin
52 | hWindow := CreateWindow(AppName, 'Win32 GUI',
53 | ws_OverlappedWindow, cw_UseDefault, cw_UseDefault,
54 | cw_UseDefault, cw_UseDefault, 0, 0, system.MainInstance, nil);
55 |
56 | if hWindow <> 0 then begin
57 | ShowWindow(hWindow, CmdShow);
58 | ShowWindow(hWindow, SW_SHOW);
59 | UpdateWindow(hWindow);
60 | end;
61 |
62 | Result := hWindow;
63 | end;
64 |
65 |
66 | var
67 | AMessage: Msg;
68 | hWindow: HWnd;
69 |
70 | begin
71 | if not WinRegister then begin
72 | MessageBox(0, 'Register failed', nil, mb_Ok);
73 | Exit;
74 | end;
75 |
76 | hWindow := WinCreate;
77 | if longint(hWindow) = 0 then begin
78 | MessageBox(0, 'WinCreate failed', nil, mb_Ok);
79 | Exit;
80 | end;
81 |
82 | while GetMessage(@AMessage, 0, 0, 0) do begin
83 | TranslateMessage(AMessage);
84 | DispatchMessage(AMessage);
85 | end;
86 |
87 | Halt(AMessage.wParam);
88 | end.
89 |
--------------------------------------------------------------------------------
/cmd/Adventure/Templates/Python Script.py:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env python3
2 |
3 |
--------------------------------------------------------------------------------
/cmd/Adventure/Templates/VB.NET WinForms Application.vb:
--------------------------------------------------------------------------------
1 | Imports System.ComponentModel
2 | Imports System.Drawing
3 | Imports System.Windows.Forms
4 |
5 | Namespace SampleApp
6 | Public Class MainForm : Inherits Form
7 | Private btnHello As Button
8 |
9 | ' The form's constructor: this initializes the form and its controls.
10 | Public Sub New()
11 | ' Set the form's caption, which will appear in the title bar.
12 | Me.Text = "WinForms GUI"
13 | Me.Size = New Size(800, 600)
14 |
15 | ' Create a button control and set its properties.
16 | btnHello = New Button()
17 | btnHello.Name = "btnHello"
18 | btnHello.Location = New Point(12, 12)
19 | btnHello.Size = New Size(84, 24)
20 | btnHello.Text = "Hello!"
21 |
22 | ' Wire up an event handler to the button's "Click" event
23 | ' (see the code in the btnHello_Click function below).
24 | AddHandler btnHello.Click, New EventHandler(AddressOf btnHello_Click)
25 |
26 | ' Add the button to the form's control collection,
27 | ' so that it will appear on the form.
28 | Me.Controls.Add(btnHello)
29 | End Sub
30 |
31 | ' When the button is clicked, display a message.
32 | Private Sub btnHello_Click(sender As Object, e As EventArgs)
33 | MessageBox.Show("Hello, World!", "Message")
34 | End Sub
35 |
36 | ' This is the main entry point for the application.
37 | ' All VB.NET applications have one and only one of these methods.
38 | _
39 | Public Shared Sub Main()
40 | Application.EnableVisualStyles()
41 | Application.Run(New MainForm())
42 | End Sub
43 | End Class
44 | End Namespace
45 |
--------------------------------------------------------------------------------
/cmd/Adventure/Templates/VBScript.vbs:
--------------------------------------------------------------------------------
1 | Option Explicit
2 |
3 | WScript.Echo "Hello!"
4 |
--------------------------------------------------------------------------------
/cmd/Adventure/Templates/XML Document.xml:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/cmd/Adventure/Templates/XSL Transformation File.xslt:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/cmd/Adventure/Themes/Specifics/AutoIt.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
--------------------------------------------------------------------------------
/cmd/Adventure/Themes/Specifics/Bash.xml:
--------------------------------------------------------------------------------
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 |
--------------------------------------------------------------------------------
/cmd/Adventure/Themes/Specifics/Batch.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
--------------------------------------------------------------------------------
/cmd/Adventure/Themes/Specifics/Harbour.xml:
--------------------------------------------------------------------------------
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 |
56 |
--------------------------------------------------------------------------------
/cmd/Adventure/Themes/Specifics/IniFile.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/cmd/Adventure/Themes/Specifics/JSON.xml:
--------------------------------------------------------------------------------
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 |
--------------------------------------------------------------------------------
/cmd/Adventure/Themes/Specifics/Java.xml:
--------------------------------------------------------------------------------
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 |
--------------------------------------------------------------------------------
/cmd/Adventure/Themes/Specifics/Lua.xml:
--------------------------------------------------------------------------------
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 |
40 |
--------------------------------------------------------------------------------
/cmd/Adventure/Themes/Specifics/Makefile.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/cmd/Adventure/Themes/Specifics/Markdown.xml:
--------------------------------------------------------------------------------
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 |
--------------------------------------------------------------------------------
/cmd/Adventure/Themes/Specifics/NSIS.xml:
--------------------------------------------------------------------------------
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 |
--------------------------------------------------------------------------------
/cmd/Adventure/Themes/Specifics/Pascal.xml:
--------------------------------------------------------------------------------
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 |
--------------------------------------------------------------------------------
/cmd/Adventure/Themes/Specifics/Perl.xml:
--------------------------------------------------------------------------------
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 |
--------------------------------------------------------------------------------
/cmd/Adventure/Themes/Specifics/Python.xml:
--------------------------------------------------------------------------------
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 |
--------------------------------------------------------------------------------
/cmd/Adventure/Themes/Specifics/Ruby.xml:
--------------------------------------------------------------------------------
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 |
--------------------------------------------------------------------------------
/cmd/Adventure/Themes/Specifics/Rust.xml:
--------------------------------------------------------------------------------
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 |
42 |
--------------------------------------------------------------------------------
/cmd/Adventure/Themes/Specifics/SQL.xml:
--------------------------------------------------------------------------------
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 |
54 |
--------------------------------------------------------------------------------
/cmd/Adventure/Themes/Specifics/VB.xml:
--------------------------------------------------------------------------------
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 |
--------------------------------------------------------------------------------
/cmd/Adventure/Themes/Specifics/VHDL.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
--------------------------------------------------------------------------------
/cmd/Adventure/Themes/Specifics/XML.xml:
--------------------------------------------------------------------------------
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 |
--------------------------------------------------------------------------------
/cmd/Adventure/Themes/Specifics/YAML.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
--------------------------------------------------------------------------------
/cmd/Adventure/Tools/AHK Website.url:
--------------------------------------------------------------------------------
1 | [InternetShortcut]
2 | URL=https://www.autohotkey.com/
--------------------------------------------------------------------------------
/cmd/Adventure/Tools/COM Inspector/COM Inspector.exe:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sxzxs/cherry-snippet/8e6b7c000a932380bb44eecb98fe4782f40003e1/cmd/Adventure/Tools/COM Inspector/COM Inspector.exe
--------------------------------------------------------------------------------
/cmd/Adventure/Tools/Constantine/Constantine.exe:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sxzxs/cherry-snippet/8e6b7c000a932380bb44eecb98fe4782f40003e1/cmd/Adventure/Tools/Constantine/Constantine.exe
--------------------------------------------------------------------------------
/cmd/Adventure/Tools/ErrorView/ErrorView.exe:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sxzxs/cherry-snippet/8e6b7c000a932380bb44eecb98fe4782f40003e1/cmd/Adventure/Tools/ErrorView/ErrorView.exe
--------------------------------------------------------------------------------
/cmd/Adventure/Tools/Find in Files/Find in Files.exe:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sxzxs/cherry-snippet/8e6b7c000a932380bb44eecb98fe4782f40003e1/cmd/Adventure/Tools/Find in Files/Find in Files.exe
--------------------------------------------------------------------------------
/cmd/Adventure/Tools/GUI Designer/Include/Globals.ahk:
--------------------------------------------------------------------------------
1 | Global g_Version := "3.0.1"
2 | , g_AppName := "Auto-GUI"
3 | , g_AppData := A_AppData . "\AmberSoft\Adventure"
4 | , hAutoWnd
5 | , Sci := []
6 | , SciLexer := A_ScriptDir . (A_PtrSize == 8 ? "\..\..\SciLexer64.dll" : "\..\..\SciLexer32.dll")
7 | , g_SciFontName
8 | , g_SciFontSize
9 | , IniFile
10 | , IconLib := A_ScriptDir . "\..\..\Icons\Auto-GUI.icl"
11 | , hChildWnd := 0
12 | , Child := 1
13 | , hSelWnd := 0
14 | , hToolbar := 0
15 | , hChildToolbar := 0
16 | , TB_CHECKBUTTON := 0x402
17 | , hFontDlg
18 | , hCloneDlg
19 | , hToolbarEditor := 0
20 | , m := New MenuBar
21 | , hMenuEditor := 0
22 | , hAddMenuItemDlg := 0
23 | , g
24 | , g_X := 0
25 | , g_Y := 0
26 | , g_Control := 0
27 | , g_OpenDir
28 | , g_SaveDir
29 | , Indent
30 | , g_TabSize
31 | , g_ShowGrid
32 | , g_SnapToGrid
33 | , g_GridSize
34 | , g_WordWrap
35 | , g_LineNumbers
36 | , hLvToolbox
37 | , hPropWnd := 0
38 | , hCbxClassNN := 0
39 | , hTabStyles
40 | , g_oStyles
41 | , g_PropX
42 | , g_PropY
43 | , hBitmapTile
44 | , hCursorCross
45 | , g_Cross := False
46 | , CRLF := "`r`n"
47 | , g_Signature := "; Generated by " . g_AppName . " " . g_Version . CRLF
48 | , g_Resizers := []
49 | , hResizer1
50 | , hResizer2
51 | , hResizer3
52 | , hResizer4
53 | , hResizer5
54 | , hResizer6
55 | , hResizer7
56 | , hResizer8
57 | , hReszdCtl
58 | , g_ResizerSize := 6
59 | , g_ResizerColor
60 | , g_ResizerBrush
61 | , g_Cursors := {}
62 | , g_Adding := False
63 | , g_NT6orLater := DllCall("Kernel32.dll\GetVersion") & 0xFF > 5
64 | , g_TempFile := GetTempDir() . "\Temp.ahk"
65 | , g_IconPath := "shell32.dll"
66 | , g_PicturePath := A_MyDocuments
67 | , g_GuiVis := False
68 | , g_HighlightActiveLine
69 | , g_IndentGuides
70 | , g_Highlights
71 | , g_HITMode
72 | , g_HITLimit
73 | , g_IndentWithSpaces
74 | , g_InitialX
75 | , g_InitialY
76 | , g_InitialW
77 | , g_InitialH
78 | , g_ToolbarH := 30
79 | , g_hStatusBar
80 | , g_StatusBarH
81 | , g_SplitterW := 4
82 | , g_AskToSaveOnExit
83 | , g_HelpFile
84 | , g_ShowAllFonts
85 | , g_FontList
86 | , g_hHiddenEdit
87 | , g_MenuFuncs
88 | , g_MenuHandler
89 | , g_CaretWidth
90 | , g_CaretStyle
91 | , g_CaretBlink
92 | , g_Encodings := {"CP1252": "UTF-8 without BOM", "UTF-16": "UTF-16 LE", "UTF-8-RAW": "UTF-8 without BOM", "UTF-8": "UTF-8"}
93 | , g_MaxEncodings := 3
94 | , g_AhkPath64
95 | , g_AhkPath32
96 | , g_AhkPathEx
97 | , g_MenuColor := 0xFAFAFA
98 | , g_DefGUIFontName := "Segoe UI"
99 | , g_DefGUIFontOpts := "s9"
100 | , g_ShowToolbox := True
101 | , g_ShowToolbar := True
102 | , g_ShowStatusBar := True
103 | , g_aGradColors := [0x3FBBE3, 0x0080C0]
104 |
--------------------------------------------------------------------------------
/cmd/Adventure/Tools/MagicBox/Examples/Close Tabs.ahk:
--------------------------------------------------------------------------------
1 | #Include ..\Functions\MsgBoxEx.ahk
2 |
3 | Text := "You are about to close 3 tabs. Are you sure you want to continue?"
4 | CheckText := "*Warn me when I attempt to close multiple tabs"
5 |
6 | Result := MsgBoxEx(Text, "Confirm close", "Close tabs|Cancel", 3, CheckText)
7 | ; ...
8 | ExitApp
9 |
--------------------------------------------------------------------------------
/cmd/Adventure/Tools/MagicBox/Examples/Error 25.ahk:
--------------------------------------------------------------------------------
1 | #Include ..\Functions\MsgBoxEx.ahk
2 |
3 | Text := "An error occurred while copying the file NDIS.386`n`nMS-DOS Error 25: Unknown MS-DOS error."
4 |
5 | SoundPlay *48
6 | Result := MsgBoxEx(Text, "Network Setup", "Cancel|Try Again|Continue", [9, "explorer.exe"], "", "", 0, 0, "s10 c0x000000", "Fixedsys")
7 | ExitApp
8 |
--------------------------------------------------------------------------------
/cmd/Adventure/Tools/MagicBox/Examples/Filename.ahk:
--------------------------------------------------------------------------------
1 | #Include ..\Functions\MsgBoxEx.ahk
2 |
3 | Text := "A file named ""FILENAME.EXT"" already exists in this location.`n`nSelect the action to be taken."
4 |
5 | Result := MsgBoxEx(Text, "Confirm", "&Browse...|&Auto-rename|&Compare...|&Replace|Ca&ncel", [69], "", "", 0, 0, "", "", "", "Callback")
6 | ExitApp
7 |
8 | Callback:
9 | If (A_GuiControl == "&Browse...") {
10 | FileSelectFile SelectedFile
11 | } Else {
12 | MsgBox 0x2040, Comparisson, The two files are identical.
13 | }
14 | Return
15 |
--------------------------------------------------------------------------------
/cmd/Adventure/Tools/MagicBox/Examples/Input Box.ahk:
--------------------------------------------------------------------------------
1 | #Include ..\Functions\InputBoxEx.ahk
2 |
3 | Details := "Enter the name of an AHK GUI control type or choose one from the list."
4 | Type := "ComboBox"
5 |
6 | Start:
7 | Options := ""
8 |
9 | If (Type ~= "i)ComboBox|DropDownList|DDL|ListBox") {
10 | Default := "Edit|ComboBox|DropDownList|CheckBox|ListBox||DateTime|MonthCal|Hotkey|Slider"
11 | If (Type = "ListBox") {
12 | Options := "r9"
13 | }
14 | } Else If (Type = "CheckBox") {
15 | Default := " In the future, do not show me this message again"
16 | Options := "Checked"
17 | } Else If (Type = "DateTime") {
18 | Default := "LongDate"
19 | Options := "Right"
20 | } Else If (Type = "Hotkey") {
21 | Default := "^!Home"
22 | } Else If (Type = "Slider") {
23 | Options := "NoTicks Center Tooltip"
24 | } Else If (Type = "Text") {
25 | Default := "AutoHotkey " . A_AhkVersion . " "
26 | . ((A_IsUnicode) ? "Unicode" : "ANSI") . " "
27 | . ((A_PtrSize == 4) ? "32-bit" : "64-bit")
28 | Options := "h30 +0x400201 +E0x200"
29 | } Else {
30 | Default := Type
31 | }
32 |
33 | Try {
34 | Type := InputBoxEx("Specify the input control type", Details, "InputBoxEx Example", Default, Type, Options, "", "", "", "", "", "MinimizeBox")
35 | } Catch {
36 | Type := "ComboBox"
37 | GoSub Start
38 | }
39 |
40 | If (!ErrorLevel) {
41 | GoSub Start
42 | }
43 |
44 | ExitApp
45 |
--------------------------------------------------------------------------------
/cmd/Adventure/Tools/MagicBox/Examples/Partition.ahk:
--------------------------------------------------------------------------------
1 | If (DllCall("kernel32.dll\GetVersion") & 0xFF < 6) {
2 | MsgBox 0x10, Error, This script requires Windows Vista or higher.
3 | Return
4 | }
5 |
6 | Instruction := "The requested partition has been marked active."
7 | Content := "When you reboot your computer the operating system on that partition will be started."
8 | ;Title := "Disk Administrator"
9 | Title := "Task Dialog Example"
10 | MainIcon := 36
11 | Flags := 0x40
12 | Buttons := 0x1
13 | Width := 218
14 |
15 | ; TASKDIALOGCONFIG structure
16 | x64 := A_PtrSize == 8
17 | NumPut(VarSetCapacity(TDC, (x64) ? 160 : 96, 0), TDC, 0) ; cbSize
18 | NumPut(Flags, TDC, (x64) ? 20 : 12) ; dwFlags
19 | NumPut(Buttons, TDC, (x64) ? 24 : 16) ; dwCommonButtons
20 | NumPut(&Title, TDC, (x64) ? 28 : 20) ; pszWindowTitle
21 | NumPut(MainIcon, TDC, (x64) ? 36 : 24) ; pszMainIcon
22 | NumPut(&Instruction, TDC, (x64) ? 44 : 28) ; pszMainInstruction
23 | NumPut(&Content, TDC, (x64) ? 52 : 32) ; pszContent
24 | NumPut(Width, TDC, (x64) ? 156 : 92, "UInt") ; cxWidth
25 |
26 | DllCall("Comctl32.dll\TaskDialogIndirect", "Ptr", &TDC
27 | , "Int*", Button := 0
28 | , "Int*", Radio := 0
29 | , "Int*", Checked := 0)
30 |
--------------------------------------------------------------------------------
/cmd/Adventure/Tools/MagicBox/Examples/Pigeons.ahk:
--------------------------------------------------------------------------------
1 | If (DllCall("kernel32.dll\GetVersion") & 0xFF < 6) {
2 | MsgBox 0x10, Error, This script requires Windows Vista or higher.
3 | Return
4 | }
5 |
6 | Instruction := "Some facts in regard to the colouring of pigeons well deserve consideration."
7 | Content := "The rock-pigeon is of a slaty-blue, and has a white rump (the Indian sub-species, Columba intermedia of Strickland, having it bluish); the tail has a terminal dark bar, with the bases of the outer feathers externally edged with white; the wings have two black bars; some semi-domestic breeds and some apparently truly wild breeds have, besides the two black bars, the wings chequered with black."
8 | Title := "Variation under Domestication"
9 | MainIcon := 0xFFFB
10 | Width := 300
11 | Callback := RegisterCallback("Callback", "Fast")
12 |
13 | ; TASKDIALOGCONFIG structure
14 | x64 := A_PtrSize == 8
15 | NumPut(VarSetCapacity(TDC, (x64) ? 160 : 96, 0), TDC, 0) ; cbSize
16 | NumPut(&Title, TDC, (x64) ? 28 : 20) ; pszWindowTitle
17 | NumPut(MainIcon, TDC, (x64) ? 36 : 24) ; pszMainIcon
18 | NumPut(&Instruction, TDC, (x64) ? 44 : 28) ; pszMainInstruction
19 | NumPut(&Content, TDC, (x64) ? 52 : 32) ; pszContent
20 | NumPut(Callback, TDC, (x64) ? 140 : 84) ; pfCallback
21 | NumPut(Width, TDC, (x64) ? 156 : 92, "UInt") ; cxWidth
22 |
23 | SoundPlay *64
24 |
25 | DllCall("Comctl32.dll\TaskDialogIndirect", "UInt", &TDC
26 | , "Int*", Button := 0
27 | , "Int*", Radio := 0
28 | , "Int*", Checked := 0)
29 |
30 | Callback(hWnd, Notification, wParam, lParam, RefData) {
31 | If (Notification == 0) {
32 | DllCall("PostMessage", "Ptr", hWnd, "UInt", 0x474, "UInt", 0, "UInt", 0xFFFD)
33 | }
34 | }
35 |
--------------------------------------------------------------------------------
/cmd/Adventure/Tools/MagicBox/Examples/Progress.ahk:
--------------------------------------------------------------------------------
1 | WinVer := DllCall("kernel32.dll\GetVersion")
2 | MajorVer := WinVer & 0xFF
3 | MinorVer := WinVer >> 8 & 0xFF
4 |
5 | If (MajorVer < 6) {
6 | MsgBox 0x10, Error, This script requires Windows Vista or higher.
7 | Return
8 | } Else {
9 | If (MajorVer > 9 || (MajorVer > 5 && MinorVer > 1)) {
10 | IconRes := "xwizard.exe" ; Windows 8+
11 | } Else {
12 | IconRes := "setupcln.dll" ; Vista/7
13 | }
14 | }
15 |
16 | Content := "Setup is now preparing the Windows 95 Setup Wizard,`nwhich will guide you through the rest of the Setup process. Please wait."
17 | Title := "Windows 95 Setup"
18 | MainIcon := LoadPicture(IconRes, "w32 Icon1", ImageType)
19 | Flags := 0xA02
20 | Buttons := 0x8
21 | Callback := RegisterCallback("Callback", "Fast")
22 | CBData := {}
23 | CBData.Marquee := True
24 | CBData.Timeout := 8000 ; ms
25 | Parent := DllCall("GetDesktopWindow", "Ptr")
26 |
27 | ; TASKDIALOGCONFIG structure
28 | x64 := A_PtrSize == 8
29 | NumPut(VarSetCapacity(TDC, (x64) ? 160 : 96, 0), TDC, 0) ; cbSize
30 | NumPut(Parent, TDC, 4, "Ptr") ; hwndParent
31 | NumPut(Flags, TDC, (x64) ? 20 : 12) ; dwFlags
32 | NumPut(Buttons, TDC, (x64) ? 24 : 16) ; dwCommonButtons
33 | NumPut(&Title, TDC, (x64) ? 28 : 20) ; pszWindowTitle
34 | NumPut(MainIcon, TDC, (x64) ? 36 : 24) ; pszMainIcon
35 | NumPut(&Content, TDC, (x64) ? 52 : 32) ; pszContent
36 | NumPut(Callback, TDC, (x64) ? 140 : 84, "Ptr") ; pfCallback
37 | NumPut(&CBData, TDC, (x64) ? 148 : 88) ; lpCallbackData
38 |
39 | Callback(hWnd, Notification, wParam, lParam, RefData) {
40 | Static Pos := 0
41 | CBData := Object(RefData)
42 |
43 | If (Notification == 4) {
44 | If (wParam > CBData.Timeout) {
45 | ; TDM_CLICK_BUTTON := 0x466, IDCANCEL := 2
46 | DllCall("PostMessage", "Ptr", hWnd, "UInt", 0x466, "UInt", 2, "UInt", 0)
47 | }
48 |
49 | DllCall("SendMessage", "Ptr", hWnd, "UInt", 0x46A, "UInt", Pos, "UInt", 0)
50 | Pos += 3
51 | }
52 | }
53 |
54 | DllCall("Comctl32.dll\TaskDialogIndirect", "Ptr", &TDC
55 | , "Int*", Button := 0
56 | , "Int*", Radio := 0
57 | , "Int*", Checked := 0)
58 |
59 | DllCall("Kernel32.dll\GlobalFree", "Ptr", Callback)
60 |
--------------------------------------------------------------------------------
/cmd/Adventure/Tools/MagicBox/Examples/Types.ahk:
--------------------------------------------------------------------------------
1 | ; Excerpts from the book "Developer to Designer: GUI Design for the Busy Developer"
2 |
3 | #NoEnv
4 | #Warn
5 | #SingleInstance Force
6 | SetBatchLines -1
7 |
8 | #Include ..\Functions\MsgBoxEx.ahk
9 |
10 | Icon := 1
11 |
12 | Text := "Information message boxes contain information that the user should acknowledge `nto confirm that they understand what’s going on with the application."
13 |
14 | Result := MsgBoxEx(Text, "Information", " Next ...|Cancel", 5, "", "", 0, 0, "", "", "", "Callback")
15 | ExitApp
16 |
17 | Callback:
18 | Icon++
19 | If (Icon == 2) {
20 | Text := "Warning message boxes contain information about unexpected results or problems `nthat do not prevent the application from continuing."
21 | SoundPlay *0x30
22 | } Else If (Icon == 3) {
23 | Text := "Question message boxes are used to ask simple questions and to request `nconfirmation of actions."
24 | SoundPlay *0x20
25 | } Else If (Icon == 4) {
26 | Text := "Error message boxes contain information on problems that (at least potentially) `nprevent the application from continuing."
27 | SoundPlay *0x10
28 | } Else {
29 |
30 | }
31 |
32 | WinSetTitle, % SubStr(Text, 1, InStr(Text, " "))
33 | GuiControl,, Static1, *Icon%Icon% user32.dll
34 | ControlSetText SysLink1, %Text%
35 |
36 | If (Icon == 4) {
37 | GuiControl Disable, Button1
38 | GuiControl,, Button2, Close
39 | }
40 | Return
41 |
--------------------------------------------------------------------------------
/cmd/Adventure/Tools/MagicBox/Examples/Virtuoso.ahk:
--------------------------------------------------------------------------------
1 | If (DllCall("kernel32.dll\GetVersion") & 0xFF < 6) {
2 | MsgBox 0x10, Error, This script requires Windows Vista or higher.
3 | Return
4 | }
5 |
6 | Instruction := "One who makes or repairs musical instruments, such as violins."
7 | Title := "Quiz"
8 | MainIcon := LoadPicture("dxptasksync.dll", "w32 Icon5", ImageType)
9 | Flags := 0x52
10 | Buttons := 0x8
11 | CustomButtons := []
12 | CustomButtons.Push([101, "Cordon bleu"])
13 | CustomButtons.Push([102, "Sommelier"])
14 | CustomButtons.Push([103, "Luthier"])
15 | CustomButtons.Push([104, "Virtuoso"])
16 | cButtons := CustomButtons.Length()
17 | VarSetCapacity(pButtons, 4 * cButtons + A_PtrSize * cButtons, 0)
18 | Loop %cButtons% {
19 | iButtonID := CustomButtons[A_Index][1]
20 | iButtonText := &(b%A_Index% := CustomButtons[A_Index][2])
21 | NumPut(iButtonID, pButtons, (4 + A_PtrSize) * (A_Index - 1))
22 | NumPut(iButtonText, pButtons, (4 + A_PtrSize) * A_Index - A_PtrSize)
23 | }
24 | Width := 268
25 | Callback := RegisterCallback("Callback", "Fast")
26 |
27 | hModule := DllCall("kernel32.dll\LoadLibraryEx", "Str", "ieframe.dll", "UInt", 0, "UInt", 0x2, "Ptr")
28 | Global g_hIcon := DllCall("LoadIcon", "Ptr", hModule, "Ptr", 18211, "Ptr") ; ieframe.dll check mark icon
29 | DllCall("FreeLibrary", "Ptr", hModule)
30 |
31 | ; TASKDIALOGCONFIG structure
32 | x64 := A_PtrSize == 8
33 | NumPut(VarSetCapacity(TDC, (x64) ? 160 : 96, 0), TDC, 0) ; cbSize
34 | NumPut(0x10010, TDC, 4, "Ptr") ; hwndParent
35 | NumPut(Flags, TDC, (x64) ? 20 : 12) ; dwFlags
36 | NumPut(Buttons, TDC, (x64) ? 24 : 16) ; dwCommonButtons
37 | NumPut(&Title, TDC, (x64) ? 28 : 20) ; pszWindowTitle
38 | NumPut(MainIcon, TDC, (x64) ? 36 : 24) ; pszMainIcon
39 | NumPut(&Instruction, TDC, (x64) ? 44 : 28) ; pszMainInstruction
40 | NumPut(cButtons, TDC, (x64) ? 60 : 36) ; cButtons
41 | NumPut(&pButtons, TDC, (x64) ? 64 : 40) ; pButtons
42 | NumPut(Callback, TDC, (x64) ? 140 : 84, "Ptr") ; pfCallback
43 | NumPut(Width, TDC, (x64) ? 156 : 92, "UInt") ; cxWidth
44 |
45 | DllCall("Comctl32.dll\TaskDialogIndirect", "Ptr", &TDC
46 | , "Int*", Button := 0
47 | , "Int*", Radio := 0
48 | , "Int*", Checked := 0)
49 |
50 | Callback(hWnd, Notification, wParam, lParam, RefData) {
51 | If (Notification == 2) {
52 | If (wParam == 2) {
53 | ExitApp
54 | } Else If (wParam == 103) {
55 | hIcon := g_hIcon ; LoadPicture("SyncCenter.dll", "w32 Icon19", _)
56 | } Else {
57 | hIcon := LoadPicture("user32.dll", "w32 Icon4", _)
58 | }
59 | SendMessage 0x474, 0, %hIcon%,, ahk_id %hWnd% ; TDM_UPDATE_ICON
60 | Return True
61 | }
62 | }
63 |
--------------------------------------------------------------------------------
/cmd/Adventure/Tools/MagicBox/Examples/XP Support.ahk:
--------------------------------------------------------------------------------
1 | #Include ..\Functions\MsgBoxEx.ahk
2 |
3 | Text := "Windows XP End of Support is on April 8th, 2014.`nClick Here to learn more."
4 | CheckText := "Don't show this message again"
5 |
6 | Result := MsgBoxEx(Text, "Windows", "OK", 2, CheckText)
7 | ExitApp
8 |
--------------------------------------------------------------------------------
/cmd/Adventure/Tools/MagicBox/Functions/FatalAppExit.ahk:
--------------------------------------------------------------------------------
1 | ; https://msdn.microsoft.com/en-us/library/windows/desktop/ms679336(v=vs.85).aspx
2 | FatalAppExit(Message) {
3 | DllCall("kernel32.dll\FatalAppExit", "UInt", 0, "Str", Message)
4 | }
--------------------------------------------------------------------------------
/cmd/Adventure/Tools/MagicBox/Functions/InputBoxEx.ahk:
--------------------------------------------------------------------------------
1 | InputBoxEx(Instruction := "", Content := "", Title := "", Default := "", Control := "", Options := "", Owner := "", Width := "", Pos := "", Icon := "", IconIndex := 1, WindowOptions := "", Timeout := "") {
2 | Static hWnd, py, p1, p2, c, cy, ch, Input, e, ey, eh, f, ww, ExitCode
3 |
4 | Gui New, hWndhWnd LabelInputBoxEx -0xA0000
5 | Gui % (Owner) ? "+Owner" . Owner : ""
6 | Gui Font
7 | Gui Color, White
8 | Gui Margin, 10, 12
9 | py := 10
10 | Width := (Width) ? Width : 430
11 |
12 | If (Instruction != "") {
13 | Gui Font, s12 c0x003399, Segoe UI
14 | Gui Add, Text, vp1 y10, %Instruction%
15 | py := 40
16 | }
17 |
18 | Gui Font, s9 cDefault, Segoe UI
19 |
20 | If (Content != "") {
21 | Gui Add, Link, % "vp2 x10 y" . py . " w" . (Width - 20), %Content%
22 | }
23 |
24 | GuicontrolGet c, Pos, % (Content != "") ? "p2" : "p1"
25 | py := (Instruction != "" || Content !="") ? (cy + ch + 16) : 22
26 | Gui Add, % (Control != "") ? Control : "Edit", % "vInput x10 y" . py . " w" . (Width - 20) . "h21 " . Options, %Default%
27 |
28 | GuiControlGet e, Pos, Input
29 | py := ey + eh + 20
30 | Gui Add, Text, hWndf y%py% -Background +Border ; Footer
31 |
32 | Gui Add, Button, % "gInputBoxExOK x" . (Width - 176) . " yp+12 w80 h23 Default", &OK
33 | Gui Add, Button, % "gInputBoxExClose xp+86 yp w80 h23", &Cancel
34 |
35 | Gui Show, % "w" . Width . " " . Pos, %Title%
36 | Gui +SysMenu %WindowOptions%
37 | If (Icon != "") {
38 | hIcon := LoadPicture(Icon, "Icon" . IconIndex, ErrorLevel)
39 | SendMessage 0x80, 0, hIcon,, ahk_id %hWnd% ; WM_SETICON
40 | }
41 |
42 | WinGetPos,,, ww,, ahk_id %hWnd%
43 | Guicontrol MoveDraw, %f%, % "x-1 " . " w" . ww . " h" . 48
44 |
45 | If (Timeout) {
46 | SetTimer InputBoxExTIMEOUT, % Round(Timeout) * 1000
47 | }
48 |
49 | If (Owner) {
50 | WinSet Disable,, ahk_id %Owner%
51 | }
52 |
53 | GuiControl Focus, Input
54 | Gui Font
55 |
56 | WinWaitClose ahk_id %hWnd%
57 | ErrorLevel := ExitCode
58 | Return Input
59 |
60 | InputBoxExESCAPE:
61 | InputBoxExCLOSE:
62 | InputBoxExTIMEOUT:
63 | InputBoxExOK:
64 | SetTimer InputBoxExTIMEOUT, Delete
65 |
66 | If (Owner) {
67 | WinSet Enable,, ahk_id %Owner%
68 | }
69 |
70 | Gui %hWnd%: Submit
71 | Gui %hWnd%: Destroy
72 | ExitCode := (A_ThisLabel == "InputBoxExOK") ? 0 : (A_ThisLabel == "InputBoxExTIMEOUT") ? 2 : 1
73 | Return
74 | }
75 |
--------------------------------------------------------------------------------
/cmd/Adventure/Tools/MagicBox/Functions/MessageBox.ahk:
--------------------------------------------------------------------------------
1 | MessageBox(hWnd, Text, Title := "", Flags := 0) {
2 | Return DllCall("MessageBox", "Ptr", hWnd, "Str", Text, "Str", Title, "UInt", Flags)
3 | }
--------------------------------------------------------------------------------
/cmd/Adventure/Tools/MagicBox/Functions/MessageBoxCheck.ahk:
--------------------------------------------------------------------------------
1 | MessageBoxCheck(Text, Title := "", Options := 0, RegVal := "", Owner := 0) {
2 | If (DllCall("GetVersion") & 0xFF < 6) {
3 | hModule := DllCall("GetModuleHandle", "Str", "shlwapi.dll", "Ptr")
4 | SHMessageBoxCheck := DllCall("GetProcAddress", "Ptr", hModule, "UInt", (A_IsUnicode) ? 191 : 185, "Ptr")
5 | } Else {
6 | SHMessageBoxCheck := "Shlwapi\SHMessageBoxCheck"
7 | }
8 |
9 | Ret := DllCall(SHMessageBoxCheck
10 | , "Ptr" , Owner ? Owner : DllCall("GetDesktopWindow", "Ptr")
11 | , "Str" , Text
12 | , "Str" , Title
13 | , "UInt", Options
14 | , "int" , 0
15 | , "Str" , (RegVal != "") ? RegVal : A_ScriptFullPath)
16 |
17 | Return {0: "Suppressed", 1: "OK", 2: "Cancel", 3: "Abort", 4: "Retry", 5: "Ignore", 6: "Yes", 7: "No", 10: "Try Again", 11: "Continue"}[Ret]
18 | }
--------------------------------------------------------------------------------
/cmd/Adventure/Tools/MagicBox/Functions/MessageBoxIndirect.ahk:
--------------------------------------------------------------------------------
1 | MessageBoxIndirect(Text, Title := "", Options := 0, IconRes := "", IconID := 1, Owner := 0) {
2 | If (IconRes != "") {
3 | hModule := DllCall("GetModuleHandle", "Str", IconRes, "Ptr")
4 | LoadLib := !hModule
5 | && hModule := DllCall("LoadLibraryEx", "Str", IconRes, "UInt", 0, "UInt", 0x2, "Ptr")
6 | Options |= 0x80 ; MB_USERICON
7 | } Else {
8 | hModule := 0
9 | LoadLib := False
10 | }
11 |
12 | ; MSGBOXPARAMS structure
13 | NumPut(VarSetCapacity(MBP, A_PtrSize * 7, 0), MBP, 0, "UInt")
14 | NumPut(Owner, MBP, 1 * A_PtrSize, "Ptr")
15 | NumPut(hModule, MBP, 2 * A_PtrSize, "Ptr")
16 | NumPut(&Text, MBP, 3 * A_PtrSize, "Ptr")
17 | NumPut(&Title, MBP, 4 * A_PtrSize, "Ptr")
18 | NumPut(Options, MBP, 5 * A_PtrSize, "UInt")
19 | NumPut(IconID, MBP, 6 * A_PtrSize, "Ptr")
20 | Ret := DllCall("MessageBoxIndirect", "Ptr", &MBP)
21 |
22 | If (LoadLib) {
23 | DllCall("FreeLibrary", "Ptr", hModule)
24 | }
25 |
26 | Return {1: "OK", 2: "Cancel", 3: "Abort", 4: "Retry", 5: "Ignore", 6: "Yes", 7: "No", 10: "Try Again", 11: "Continue"}[Ret]
27 | }
--------------------------------------------------------------------------------
/cmd/Adventure/Tools/MagicBox/Functions/MessageBoxTimeout.ahk:
--------------------------------------------------------------------------------
1 | MessageBoxTimeout(hWnd, Text, Title := "", Flags := 0, Milliseconds := 0) {
2 | Return DllCall("MessageBoxTimeout", "Ptr", hWnd, "Str", Text, "Str", Title, "UInt", Flags, "UShort", 0, "UInt", Milliseconds)
3 | }
--------------------------------------------------------------------------------
/cmd/Adventure/Tools/MagicBox/Functions/MsgBoxEx.ahk:
--------------------------------------------------------------------------------
1 | MsgBoxEx(Text, Title := "", Buttons := "", Icon := "", ByRef CheckText := "", Styles := "", Owner := "", Timeout := "", FontOptions := "", FontName := "", BGColor := "", Callback := "") {
2 | Static hWnd, y2, p, px, pw, c, cw, cy, ch, f, o, gL, hBtn, lb, DHW, ww, Off, k, v, RetVal
3 | Static Sound := {2: "*48", 4: "*16", 5: "*64"}
4 |
5 | Gui New, hWndhWnd LabelMsgBoxEx -0xA0000
6 | Gui % (Owner) ? "+Owner" . Owner : ""
7 | Gui Font
8 | Gui Font, % (FontOptions) ? FontOptions : "s9", % (FontName) ? FontName : "Segoe UI"
9 | Gui Color, % (BGColor) ? BGColor : "White"
10 | Gui Margin, 10, 12
11 |
12 | If (IsObject(Icon)) {
13 | Gui Add, Picture, % "x20 y24 w32 h32 Icon" . Icon[1], % (Icon[2] != "") ? Icon[2] : "shell32.dll"
14 | } Else If (Icon + 0) {
15 | Gui Add, Picture, x20 y24 Icon%Icon% w32 h32, user32.dll
16 | SoundPlay % Sound[Icon]
17 | }
18 |
19 | Gui Add, Link, % "x" . (Icon ? 65 : 20) . " y" . (InStr(Text, "`n") ? 24 : 32) . " vc", %Text%
20 | GuicontrolGet c, Pos
21 | GuiControl Move, c, % "w" . (cw + 30)
22 | y2 := (cy + ch < 52) ? 90 : cy + ch + 34
23 |
24 | Gui Add, Text, vf -Background ; Footer
25 |
26 | Gui Font
27 | Gui Font, s9, Segoe UI
28 | px := 42
29 | If (CheckText != "") {
30 | CheckText := StrReplace(CheckText, "*",, ErrorLevel)
31 | Gui Add, CheckBox, vCheckText x12 y%y2% h26 -Wrap -Background AltSubmit Checked%ErrorLevel%, %CheckText%
32 | GuicontrolGet p, Pos, CheckText
33 | px := px + pw + 10
34 | }
35 |
36 | o := {}
37 | Loop Parse, Buttons, |, *
38 | {
39 | gL := (Callback != "" && InStr(A_LoopField, "...")) ? Callback : "MsgBoxExBUTTON"
40 | Gui Add, Button, hWndhBtn g%gL% x%px% w90 y%y2% h26 -Wrap, %A_Loopfield%
41 | lb := hBtn
42 | o[hBtn] := px
43 | px += 98
44 | }
45 | GuiControl +Default, % (RegExMatch(Buttons, "([^\*\|]*)\*", Match)) ? Match1 : StrSplit(Buttons, "|")[1]
46 |
47 | Gui Show, Autosize Center Hide, %Title%
48 | DHW := A_DetectHiddenWindows
49 | DetectHiddenWindows On
50 | WinGetPos,,, ww,, ahk_id %hWnd%
51 | GuiControlGet p, Pos, %lb% ; Last button
52 | Off := ww - (((px + pw + 14) * A_ScreenDPI) // 96)
53 | For k, v in o {
54 | GuiControl Move, %k%, % "x" . (v + Off)
55 | }
56 | Guicontrol MoveDraw, f, % "x-1 y" . (y2 - 10) . " w" . ww . " h" . 48
57 |
58 | Gui Show
59 | Gui +SysMenu %Styles%
60 | DetectHiddenWindows %DHW%
61 |
62 | If (Timeout) {
63 | SetTimer MsgBoxExTIMEOUT, % Round(Timeout) * 1000
64 | }
65 |
66 | If (Owner) {
67 | WinSet Disable,, ahk_id %Owner%
68 | }
69 |
70 | GuiControl Focus, f
71 | Gui Font
72 | WinWaitClose ahk_id %hWnd%
73 | Return RetVal
74 |
75 | MsgBoxExESCAPE:
76 | MsgBoxExCLOSE:
77 | MsgBoxExTIMEOUT:
78 | MsgBoxExBUTTON:
79 | SetTimer MsgBoxExTIMEOUT, Delete
80 |
81 | If (A_ThisLabel == "MsgBoxExBUTTON") {
82 | RetVal := StrReplace(A_GuiControl, "&")
83 | } Else {
84 | RetVal := (A_ThisLabel == "MsgBoxExTIMEOUT") ? "Timeout" : "Cancel"
85 | }
86 |
87 | If (Owner) {
88 | WinSet Enable,, ahk_id %Owner%
89 | }
90 |
91 | Gui %hWnd%: Submit
92 | Gui %hWnd%: Destroy
93 | Return
94 | }
95 |
--------------------------------------------------------------------------------
/cmd/Adventure/Tools/MagicBox/Functions/MsiMessageBox.ahk:
--------------------------------------------------------------------------------
1 | MsiMessageBox(Text, Title := "", Options := 0, Owner := 0) {
2 | Ret := DllCall("msi.dll\MsiMessageBox"
3 | , "Ptr" , Owner
4 | , "Str" , Text
5 | , "str" , Title
6 | , "UInt", Options
7 | , "UInt", 0)
8 | Return {1: "OK", 2: "Cancel", 3: "Cancel", 4: "Retry", 5: "Ignore", 6: "Yes", 7: "No", 10: "Try Again"}[Ret]
9 | }
--------------------------------------------------------------------------------
/cmd/Adventure/Tools/MagicBox/Functions/ShellAbout.ahk:
--------------------------------------------------------------------------------
1 | ; https://docs.microsoft.com/en-us/windows/desktop/api/shellapi/nf-shellapi-shellaboutw
2 | ShellAbout(hWnd := 0, AppName := "", Message := "", hIcon := 0) {
3 | DllCall("shell32.dll\ShellAbout", "Ptr", hWnd, "Str", AppName, "Str", Message, "Ptr", hIcon)
4 | }
--------------------------------------------------------------------------------
/cmd/Adventure/Tools/MagicBox/Functions/ShellMessageBox.ahk:
--------------------------------------------------------------------------------
1 | ShellMessageBox(Text, Title := "", Options := 0, Owner := 0) {
2 | If (DllCall("GetVersion") & 0xFF < 6) {
3 | hModule := DllCall("GetModuleHandle", "Str", "shlwapi.dll", "Ptr")
4 | ShellMessageBoxW := DllCall("GetProcAddress", "Ptr", hModule, "UInt", 388, "Ptr")
5 | } Else {
6 | ShellMessageBoxW := "Shlwapi\ShellMessageBox"
7 | }
8 |
9 | Ret := DllCall(ShellMessageBoxW
10 | , "UInt", 0
11 | , "Ptr" , Owner ? Owner : DllCall("GetDesktopWindow", "Ptr")
12 | , "Str" , Text
13 | , "Str" , Title
14 | , "UInt", Options)
15 |
16 | Return {1: "OK", 2: "Cancel", 3: "Abort", 4: "Retry", 5: "Ignore", 6: "Yes", 7: "No", 10: "Try Again", 11: "Continue"}[Ret]
17 | }
--------------------------------------------------------------------------------
/cmd/Adventure/Tools/MagicBox/Functions/SoftModalMessageBox.ahk:
--------------------------------------------------------------------------------
1 | SoftModalMessageBox(Text, Title, Buttons, DefBtn := 1, Options := 0x1, IconRes := "", IconID := 1, Timeout := -1, Owner := 0, Callback := "") {
2 | Local
3 |
4 | If (IconRes != "") {
5 | hModule := DllCall("GetModuleHandle", "Str", IconRes, "Ptr")
6 | LoadLib := !hModule
7 | && hModule := DllCall("kernel32.dll\LoadLibraryEx", "Str", IconRes, "UInt", 0, "UInt", 0x2, "Ptr")
8 | Options |= 0x80 ; MB_USERICON
9 | } Else {
10 | hModule := 0
11 | LoadLib := False
12 | }
13 |
14 | cButtons := Buttons.Length()
15 | VarSetCapacity(ButtonIDs, cButtons * A_PtrSize, 0)
16 | VarSetCapacity(ButtonText, cButtons * A_PtrSize, 0)
17 | Loop %cButtons% {
18 | NumPut(Buttons[A_Index][1], ButtonIDs, 4 * (A_Index - 1), "UInt")
19 | NumPut(&(b%A_Index% := Buttons[A_Index][2]), ButtonText, A_PtrSize * (A_Index - 1), "Ptr")
20 | }
21 |
22 | If (Callback != "") {
23 | Callback := RegisterCallback(Callback, "F")
24 | }
25 |
26 | x64 := A_PtrSize == 8
27 | Offsets := (A_Is64BitOS) ? (x64 ? [96, 104, 112, 116, 120, 124] : [52, 56, 60, 64, 68, 72]) : [48, 52, 56, 60, 64, 68]
28 |
29 | ; MSGBOXPARAMS and MSGBOXDATA structures
30 | NumPut(VarSetCapacity(MBCONFIG, (x64) ? 136 : 76, 0), MBCONFIG, 0, "UInt")
31 | NumPut(Owner, MBCONFIG, 1 * A_PtrSize, "Ptr") ; Owner window
32 | NumPut(hModule, MBCONFIG, 2 * A_PtrSize, "Ptr") ; Icon resource
33 | NumPut(&Text, MBCONFIG, 3 * A_PtrSize, "Ptr") ; Message
34 | NumPut(&Title, MBCONFIG, 4 * A_PtrSize, "Ptr") ; Window title
35 | NumPut(Options, MBCONFIG, 5 * A_PtrSize, "UInt") ; Options
36 | NumPut(IconID, MBCONFIG, 6 * A_PtrSize, "Ptr") ; Icon resource ID
37 | NumPut(Callback, MBCONFIG, 8 * A_PtrSize, "Ptr") ; Callback
38 | NumPut(&ButtonIDs, MBCONFIG, Offsets[1], "Ptr") ; Button IDs
39 | NumPut(&ButtonText, MBCONFIG, Offsets[2], "Ptr") ; Button texts
40 | NumPut(cButtons, MBCONFIG, Offsets[3], "UInt") ; Number of buttons
41 | NumPut(DefBtn - 1, MBCONFIG, Offsets[4], "UInt") ; Default button
42 | NumPut(1, MBCONFIG, Offsets[5], "UInt") ; Allow cancellation
43 | NumPut(Timeout, MBCONFIG, Offsets[6], "Int") ; Timeout (ms)
44 |
45 | ProcAddr := DllCall("GetProcAddress", "Ptr", DllCall("GetModuleHandle", "Str", "User32.dll", "Ptr"), "AStr", "SoftModalMessageBox", "Ptr")
46 | Ret := DllCall(ProcAddr, "Ptr", &MBCONFIG)
47 |
48 | If (LoadLib) {
49 | DllCall("FreeLibrary", "Ptr", hModule)
50 | }
51 |
52 | If (Callback != "") {
53 | DllCall("GlobalFree", "Ptr", Callback)
54 | }
55 |
56 | Return Ret
57 | }
--------------------------------------------------------------------------------
/cmd/Adventure/Tools/MagicBox/Functions/TaskDialog.ahk:
--------------------------------------------------------------------------------
1 | TaskDialog(Instruction, Content := "", Title := "", Buttons := 1, IconID := 0, IconRes := "", Owner := 0x10010) {
2 | Local hModule, LoadLib, Ret
3 |
4 | If (IconRes != "") {
5 | hModule := DllCall("GetModuleHandle", "Str", IconRes, "Ptr")
6 | LoadLib := !hModule
7 | && hModule := DllCall("LoadLibraryEx", "Str", IconRes, "UInt", 0, "UInt", 0x2, "Ptr")
8 | } Else {
9 | hModule := 0
10 | LoadLib := False
11 | }
12 |
13 | DllCall("TaskDialog"
14 | , "Ptr" , Owner ; hWndParent
15 | , "Ptr" , hModule ; hInstance
16 | , "Ptr" , &Title ; pszWindowTitle
17 | , "Ptr" , &Instruction ; pszMainInstruction
18 | , "Ptr" , &Content ; pszContent
19 | , "Int" , Buttons ; dwCommonButtons
20 | , "Ptr" , IconID ; pszIcon
21 | , "Int*", Ret := 0) ; *pnButton
22 |
23 | If (LoadLib) {
24 | DllCall("FreeLibrary", "Ptr", hModule)
25 | }
26 |
27 | Return {1: "OK", 2: "Cancel", 4: "Retry", 6: "Yes", 7: "No", 8: "Close"}[Ret]
28 | }
--------------------------------------------------------------------------------
/cmd/Adventure/Tools/MagicBox/Functions/TaskDialogEx.ahk:
--------------------------------------------------------------------------------
1 | TaskDialogEx(Instruction, Content := "", Title := "", CustomButtons := "", CommonButtons := 0, MainIcon := 0, Flags := 0, Owner := 0x10010, VerificationText := "", ExpandedText := "", FooterText := "", FooterIcon := 0, Width := 0) {
2 | Static x64 := A_PtrSize == 8
3 |
4 | If (CustomButtons != "") {
5 | Buttons := StrSplit(CustomButtons, "|")
6 | cButtons := Buttons.Length()
7 | VarSetCapacity(pButtons, 4 * cButtons + A_PtrSize * cButtons, 0)
8 | Loop %cButtons% {
9 | iButtonText := &(b%A_Index% := Buttons[A_Index])
10 | NumPut(100 + A_Index, pButtons, (4 + A_PtrSize) * (A_Index - 1), "Int")
11 | NumPut(iButtonText, pButtons, (4 + A_PtrSize) * A_Index - A_PtrSize, "Ptr")
12 | }
13 | } Else {
14 | cButtons := 0
15 | pButtons := 0
16 | }
17 |
18 | NumPut(VarSetCapacity(TDC, x64 ? 160 : 96, 0), TDC, 0, "UInt") ; cbSize
19 | NumPut(Owner, TDC, 4, "Ptr") ; hwndParent
20 | NumPut(Flags, TDC, x64 ? 20 : 12, "Int") ; dwFlags
21 | NumPut(CommonButtons, TDC, x64 ? 24 : 16, "Int") ; dwCommonButtons
22 | NumPut(&Title, TDC, x64 ? 28 : 20, "Ptr") ; pszWindowTitle
23 | NumPut(MainIcon, TDC, x64 ? 36 : 24, "Ptr") ; pszMainIcon
24 | NumPut(&Instruction, TDC, x64 ? 44 : 28, "Ptr") ; pszMainInstruction
25 | NumPut(&Content, TDC, x64 ? 52 : 32, "Ptr") ; pszContent
26 | NumPut(cButtons, TDC, x64 ? 60 : 36, "UInt") ; cButtons
27 | NumPut(&pButtons, TDC, x64 ? 64 : 40, "Ptr") ; pButtons
28 | NumPut(&VerificationText, TDC, x64 ? 92 : 60, "Ptr") ; pszVerificationText
29 | NumPut(&ExpandedText, TDC, x64 ? 100 : 64, "Ptr") ; pszExpandedInformation
30 | NumPut(FooterIcon, TDC, x64 ? 124 : 76, "Ptr") ; pszFooterIcon
31 | NumPut(&FooterText, TDC, x64 ? 132 : 80, "Ptr") ; pszFooter
32 | NumPut(Width, TDC, x64 ? 156 : 92, "UInt") ; cxWidth
33 |
34 | If (DllCall("Comctl32.dll\TaskDialogIndirect", "Ptr", &TDC, "Int*", Button, "Int", 0, "Int*", Checked) == 0) {
35 | Return (VerificationText == "") ? Button : [Button, Checked]
36 | } Else {
37 | Return "ERROR"
38 | }
39 | }
40 |
--------------------------------------------------------------------------------
/cmd/Adventure/Tools/MagicBox/Functions/WTSSendMessage.ahk:
--------------------------------------------------------------------------------
1 | WTSSendMessage(Text, Title := "", Options := 0, Timeout := 0, Wait := True, Session := -1, Server := 0, ByRef Response := 0) {
2 | DllCall("winsta.dll\WinStationSendMessage"
3 | , "Ptr" , Server
4 | , "UInt", Session
5 | , "Str" , Title
6 | , "UInt", StrLen(Title) * 2
7 | , "Str" , Text
8 | , "UInt", StrLen(Text) * 2
9 | , "UInt", Options
10 | , "UInt", Timeout
11 | , "Int*", Response
12 | , "UInt", !Wait)
13 |
14 | Return {1: "OK", 2: "Cancel", 3: "Abort", 4: "Retry", 5: "Ignore", 6: "Yes", 7: "No", 10: "Try Again", 11: "Continue", 32000: "Timeout"}[Response]
15 | }
--------------------------------------------------------------------------------
/cmd/Adventure/Tools/Sort Panel/Sort Panel.exe:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sxzxs/cherry-snippet/8e6b7c000a932380bb44eecb98fe4782f40003e1/cmd/Adventure/Tools/Sort Panel/Sort Panel.exe
--------------------------------------------------------------------------------
/cmd/Adventure/Tools/Sort Panel/Sort Panel.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sxzxs/cherry-snippet/8e6b7c000a932380bb44eecb98fe4782f40003e1/cmd/Adventure/Tools/Sort Panel/Sort Panel.png
--------------------------------------------------------------------------------
/cmd/Adventure/Tools/XML Syntax Checker/XML Syntax Checker.ahk:
--------------------------------------------------------------------------------
1 | ; XML Syntax Checker 1.0.0
2 |
3 | #SingleInstance Force
4 | #NoEnv
5 | SetWorkingDir %A_ScriptDir%
6 | SetBatchLines -1
7 |
8 | ; Prompt for filename if it isn't specified on command line
9 | If (!A_Args.Length() || !FileExist(A_Args[1])) {
10 | FileSelectFile XmlFile, 3,, Select XML File, XML Files (*.xml)
11 | If (ErrorLevel) {
12 | ExitApp
13 | }
14 |
15 | } Else {
16 | XmlFile := A_Args[1]
17 | }
18 |
19 | If (LoadXMLEx(x, XmlFile)) {
20 | SplitPath XmlFile, Filename
21 | MsgBox 0x40, XML Syntax Checker, No error found in file "%Filename%".
22 | }
23 |
24 | ExitApp
25 |
26 | LoadXMLEx(ByRef oXML, Fullpath) {
27 | oXML := ComObjCreate("MSXML2.DOMDocument.6.0")
28 | oXML.async := False
29 |
30 | If (!oXML.load(Fullpath)) {
31 | MsgBox 0x10, Error, % "Failed to load XML file."
32 | . "`n`nFilename: """ . Fullpath . """"
33 | . "`n`nError: " . Format("0x{:X}", oXML.parseError.errorCode & 0xFFFFFFFF)
34 | . "`n`nReason: " . oXML.parseError.reason
35 | Return 0
36 | }
37 |
38 | Return 1
39 | }
40 |
--------------------------------------------------------------------------------
/cmd/Adventure/Tools/XML Syntax Checker/XML Syntax Checker.exe:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sxzxs/cherry-snippet/8e6b7c000a932380bb44eecb98fe4782f40003e1/cmd/Adventure/Tools/XML Syntax Checker/XML Syntax Checker.exe
--------------------------------------------------------------------------------
/cmd/Adventure/sqlite3.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sxzxs/cherry-snippet/8e6b7c000a932380bb44eecb98fe4782f40003e1/cmd/Adventure/sqlite3.dll
--------------------------------------------------------------------------------
/cmd/tmp/tmp.ahk:
--------------------------------------------------------------------------------
1 | run,www.baidu.com
2 | run,www.baidu.com
--------------------------------------------------------------------------------
/cmd/tmp/tmp.bat:
--------------------------------------------------------------------------------
1 | ::bat
2 | set message=Hello World
3 | echo %message%
--------------------------------------------------------------------------------
/cmd/tmp/tmp.py:
--------------------------------------------------------------------------------
1 | #py
2 | #!/usr/bin/python3
3 |
4 | import tkinter
5 | top = tkinter.Tk()
6 | # 进入消息循环
7 | top.mainloop()
--------------------------------------------------------------------------------
/config/py_map.bin:
--------------------------------------------------------------------------------
1 | {
2 |
3 | }
--------------------------------------------------------------------------------
/config/settings.json:
--------------------------------------------------------------------------------
1 | {
2 | "auto_english": 1,
3 | "cherry_tree_path": "F:\\cherry-tree-protable\\cherrytree_0.99.51.0_win64_portable\\mingw64\\bin\\cherrytree.exe",
4 | "db_path": "G:\\我的AHK程序\\我的工程\\cherry-snippet1\\data.ctb",
5 | "hook_open": "+space",
6 | "html_path": "G:\\我的AHK程序\\我的工程\\cherry-snippet",
7 | "is_hook_open_double_press": 0,
8 | "is_open_search_box_double_press": 0,
9 | "is_show_logo": 0,
10 | "is_use_86wubi": 0,
11 | "is_use_html_preview": 1,
12 | "is_use_xiaohe_double_pinyin": 0,
13 | "key_edit_new": "~$^d",
14 | "key_edit_now": "~$^e",
15 | "key_open_editor": "~$!c",
16 | "key_open_search_box": "+enter",
17 | "key_quick_switch_node": "~$^c",
18 | "key_send": "~$^enter",
19 | "last_parse_time": "20230130004158",
20 | "python_path": "C:\\Python310\\python.exe",
21 | "tooltip_back_color": "0x1E1E1E",
22 | "tooltip_font_size": "15",
23 | "tooltip_help": 0,
24 | "tooltip_random": 0,
25 | "tooltip_text_color": "0xEDE0EA",
26 | "win_hook_backgroundcolor": "444444",
27 | "win_hook_bordercolor": "444444",
28 | "win_hook_codecolor": "C9E47E",
29 | "win_hook_focusbackcolor": "CAE682",
30 | "win_hook_focuscolor": "070C0D",
31 | "win_hook_font": "Microsoft YaHei UI",
32 | "win_hook_fontbold": "0",
33 | "win_hook_fontsize": "20",
34 | "win_hook_textcolor": "EEECE2",
35 | "win_hook_total_show_number": "20",
36 | "win_list_back_color": "0x252525",
37 | "win_list_focus_back_color": "0x663DB5",
38 | "win_list_focus_text_color": "0x959595",
39 | "win_list_font_size": "16",
40 | "win_list_height": "35",
41 | "win_list_text_color": "0xFFFFFF",
42 | "win_search_box_back_color": "0x0E0E0E",
43 | "win_search_box_font_size": "16",
44 | "win_search_box_text_color": "0x663DB5",
45 | "win_trans": "240",
46 | "win_w": 700,
47 | "win_x": 727,
48 | "win_y": 105
49 | }
--------------------------------------------------------------------------------
/config/template.json:
--------------------------------------------------------------------------------
1 | {
2 | "auto_english": "1",
3 | "hook_open": "+space",
4 | "key_edit_new": "~$^d",
5 | "key_edit_now": "~$^e",
6 | "key_open_editor": "~$!c",
7 | "key_open_search_box": "+enter",
8 | "key_send": "~$^enter",
9 | "python_path": "C:\\Python310\\python.exe",
10 | "tooltip_back_color": "1d1d1d",
11 | "tooltip_font_size": "15",
12 | "tooltip_help": "1",
13 | "tooltip_random": "0",
14 | "tooltip_text_color": "999999",
15 | "win_list_back_color": "1d1d1d",
16 | "win_list_focus_back_color": "3223857",
17 | "win_list_focus_text_color": "9803157",
18 | "win_list_font_size": "14",
19 | "win_list_text_color": "999999",
20 | "win_search_box_back_color": "10101",
21 | "win_search_box_font_size": "16",
22 | "win_search_box_text_color": "999999",
23 | "win_w": "688",
24 | "win_x": 838,
25 | "win_y": 194
26 | }
--------------------------------------------------------------------------------
/config/wubi.bin:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sxzxs/cherry-snippet/8e6b7c000a932380bb44eecb98fe4782f40003e1/config/wubi.bin
--------------------------------------------------------------------------------
/data.ctb:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sxzxs/cherry-snippet/8e6b7c000a932380bb44eecb98fe4782f40003e1/data.ctb
--------------------------------------------------------------------------------
/lib/dll_32/cpp2ahk.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sxzxs/cherry-snippet/8e6b7c000a932380bb44eecb98fe4782f40003e1/lib/dll_32/cpp2ahk.dll
--------------------------------------------------------------------------------
/lib/dll_64/cpp2ahk.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sxzxs/cherry-snippet/8e6b7c000a932380bb44eecb98fe4782f40003e1/lib/dll_64/cpp2ahk.dll
--------------------------------------------------------------------------------
/lib/dll_64/fuzz.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sxzxs/cherry-snippet/8e6b7c000a932380bb44eecb98fe4782f40003e1/lib/dll_64/fuzz.dll
--------------------------------------------------------------------------------
/lib/dll_64/libsodium.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sxzxs/cherry-snippet/8e6b7c000a932380bb44eecb98fe4782f40003e1/lib/dll_64/libsodium.dll
--------------------------------------------------------------------------------
/lib/dll_64/libzmq-v141-mt-4_3_4.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sxzxs/cherry-snippet/8e6b7c000a932380bb44eecb98fe4782f40003e1/lib/dll_64/libzmq-v141-mt-4_3_4.dll
--------------------------------------------------------------------------------
/lib/empty1.exe:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sxzxs/cherry-snippet/8e6b7c000a932380bb44eecb98fe4782f40003e1/lib/empty1.exe
--------------------------------------------------------------------------------
/lib/fuzz.ahk:
--------------------------------------------------------------------------------
1 | class fuzz
2 | {
3 | static all_dll_func := {"fuzz.dll" : {"rapid_fuzz_cpp_ratio": 0, "rapid_fuzz_cpp_partial_ratio" : 0 ,"rapid_fuzz_cpp_token_ratio" : 0, "rapid_fuzz_cpp_partial_token_ratio" : 0 ,"rapid_fuzz_cpp_token_sort_ratio" : 0, "rapid_fuzz_cpp_partial_token_sort_ratio" : 0,"rapid_fuzz_cpp_token_set_ratio" : 0, "rapid_fuzz_cpp_partial_token_set_ratio" : 0}}
4 | static _ := fuzz.load_all_dll_func()
5 | load_all_dll_func()
6 | {
7 | SplitPath,A_LineFile,,dir
8 | path := ""
9 | lib_path := dir
10 | if(A_IsCompiled)
11 | {
12 | path := A_PtrSize == 4 ? A_ScriptDir . "\lib\dll_32\" : A_ScriptDir . "\lib\dll_64\"
13 | lib_path := A_ScriptDir . "\lib"
14 | }
15 | else
16 | {
17 | path := (A_PtrSize == 4) ? dir . "\dll_32\" : dir . "\dll_64\"
18 | }
19 | dllcall("SetDllDirectory", "Str", path)
20 | for k,v in this.all_dll_func
21 | {
22 | for k1, v1 in v
23 | {
24 | this.all_dll_func[k][k1] := DllCall("GetProcAddress", "Ptr", DllCall("LoadLibrary", "Str", k, "Ptr"), "AStr", k1, "Ptr")
25 | }
26 | }
27 | this.is_dll_load := true
28 | DllCall("SetDllDirectory", "Str", A_ScriptDir)
29 | }
30 | __new()
31 | {
32 | this.load_all_dll_func()
33 | }
34 | partial_token_set_ratio(str1, str2)
35 | {
36 | return DllCall(this.all_dll_func["fuzz.dll"]["rapid_fuzz_cpp_partial_token_set_ratio"], "wstr", str1, "wstr", str2, "Cdecl Double")
37 | }
38 | match_single(str1, str2)
39 | {
40 | if(str1 == " ")
41 | return 100
42 | score = fuzz.partial_token_set_ratio(str1, str2)
43 | return score
44 | }
45 | /*
46 | * param str1 输入字符串 空格分割
47 | * param str2 待查找字符串
48 | */
49 | match(str1, str2)
50 | {
51 | arr := StrSplit(str1, [A_Space, A_tab])
52 | if(arr.MaxIndex() == "")
53 | return 100
54 | score := 0
55 | real_Length = 0
56 | for k,v in arr
57 | {
58 | if(v != "" && v != " ")
59 | real_Length++
60 | Else
61 | Continue
62 | score += fuzz.partial_token_set_ratio(v, str2)
63 | }
64 | if(real_Length > 0)
65 | return score / real_Length
66 | Else
67 | return 0
68 | }
69 | }
--------------------------------------------------------------------------------
/lib/json.ahk:
--------------------------------------------------------------------------------
1 | ;------------------------------
2 | ; JSon.ahk - v2.1 By FeiYue
3 | ;------------------------------
4 |
5 | json_toobj(s) ; JSon字符串转AHK对象
6 | {
7 | static rep:=[ ["\\","\u005c"], ["\""",""""], ["\/","/"]
8 | , ["\r","`r"], ["\n","`n"], ["\t","`t"]
9 | , ["\b","`b"], ["\f","`f"] ]
10 | if !(p:=RegExMatch(s, "[\{\[]", r))
11 | return
12 | SetBatchLines, % (bch:=A_BatchLines)?"-1":"-1"
13 | stack:=[], obj:=arr:=[], is_arr:=(r="[")
14 | , key:=(is_arr ? 1:""), keyok:=0
15 | While p:=RegExMatch(s, "\S", r, p+StrLen(r))
16 | {
17 | if (r="{" or r="[") ; 如果是 左括号
18 | {
19 | stack.Push(is_arr, arr), arr[key]:=[], arr:=arr[key]
20 | , is_arr:=(r="["), key:=(is_arr ? 1:""), keyok:=0
21 | }
22 | else if (r="}" or r="]") ; 如果是 右括号
23 | {
24 | if !stack.Length()
25 | Break
26 | arr:=stack.Pop(), is_arr:=stack.Pop()
27 | , key:=(is_arr ? arr.Length():""), keyok:=0
28 | }
29 | else if (r=",") ; 如果是 逗号
30 | {
31 | key:=(is_arr ? Floor(key)+1:""), keyok:=0
32 | }
33 | else if (r="""") ; 如果是 双引号
34 | {
35 | if RegExMatch(s, """((?:[^""\\]|\\[\s\S])*)""", r, p)!=p
36 | Break
37 | if InStr(r1, "\")
38 | {
39 | For k,v in rep
40 | r1:=StrReplace(r1, v[1], v[2])
41 | v:="", k:=1
42 | While i:=RegExMatch(r1, "\\u[0-9A-Fa-f]{4}",, k)
43 | v.=SubStr(r1,k,i-k) . Chr("0x" SubStr(r1,i+2,4)), k:=i+6
44 | r1:=v . SubStr(r1,k)
45 | }
46 | if (!is_arr and keyok=0)
47 | {
48 | p+=StrLen(r)
49 | if RegExMatch(s, "\s*:", r, p)!=p
50 | Break
51 | key:=r1, keyok:=1
52 | }
53 | else arr[key]:=r1
54 | }
55 | else ; 如果是 true、false、null、数字
56 | {
57 | if RegExMatch(s, "[\w\+\-\.]+", r, p)!=p
58 | Break
59 | arr[key]:=(r=="true" ? 1:r=="false" ? 0:r=="null" ? "":r+0)
60 | }
61 | }
62 | SetBatchLines, %bch%
63 | return obj
64 | }
65 |
66 | json_fromobj(obj, space:="") ; AHK对象转JSon字符串
67 | {
68 | ;-------------------
69 | ; 默认不替换 "/-->\/" 与 特殊html字符<、>、&
70 | ;-------------------
71 | static rep:=[ ["\\","\"], ["\""",""""] ; , ["\/","/"]
72 | ; , ["\\u003c","<"], ["\\u003e",">"], ["\\u0026","&"]
73 | , ["\r","`r"], ["\n","`n"], ["\t","`t"]
74 | , ["\b","`b"], ["\f","`f"] ]
75 | if !IsObject(obj)
76 | {
77 | if obj is Number ; thanks lexikos
78 | return ([obj].GetCapacity(1) ? """" obj """" : obj)
79 | ;-------------------
80 | ; 布尔值在AHK中转为数字了
81 | ; if (obj=="true" or obj=="false" or obj=="null")
82 | ; return obj
83 | ;-------------------
84 | For k,v in rep
85 | obj:=StrReplace(obj, v[2], v[1])
86 | ;-------------------
87 | ; 默认不替换 "Unicode字符-->\uXXXX"
88 | ; While RegExMatch(obj, "[^\x20-\x7e]", k)
89 | ; obj:=StrReplace(obj, k, Format("\u{:04x}",Ord(k)))
90 | ;-------------------
91 | return """" obj """"
92 | }
93 | is_arr:=1 ; 是简单数组
94 | For k,v in obj
95 | if (k!=A_Index) and !(is_arr:=0)
96 | Break
97 | s:="", space2:=space . " ", f:=A_ThisFunc
98 | For k,v in obj
99 | s.= "`r`n" space2
100 | . (is_arr ? "" : """" Trim(%f%(k ""),"""") """: ")
101 | . %f%(v,space2) . ","
102 | return (is_arr?"[":"{") . Trim(s,",")
103 | . "`r`n" space . (is_arr?"]":"}")
104 | }
105 |
--------------------------------------------------------------------------------
/plugin/bd/bd.ahk:
--------------------------------------------------------------------------------
1 | #SingleInstance, Force
2 | url := "http://www.baidu.com/s?wd=" A_args[1]
3 | run,% url
--------------------------------------------------------------------------------
/plugin/cal/cal.ahk:
--------------------------------------------------------------------------------
1 | #include
2 | command := A_args[1]
3 |
4 | ;第一种调用方式
5 | NTLCalc.SetOutputPrecision(500)
6 | NTLCalc.SetPrecision(500)
7 | MsgBox, % NTLCalc.Call(command)
--------------------------------------------------------------------------------
/plugin/cal/lib/32bit/ntl.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sxzxs/cherry-snippet/8e6b7c000a932380bb44eecb98fe4782f40003e1/plugin/cal/lib/32bit/ntl.dll
--------------------------------------------------------------------------------
/plugin/cal/lib/64bit/ntl.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sxzxs/cherry-snippet/8e6b7c000a932380bb44eecb98fe4782f40003e1/plugin/cal/lib/64bit/ntl.dll
--------------------------------------------------------------------------------
/plugin/cal/lib/NTLCalc.ahk:
--------------------------------------------------------------------------------
1 | /*
2 | * @description Number Theory Lib, used for high precision integer and floating point number calculation
3 | * @file NTLCalc.ahk
4 | * @author thqby
5 | * @date 2021/12/12
6 | * @version 1.0.3
7 | */
8 |
9 | /*
10 | * Computational mathematical expression.
11 | * @param exp A mathematical expression to be evaluated, such as `4*23.2/4.1`
12 | * #### `constants`
13 | * - pi, e
14 | *
15 | * #### functions
16 | * - sin, cos, tan, pow, pow2, pow3, sqrt, abs, ceil, floor, exp, ln, log
17 | * - max(x1, x2, ...)
18 | * - min(x1, x2, ...)
19 | * - round(x, n = 0)
20 | */
21 |
22 |
23 |
24 | class NTLCalc
25 | {
26 | ;static static_:= DllCall("LoadLibrary", "str","ntl.dll", "ptr")
27 | static static_ := DllCall("LoadLibrary", "str", A_LineFile "\..\" (A_PtrSize * 8) "bit\ntl.dll", "ptr")
28 |
29 | Call(exp) {
30 | switch (DllCall("ntl\Calc", "astr", exp, "ptr*", val, "cdecl")) {
31 | case 0: return StrGet(val, "cp0")
32 | case 1: throw Exception("ExpressionError")
33 | case 2: throw Exception("ParamCountError")
34 | case 3: throw Exception("TypeError")
35 | case 4: throw Exception("UnknowTokenError")
36 | case 5: throw Exception("ZeroDivisionError")
37 | }
38 | }
39 |
40 | ; Set Debug Mode, Print the results of each step in the stdout.
41 | SetDebugMode(p := false) {
42 | DllCall("ntl\SetDebugMode", "char", p, "cdecl")
43 | }
44 |
45 | ; Set output precision(number of bits). ;设置输出精度(位数)。
46 | SetOutputPrecision(p) {
47 | DllCall("ntl\SetOutputPrecision", "int", p, "cdecl")
48 | }
49 |
50 | ; Set the precision(number of bits). ;设置精度(位数)。
51 | SetPrecision(p) {
52 | DllCall("ntl\SetPrecision", "int", p, "cdecl")
53 | }
54 | }
--------------------------------------------------------------------------------
/readme.md:
--------------------------------------------------------------------------------
1 | 请更新到最新版本:https://github.com/sxzxs/cherry-snippet-v2
2 | # 功能介绍
3 | * 借助cherrytree作为代码片段工具
4 | * 通过设置关键字检索文本,文本可以预览并复制到粘贴板。如果文本是ahk,python,bat等脚本则可以执行
5 | * 检索支持拼音首字母、全拼等
6 |
7 | * cherrytree 定制版下载路径:链接:https://pan.baidu.com/s/1romeZMHpUX9SPxnD5ZWtlw?pwd=2hpl 提取码:2hpl
8 |
9 | # 使用说明:
10 |
11 | 1、打开 cherry-snippet.exe
12 |
13 | 2、选择 cherrytree.exe的路径
14 |
15 | 3、选择 cherrytree 数据文件 .ctb路径
16 |
17 | 4、默认shift+enter执行搜索, shift+space hook搜索
18 |
19 | 5、cherrytree定制版支持搜索后快速跳转,默认快捷键是ctrl+c
20 |
21 | 6、html预览,需要配置html导出路径
22 |
23 | # 默认按键使用说明
24 | * 打开搜索框 shift+enter
25 | * 执行命令 enter
26 | * 命令面板编辑命令 alt+c
27 | * 复制结果,再次执行shift+enter
28 | * 发送文本到窗口 ctrl+enter
29 | * 编辑当前命令 ctrl+e
30 | * hook 输入法模式 shift+space
31 |
32 | # 其他支持的脚本语言执行
33 | * bat 脚本开头 ::bat
34 | * python 脚本开头 #py
35 | * ahk v2 脚本开头 ;v2
36 |
37 | # TODO
38 | * 配置界面dx11依赖项内置
39 |
40 |
41 | # 其他链接
42 |
43 | https://www.youtube.com/watch?v=jO3MFl0Vsbg
44 |
45 | 【AutoHotkey(ahk) | 中文社区】:https://jq.qq.com/?_wv=1027&k=iDG6c0qS
46 |
47 | 【ahk代码片段管理软件】:https://jq.qq.com/?_wv=1027&k=sxkummKG
48 |
49 |
50 | 
51 | 
52 | 
53 | 
54 |
55 | * 设置界面
56 | 
57 | * 发送到窗口
58 | 
59 | * 复制到粘贴板
60 | 
61 | * hook 模式
62 | 
63 | * 执行ahk代码片段
64 | 
65 | * 执行python命令
66 | 
67 | * 编辑已有代码片段
68 | 
69 | * 添加代码片段和命令
70 | 
71 |
--------------------------------------------------------------------------------
/set.exe:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sxzxs/cherry-snippet/8e6b7c000a932380bb44eecb98fe4782f40003e1/set.exe
--------------------------------------------------------------------------------
/setv2需要安装dx11.txt:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sxzxs/cherry-snippet/8e6b7c000a932380bb44eecb98fe4782f40003e1/setv2需要安装dx11.txt
--------------------------------------------------------------------------------
/sqlite3.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sxzxs/cherry-snippet/8e6b7c000a932380bb44eecb98fe4782f40003e1/sqlite3.dll
--------------------------------------------------------------------------------
/tool/set-v2/imgui.ini:
--------------------------------------------------------------------------------
1 | [Window][Debug##Default]
2 | ViewportPos=-31,-3
3 | ViewportId=0x9F5F46A1
4 | Size=500,400
5 | Collapsed=0
6 |
7 | [Window][AHK2]
8 | ViewportPos=792,194
9 | ViewportId=0xA73FFB72
10 | Size=1034,448
11 | Collapsed=0
12 |
13 | [Window][设置]
14 | ViewportPos=368,230
15 | ViewportId=0xB5C7B82D
16 | Size=1079,721
17 | Collapsed=0
18 |
19 | [Docking][Data]
20 |
21 |
--------------------------------------------------------------------------------
/tool/set-v2/lib/dll_32/cpp2ahk.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sxzxs/cherry-snippet/8e6b7c000a932380bb44eecb98fe4782f40003e1/tool/set-v2/lib/dll_32/cpp2ahk.dll
--------------------------------------------------------------------------------
/tool/set-v2/lib/dll_64/DXGICapture.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sxzxs/cherry-snippet/8e6b7c000a932380bb44eecb98fe4782f40003e1/tool/set-v2/lib/dll_64/DXGICapture.dll
--------------------------------------------------------------------------------
/tool/set-v2/lib/dll_64/cpp2ahk.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sxzxs/cherry-snippet/8e6b7c000a932380bb44eecb98fe4782f40003e1/tool/set-v2/lib/dll_64/cpp2ahk.dll
--------------------------------------------------------------------------------
/tool/set-v2/lib/dll_64/imgui.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sxzxs/cherry-snippet/8e6b7c000a932380bb44eecb98fe4782f40003e1/tool/set-v2/lib/dll_64/imgui.dll
--------------------------------------------------------------------------------
/tool/set-v2/lib/dll_64/imgui.pdb:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sxzxs/cherry-snippet/8e6b7c000a932380bb44eecb98fe4782f40003e1/tool/set-v2/lib/dll_64/imgui.pdb
--------------------------------------------------------------------------------
/tool/set-v2/setv2.exe:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sxzxs/cherry-snippet/8e6b7c000a932380bb44eecb98fe4782f40003e1/tool/set-v2/setv2.exe
--------------------------------------------------------------------------------
/tool/超级命令工具-excel转xml/lib/dll_32/cpp2ahk.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sxzxs/cherry-snippet/8e6b7c000a932380bb44eecb98fe4782f40003e1/tool/超级命令工具-excel转xml/lib/dll_32/cpp2ahk.dll
--------------------------------------------------------------------------------
/tool/超级命令工具-excel转xml/lib/dll_64/cpp2ahk.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sxzxs/cherry-snippet/8e6b7c000a932380bb44eecb98fe4782f40003e1/tool/超级命令工具-excel转xml/lib/dll_64/cpp2ahk.dll
--------------------------------------------------------------------------------
/tool/超级命令工具-excel转xml/libxl.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sxzxs/cherry-snippet/8e6b7c000a932380bb44eecb98fe4782f40003e1/tool/超级命令工具-excel转xml/libxl.dll
--------------------------------------------------------------------------------
/tool/超级命令工具-excel转xml/libxl/32/libxl.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sxzxs/cherry-snippet/8e6b7c000a932380bb44eecb98fe4782f40003e1/tool/超级命令工具-excel转xml/libxl/32/libxl.dll
--------------------------------------------------------------------------------
/tool/超级命令工具-excel转xml/libxl/64/libxl.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sxzxs/cherry-snippet/8e6b7c000a932380bb44eecb98fe4782f40003e1/tool/超级命令工具-excel转xml/libxl/64/libxl.dll
--------------------------------------------------------------------------------
/tool/超级命令工具-excel转xml/src.xlsx:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sxzxs/cherry-snippet/8e6b7c000a932380bb44eecb98fe4782f40003e1/tool/超级命令工具-excel转xml/src.xlsx
--------------------------------------------------------------------------------
/tool/超级命令工具-excel转xml/vscode代码片段转换为excel.ahk2:
--------------------------------------------------------------------------------
1 | #include
2 |
3 |
--------------------------------------------------------------------------------
/v1/AutoHotkey.exe:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sxzxs/cherry-snippet/8e6b7c000a932380bb44eecb98fe4782f40003e1/v1/AutoHotkey.exe
--------------------------------------------------------------------------------
/v2/AutoHotkey.exe:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sxzxs/cherry-snippet/8e6b7c000a932380bb44eecb98fe4782f40003e1/v2/AutoHotkey.exe
--------------------------------------------------------------------------------