可以创建控制台应用程序。NEW\console application,代码如下:
program Project1;
{$APPTYPE CONSOLE}
VAR ZXB:STRING;
begin
{ TODO -oUser -cConsole Main : Insert code here }
** WRITE('WHO ARE YOU ?');
readln(zxb);
writeln('hello!',zxb,',welcome');
readln;
**
end.
**中间是自己添加的代码,并将USE语句删除。
编译看看吧!
begin
HandleCommand (Wnd, LoWord (wParam));
Exit;
end;
{收到其他用户消息时的处理}
wm_User: // Had a tray notification - see what to do
{如果单击了鼠标左键, 则打开或关闭桌面}
if (lParam = wm_LButtonDown) then
begin
if x = 0 then
begin
ShowWindow(TrayHandle, SW_HIDE);
tid.hIcon := LoadIcon (hInstance, 'offICON');
lstrcpy (tid.szTip,'Desktop is off');
Shell_NotifyIcon (NIM_MODIFY, @tid);
x:=1
end else
begin
ShowWindow(TrayHandle, SW_RESTORE);
tid.hIcon := LoadIcon (hInstance, 'ONICON');
lstrcpy (tid.szTip,'Desktop is on');
Shell_NotifyIcon (NIM_MODIFY, @tid);
x:= 0;
end; {end of if}
end else
{如果是鼠标右键,则动态生成一个弹出式菜单}
if (lParam = wm_RButtonDown) then
begin
GetCursorPos (pt);
pm := CreatePopupMenu;
AppendMenu (pm, 0, Ord ('A'), 'About DeskTop Hide...');
AppendMenu (pm, mf_Separator, 0, Nil);
AppendMenu (pm, 0, Ord ('E'), 'Exit DeskTop Hide');
SetForegroundWindow (Wnd);
dc := GetDC (0);
if TrackPopupMenu (pm, tpm_BottomAlign or tpm_RightAlign,pt.x,GetDeviceCaps(dc,HORZRES){pt.y}, 0, Wnd, Nil) then SetForegroundWindow (Wnd);
DestroyMenu (pm)
end; {end of if}
end; {end of case}
KOL - Key Objects Library is a set of objects to develop applications using Delphi. It is distributed free of charge, with source code.
Why not use KOL ????
Delphi2, Delphi3, Delphi4, Delphi5 and Delphi6 are supported. KOL allows to create very compact GUI applications (starting from ~13,5K without compression - if suggested system units replacement used). The most of code is converted to assembler.