-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathheaders.py
More file actions
197 lines (181 loc) · 6.25 KB
/
headers.py
File metadata and controls
197 lines (181 loc) · 6.25 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
"""
Visual HSP -> Headers, headers.py
Copyright (C) 2025 CalaMityX
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <https://gnu.ac.cn/licenses/>.
"""
hsp_header = """; Generated by HSPVisual By CalaMity
#packopt hide 1
#packopt upx 1
onexit goto *quit
"""
hsp_w32api_header = """
;--- Win32APIs
#uselib "USER32.DLL"
#func CharUpperA "CharUpperA" sptr
#func DestroyWindow "DestroyWindow" sptr
#func DrawEdge "DrawEdge" sptr, sptr, sptr, sptr
#func DrawFocusRect "DrawFocusRect" sptr, sptr
#func DrawTextA "DrawTextA" sptr, sptr, sptr, sptr, sptr
#func FillRect "FillRect" sptr, sptr, sptr
#func GetClassInfoExA "GetClassInfoExA" sptr, sptr, sptr
#func GetClassInfoExW "GetClassInfoExW" wptr, wptr, wptr
#func GetClassNameA "GetClassNameA" sptr, sptr, sptr
#func GetWindowLongA "GetWindowLongA" sptr, sptr
#func GetWindowRect "GetWindowRect" sptr, sptr
#func GetWindowTextA "GetWindowTextA" sptr, sptr, sptr
#func InvalidateRect "InvalidateRect" sptr, sptr, sptr
#func IsWindowEnabled "IsWindowEnabled" sptr
#func IsWindowUnicode "IsWindowUnicode" sptr
#func MoveWindow "MoveWindow" sptr, sptr, sptr, sptr, sptr, sptr
#func RegisterClassExA "RegisterClassExA" sptr
#func RegisterClassExW "RegisterClassExW" wptr
#func ScreenToClient "ScreenToClient" sptr, sptr
#func SetWindowLongA "SetWindowLongA" sptr, sptr, sptr
#func SetWindowRgn "SetWindowRgn" sptr, sptr, sptr
#func ShowScrollBar "ShowScrollBar" sptr, sptr, sptr
#func UpdateWindow "UpdateWindow" sptr
#func SetWindowPos "SetWindowPos" int,int,int,int,int,int,int
#func GetSystemMetrics "GetSystemMetrics" int
#uselib "GDI32.DLL"
#func BitBlt "BitBlt" sptr, sptr, sptr, sptr, sptr, sptr, sptr, sptr, sptr
#func CombineRgn "CombineRgn" sptr, sptr, sptr, sptr
#func DeleteDC "DeleteDC" sptr
#func DeleteObject "DeleteObject" sptr
#func ExtSelectClipRgn "ExtSelectClipRgn" sptr, sptr, sptr
#func FillRgn "FillRgn" sptr, sptr, sptr
#func IntersectClipRect "IntersectClipRect" sptr, sptr, sptr, sptr, sptr
#func SelectClipRgn "SelectClipRgn" sptr, sptr
#func SetPixelV "SetPixelV" sptr, sptr, sptr, sptr
#uselib "gdi32.dll"
#cfunc CreateFontIndirectA "CreateFontIndirectA" int
#func func_1 "DeleteObject" int
#func GetObjectA "GetObjectA" int, int, int
#cfunc CreateCompatibleBitmap "CreateCompatibleBitmap" int, int, int
#cfunc CreateCompatibleDC "CreateCompatibleDC" int
#cfunc CreateEllipticRgn "CreateEllipticRgn" int, int, int, int
#cfunc CreatePatternBrush "CreatePatternBrush" int
#cfunc CreatePolygonRgn "CreatePolygonRgn" int, int, int
#cfunc CreateSolidBrush "CreateSolidBrush" int
#cfunc CreateRectRgn "CreateRectRgn" int, int, int, int
#cfunc ExtCreateRegion "ExtCreateRegion" int, int, int
#cfunc GetRegionData "GetRegionData" int, int, int
#cfunc GetStockObject "GetStockObject" int
#cfunc SelectObject "SelectObject" int, int
#cfunc SetBkMode "SetBkMode" int, int
#cfunc SetROP2 "SetROP2" int, int
#cfunc SetTextColor "SetTextColor" int, int
#uselib "user32.dll"
#cfunc CreateWindowExA "CreateWindowExA" int, int, int, int, int, int, int, int, int, int, int, int
#cfunc GetParent "GetParent" int
#cfunc GetSysColor "GetSysColor" int
#cfunc GetSysColorBrush "GetSysColorBrush" int
#cfunc GetWindowTextLengthA "GetWindowTextLengthA" int
#cfunc WindowFromPoint "WindowFromPoint" int, int
#uselib "uxtheme.dll"
#func SetWindowTheme "SetWindowTheme" int, sptr, sptr
#const GWL_EXSTYLE -20
#const WS_EX_TOOLWINDOW $00000080
#const WS_EX_TOPMOST $00000008
#const HWND_TOPMOST -1
#const SWP_NOMOVE $0002
#const SWP_NOSIZE $0001
#const SWP_SHOWWINDOW $0040
#const SM_CXSCREEN 0
#const SM_CYSCREEN 1
#const HWND_TOP 0
#uselib "kernel32.dll"
#func ExitProcess "ExitProcess" int
#const WS_MINIMIZEBOX 0x00020000
#const GWL_STYLE -16
#const WS_SYSMENU $00080000
#const ES_READONLY 0x0800
#const WS_EX_TOOLWINDOW 0x00000080
"""
hsp_tool_header = """
;--- Tools function
#deffunc HideScroll int prm1
p = objinfo(prm1,2)
ShowScrollBar p,3,0
return
#deffunc MakeCenter int prm1
p = objinfo(prm1,2)
GetWindowLongA p, GWL_STYLE
SetWindowLongA p, GWL_STYLE, stat|1
SetWindowPos p,0,0,0,0,0, SWP_NOMOVE|SWP_NOSIZE|SWP_NOZORDER|SWP_FRAMECHANGED
return
#deffunc CenterWindow
win_w = wWid
win_h = wHit
width win_w, win_h
scr_w = GetSystemMetrics(SM_CXSCREEN)
scr_h = GetSystemMetrics(SM_CYSCREEN)
x = (scr_w - win_w) / 2
y = (scr_h - win_h) / 2
SetWindowPos hwnd, HWND_TOP, x, y, win_w, win_h, SWP_SHOWWINDOW
return
#deffunc TopMost
style = GetWindowLongA(hwnd, GWL_EXSTYLE)
style = style | WS_EX_TOPMOST
SetWindowLongA hwnd, GWL_EXSTYLE, style
SetWindowPos hwnd, HWND_TOPMOST, 0,0,0,0, SWP_NOMOVE|SWP_NOSIZE|SWP_SHOWWINDOW
return
#deffunc RemoveMinimize
style = GetWindowLongA(hwnd, GWL_STYLE)
style = style - (style & WS_MINIMIZEBOX)
SetWindowLongA hwnd, GWL_STYLE, style
return
#deffunc MakeToolWindow
style = GetWindowLongA(hwnd, GWL_EXSTYLE)
style = style | WS_EX_TOOLWINDOW
SetWindowLongA hwnd, GWL_EXSTYLE, style
return
"""
hsp_bass_header = """
#uselib "BASSMOD.dll"
#func BASS_Free "BASSMOD_Free"
#func BASS_Init "BASSMOD_Init" int, int, int, int, int
#func BASS_MusicFree "BASSMOD_MusicFree"
#func BASS_MusicLoad "BASSMOD_MusicLoad" int, sptr, int, int, int
#func BASS_MusicPlay "BASSMOD_MusicPlay"
#func BASS_MusicStop "BASSMOD_MusicStop"
#func BASS_MusicPlayEx "BASSMOD_MusicPlayEx" int,int,int
#define BASS
BASS_STATE=0
"""
hsp_bass_init = """
_ = BASS_Init(-1,44100,0)
if _ == 0 {
;Init failed
}else{
BASS_STATE=1
}
"""
hsp_bass_load = """
if(BASS_STATE==1){
music = BASS_MusicLoad(0,"{customName}",0,0,0)
if music == 0 {
;Load failed
}else{
BASS_STATE=2
}
}
"""
hsp_bass_play = "\nif BASS_STATE==2: BASS_MusicPlayEx 0,4,1\n"
hsp_bass_end = """
BASS_MusicStop
BASS_Free
"""
hsp_quit_lbl=""" #ifdef BASS
BASS_MusicStop
BASS_Free
#endif
end"""