如题。
解决方案 »
- c/s实现
- 请问delphi中如何实现:在数据列表中点一条记录,这条记录下面会显示跟这条记录相关的记录,这些记录插在该记录的下面
- 菜鸟求算法,不会这个算法的人肯定很少。
- 急求啊,一个简单的问题,但我不是不知道
- 请问谁有infopower 4000的使用教程,不是ip4000的帮助文件
- 关于一个API! 网络的!
- 发送命令给程序 管理员帮帮我。。都三天了还没有解决
- 我有两个Idtcpclient,怎样使用多线程同时连接到服务端。
- 那位高手能否帮我解决这个问题??急!!
- D5的DCOM问题,本机可以运行,联网时出错。——大虾救我!
- 如何给IHTMLDocument2类型的变量赋值。
- 手头有一项目,急需测试。
2、修改Delphi的编译参数,把无用的开关关闭。
举个简单的例子,delphi启动时建立的application,不做任何改动,编译成 .exe,是360多K,怎样可以让他最小且可以在不安装delphi的机器上运行。
如果点了 with runtime packages 只有14K,但是在不装delphi的机器上找不到 rtl60.dll ,运行不了。
但要同EXE一起发布.
这样吧,
delphi启动时建立的application,不做任何改动,编译成 .exe,让他最小且可以在不安装delphi的机器上运行。你们能搞到多小?怎么搞?
另外 to means_pan 把不用的pack删掉,删哪里的?是上边的复选框吗,我删光了也没效果啊。
但你在做安裝程式時要打包,打需要的文件包進去。
它。它能够使Delphi编出尺寸非常小的32位Windows图形用户界面的应用程序。目前支持的Delphi版本:Delphi6,Delphi5,Delphi4,Delphi3和Delphi2。使用KOL在D2-D5中编写的最小图形界面程序(只有一个窗体的空应用程序),只有13K左右。
在D6中为20K左右。MCK一套以KOL为基础的可视化组件,用它就像用VCL一样的方便省事而且可以达到和KOL一
样的效果。二、KOL和MCK的安装1、http://bonanzas.rinet.ru/下载到KOL和MCK后,把它们解压到你自已想要的目录中。
把KOL中的kol.pas拷贝到MCK目录中。2、运行Delphi选择Tools菜单->Environmaent Options...->Library页,选择"Library
Path"右边的按钮会弹出"Directories"对话框,然后添加KOL和MCK的路径。3、打MCK目录中的包文件安装。
变,窗体名可以随便。2、在控件面板KOL中放一个TKOLProject控件到窗体并设置projectDest属性为你想要的工
程名比如说是"KOLSample",再把dprResource属性设为真(这关系到你能不能用Project->
Options...中的设置设置你的程序图标以及程序的版本号)。3、在控件面板KOL中放一个TKOLForm控件到窗体,这个控件和TForm差不多的,保存并关
闭当前工程。4、这时候你就会在保存目录中发现一个名为"KOLSample"的工程,聪明的你可能会想到
Project1这个工程不再需要了,是的你可以毫不留情的删掉它(其它的就不要删了)。打
开KOLSample,运行它,看看生成的程序,怎么样?:)注:其实在KOL的老家还有很多KOL爱好者写的第三方KOL可视化组件,如要传载请注明
出处。待继......SQUALL[S&A SSC]
2002.8.27
是我知道的DELPHI中非VCL的最“接近”实用的framework
http://bonanzas.rinet.ru/e_kolmck.htm
比如form、edit、button等~~~~~~~~
Windows,
ShellAPI,
Sysutils,
Messages;{$R *.RES}
var
WinClass:TWndClassA;
Handle:hwnd;
Inst,Button1, Label1, Edit1: Integer;
Msg: TMsg;
tid: TNotifyIconDataA;
sdt:tdatetime;
timerid:integer;
hFont: Integer;
const
AppName='AutoShutDown';
st='定时关机:';
About='不想吃天鹅肉的癞蛤蟆不是好癞蛤蟆!';
gjs='设定关机时间';
procedure SetShutdownTime;
var
Textlength: Integer;
Text: PChar;
i:tdatetime;
begin
TextLength := GetWindowTextLength(Edit1);
GetMem(Text, TextLength + 1);
GetWindowText(Edit1, Text, TextLength + 1);
try
i:=Strtodatetime(Text);
if i<=now then
begin
MessageBox(handle,'设置有误,请重来!','错误',mb_ok or MB_ICONERROR);
exit;
end;
sdt:=i;
timerid:=Settimer(handle,1000,1000,nil);
Showwindow(handle,sw_hide);
lstrcpy (tid.szTip,pchar(st+' 关机时间:'+Datetimetostr(sdt)));
Shell_NotifyIcon (nim_modify, @tid);
except
Killtimer(handle,timerid);
Messagebox(handle,pchar('关机时间设定错误!'#13#10#13#10+'格式因该是:'#13#10#13#10
+Datetimetostr(now)),AppName,Mb_ok or MB_ICONINFORMATION);
end;
FreeMem(Text, TextLength + 1);
end;
function WindowProc(hWnd, uMsg, wParam, lParam: Integer): Integer; stdcall;
var
pt:tpoint;pm:Hmenu;
htoken:thandle;
tkp:token_privileges;
rr:dword;
begin
result:=0;
Case uMsg of
wm_timer:
begin
if now>=sdt then
begin
openprocesstoken(getcurrentprocess(),token_adjust_privileges or token_query,htoken);
lookupprivilegevalue(nil,'seshutdownprivilege',tkp.privileges[0].luid);
//设定权限为1
tkp.PrivilegeCount:=1;
tkp.privileges[0].Attributes:=se_privilege_enabled;
//得到关机权限
adjusttokenprivileges(htoken,false,tkp,0,nil,rr);
//关闭计算机
exitwindowsex(ewx_shutdown or ewx_poweroff,0);
PostMessage(handle,wm_Destroy,0,0);
end;
end;
wm_User:
begin
Case lparam of
WM_LBUTTONDBLCLK:
begin
showwindow(handle,sw_restore);
setforegroundwindow(handle);
end;
wm_LButtonDown,wm_RButtonDown:
begin
GetCursorPos (pt);
pm := CreatePopupMenu;
AppendMenu (pm,0,Ord ('S'),gjs);
AppendMenu (pm, 0, Ord ('A'), '关于...');
AppendMenu (pm, mf_Separator, 0, Nil);
AppendMenu (pm, 0, Ord ('E'), '退出');
SetForegroundWindow (handle);
if TrackPopupMenu (pm, tpm_BottomAlign or tpm_RightAlign, pt.x,{GetDeviceCaps(dc,Vertres)}pt.y, 0, handle, Nil) then
SetForegroundWindow (handle);
DestroyMenu (pm)
end;
end;
end;
wm_Destroy:
begin
Shell_NotifyIcon (nim_Delete, @tid);
Killtimer(handle,timerid);
halt;
end;
wm_Command:
begin
if (lParam = Button1) then begin SetshutdownTime;exit end;
Case Loword(wParam) of
Ord ('A'): MessageBox (0, About, AppName, mb_ok or MB_ICONINFORMATION);
Ord ('E'): PostMessage (handle, wm_Close, 0, 0);
Ord ('S'):
begin
Showwindow(handle,sw_restore);
end;
end;
end;
end;
Result := DefWindowProc(hWnd, uMsg, wParam, lParam);
end;begin
{ ** Register Custom WndClass ** }
if FindWindow (AppName, Nil) <> 0 then begin
Messagebox(handle,'已经有一个AutoShutDown运行了',AppName,mb_ok or MB_ICONWARNING);
halt(0);
end;
Inst := hInstance;
with WinClass do
begin
style := CS_CLASSDC or CS_PARENTDC;
lpfnWndProc := @WindowProc;
hInstance := Inst;
hbrBackground := color_btnface + 1;
lpszClassname := AppName;
hCursor := LoadCursor(0, IDC_ARROW);
end;
RegisterClass(WinClass);
Handle := CreateWindowEx(WS_EX_WINDOWEDGE, AppName, '定时关机XP',
WS_VISIBLE {or WS_SIZEBOX} or WS_CAPTION or WS_SYSMENU,
315, 248, 330, 75, 0, 0, Inst, nil);
Button1 := CreateWindow('Button', '确 定', WS_VISIBLE or WS_CHILD or BS_PUSHLIKE or BS_TEXT,
240, 10, 75, 20, handle, 0, Inst, nil);
Label1 := Createwindow('Static', '', WS_VISIBLE or WS_CHILD or SS_LEFT,
10, 14, 105, 13, Handle, 0, Inst, nil);
Edit1 := CreateWindowEx(WS_EX_CLIENTEDGE, 'Edit', Pchar(Datetimetostr(now)), WS_CHILD or WS_VISIBLE or
WS_BORDER {or ES_PASSWORD}, 105, 10, 125, 20, Handle, 0, Inst, nil);
hFont := CreateFont(-12, 0, 0, 0, 500, 0, 0, 0, GB2312_CHARSET,
OUT_DEFAULT_PRECIS, CLIP_DEFAULT_PRECIS, DEFAULT_QUALITY,
DEFAULT_PITCH or FF_DONTCARE, '宋体');
if hFont <> 0 then
begin
SendMessage(Button1, WM_SETFONT, hFont, 0);
SendMessage(Label1, WM_SETFONT, hFont, 0);
SendMessage(Edit1, WM_SETFONT, hFont, 0);
end;
SetWindowText(Label1, pchar('请'+gjs+':'));
SetFocus(Edit1);
UpdateWindow(Handle);
tid.cbSize := sizeof (tid);
tid.Wnd := handle;
tid.uID := 1;
tid.uFlags := nif_Message or nif_Icon or nif_Tip;
tid.uCallBackMessage := wm_User;
tid.hIcon := LoadIcon (hInstance, 'MAINICON');
lstrcpy (tid.szTip,st);
Shell_NotifyIcon (nim_Add, @tid);
while(GetMessage(Msg, Handle, 0, 0)) do
begin
TranslateMessage(msg);
DispatchMessage(msg);
end;
end.程序功能很简单,就是定时关机,但是没有一定的基础很难办到!
在下看懂了~~~~~~~ 但是不全理解~~~~~~~
看懂跟理解是两码事!
不错。
保证你小于 10K