-
Notifications
You must be signed in to change notification settings - Fork 72
/
GPF.ahk
145 lines (123 loc) · 4.71 KB
/
GPF.ahk
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
; ==========================================
;
; Library: GPF v1.1c
; Author: MasterFocus
; Info: www.autohotkey.net/~MasterFocus
;
; Direct3D game overlaying
; DLLs provided by www.mikoweb.eu/index.php?node=28
;
; Please give credits and refer to one of the following
; links when using this library in your project:
; www.autohotkey.net/~MasterFocus
; www.autohotkey.com/forum/viewtopic.php?t=45689
;
; ==========================================
GPF_SetSingleLine(ObjNum,PosX,PosY,Text,ARGB,UseBlackBG,FontSize,UseBold,FontFamily)
{
static proc_GPSL_SetTextLineData
If ( proc_GPSL_SetTextLineData = "" )
proc_GPSL_SetTextLineData := DllCall("GetProcAddress", uint, DllCall("GetModuleHandle", str, "gpcomms"), str, "GPSL_SetTextLineData")
DllCall(proc_GPSL_SetTextLineData, UChar, ObjNum, "UShort", PosX, "UShort", PosY, "str", GPF_AuxGetFilledStr(Text,False), "UInt", ARGB, "Int", UseBlackBG, "UChar", FontSize, "Int", UseBold, "UChar", FontFamily)
return ErrorLevel
}
; ==========================================
GPF_SetMultiLine(ObjNum,PosX,PosY,Text,ARGB,UseBlackBG,FontSize,UseBold,SizeX,SizeY,FontFamily)
{
static proc_GPML_SetTextMultilineData
If ( proc_GPML_SetTextMultilineData = "" )
proc_GPML_SetTextMultilineData := DllCall("GetProcAddress", uint, DllCall("GetModuleHandle", str, "gpcomms"), str, "GPML_SetTextMultilineData")
DllCall(proc_GPML_SetTextMultilineData, UChar, ObjNum, "UShort", PosX, "UShort", PosY, "str", GPF_AuxGetFilledStr(Text,True), "UInt", ARGB, "Int", UseBlackBG, "UChar", FontSize, "Int", UseBold, "UChar", SizeX, "UChar", SizeY, "UChar", FontFamily)
return ErrorLevel
}
; ==========================================
GPF_ShowSingleLine(ObjNum,ShowText)
{
static proc_GPSL_ShowText
If ( proc_GPSL_ShowText = "" )
proc_GPSL_ShowText := DllCall("GetProcAddress", uint, DllCall("GetModuleHandle", str, "gpcomms"), str, "GPSL_ShowText")
DllCall(proc_GPSL_ShowText, UChar, ObjNum, "Int", ShowText)
return ErrorLevel
}
; ==========================================
GPF_ShowMultiLine(ObjNum,ShowText)
{
static proc_GPML_ShowText
If ( proc_GPML_ShowText = "" )
proc_GPML_ShowText := DllCall("GetProcAddress", uint, DllCall("GetModuleHandle", str, "gpcomms"), str, "GPML_ShowText")
DllCall(proc_GPML_ShowText, UChar, ObjNum, "Int", ShowText)
return ErrorLevel
}
; ==========================================
GPF_SetPicture(FullPath)
{
static proc_GPPIC_LoadNewPicture
If ( proc_GPPIC_LoadNewPicture = "" )
proc_GPPIC_LoadNewPicture := DllCall("GetProcAddress", uint, DllCall("GetModuleHandle", str, "gpcomms"), str, "GPPIC_LoadNewPicture")
DllCall(proc_GPPIC_LoadNewPicture, str, FullPath)
return ErrorLevel
}
; ==========================================
GPF_ShowPicture(ShowPic,PosX,PosY)
{
static proc_GPPIC_ShowPicturePos
If ( proc_GPPIC_ShowPicturePos = "" )
proc_GPPIC_ShowPicturePos := DllCall("GetProcAddress", uint, DllCall("GetModuleHandle", str, "gpcomms"), str, "GPPIC_ShowPicturePos")
DllCall(proc_GPPIC_ShowPicturePos, "Int", ShowPic, "UShort", PosX, "UShort", PosY)
return ErrorLevel
}
; ==========================================
GPF_ShowFPS(bShowFPS)
{
static proc_GPSI_ShowFPS
If ( proc_GPSI_ShowFPS = "" )
proc_GPSI_ShowFPS := DllCall("GetProcAddress", uint, DllCall("GetModuleHandle", str, "gpcomms"), str, "GPSI_ShowFPS")
DllCall(proc_GPSI_ShowFPS, "Int", bShowFPS)
return ErrorLevel
}
; ==========================================
GPF_GetScreenSize(ByRef SizeX,ByRef SizeY)
{
static proc_GPSI_GetScreenSize
If ( proc_GPSI_GetScreenSize = "" )
proc_GPSI_GetScreenSize := DllCall("GetProcAddress", uint, DllCall("GetModuleHandle", str, "gpcomms"), str, "GPSI_GetScreenSize")
DllCall(GPSI_GetScreenSize, "Int *", SizeX, "Int *", SizeY)
return ErrorLevel
}
; ==========================================
GPF_TakeScreenShot(bFormat,SaveFullPath)
{
static proc_GPSS_MakeScreenshot
If ( proc_GPSS_MakeScreenshot = "" )
proc_GPSS_MakeScreenshot := DllCall("GetProcAddress", uint, DllCall("GetModuleHandle", str, "gpcomms"), str, "GPSS_MakeScreenshot")
DllCall(GPSS_MakeScreenshot, "Int *", SizeX, "Int *", SizeY)
return ErrorLevel
}
; ==========================================
GPF_Main()
{
static hModule
If !hModule
hModule := DllCall("LoadLibrary", "str", "gpcomms.dll")
Else
{
temp := hModule
hModule := 0
If ( DllCall("FreeLibrary", "UInt", temp) != 1 )
return -2 ; --- FREE FAIL
Else
return 2 ; ---- FREE SUCCESS
}
If !hModule
return -1 ; --- LOAD FAIL
Else
return 1 ; ---- LOAD SUCCESS
}
; ==========================================
GPF_AuxGetFilledStr(str,multiline)
{
Loop, % ( multiline ? 1023 : 127 ) - StrLen(str)
str .= " "
return str
}
; ==========================================