DEADSOFTWARE

gui: redesign menu
[d2df-editor.git] / src / shared / codepage.pas
1 unit codepage;
2
3 interface
4
5 implementation
6
7 uses windows;
8
9 function ConOutFunc(var Text: TTextRec): Integer;
10 var
11 a: LongWord;
12 _pos: Integer;
13 begin
14 Result := 0;
15
16 _pos := Text.BufPos;
17
18 if _pos <= 0 then Exit;
19
20 Text.BufPos := 0;
21 CharToOemBuff(Text.BufPtr, Text.BufPtr, _pos);
22 if not WriteFile(Text.Handle, Text.BufPtr^, _pos, a, nil) then
23 Result := GetLastError;
24 end;
25
26 initialization
27
28 Rewrite(Output);
29 TTextRec(Output).InOutFunc := @ConOutFunc;
30 TTextRec(Output).FlushFunc := @ConOutFunc;
31
32 end.