转至繁体中文版     | 网站首页 | 图文教程 | 资源下载 | 站长博客 | 图片素材 | 武汉seo | 武汉网站优化 | 
最新公告:     敏韬网|教学资源学习资料永久免费分享站!  [mintao  2008年9月2日]        
您现在的位置: 学习笔记 >> 图文教程 >> 软件开发 >> Delphi程序 >> 正文
DELPHI开发技巧         ★★★★

DELPHI开发技巧

作者:闵涛 文章来源:闵涛的学习笔记 点击数:2575 更新时间:2009/4/23 18:29:00
关于处理注册表

uses Registry;

var reg:Tregistry;

reg:=Tregistry.create;

reg.rootkey:=''''HKey_Current_User'''';

reg.openkey(''''Control Panel\Desktop'''',false);

reg.WriteString(''''Title Wallpaper'''',''''0'''');

reg.writeString(''''Wallpaper'''',filelistbox1.filename);

reg.closereg;

reg.free;

◇[DELPHI]关于键盘常量名

VK_BACK/VK_TAB/VK_RETURN/VK_SHIFT/VK_CONTROL/VK_MENU/VK_PAUSE/VK_ESCAPE

/VK_SPACE/VK_LEFT/VK_RIGHT/VK_UP/VK_DOWN

F1--F12:$70(112)--$7B(123)

A-Z:$41(65)--$5A(90)

0-9:$30(48)--$39(57)

◇[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输入法词库

windows\system\user.rem

windows\system\tmmr.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/

◇[Java Script]Java Script网页常用效果

网页60秒定时关闭

<script language="java script"><!--

settimeout(''''window.close();'''',60000)

--></script>

关闭窗口

<a href="/" onclick="javascript:window.close();return false;">关闭</a>

定时转URL

<meta http-equiv="refresh" content="40;url=http://www.086net.com">

设为首页

<a onclick="this.style.behavior=''''url(#default#homepage)'''';this.sethomepage(''''http://086net.com'''');"href="#">设为首页</a>

收藏本站

<a href="javascript:window.external.addfavorite(''''http://086net.com'''',''''[未名码头]'''')">收藏本站</a>

加入频道

<a href="javascript:window.external.addchannel(''''http://086net.com'''')">加入频道</a>

◇[DELPHI]随机产生文本色

randomize;//随机种子

memo1.font.color:=rgb(random(255),random(255),random(255));

◇[DELPHI]DELPHI5 UPDATE升级补丁序列号

1000003185

90X25fx0

◇[DELPHI]文件名的非法字符过滤

for i:=1 to length(s) do

if s[i] in [''''\'''',''''/'''','''':'''',''''*'''',''''?'''',''''<'''',''''>'''',''''|''''] then

◇[DELPHI]转换函数的定义及说明

datetimetofiledate (datetime:Tdatetime):longint; 将Tdatetime格式的日期时间值转换成DOS格式的日期时间值

datetimetostr (datetime:Tdatetime):string; 将Tdatatime格式变量转换成字符串,如果datetime参数不包含日期值,返回字符串日期显示成为00/00/00,如果datetime参数中没有时间值,返回字符串中的时间部分显示成为00:00:00 AM

datetimetostring (var result string;

const format:string;

datetime:Tdatetime); 根据给定的格式字符串转换时间和日期值,result为结果字符串,format为转换格式字符串,datetime为日期时间值

datetostr (date:Tdatetime) 使用shortdateformat全局变量定义的格式字符串将date参数转换成对应的字符串

floattodecimal (var result:Tfloatrec;value:

extended;precision,decimals:

integer); 将浮点数转换成十进制表示

floattostr (value:extended):string 将浮点数value转换成字符串格式,该转换使用普通数字格式,转换的有效位数为15位。

floattotext (buffer:pchar;value:extended;

format:Tfloatformat;precision,

digits:integer):integer; 用给定的格式、精度和小数将浮点值value转换成十进制表示形式,转换结果存放于buffer参数中,函数返回值为存储到buffer中的字符位数,buffer是非0结果的字符串缓冲区。

floattotextfmt (buffer:pchar;value:extended;

format:pchar):integer 用给定的格式将浮点值value转换成十进制表示形式,转换结果存放于buffer参数中,函数返回值为存储到buffer中的字符位数。

inttohex (value:longint;digits:integer):

string; 将给定的数值value转换成十六进制的字符串。参数digits给出转换结果字符串包含的数字位数。

inttostr (value:longint):string 将整数转换成十进制形式字符串

strtodate (const S:string):Tdatetime 将字符串转换成日期值,S必须包含一个合法的格式日期的字符串。

strtodatetime (const S:string):Tdatetime 将字符串S转换成日期时间格式,S必须具有MM/DD/YY HH:MM:SS[AM|PM]格式,其中日期和时间分隔符与系统时期时间常量设置相关。如果没有指定AM或PM信息,表示使用24小时制。

strtofloat (const S:string):extended; 将给定的字符串转换成浮点数,字符串具

上一页  [1] [2] [3] [4] [5] [6] [7]  下一页


[ORACLE]项目中的oracle开发技巧  
教程录入:mintao    责任编辑:mintao 
  • 上一篇教程:

  • 下一篇教程:
  • 【字体: 】【发表评论】【加入收藏】【告诉好友】【打印此文】【关闭窗口
      注:本站部分文章源于互联网,版权归原作者所有!如有侵权,请原作者与本站联系,本站将立即删除! 本站文章除特别注明外均可转载,但需注明出处! [MinTao学以致用网]
      网友评论:(只显示最新10条。评论内容只代表网友观点,与本站立场无关!)

    同类栏目
    · C语言系列  · VB.NET程序
    · JAVA开发  · Delphi程序
    · 脚本语言
    更多内容
    热门推荐 更多内容
  • 没有教程
  • 赞助链接
    更多内容
    闵涛博文 更多关于武汉SEO的内容
    500 - 内部服务器错误。

    500 - 内部服务器错误。

    您查找的资源存在问题,因而无法显示。

    | 设为首页 |加入收藏 | 联系站长 | 友情链接 | 版权申明 | 广告服务
    MinTao学以致用网

    Copyright @ 2007-2012 敏韬网(敏而好学,文韬武略--MinTao.Net)(学习笔记) Inc All Rights Reserved.
    闵涛 投放广告、内容合作请Q我! E_mail:admin@mintao.net(欢迎提供学习资源)

    站长:MinTao ICP备案号:鄂ICP备11006601号-18

    闵涛站盟:医药大全-武穴网A打造BCD……
    咸宁网络警察报警平台