Delphi Base

WindSon

导航

03 2020 档案

Delphi 检测鼠标键盘多久没有活动
摘要:function GetInputAwayTime():DWORD; var lpi:TLastInputInfo; begin lpi.cbSize := sizeof(lpi); GetLastInputInfo(lpi); Result := Round((GetTickCount()-lpi 阅读全文

posted @ 2020-03-28 14:49 windsonvip 阅读(447) 评论(0) 推荐(0)

Delphi 使用API函数AnimateWindow实现窗体特效功能
摘要:API函数 AnimateWindow 使用: 函数功能:窗体显示和隐藏时产生特殊的动画效果;可以产生两种类型的动画效果: 滚动动画 和 滑动动画 函数原型:BOOL AnimateWindow(HWND hWnd, DWORD dwTime, DWORD dwFlags) 参数说明:hWnd 指定 阅读全文

posted @ 2020-03-25 21:45 windsonvip 阅读(389) 评论(0) 推荐(0)

delphi 让子窗体显示最大化
摘要:procedure TForm2.FormCreate(Sender: TObject); begin perform(WM_SIZE,SIZE_MAXIMIZED,0); end; 阅读全文

posted @ 2020-03-25 21:24 windsonvip 阅读(515) 评论(0) 推荐(0)

Delphi 中拖动无边框窗口的5种方法
摘要:1.MouseMove事件中加入: // ReleaseCapture; // Perform(WM_SYSCOMMAND, $F017 , 0); 2.MouseDown事件中加入: // POSTMESSAGE(Self.Handle,WM_LBUTTONUP,0,0); // POSTMESS 阅读全文

posted @ 2020-03-25 21:22 windsonvip 阅读(587) 评论(0) 推荐(0)

Delphi 非主窗体(即子窗体)在任务栏显示按钮
摘要:type TForm2 = class(TForm) private { Private declarations } public { Public declarations } procedure CreateParams(var Params:TCreateParams); override; 阅读全文

posted @ 2020-03-25 21:17 windsonvip 阅读(301) 评论(0) 推荐(0)

Delphi 时间控制窗口标题栏文字或任务栏标题文字滚动
摘要:1、定义一个全局变量保存显示到标题栏的字符串,strScroll: Widestring = '风行天下 - By WindSon '; 2、添加一个Timer控件,设置属性Interval := 300; Enabled:=True; 3、然后添加Timer事件 procedure TForm1. 阅读全文

posted @ 2020-03-25 21:03 windsonvip 阅读(647) 评论(0) 推荐(0)

Delphi MEMO 循环往上往下滚动
摘要:// 循环往上滚动 if Memo1.Perform(EM_SCROLL,SB_LINEDOWN,0)=0 then begin Memo1.Perform(WM_VSCROLL,SB_TOP,0); end else begin SendMessage(Memo1.Handle,WM_VSCROL 阅读全文

posted @ 2020-03-25 20:38 windsonvip 阅读(877) 评论(0) 推荐(0)

Delphi 多线程使用
摘要:1. 定义线程类 type TMyThread = class(TThread) private { Private declarations } fPos:Integer; // 变量 protected procedure GetMailList; procedure UpdatepBar; / 阅读全文

posted @ 2020-03-25 20:23 windsonvip 阅读(393) 评论(0) 推荐(0)

Delphi CheckListBox 用法
摘要:for i := CheckListBox1.Items.Count-1 downto 0 do //从后面往前面删 begin if CheckListBox1.Checked[i] then // 是否选中 begin CheckListBox1.Items.Delete(i); end; en 阅读全文

posted @ 2020-03-25 20:15 windsonvip 阅读(740) 评论(0) 推荐(0)

Delphi edit只允许输入数字
摘要:if not (key in ['0'..'9',#8]) then key := #0; 阅读全文

posted @ 2020-03-25 20:07 windsonvip 阅读(1219) 评论(0) 推荐(0)

Delphi 判断字符是否是汉字
摘要:function IsHZ(ch: WideChar): boolean; var i: Integer; begin i := Ord(ch); if (i < 19968) or (i > 40869) then result := False else result := True; end; 阅读全文

posted @ 2020-03-24 21:55 windsonvip 阅读(557) 评论(0) 推荐(0)

Delphi 判断当前系统是否64位
摘要:uses Winapi.Windows; function IsWin64: Boolean; var IsWow64Process: function(Handle: THandle; var Res: BOOL): BOOL; stdcall; GetNativeSystemInfo: proc 阅读全文

posted @ 2020-03-24 21:52 windsonvip 阅读(594) 评论(0) 推荐(0)

Delphi 使控件变成圆角的方法
摘要:procedure RoundControl(Control: TWinControl; arc1, arc2: Integer); var R: TRect; Rgn: HRGN; begin with Control do begin R := Control.ClientRect; Rgn : 阅读全文

posted @ 2020-03-24 21:40 windsonvip 阅读(866) 评论(0) 推荐(0)

Delphi使程序的窗口出现在最前面并激活
摘要:procedure setAppFront(); //使程序的窗口出现在最前面并激活 var pt, OldPt, NewPt: TPoint; begin //判断Application是否最小化,而不是主窗口的Handle, 使用Restore来还原 if IsIconic(Applicatio 阅读全文

posted @ 2020-03-23 20:09 windsonvip 阅读(806) 评论(1) 推荐(0)

Delphi 禁止重复运行程序的方法
摘要:第一种方法,使用“过程调用” procedure Del; // 自定义过程 var Mutex: THandle; begin Mutex := CreateMutex(nil, True, PChar(Application.Title)); if GetLastError = ERROR_AL 阅读全文

posted @ 2020-03-23 19:54 windsonvip 阅读(669) 评论(1) 推荐(0)

delphi 让执行程序不在任务栏显示
摘要:Application.MainFormOnTaskbar := False; procedure TForm1.FormShow(Sender: TObject); begin ShowWindow(Application.Handle, SW_HIDE); //不显示在任务栏上 end; 阅读全文

posted @ 2020-03-21 21:30 windsonvip 阅读(658) 评论(0) 推荐(0)

Delphi WebBrowser内核版本修改D7
摘要:private { Private declarations } public { Public declarations } function WriteAppNameToReg:Boolean; function GetIEVersionStr: string; function IsWin64 阅读全文

posted @ 2020-03-18 23:34 windsonvip 阅读(503) 评论(0) 推荐(0)

Delphi让网页只允许在WebBrowser里面打开
摘要:[添加组件] 添加 Internet->WebBrowser //显示网页 [添加事件] 鼠标点击WebBrowser组件,在Events事件选项框中找到. OnNewWindows2,OnStatusTextChange.双击添加事件. unit Unit1; interface uses Win 阅读全文

posted @ 2020-03-18 22:54 windsonvip 阅读(493) 评论(0) 推荐(0)

Delphi 判断操作系统是32位或是64位
摘要:function IsWin64: Boolean; var Kernel32Handle: THandle; IsWow64Process: function(Handle: Windows.THandle; var Res: Windows.BOOL): Windows.BOOL; stdcal 阅读全文

posted @ 2020-03-16 22:14 windsonvip 阅读(1073) 评论(0) 推荐(0)

Delphi Inputbox 输入时显示‘*’号
摘要:unit Unit1; interface uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls; const InputboxMessage = WM_US 阅读全文

posted @ 2020-03-16 18:11 windsonvip 阅读(565) 评论(0) 推荐(0)

Delphi 让窗体自适应屏幕显示
摘要:unit Unit1; interface uses Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics, Vcl.Controls, Vcl.Forms, V 阅读全文

posted @ 2020-03-16 17:52 windsonvip 阅读(870) 评论(0) 推荐(0)

delphi 弹出输入框的InputQuery, InputQuery 函数用法
摘要:delphi 弹出输入框的InputQuery, InputQuery 函数用法 procedure TForm1.Button1Click(Sender: TObject); var str: string; begin str := InputBox('输入窗口标题', '输入提示', '默认输 阅读全文

posted @ 2020-03-16 17:48 windsonvip 阅读(1374) 评论(0) 推荐(0)

delphi Wmi 获取操作系统信息
摘要:uses ActiveX, ComObj; function GetWMIProperty(WMIProperty: string): string; var Wmi, Objs, Obj: OleVariant; Enum: IEnumVariant; C: Cardinal; begin Wmi 阅读全文

posted @ 2020-03-16 17:46 windsonvip 阅读(717) 评论(0) 推荐(0)

DELPHI 检测服务器地址是否有效
摘要:利用DELPH 的ICMP控件检测服务器地址 function CheckNetServer():Boolean; begin IdIcmpClient1.Host := '192.168.1.230'; //服务器地址 IdIcmpClient1.Ping; if IdIcmpClient1.Re 阅读全文

posted @ 2020-03-16 17:43 windsonvip 阅读(301) 评论(0) 推荐(0)

Delphi 动态生成进度条窗体
摘要:在implementation加入下面 uses Gauges; var Gauge1: TGauge; 加入Timer1控件,设为false procedure TForm1.Button1Click(Sender: TObject); var form2: TForm; begin form2 阅读全文

posted @ 2020-03-16 17:38 windsonvip 阅读(1053) 评论(0) 推荐(0)

Delphi 执行一个外部程序,当外部程序结束后言主程序立即响应
摘要:delphi 执行一个外部程序,当外部程序结束后言主程序立即响应 我们经常能看到360安全卫士进行windows系统升级时,执行windows升级程序,当升级程序执行完成后,360马上弹出提示框。这样的程序是如何做到的呢?下述代码就能完成! uses shellAPI; procedure TFor 阅读全文

posted @ 2020-03-16 17:25 windsonvip 阅读(289) 评论(0) 推荐(0)

delphi获取DOS命令行输出函数 运行CMD命令并获取结果
摘要:procedure TForm1.Button4Click(Sender: TObject); var hReadPipe,hWritePipe:THandle; si:STARTUPINFO; lsa:SECURITY_ATTRIBUTES; pi:PROCESS_INFORMATION; mDo 阅读全文

posted @ 2020-03-16 17:23 windsonvip 阅读(1870) 评论(0) 推荐(0)

delphi 使控件变成圆角的方法
摘要:procedure RoundControl(Control: TWinControl; arc1, arc2: Integer); var R: TRect; Rgn: HRGN; begin with Control do begin R := Control.ClientRect; Rgn : 阅读全文

posted @ 2020-03-16 17:22 windsonvip 阅读(345) 评论(0) 推荐(0)

delphi判断字符是否是汉字
摘要:function IsHZ(ch: WideChar): boolean; var i: Integer; begin i := Ord(ch); if (i < 19968) or (i > 40869) then result := False else result := True; end; 阅读全文

posted @ 2020-03-16 17:20 windsonvip 阅读(215) 评论(0) 推荐(0)

delphi获得唯一ID字符串
摘要://这是我三层开发中常用的一个函数,直接调用CreateSortID uses System.Win.ComObj,System.RegularExpressions,System.StrUtils,System.SysUtils; function CreateID(ll: Integer): s 阅读全文

posted @ 2020-03-16 17:18 windsonvip 阅读(766) 评论(0) 推荐(0)

MD5加密BASE64加解密
摘要:MD5需要引入system.Hash,BASE64需要引入System.NetEncoding,这两个单元应该只有高版本的DELPHI IDE才有 (貌似XE5以上版本才有)。如果是D7的话,找第三方的库。 procedure TForm19.Button8Click(Sender: TObject 阅读全文

posted @ 2020-03-16 17:16 windsonvip 阅读(1347) 评论(0) 推荐(0)

cxDBTreeList:最简单的节点图标添加方法
摘要:先在窗体上放ImageList关联到cxDBTreeList,在cxDBTreeList的GetNodeImageIndex事件中写如下: procedure cxDBTreeList1GetNodeImageIndex(Sender: TcxCustomTreeList; ANode: TcxTr 阅读全文

posted @ 2020-03-16 17:13 windsonvip 阅读(477) 评论(0) 推荐(0)

dxTabbedMDIManager1关闭窗体
摘要:procedure TfrmJianKongXinXi.FormClose(Sender: TObject; var Action: TCloseAction);begin Action:=caFree;end; procedure TfrmJianKongXinXi.FormCloseQuery( 阅读全文

posted @ 2020-03-16 17:12 windsonvip 阅读(651) 评论(0) 推荐(0)

DEV插件--Spreadsheet1电子表格
摘要:常用操作Spreadsheet常用属性标题栏是否可见 Spreadsheet1.TitleBar.Visible=true标题栏背景颜色 Spreadsheet1.TitleBar.Interior.Color="Green"标题栏标题内容 Spreadsheet1.TitleBar.Caption 阅读全文

posted @ 2020-03-16 17:11 windsonvip 阅读(873) 评论(0) 推荐(0)

如何让tcxGrid左边显示序号
摘要:第一步: 设置cxgrid的属性, OptionsView.Indicator = True 第二步: 写OnCustomDrawIndicatorCell方法 procedure TForm1.cxGrid1DBTableView1CustomDrawIndicatorCell(Sender: T 阅读全文

posted @ 2020-03-16 17:09 windsonvip 阅读(656) 评论(1) 推荐(2)

批处理脚本自动以管理员权限运行
摘要::::::::::::::::::::::::::::::::::::::::::::: :: Elevate.cmd - Version 4 :: Automatically check & get admin rights :::::::::::::::::::::::::::::::::::: 阅读全文

posted @ 2020-03-16 17:06 windsonvip 阅读(1113) 评论(0) 推荐(0)

Delphi编写的一款锁屏小工具
摘要:Delphi编写的一款锁屏小工具,双击程序立即锁屏,木有界面的。解除锁屏密码:alt+空格。 unit Unit1; interface uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, D 阅读全文

posted @ 2020-03-16 16:21 windsonvip 阅读(615) 评论(0) 推荐(0)

Delphi字符串加密解密函数
摘要:unit Unit1; interface uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls; type TForm1 = class(TForm) Bu 阅读全文

posted @ 2020-03-16 16:08 windsonvip 阅读(1084) 评论(0) 推荐(0)

Delphi 增加/获得windows用户帐号
摘要:unit Unit1; interface uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls, ComCtrls; typeUSER_INFO_1 = r 阅读全文

posted @ 2020-03-16 15:52 windsonvip 阅读(356) 评论(0) 推荐(0)

WIN2012域用户添加和批量添加工具
摘要:WIN2012域用户添加和批量添加,不需要进行复杂的进电脑管理去添加 直接在软件上就可单个用户添加,可批量添加,并把指定的用户加入组 可以自定义组织单位,使用起来比较简单方便。 链接:https://pan.baidu.com/s/1MtgZfSBi0Op6TQLEEFw-Pw 提取码:bgcw 阅读全文

posted @ 2020-03-16 15:43 windsonvip 阅读(875) 评论(1) 推荐(0)

Win7共享账号切换程序
摘要:服务器共享目录需要多账号登录时,需要重启电脑才可切换不同账号登 为了不重启电脑就可立即切换不同账号登,特意写了此款软件, 下载: 链接:https://pan.baidu.com/s/1g_4SCXldoCFDBZgD6ncKAg 提取码:pzf9 阅读全文

posted @ 2020-03-16 15:27 windsonvip 阅读(376) 评论(1) 推荐(0)