forked from Ox18/cheatmatrix-gunbound
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSplashScreen.pas
More file actions
248 lines (216 loc) · 6.92 KB
/
SplashScreen.pas
File metadata and controls
248 lines (216 loc) · 6.92 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
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
unit SplashScreen;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
jpeg, ExtCtrls, StdCtrls, Gauges, Utils, OleCtrls, ComCtrls, XPMan, CommCtrl,
Menus, ShellApi, IdBaseComponent, IdComponent, IdTCPConnection, IdTCPClient,
IdHTTP, IdAntiFreezeBase, IdAntiFreeze;
type
TSplash = class(TForm)
painelAtivacao: TPanel;
campoSenha: TEdit;
Label3: TLabel;
Label2: TLabel;
campoUser: TEdit;
Label1: TLabel;
campoCodigo: TEdit;
Panel2: TPanel;
Shape1: TShape;
Panel4: TPanel;
Shape2: TShape;
lblSplashStatus: TLabel;
Panel1: TPanel;
Image1: TImage;
pParcial: TGauge;
geralBar: TGauge;
Timer1: TTimer;
PopupMenu1: TPopupMenu;
Cancelar1: TMenuItem;
TimerAnime: TTimer;
Label4: TLabel;
Panel3: TPanel;
IdHTTP2: TIdHTTP;
Panel5: TPanel;
pTotal: TGauge;
IdAntiFreeze1: TIdAntiFreeze;
procedure Cancelar1Click(Sender: TObject);
//procedure Timer1Timer(Sender: TObject);
procedure FormCreate(Sender: TObject);
procedure Image1MouseDown(Sender: TObject; Button: TMouseButton;
Shift: TShiftState; X, Y: Integer);
procedure Panel2MouseDown(Sender: TObject; Button: TMouseButton;
Shift: TShiftState; X, Y: Integer);
procedure TimerAnimeTimer(Sender: TObject);
procedure Panel2MouseUp(Sender: TObject; Button: TMouseButton;
Shift: TShiftState; X, Y: Integer);
procedure Panel2Click(Sender: TObject);
procedure Label4Click(Sender: TObject);
procedure Panel3Click(Sender: TObject);
procedure IdHTTP2Work(ASender: TObject; AWorkMode: TWorkMode;
AWorkCount: Int64);
procedure IdHTTP2WorkBegin(ASender: TObject; AWorkMode: TWorkMode;
AWorkCountMax: Int64);
procedure IdHTTP2WorkEnd(ASender: TObject; AWorkMode: TWorkMode);
private
{ Private declarations }
public
{ Public declarations }
tini,tfim,tres:integer;
end;
Procedure ChangeSplash(Texto: AnsiString);
procedure SetProgress(index: integer; valor: cardinal);
procedure telaAtivacao;
var
Splash: TSplash;
SplashAtivar: TSplash;
totalBaixados, totalAtual, totalGeral: Int64;
implementation
{$R *.dfm}
uses constantes, Inicializador;
procedure SetProgress(index: integer; valor: cardinal);
begin
if index = 1 then
Splash.pParcial.Progress := valor;
if index = 2 then
Splash.pTotal.Progress := valor;
end;
//uses UnitMatriz;
{procedure TSplash.Timer1Timer(Sender: TObject);
begin
lblSplashStatus.Caption := SplashStatus;
lblSplashStatus.Left:= (Splash.Width-Label1.Width) div 2;
lblSplashStatus.Refresh;
Update;
end; }
Procedure ChangeSplash(Texto: AnsiString);
begin
Splash.lblSplashStatus.Caption := Texto;
Splash.lblSplashStatus.Left:= (Splash.Width - Splash.lblSplashStatus.Width) div 2;
Splash.lblSplashStatus.Refresh;
Splash.Update;
end;
procedure TSplash.Cancelar1Click(Sender: TObject);
begin
ExitProcess(0);
end;
procedure TSplash.FormCreate(Sender: TObject);
begin
DoubleBuffered := true;
painelAtivacao.DoubleBuffered := true;
Panel4.DoubleBuffered := true;
//SetWindowLong(Handle, GWL_EXSTYLE, GetWindowLong(Handle, GWL_EXSTYLE) or WS_EX_LAYERED);
//SetLayeredWindowAttributes(Handle, ColorToRGB($00A8A3A1), 0, LWA_COLORKEY);
//ProgressBar1.Brush.Color := $00454545;
// Set Bar color
//SendMessage(ProgressBar1.Handle, PBM_SETBARCOLOR, 0, clAqua) ;
//ShowWindow(Application.Handle, SW_HIDE) ;
//SetWindowLong(Application.Handle, GWL_EXSTYLE, getWindowLong(Application.Handle, GWL_EXSTYLE) or WS_EX_TOOLWINDOW) ;
//ShowWindow(Application.Handle, SW_SHOW) ;
//Caption := '';
//SetWindowText(handle,'');
tini:=GetTickCount;
end;
procedure TSplash.IdHTTP2Work(ASender: TObject; AWorkMode: TWorkMode;
AWorkCount: Int64);
begin
if (AWorkMode = wmRead) and (totalGeral > 0) then
begin
totalBaixados := AWorkCount;
Splash.pTotal.Progress := AWorkCount+totalAtual;
Splash.pParcial.Progress := AWorkCount;
end;
end;
procedure TSplash.IdHTTP2WorkBegin(ASender: TObject; AWorkMode: TWorkMode;
AWorkCountMax: Int64);
begin
if (AWorkMode = wmRead) and (totalGeral > 0) then
begin
Splash.pParcial.Progress := 0;
Splash.pParcial.MaxValue := AWorkCountMax;
Splash.pTotal.MaxValue := totalGeral;
end;
end;
procedure TSplash.IdHTTP2WorkEnd(ASender: TObject; AWorkMode: TWorkMode);
begin
if (AWorkMode = wmRead) and (totalGeral > 0) then
begin
Splash.pTotal.Progress := totalBaixados + totalAtual;
totalAtual := totalAtual + Splash.pParcial.MaxValue;
Splash.pParcial.Progress := Splash.pParcial.MaxValue;
end;
end;
procedure TSplash.Image1MouseDown(Sender: TObject; Button: TMouseButton;
Shift: TShiftState; X, Y: Integer);
const
SC_DragMove = $F012; { a magic number }
begin
//////{$I VMProtectBegin.inc}
ReleaseCapture;
Splash.Perform(WM_SysCommand, SC_DragMove, 0);
end;
procedure TSplash.Label4Click(Sender: TObject);
var p: pchar;
pansi: AnsiString;
begin
pansi := Constante(0064, false)+Constante(0090, false);
p := CMPchar(pansi);
ShellExecute(0, nil, p, '', '', 0);
end;
procedure TSplash.Panel2Click(Sender: TObject);
begin
// Enviar dados
ChangeSplash( Constante(0012, true) );
ativarCMX(campoUser.Text, campoSenha.Text, campoCodigo.Text);
end;
procedure TSplash.Panel2MouseDown(Sender: TObject; Button: TMouseButton;
Shift: TShiftState; X, Y: Integer);
begin
TPanel(Sender).BevelInner := bvLowered;
end;
procedure TSplash.Panel2MouseUp(Sender: TObject; Button: TMouseButton;
Shift: TShiftState; X, Y: Integer);
begin
TPanel(Sender).BevelInner := bvRaised;
end;
procedure TSplash.Panel3Click(Sender: TObject);
begin
close;
end;
var mostrarTela: boolean = false;
const ativacaoATop: integer = 144;
ativacaoDTop: integer = 4;
ativacaoLeft: integer = 12;
procedure telaAtivacao;
begin
mostrarTela := not mostrarTela;
end;
procedure TSplash.TimerAnimeTimer(Sender: TObject);
begin
if mostrarTela then
begin
if (not painelAtivacao.Visible) then
begin
Height := 300;
painelAtivacao.Visible := true;
end else
begin
if (painelAtivacao.Top < ativacaoATop) then
begin
painelAtivacao.Top := painelAtivacao.Top + 4;
end;
end;
end else
begin
if (painelAtivacao.Top > ativacaoDTop) then
begin
painelAtivacao.Top := painelAtivacao.Top - 4;
end else
begin
if painelAtivacao.Visible then
painelAtivacao.Visible := false;
Height := 150;
end;
end;
end;
end.
Font.Color = clWhite