📄 unitdll.pas
字号:
unit UnitDll;
interface
uses
SysUtils,
Classes,
Windows,
Dialogs;
var
hThreadHandle: Dword;
dwThreadID: Dword;
implementation
{在左上角显示时间}
procedure ThreadProc;
var
hScreenDC: hdc;
SystemTime: _SYSTEMTIME;
Temp: string;
MyOutput: PChar;
begin
while true do
begin
Sleep(100);
hScreenDC := GetDC(0);
GetLocalTime(SystemTime);
Temp := format('Current Time is %d-%d-%d %d:%d:%d', [SystemTime.wYear,
SystemTime.wMonth,
SystemTime.wDay,
SystemTime.wHour,
SystemTime.wMinute,
SystemTime.wSecond]);
MyOutPut := Pchar(temp);
TextOut(hScreenDC, 0, 0, MyOutPut, lstrlen(MyOutPut));
ReleaseDC(0, hScreenDC);
end;
end;
initialization
hThreadHandle := CreateThread(nil, 0, @ThreadProc, nil, 0, dwThreadID);
finalization
if (hThreadHandle <> 0) then
TerminateThread(hThreadHandle, 0);
end.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -