-
Notifications
You must be signed in to change notification settings - Fork 0
/
unit1.pas
658 lines (559 loc) · 18.9 KB
/
unit1.pas
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
unit Unit1;
{$mode objfpc}{$H+}
interface
uses
Classes, SysUtils, LResources, Forms, Controls, Graphics, Dialogs, StdCtrls,
ComCtrls, ExtCtrls, Buttons, Grids, HlpHashFactory, HlpCRC32Fast, HlpIHash,
Clipbrd, EditBtn, IniPropStorage, Menus, Types, INIFiles;
type
{ TForm1 }
TForm1 = class(TForm)
CheckBox1: TCheckBox;
CheckBox2: TCheckBox;
CheckGroup1: TCheckGroup;
Edit1: TEdit;
GroupBox1: TGroupBox;
GroupBox2: TGroupBox;
GroupBox3: TGroupBox;
GroupBox4: TGroupBox;
GroupBox5: TGroupBox;
GroupBox6: TGroupBox;
GroupBox7: TGroupBox;
GroupBox8: TGroupBox;
ImageList1: TImageList;
IniPropStorage1: TIniPropStorage;
LabeledEdit1: TLabeledEdit;
Memo1: TMemo;
MenuItem1: TMenuItem;
OpenDialog1: TOpenDialog;
PageControl1: TPageControl;
PopupMenu1: TPopupMenu;
ProgressBar1: TProgressBar;
SaveDialog1: TSaveDialog;
SpeedButton1: TSpeedButton;
SpeedButton2: TSpeedButton;
SpeedButton3: TSpeedButton;
SpeedButton4: TSpeedButton;
SpeedButton5: TSpeedButton;
StatusBar1: TStatusBar;
StringGrid1: TStringGrid;
StringGrid2: TStringGrid;
StringGrid3: TStringGrid;
TabSheet1: TTabSheet;
TabSheet2: TTabSheet;
TabSheet3: TTabSheet;
TabSheet4: TTabSheet;
procedure Button1Click(Sender: TObject);
procedure CheckBox1Change(Sender: TObject);
procedure CheckBox2Change(Sender: TObject);
procedure CheckGroup1Click(Sender: TObject);
procedure CheckGroup1ItemClick(Sender: TObject; Index: integer);
procedure FormClose(Sender: TObject; var CloseAction: TCloseAction);
procedure FormCreate(Sender: TObject);
procedure Image1Click(Sender: TObject);
procedure MenuItem1Click(Sender: TObject);
procedure PageControl1Change(Sender: TObject);
procedure PageControl1MouseMove(Sender: TObject; Shift: TShiftState;
X, Y: integer);
procedure SpeedButton1Click(Sender: TObject);
procedure SpeedButton2Click(Sender: TObject);
procedure SpeedButton3Click(Sender: TObject);
procedure SpeedButton4Click(Sender: TObject);
procedure SpeedButton5Click(Sender: TObject);
procedure StringGrid2MouseMove(Sender: TObject; Shift: TShiftState;
X, Y: integer);
procedure StringGrid1Selection(Sender: TObject; aCol, aRow: integer);
procedure HashFile(filename: string);
function getFileHash(filename: string; algo: string): string;
procedure CopyOnSelectSave(Sender: TObject);
procedure StringGrid2Selection(Sender: TObject; aCol, aRow: integer);
procedure StringGrid3CellProcess(Sender: TObject; aCol, aRow: integer;
processType: TCellProcessType; var aValue: string);
procedure StringGrid3Click(Sender: TObject);
procedure StringGrid3DrawCell(Sender: TObject; aCol, aRow: integer;
aRect: TRect; aState: TGridDrawState);
procedure StringGrid3MouseMove(Sender: TObject; Shift: TShiftState;
X, Y: integer);
procedure StringGrid3Selection(Sender: TObject; aCol, aRow: integer);
private
public
end;
const
_config = '.gethash/gethash.conf';
var
Form1: TForm1;
max_checked: shortint;
implementation
{ TForm1 }
procedure TForm1.Button1Click(Sender: TObject);
begin
//Button1.Caption := THashFactory.TCrypto.CreateTiger_5_192().ComputeString('Fish', TEncoding.UTF8).ToString();
// Button1.Caption := THashFactory.TCrypto.CreateGOST3411_2012_256().ComputeFile('/tmp/LibreOffice-mate').ToString();
end;
procedure TForm1.CopyOnSelectSave(Sender: TObject);
var
_ini: TIniFile;
begin
_ini := TIniFile.Create(GetUserDir + PathDelim + _config);
if Checkbox1.Checked then
_ini.WriteString('Settings', 'CopyOnSelect', '1')
else
_ini.WriteString('Settings', 'CopyOnSelect', '0');
_ini.Free;
end;
procedure TForm1.StringGrid2Selection(Sender: TObject; aCol, aRow: integer);
var
Clipboard: TClipboard;
begin
if CheckBox1.Checked and (StringGrid2.Cells[aCol, aRow] <> '') then
begin
Clipboard := TClipboard.Create();
ClipBoard.AsText := StringGrid2.Cells[aCol, aRow];
StatusBar1.SimpleText := 'скопировано в буфер ' +
StringGrid2.Cells[aCol, aRow] + '';
end;
end;
procedure TForm1.CheckBox1Change(Sender: TObject);
begin
CopyOnSelectSave(Sender);
end;
procedure TForm1.CheckBox2Change(Sender: TObject);
var
_ini: TIniFile;
begin
_ini := TIniFile.Create(GetUserDir + PathDelim + _config);
if CheckBox2.Checked then
_ini.WriteBool('Settings', 'SaveCSV', True)
else
_ini.WriteBool('Settings', 'SaveCSV', False);
_ini.Free;
end;
procedure TForm1.CheckGroup1Click(Sender: TObject);
begin
StringGrid1.Clear;
StringGrid2.Clear;
StringGrid3.Clear;
end;
procedure TForm1.CheckGroup1ItemClick(Sender: TObject; Index: integer);
var
_ini: TIniFile;
i: shortint;
begin
_ini := TIniFile.Create(GetUserDir + PathDelim + _config);
if CheckGroup1.Checked[Index] then
_ini.WriteString('Hashes', CheckGroup1.Items.Strings[Index], '1')
else
_ini.WriteString('Hashes', CheckGroup1.Items.Strings[Index], '0');
_ini.Free;
end;
procedure TForm1.FormClose(Sender: TObject; var CloseAction: TCloseAction);
var
i: shortint;
_ini: TIniFile;
begin
_ini := TIniFile.Create(GetUserDir + PathDelim + _config);
for i := 0 to CheckGroup1.Items.Count - 1 do
begin
if CheckGroup1.Checked[i] then
_ini.WriteString('Hashes', CheckGroup1.Items.Strings[i], '1')
else
_ini.WriteString('Hashes', CheckGroup1.Items.Strings[i], '0');
end;
_ini.WriteBool('Settings', 'CopyOnSelect', CheckBox1.Checked);
_ini.WriteBool('Settings', 'SaveCSV', CheckBox2.Checked);
_ini.Free;
end;
procedure TForm1.FormCreate(Sender: TObject);
var
_ini: TINIFile;
i: shortint;
hashes: array of string;
_hashes_name: TStringList;
begin
if FileExists(GetUserDir + PathDelim + _config) then
begin
//заполним из конфига
_ini := TIniFile.Create(GetUserDir + PathDelim + _config);
_hashes_name := TStringList.Create;
_ini.ReadSectionValues('Hashes', _hashes_name);
_hashes_name.Sort;
CheckBox1.Checked := _ini.ReadBool('Settings', 'CopyOnSelect', True);
for i := 0 to _hashes_name.Count - 1 do
if _hashes_name.Strings[i].Split(['='])[1] = '1' then
begin
CheckGroup1.Checked[i] := True;
end;
_hashes_name.Free;
max_checked := 0;
for i := 0 to CheckGroup1.Items.Count - 1 do
begin
if CheckGroup1.Checked[i] then
Inc(max_checked, 1);
end;
CheckBox2.Checked := _ini.ReadBool('Settings', 'SaveCSV', True);
stringGrid1.Clear;
stringGrid2.Clear;
stringGrid3.Clear;
StringGrid3.ColCount := max_checked + 1;
_ini.Free;
end
else
begin
CheckBox1.Checked := True;
CheckBox2.Checked := True;
// just for fun
CheckGroup1.Checked[0]:=true;
CheckGroup1.Checked[1]:=true;
end;
end;
procedure TForm1.Image1Click(Sender: TObject);
begin
end;
procedure TForm1.MenuItem1Click(Sender: TObject);
var
sendername: string;
begin
sendername := ActiveControl.Name;
// Application.MessageBox(pchar(sendername),'',0);
//sendername:=TComponent(Sender).GetParentComponent.name;
case sendername of
'StringGrid1':
begin
SaveDialog1.FileName := 'gethash.csv';
if SaveDialog1.Execute then
if CheckBox2.Checked then
StringGrid1.SaveToCSVFile(SaveDialog1.FileName, ';', True)
else
StringGrid1.SaveToFile(SaveDialog1.FileName);
end;
'StringGrid2':
begin
SaveDialog1.FileName := 'gethash.csv';
if SaveDialog1.Execute then
begin
StringGrid2.InsertRowWithValues(0, [edit1.Text]);
if CheckBox2.Checked then
StringGrid2.SaveToCSVFile(SaveDialog1.FileName, ';', True)
else
StringGrid2.SaveToFile(SaveDialog1.FileName);
StringGrid2.DeleteRow(0);
end;
end;
'StringGrid3':
begin
SaveDialog1.FileName := 'gethash.csv';
if SaveDialog1.Execute then
if CheckBox2.Checked then
StringGrid3.SaveToCSVFile(SaveDialog1.FileName, ';', True)
else
StringGrid3.SaveToFile(SaveDialog1.FileName);
end;
end;
end;
procedure TForm1.PageControl1Change(Sender: TObject);
var
i: byte;
r: byte;
hash_str: string;
crc32: ihash;
begin
if LabeledEdit1.Text = '' then exit;
StringGrid1.Clear;
for i := 0 to CheckGroup1.Items.Count - 1 do
begin
if CheckGroup1.Checked[i] then
// StringGrid1.ColCount:=2;
begin
case CheckGroup1.Items.Strings[i] of
'MD5':
hash_str := THashFactory.TCrypto.CreateMD5().ComputeString(
LabeledEdit1.Text, TEncoding.UTF8).ToString();
'SHA1':
hash_str := THashFactory.TCrypto.CreateSHA1().ComputeString(
LabeledEdit1.Text, TEncoding.UTF8).ToString();
'SHA256':
hash_str := THashFactory.TCrypto.CreateSHA2_256().ComputeString(
LabeledEdit1.Text, TEncoding.UTF8).ToString();
'SHA512':
hash_str := THashFactory.TCrypto.CreateSHA2_512().ComputeString(
LabeledEdit1.Text, TEncoding.UTF8).ToString();
'GOST R34.11-94':
hash_str := THashFactory.TCrypto.CreateGost().ComputeString(
LabeledEdit1.Text, TEncoding.UTF8).ToString();
'GOST R 34.11-2012 256':
hash_str := THashFactory.TCrypto.CreateGOST3411_2012_256().ComputeString(
LabeledEdit1.Text, TEncoding.UTF8).ToString();
'GOST R 34.11-2012 512':
hash_str := THashFactory.TCrypto.CreateGOST3411_2012_512().ComputeString(
LabeledEdit1.Text, TEncoding.UTF8).ToString();
'CRC32':
hash_str := THashFactory.TChecksum.TCRC.CreateCRC32_PKZIP().ComputeString(
LabeledEdit1.Text, TEncoding.UTF8).ToString();
'BLAKE2B 512':
hash_str := THashFactory.TCrypto.CreateBlake2B_512().ComputeString(
LabeledEdit1.Text, TEncoding.UTF8).ToString();
'BLAKE2s 256':
hash_str := THashFactory.TCrypto.CreateBlake2S_256().ComputeString(
LabeledEdit1.Text, TEncoding.UTF8).ToString();
'SHA3-256':
hash_str := THashFactory.TCrypto.CreateSHA3_256().ComputeString(
LabeledEdit1.Text, TEncoding.UTF8).ToString();
'SHA3-512':
hash_str := THashFactory.TCrypto.CreateSHA3_512().ComputeString(
LabeledEdit1.Text, TEncoding.UTF8).ToString();
end;
StringGrid1.InsertRowWithValues(0, [CheckGroup1.Items.Strings[i], hash_str]);
StringGrid1.ColWidths[1] := 600;
{ StringGrid1.ColCount:=2;
StringGrid1.Cells[0,r]:=CheckGroup1.Items.Strings[i];
// StringGrid1.Cells[1,r]
StringGrid1.Cells[1,r]:='hash here';
;//CheckGroup1.Items[i];
}
end;
end;
end;
procedure TForm1.PageControl1MouseMove(Sender: TObject; Shift: TShiftState;
X, Y: integer);
begin
end;
procedure TForm1.HashFile(filename: string);
var
hash_str: string;
i: shortint;
begin
StringGrid2.Clear;
ProgressBar1.Position := 0;
ProgressBar1.Visible := True;
SpeedButton1.Enabled := False;
for i := 0 to CheckGroup1.Items.Count - 1 do
begin
ProgressBar1.Max := max_checked;
if CheckGroup1.Checked[i] then
// StringGrid1.ColCount:=2;
begin
Application.ProcessMessages;
StatusBar1.SimpleText :=
'Идет обработка: ' + CheckGroup1.Items.Strings[i];
{case CheckGroup1.Items.Strings[i] of
'MD5':
hash_str:= THashFactory.TCrypto.CreateMD5().ComputeFile(OpenDialog1.FileName).ToString();
'SHA1':
hash_str:= THashFactory.TCrypto.CreateSHA1().ComputeFile(OpenDialog1.FileName).ToString();
'SHA256':
hash_str:= THashFactory.TCrypto.CreateSHA2_256().ComputeFile(OpenDialog1.FileName).ToString();
'SHA512':
hash_str:= THashFactory.TCrypto.CreateSHA2_512().ComputeFile(OpenDialog1.FileName).ToString();
'GOST R34.11-94':
hash_str:= THashFactory.TCrypto.CreateGost().ComputeFile(OpenDialog1.FileName).ToString();
'GOST R 34.11-2012 256':
hash_str:= THashFactory.TCrypto.CreateGOST3411_2012_256().ComputeFile(OpenDialog1.FileName).ToString();
'GOST R 34.11-2012 512':
hash_str:= THashFactory.TCrypto.CreateGOST3411_2012_512().ComputeFile(OpenDialog1.FileName).ToString();
'CRC32':
hash_str:=THashFactory.TChecksum.TCRC.CreateCRC32_PKZIP().ComputeFile(OpenDialog1.FileName).ToString();
'BLAKE2B 512':
hash_str:= THashFactory.TCrypto.CreateBlake2B_512().ComputeFile(OpenDialog1.FileName).ToString();
'BLAKE2s 256':
hash_str:= THashFactory.TCrypto.CreateBlake2S_256().ComputeFile(OpenDialog1.FileName).ToString();
'SHA3-256':
hash_str:= THashFactory.TCrypto.CreateSHA3_256().ComputeFile(OpenDialog1.FileName).ToString();
'SHA3-512':
hash_str:= THashFactory.TCrypto.CreateSHA3_512().ComputeFile(OpenDialog1.FileName).ToString();
end;}
hash_str := getFileHash(OpenDialog1.FileName, CheckGroup1.Items.Strings[i]);
ProgressBar1.Position := ProgressBar1.Position + 1;
StringGrid2.InsertRowWithValues(0, [CheckGroup1.Items.Strings[i], hash_str]);
StringGrid2.ColWidths[1] := 600;
end;
end;
StatusBar1.SimpleText := 'Подсчет закончен';
SpeedButton1.Enabled := True;
ProgressBar1.Visible := False;
end;
procedure TForm1.StringGrid3CellProcess(Sender: TObject; aCol, aRow: integer;
processType: TCellProcessType; var aValue: string);
begin
end;
procedure TForm1.StringGrid3Click(Sender: TObject);
begin
end;
procedure TForm1.StringGrid3DrawCell(Sender: TObject; aCol, aRow: integer;
aRect: TRect; aState: TGridDrawState);
begin
if StringGrid3.RowCount > 1 then
SpeedButton5.Enabled := True
else
SpeedButton5.Enabled := False;
end;
procedure TForm1.StringGrid3MouseMove(Sender: TObject; Shift: TShiftState;
X, Y: integer);
var
Col, Row: integer;
begin
StringGrid2.MouseToCell(X, Y, Col, Row);
if (Row >= 0) and (Col >= 0) and (StringGrid2.Hint <>
StringGrid2.Cells[Col, Row]) then
begin
Application.CancelHint;
StringGrid2.Hint := StringGrid2.Cells[Col, Row];
end;
end;
procedure TForm1.StringGrid3Selection(Sender: TObject; aCol, aRow: integer);
var
clipboard: TClipboard;
begin
if (CheckBox1.Checked) and (aCol >= 1) and (StringGrid3.Cells[aCol, aRow] <> '') then
begin
Clipboard := TClipboard.Create();
ClipBoard.AsText := StringGrid3.Cells[aCol, aRow];
StatusBar1.SimpleText := 'скопировано в буфер ' +
StringGrid3.Cells[aCol, aRow] + '';
end;
end;
procedure TForm1.SpeedButton1Click(Sender: TObject);
begin
if OpenDialog1.Execute then
begin
Edit1.Caption := OpenDialog1.FileName;
HashFile(OpenDialog1.FileName);
end;
end;
procedure TForm1.SpeedButton2Click(Sender: TObject);
var
oldOptions: TOpenOptions;
i: integer;
hashes: array of string;
begin
StringGrid3.FixedCols := 0;
StringGrid3.RowCount := 1;
SetLength(hashes, 1);
hashes[0] := 'Filename';
for i := 0 to CheckGroup1.Items.Count - 1 do
begin
if CheckGroup1.Checked[i] then
SetLength(hashes, Length(hashes) + 1);
hashes[High(hashes)] := CheckGroup1.Items.Strings[i];
end;
//StringGrid3.Row:=Length(hashes)+1;
StringGrid3.InsertRowWithValues(0, hashes);
oldOptions := OpenDialog1.Options;
OpenDialog1.Options := [ofAllowMultiSelect, ofEnableSizing, ofViewDetail];
if OpenDialog1.Execute then
begin
for i := 0 to OpenDialog1.Files.Count - 1 do
begin
StringGrid3.InsertRowWithValues(1, [OpenDialog1.Files[i]]);
end;
end;
StringGrid3.FixedRows := 1;
StringGrid3.RowCount := OpenDialog1.Files.Count + 1;
OpenDialog1.Options := oldOptions;
SpeedButton3.Enabled := True;
SpeedButton4.Enabled := True;
end;
procedure TForm1.SpeedButton3Click(Sender: TObject);
begin
StringGrid3.DeleteRow(StringGrid3.row);
end;
procedure TForm1.SpeedButton4Click(Sender: TObject);
begin
StringGrid3.Clear;
SpeedButton3.Enabled := False;
SpeedButton4.Enabled := False;
SpeedButton5.Enabled := False;
end;
function TForm1.getFileHash(filename: string; algo: string): string;
var
hash_str: string;
begin
case algo of
'MD5':
hash_str := THashFactory.TCrypto.CreateMD5().ComputeFile(filename).ToString();
'SHA1':
hash_str := THashFactory.TCrypto.CreateSHA1().ComputeFile(filename).ToString();
'SHA256':
hash_str := THashFactory.TCrypto.CreateSHA2_256().ComputeFile(
filename).ToString();
'SHA512':
hash_str := THashFactory.TCrypto.CreateSHA2_512().ComputeFile(
filename).ToString();
'GOST R34.11-94':
hash_str := THashFactory.TCrypto.CreateGost().ComputeFile(filename).ToString();
'GOST R 34.11-2012 256':
hash_str := THashFactory.TCrypto.CreateGOST3411_2012_256().ComputeFile(
filename).ToString();
'GOST R 34.11-2012 512':
hash_str := THashFactory.TCrypto.CreateGOST3411_2012_512().ComputeFile(
filename).ToString();
'CRC32':
hash_str := THashFactory.TChecksum.TCRC.CreateCRC32_PKZIP().ComputeFile(
filename).ToString();
'BLAKE2B 512':
hash_str := THashFactory.TCrypto.CreateBlake2B_512().ComputeFile(
filename).ToString();
'BLAKE2s 256':
hash_str := THashFactory.TCrypto.CreateBlake2S_256().ComputeFile(
filename).ToString();
'SHA3-256':
hash_str := THashFactory.TCrypto.CreateSHA3_256().ComputeFile(
filename).ToString();
'SHA3-512':
hash_str := THashFactory.TCrypto.CreateSHA3_512().ComputeFile(
filename).ToString();
end;
Result := hash_str;
end;
procedure TForm1.SpeedButton5Click(Sender: TObject);
var
x, i: integer;
begin
ProgressBar1.Visible := True;
ProgressBar1.Max := StringGrid3.RowCount - 1;
for i := 1 to StringGrid3.RowCount - 1 do
begin
// Application.MessageBox(pchar(inttostr(i)),'',0);
//имя файла
ProgressBar1.Position := ProgressBar1.Position + 1;
for x := 1 to StringGrid3.ColCount - 1 do
begin
Application.ProcessMessages;
StatusBar1.SimpleText :=
'Идет обработка файла: ' +
ExtractFileName(StringGrid3.Cells[0, i]) + ' (' + StringGrid3.Cells[x, 0] + ')';
StringGrid3.Cells[x, i] :=
getFileHash(StringGrid3.Cells[0, i], StringGrid3.Cells[x, 0]);
end;
end;
ProgressBar1.Visible := False;
StatusBar1.SimpleText := 'Обработка закончена';
end;
procedure TForm1.StringGrid2MouseMove(Sender: TObject; Shift: TShiftState;
X, Y: integer);
var
Row: integer;
Col: integer;
begin
StringGrid2.MouseToCell(X, Y, Col, Row);
if (Row >= 0) and (Col >= 0) and (StringGrid2.Hint <>
StringGrid2.Cells[Col, Row]) then
begin
Application.CancelHint;
StringGrid2.Hint := StringGrid2.Cells[Col, Row];
end;
end;
procedure TForm1.StringGrid1Selection(Sender: TObject; aCol, aRow: integer);
var
Clipboard: TClipboard;
begin
if CheckBox1.Checked then
begin
Clipboard := TClipboard.Create();
ClipBoard.AsText := StringGrid1.Cells[aCol, aRow];
StatusBar1.SimpleText := 'скопировано в буфер ' +
StringGrid1.Cells[aCol, aRow] + '';
end;
end;
initialization
{$I unit1.lrs}
end.