git-svn-id: https://spexeah.com:8443/svn/Asuro@625 6dbc8c32-bb84-406f-8558-d1cf31a0ab0c

This commit is contained in:
kieron 2018-05-01 01:35:45 +00:00
parent 76ad01dfc7
commit ecf09646ec
2 changed files with 63 additions and 0 deletions

BIN
lib/shell.ppu Normal file

Binary file not shown.

63
src/prog/shell.pas Normal file
View File

@ -0,0 +1,63 @@
unit shell;
interface
uses
Console, RTC;
procedure init();
implementation
var
Handle : HWND = 0;
Colors : uint32;
Explore_Colors : uint32;
procedure Draw();
var
DateTime : TDateTime;
i : uint32;
s : pchar;
begin
DateTime:= getDateTime;
console.clearWNDEx(Handle, colors);
console.setCursorPosWND(0, 0, Handle);
console.writeStringExWND(' TERMINAL ', Explore_Colors, Handle);
console.writeCharExWND(#6, Colors, Handle);
for i:=0 to 9 do begin
s:= getWindowName(i);
if s <> nil then begin
console.writeStringExWND(s, Colors, Handle);
console.writeCharExWND(' ', Colors, Handle);
console.writeCharExWND(#6, Colors, Handle);
end;
end;
console.setCursorPosWND(150, 0, Handle);
if DateTime.Hours < 10 then writeIntExWND(0, Colors, Handle);
writeIntExWND(DateTime.Hours, Colors, Handle);
writeStringExWND(':', Colors, Handle);
if DateTime.Minutes < 10 then writeIntExWND(0, Colors, Handle);
writeIntExWND(DateTime.Minutes, Colors, Handle);
writeStringExWND(':', Colors, Handle);
if DateTime.Seconds < 10 then writeIntExWND(0, Colors, Handle);
writeIntExWND(DateTime.Seconds, Colors, Handle);
end;
procedure init();
begin
colors:= console.combinecolors($0000, $FFFF);
Explore_Colors:= console.combinecolors($01C3, $07EE);
Handle:= Console.newWindow(0, 63, 159, 1, 'SHELL');
console.bordersEnabled(Handle, false);
//console.clearWNDEx(Handle, colors);
console.setShellWindow(Handle, false);
console.registerEventHandler(Handle, EVENT_DRAW, void(@Draw));
end;
end.