-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathrawwrite.pas
761 lines (692 loc) · 21.3 KB
/
rawwrite.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
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
unit rawwrite;
interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
StdCtrls, ComCtrls, ExtCtrls, BlockDev;
const
DebugHigh = 0;
DebugOff = 0;
DebugLow = 0;
type
TMainForm = class(TForm)
Label2: TLabel;
StatusBar1: TStatusBar;
FloppyImage: TImage;
DriveComboBox: TComboBox;
Label3: TLabel;
Label4: TLabel;
Label5: TLabel;
ExitButton: TButton;
PageControl1: TPageControl;
TabSheet1: TTabSheet;
TabSheet2: TTabSheet;
Label1: TLabel;
FileNameEdit: TEdit;
BrowseWriteButton: TButton;
OpenDialog1: TOpenDialog;
DebugMemo: TMemo;
WriteButton: TButton;
Label7: TLabel;
ReadFileNameEdit: TEdit;
BrowseReadButton: TButton;
ReadButton: TButton;
SaveDialog1: TSaveDialog;
TabSheet3: TTabSheet;
Memo1: TMemo;
Label8: TLabel;
Label9: TLabel;
TabSheet4: TTabSheet;
Label10: TLabel;
Label11: TLabel;
WriteCopyEdit: TEdit;
UpDown1: TUpDown;
TabSheet5: TTabSheet;
Memo2: TMemo;
TabSheet6: TTabSheet;
Label12: TLabel;
Label6: TLabel;
Label13: TLabel;
Label14: TLabel;
Version: TLabel;
procedure BrowseWriteButtonClick(Sender: TObject);
procedure FormCreate(Sender: TObject);
procedure DriveComboBoxDrawItem(Control: TWinControl; Index: Integer;
Rect: TRect; State: TOwnerDrawState);
procedure WriteButtonClick(Sender: TObject);
procedure Label5Click(Sender: TObject);
procedure ExitButtonClick(Sender: TObject);
procedure Label3DblClick(Sender: TObject);
procedure BrowseReadButtonClick(Sender: TObject);
procedure ReadButtonClick(Sender: TObject);
procedure TabSheet3Show(Sender: TObject);
procedure TabSheet5Show(Sender: TObject);
procedure FileNameEditKeyPress(Sender: TObject; var Key: Char);
procedure FormShow(Sender: TObject);
private
{ Private declarations }
OSis95 : Boolean;
procedure Find95Floppy;
procedure FindNTFloppy;
public
{ Public declarations }
procedure FindFloppy;
procedure Wait;
procedure UnWait;
end;
var
MainForm: TMainForm;
function ReadFile2(hFile: THandle; Buffer : Pointer; nNumberOfBytesToRead: DWORD;
var lpNumberOfBytesRead: DWORD; lpOverlapped: POverlapped): BOOL; stdcall;
function WriteFile2(hFile: THandle; Buffer : Pointer; nNumberOfBytesToWrite: DWORD;
var lpNumberOfBytesWritten: DWORD; lpOverlapped: POverlapped): BOOL; stdcall;
procedure Debug(Str : String; Level : Integer);
implementation
uses DiskIO, ShellAPI;
{$R *.DFM}
function ReadFile2; external kernel32 name 'ReadFile';
function WriteFile2; external kernel32 name 'WriteFile';
procedure Debug(Str : String; Level : Integer);
begin
MainForm.DebugMemo.Lines.Add(Str);
end;
procedure TMainForm.Wait;
begin
Screen.Cursor := crHourGlass;
end;
procedure TMainForm.UnWait;
begin
Screen.Cursor := crDefault;
end;
procedure TMainForm.BrowseWriteButtonClick(Sender: TObject);
begin
OpenDialog1.FileName := FileNameEdit.Text;
if OpenDialog1.Execute then
begin
FileNameEdit.Text := OpenDialog1.FileName;
end;
end;
procedure TMainForm.FormCreate(Sender: TObject);
var
Version : TOSVersionInfo;
VersionString : String;
CommandLine : Boolean;
CmdRead : Boolean;
CmdCopies : Integer;
CmdImage : String;
CmdDrive : Integer;
i : Integer;
begin
// Prevent error messages being displayed by NT
SetErrorMode(SEM_FAILCRITICALERRORS);
{ if AUTOUPDATE_VERSION < 102 then
begin
ShowMessage('AUTOUPDATE_VERSION is too old');
end;}
// what OS
Version.dwOSVersionInfoSize := Sizeof(Version);
if GetVersionEx(Version) then
begin
case Version.dwPlatformId of
VER_PLATFORM_WIN32s : VersionString := 'WIN32s';
VER_PLATFORM_WIN32_WINDOWS : VersionString := 'Windows 95';
VER_PLATFORM_WIN32_NT : VersionString := 'Windows NT';
else
VersionString := 'Unknown OS';
end;
VersionString := VersionString + ' ' + IntToStr(Version.dwMajorVersion) +
'.' + IntToStr(Version.dwMinorVersion) +
' build number ' + IntToStr(Version.dwBuildNumber);
StatusBar1.Panels[2].Text := VersionString;
if Version.dwPlatformId = VER_PLATFORM_WIN32_WINDOWS then
begin
OSis95 := True;
end
else
begin
OSis95 := False;
end;
end
else
begin
MessageDlg('Could not get Version info!', mtError, [mbOK], 0);
end;
FindFloppy;
if DriveComboBox.Items.Count > 0 then
begin
DriveComboBox.ItemIndex := 0;
end
else
begin
MessageDlg('No Floppy drives found', mtInformation, [mbOK], 0);
end;
if OSis95 then
begin
if not FileExists('diskio.dll') then
begin
{ if MessageDlg('You seem to be missing diskio.dll. RawWrite can automaticly download it for you. Do you want to download it now?', mtConfirmation, [mbYes, mbNo], 0) = mrYes then
begin
AutoUpdate1.GetFile('diskio.dll');
end;}
ShowMessage('You seem to be missing diskio.dll.');
end;
end;
PageControl1.ActivePage := TabSheet1;
if ParamCount > 0 then
begin
CommandLine := True;
CmdRead := False;
CmdCopies := 1;
CmdDrive := 0;
i := 1;
while i <= ParamCount do
begin
if ParamStr(i) = '--read' then
begin
Inc(i);
CmdRead := True;
end
else if ParamStr(i) = '--write' then
begin
Inc(i);
CmdRead := False;
end
else if ParamStr(i) = '--copies' then
begin
Inc(i);
CmdCopies := StrToIntDef(ParamStr(i), 1);
Inc(i);
end
else if ParamStr(i) = '--drive' then
begin
Inc(i);
CmdDrive := StrToIntDef(ParamStr(i), 0);
Inc(i);
end
else
begin
if Pos('--', ParamStr(i)) = 1 then
begin
// unknown command
MessageDlg('Unknown command line option ''' + ParamStr(i) + '''', mtError, [mbOK], 0);
break;
end
else
begin
CmdImage := ParamStr(i);
break;
end;
end;
end;
// check command line parameters
// [--write] [--copies n] [--drive \\.\a:] file.img
// --read [--drive 0|1|...] file.img
if CmdRead then
begin
try
// do a command line read
ReadFileNameEdit.Text := CmdImage;
DriveComboBox.ItemIndex := CmdDrive;
ReadButtonClick(ReadButton);
except
on E : Exception do
begin
MessageDlg(E.Message, mtError, [mbOK], 0);
end;
end;
Application.Terminate;
end
else
begin
// do a command line write
try
WriteCopyEdit.Text := IntToStr(CmdCopies);
FileNameEdit.Text := CmdImage;
DriveComboBox.ItemIndex := CmdDrive;
WriteButtonClick(WriteButton);
except
on E : Exception do
begin
MessageDlg(E.Message, mtError, [mbOK], 0);
end;
end;
Application.Terminate;
end;
end
else
begin
CommandLine := False;
end;
end;
procedure TMainForm.FindFloppy;
begin
if OSis95 then
begin
Find95Floppy;
end
else
begin
FindNTFloppy;
end;
end;
procedure TMainForm.Find95Floppy;
begin
// just add a and b ...? at least for now
DriveComboBox.Items.Add('A:');
DriveComboBox.Items.Add('B:');
end;
procedure TMainForm.FindNTFloppy;
var
Drive : Char;
h : THandle;
FileName : String;
Error : DWORD;
begin
for Drive := 'A' to 'B' do
begin
FileName := '\\.\' + Drive + ':';
h := CreateFile(PChar(FileName), GENERIC_READ, FILE_SHARE_READ, nil, OPEN_EXISTING, 0, 0);
if h <> INVALID_HANDLE_VALUE then
begin
DriveComboBox.Items.Add(FileName);
CloseHandle(h);
end
else
begin
Error := GetLastError;
if Error = 21 then
begin
DriveComboBox.Items.Add(FileName);
end
else
begin
Debug(FileName, DebugLow);
Debug(IntToStr(Error) + #10 + SysErrorMessage(Error), DebugLow);
end;
end;
end;
end;
procedure TMainForm.DriveComboBoxDrawItem(Control: TWinControl;
Index: Integer; Rect: TRect; State: TOwnerDrawState);
begin
with Control as TComboBox do
begin
// draw the icon
Canvas.Draw(Rect.Left + 2, Rect.Top + 3, FloppyImage.Picture.Graphic);
Canvas.TextOut(Rect.Left + 20, Rect.Top, Items[Index]);
end;
end;
procedure TMainForm.WriteButtonClick(Sender: TObject);
var
h1 : THandle;
Buffer : String;
Read : DWORD;
Written : DWORD;
Blocks : Integer;
WrittenBlocks : Integer;
BlocksCount : Integer;
BlocksRemaining : Integer;
BlockCount : Integer;
FileSize : Integer;
CopiesRemaining : Integer;
Device : TBlockDevice;
Zero : _Large_Integer;
DiskSize : _Large_Integer;
HadError : Boolean;
DiskNumber : Integer;
Error : DWORD;
begin
if DriveComboBox.ItemIndex < 0 then
begin
MessageDlg('Please Select a disk drive', mtWarning, [mbOK], 0);
exit;
end;
if Length(FileNameEdit.Text) = 0 then
begin
BrowseWriteButtonClick(BrowseWriteButton);
end;
HadError := False;
Wait;
try
CopiesRemaining := UpDown1.Position;
DiskNumber := 0;
while CopiesRemaining > 0 do
begin
DiskNumber := DiskNumber + 1;
StatusBar1.Panels[1].Text := 'Disk ' + IntToStr(DiskNumber) + ' of ' + IntToStr(UpDown1.Position);
CopiesRemaining := CopiesRemaining - 1;
BlocksCount := 64;
// make sure that the file exists...
h1 := CreateFile(PChar(FileNameEdit.Text), GENERIC_READ, FILE_SHARE_READ, nil, OPEN_EXISTING, 0, 0);
if h1 <> INVALID_HANDLE_VALUE then
try
FileSize := GetFileSize(h1, nil);
if FileSize = 0 then
begin
raise Exception.Create('File ' + FileNameEdit.Text + ' is 0 bytes long');
end;
Blocks := FileSize div 512;
if (Blocks * 512) < FileSize then
begin
Blocks := Blocks + 1;
end;
WrittenBlocks := 0;
SetLength(Buffer, 512 * BlocksCount);
// open the drive
if osIs95 then
begin
Device := TWin95Disk.Create;
TWin95Disk(Device).SetDiskNumber(DriveComboBox.ItemIndex);
TWin95Disk(Device).SetOffset(0);
// read the 1st sector to settle the disk...
try
Device.ReadPhysicalSector(1, 1, PChar(Buffer));
except
end;
TWin95Disk(Device).SetOffset(0);
end
else
begin
Zero.Quadpart := 0;
DiskSize.Quadpart := 512 * 80 * 2 * 18;
Device := TNTDisk.Create;
TNTDisk(Device).SetFileName(DriveComboBox.Text);
TNTDisk(Device).SetMode(True);
TNTDisk(Device).SetPartition(Zero, DiskSize);
end;
if Device.Open then
try
try
// write away...
while WrittenBlocks < Blocks do
begin
BlocksRemaining := Blocks - WrittenBlocks;
if BlocksRemaining > BlocksCount then
begin
BlockCount := BlocksCount;
end
else
begin
BlockCount := BlocksRemaining;
end;
ReadFile2(h1, PChar(Buffer), 512 * BlockCount, Read, nil);
if Read = 0 then break;
Device.WritePhysicalSector(WrittenBlocks, BlockCount, PChar(Buffer));
WrittenBlocks := WrittenBlocks + BlockCount;
StatusBar1.Panels[0].Text := IntToStr((WrittenBlocks * 100) div Blocks) + '%';
Application.ProcessMessages;
end;
except
on E : Exception do
begin
MessageDlg(E.Message, mtError, [mbOK], 0);
HadError := True;
end;
end;
finally
Device.Close;
Device.Free;
end
else
begin
Error := GetLastError;
MessageDlg('Error ' + IntToStr(GetLastError) + ' opening floppy device'#10 + SysErrorMessage(Error) , mtError, [mbOK], 0);
HadError := True;
end;
finally
CloseHandle(h1);
end
else
begin
Error := GetLastError;
MessageDlg('Error ' + IntToStr(GetLastError) + ' opening image file ''' + FileNameEdit.Text + ''''#10 + SysErrorMessage(Error) , mtError, [mbOK], 0);
HadError := True;
end;
if CopiesRemaining > 0 then
begin
if HadError then
begin
if MessageDlg('The image was not successfully written. Do you want to continue with the remaining ' + IntToStr(CopiesRemaining) + ' copies?', mtConfirmation, [mbYes, mbNo], 0) = mrNo then
begin
CopiesRemaining := 0;
end
else
begin
HadError := False;
end;
end
else
begin
if MessageDlg('Image successfully written. Insert next disk', mtInformation, [mbOK, mbCancel], 0) = mrCancel then
begin
CopiesRemaining := 0;
end;
end;
end
else
begin
if HadError then
begin
MessageDlg('Image was not successfully written.', mtError, [mbOK], 0);
end
else
begin
MessageDlg('Image successfully written.', mtInformation, [mbOK], 0);
end;
end;
end;
finally
UnWait;
end;
end;
procedure TMainForm.Label5Click(Sender: TObject);
begin
ShellExecute(Handle, 'open', PChar(TLabel(Sender).Caption), nil, nil, SW_SHOWNORMAL)
end;
procedure TMainForm.ExitButtonClick(Sender: TObject);
begin
Close;
end;
procedure TMainForm.Label3DblClick(Sender: TObject);
begin
// This will enable the original write code
DebugMemo.Visible := True;
// WriteButton.Visible := True;
end;
procedure TMainForm.BrowseReadButtonClick(Sender: TObject);
begin
SaveDialog1.FileName := ReadFileNameEdit.Text;
if SaveDialog1.Execute then
begin
ReadFileNameEdit.Text := SaveDialog1.FileName;
end;
end;
procedure TMainForm.ReadButtonClick(Sender: TObject);
var
h1 : THandle;
Buffer : String;
Read : DWORD;
Written : DWORD;
Blocks : Integer;
WrittenBlocks : Integer;
BlocksCount : Integer;
BlocksRemaining : Integer;
BlockCount : Integer;
FileSize : Integer;
Device : TBlockDevice;
Zero : _Large_Integer;
DiskSize : _Large_Integer;
Error : DWORD;
begin
if DriveComboBox.ItemIndex < 0 then
begin
MessageDlg('Please Select a disk drive', mtWarning, [mbOK], 0);
exit;
end;
Wait;
try
BlocksCount := 64;
// make sure that the file exists...
h1 := CreateFile(PChar(ReadFileNameEdit.Text), GENERIC_WRITE, 0, nil, CREATE_ALWAYS, 0, 0);
if h1 <> INVALID_HANDLE_VALUE then
try
// we need to read until the end of the disk
// all data gets written to the file...
{ FileSize := GetFileSize(h1, nil);
Blocks := FileSize div 512;
if (Blocks * 512) < FileSize then
begin
Blocks := Blocks + 1;
end;}
WrittenBlocks := 0;
Blocks := 2880; // no of 512 blocks on a 1.44 (= 80 * 2 * 18)
SetLength(Buffer, 512 * BlocksCount);
// open the drive
if osIs95 then
begin
Device := TWin95Disk.Create;
TWin95Disk(Device).SetDiskNumber(DriveComboBox.ItemIndex);
TWin95Disk(Device).SetOffset(0);
// read the 1st sector to settle the disk...
try
Device.ReadPhysicalSector(1, 1, PChar(Buffer));
except
end;
end
else
begin
Zero.Quadpart := 0;
DiskSize.Quadpart := 512 * 80 * 2 * 18;
Device := TNTDisk.Create;
TNTDisk(Device).SetFileName(DriveComboBox.Text);
TNTDisk(Device).SetMode(True);
TNTDisk(Device).SetPartition(Zero, DiskSize);
end;
if Device.Open then
try
// write away...
while WrittenBlocks < Blocks do
begin
BlocksRemaining := Blocks - WrittenBlocks;
if BlocksRemaining > BlocksCount then
begin
BlockCount := BlocksCount;
end
else
begin
BlockCount := BlocksRemaining;
end;
Device.ReadPhysicalSector(WrittenBlocks, BlockCount, PChar(Buffer));
WriteFile2(h1, PChar(Buffer), 512 * BlockCount, Read, nil);
// if Read = 0 then break;
// Device.WritePhysicalSector(WrittenBlocks, BlockCount, PChar(Buffer));
WrittenBlocks := WrittenBlocks + BlockCount;
StatusBar1.Panels[0].Text := IntToStr((WrittenBlocks * 100) div Blocks) + '%';
Application.ProcessMessages;
end;
finally
Device.Close;
Device.Free;
end
else
begin
Error := GetLastError;
MessageDlg('Error (' + IntToStr(GetLastError) + ')'#10 + SysErrorMessage(Error) , mtError, [mbOK], 0);
end;
finally
CloseHandle(h1);
end
else
begin
Error := GetLastError;
MessageDlg('Error (' + IntToStr(GetLastError) + ')'#10 + SysErrorMessage(Error) , mtError, [mbOK], 0);
end;
finally
UnWait;
end;
end;
procedure TMainForm.TabSheet3Show(Sender: TObject);
begin
Memo1.Text :=
'RawWrite for windows version ' + Version.Caption + #13#10+
'Written by John Newbigin'#13#10+
'Copyright (C) 2000 John Newbigin'#13#10+
''#13#10+
'Under 95, this program requires diskio.dll.'#13#10+
''#13#10+
'This program is a replacement for the traditional command'#13#10+
'line rawrite. This version works under Windows NT 4, and'#13#10+
'derived versions like Windows 2000 and Windows XP. It'#13#10+
'also works under Windows 95 and derived versions like'#13#10+
'Windows 98 and Windows ME.'#13#10+
''#13#10+
'It should be very easy to use, just select the drive you want'#13#10+
'to use, select the image file and hit read or write.'#13#10+
''#13#10+
'This verson supports reading an image from a disk. Only'#13#10+
'1.44 disks is supported at this time. Writing to 1.2 drives'#13#10+
'might work.'#13#10+
''#13#10+
'Other disk sizes are not supported because this application'#13#10+
'does not format the disks it just reads and writes it. If'#13#10+
'you want to use a non-standard disk size, you will need'#13#10+
'another tool.'#13#10+
''#13#10+
'Copyright'#13#10+
'========='#13#10+
'This program is free software; you can redistribute it and/or'#13#10+
'modify it under the terms of the GNU General Public License'#13#10+
'as published by the Free Software Foundation; either'#13#10+
'version 2 of the License, or (at your option) any later'#13#10+
'version.'#13#10+
''#13#10+
'This program is distributed in the hope that it will be useful,'#13#10+
'but WITHOUT ANY WARRANTY; without even the implied'#13#10+
'warranty of MERCHANTABILITY or FITNESS FOR A'#13#10+
'PARTICULAR PURPOSE. See the GNU General Public'#13#10+
'License for more details.'#13#10+
''#13#10+
'You should have received a copy of the GNU General'#13#10+
'Public License along with this program; if not, write to the'#13#10+
'Free Software Foundation, Inc., 675 Mass Ave, Cambridge,'#13#10+
'MA 02139, USA.'
end;
procedure TMainForm.TabSheet5Show(Sender: TObject);
begin
Memo2.Text :=
'Command Line Parameters'#13#10+
'======================='#13#10+
'This version supports command line parameters.'#13#10+
''#13#10+
'To write an image, the command is'#13#10+
'rawwritewin [--write] [--copies n] [--drive driveno] file.img'#13#10+
''#13#10+
'To read an image, the command is'#13#10+
'rawwritewin --read [--drive driveno] file.img'#13#10+
'If file.img already exists it will be overwritten'#13#10+
''#13#10+
'driveno is the index of the drive as shown when rawwritewin'#13#10+
'is run interactivly. The default is 0 which is the first drive'#13#10+
'listed'#13#10+
'';
end;
procedure TMainForm.FileNameEditKeyPress(Sender: TObject; var Key: Char);
begin
if Key = #13 then
begin
Key := #0;
{ if Length(FileNameEdit.Text) > 0 then
begin
WriteButtonClick(WriteButton);
end
else
begin
BrowseWriteButtonClick(BrowseWriteButton);
end;}
WriteButtonClick(WriteButton);
end;
end;
procedure TMainForm.FormShow(Sender: TObject);
begin
FileNameEdit.SetFocus;
end;
end.