Delphi基础开发技巧

http://tech.ddvip.com   2007年07月23日    社区交流

内容摘要:本文介绍Delphi基础开发的一些技巧

  DELPHI软件的DOS提示:This Program Must Be Run Under Win32.

  VC++软件的DOS提示:This Program Cannot Be Run In DOS Mode.

  ◇[DELPHI]操作Cookie

response.cookies("name").domain:='http://www.086net.com';
with response.cookies.add do
begin
name:='username';
value:='username';
end

  ◇[DELPHI]增加到文档菜单连接

uses shellapi,shlOBJ;
shAddToRecentDocs(shArd_path,pchar(filepath));//增加连接
shAddToRecentDocs(shArd_path,nil);//清空

  [杂类]备份智能ABC输入法词库

windowssystemuser.rem
windowssystem  mmr.rem

  [DELPHI]判断鼠标按键

if GetAsyncKeyState(VK_LButton)<>0 then ... //左键
if GetAsyncKeyState(VK_MButton)<>0 then ... //中键
if GetAsyncKeyState(VK_RButton)<>0 then ... //右键

  [DELPHI]设置窗体的最大显示

onFormCreate事件
self.width:=screen.width;
self.height:=screen.height;

  [DELPHI]按键接受消息

OnCreate事件中处理:Application.OnMessage:=MyOnMessage;
procedure TForm1.MyOnMessage(var MSG:TMSG;var Handle:Boolean);
begin
if msg.message=256 then ... //ANY键
if msg.message=112 then ... //F1
if msg.message=113 then ... //F2
end;

  [杂类]隐藏共享文件夹

  共享效果:可访问,但不可见(在资源管理、网络邻居中)

  取共享名为:direction$

  访问://computer/dirction/

责编:豆豆技术应用

正在加载评论...