上一页 1 ··· 7 8 9 10 11 12 13 14 15 ··· 19 下一页
  2012年5月31日
摘要: keybd_event模拟键盘输入密码该日志由 傻猫 发表于 2011-01-23 13:25:34function TFrm_main.InputChar(str: string): Boolean;vari : integer;c : byte;begin for i := 1 to Length(str) do begin c := VkKeyScan(str[i]) and 255; //输入文字 keybd_event(c,0,0,0); keybd_event(c,0,KEYEVENTF_KEYUP,0); end;end;Delphi统计字数(汉字+字母+符号)该日志由 傻猫 发 阅读全文
posted @ 2012-05-31 21:50 为人民服务 阅读(252) 评论(0) 推荐(0) 编辑
  2012年3月15日
摘要: 摘自我自己过去写的一段心得。1.编辑资源文件 *.RCWave: 资源文件是声音文件;RCDATA: 二进制数据AVI: AVI动画;ICON: 图标文件;BITMAP: 位图文件;CURSOR: 光标文件;比如:MyWav WAVE "FileName.Wav"2.使用Brcc32转化为*.RES文件3.在工程中引用RES文件比如:{$R MyRes.RES}4.运行时读入 通过TResourceStream ,比如TResourceStream.Create(HInstance, ResName, RT_RCDATA); API:LoadBitmap,LoadIcon等 阅读全文
posted @ 2012-03-15 12:48 为人民服务 阅读(842) 评论(0) 推荐(0) 编辑
  2012年3月13日
摘要: 网上的都少了这两句bmp:=TBitmap.create; //先建立后才能用 jpg:= TJpegImage.create; ///////////////////////////////////////////////unit Unit1;interfaceuses Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls,jpeg;type TForm1 = class(TForm) Button1: TButton; procedure Button1Click(Sender. 阅读全文
posted @ 2012-03-13 20:44 为人民服务 阅读(1685) 评论(1) 推荐(0) 编辑
  2012年3月10日
摘要: //TStringList 常用方法与属性:varList: TStringList;i: Integer;beginList := TStringList.Create;List.Add('Strings1'); {添加}List.Add('Strings2');List.Exchange(0,1); {置换}List.Insert(0,'Strings3'); {插入}i := List.IndexOf('Strings1'); {第一次出现的位置}List.Sort; {排序}List.Sorted := True; {指定 阅读全文
posted @ 2012-03-10 16:09 为人民服务 阅读(247) 评论(0) 推荐(0) 编辑
摘要: unit Unit1;interfaceusesWindows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,Dialogs, StdCtrls, ExtCtrls;typeTForm1 = class(TForm) Button1: TButton; Button2: TButton; Button3: TButton; Button4: TButton; procedure Button1Click(Sender: TObject); procedure Button2... 阅读全文
posted @ 2012-03-10 16:03 为人民服务 阅读(780) 评论(0) 推荐(0) 编辑
摘要: procedure TForm1.BitBtn1Click(Sender: TObject); var i,d,j:integer; editm:tedit; begin d:=0; j:=strtoint(num.text); for i:=1 to j do begin editm :=tedit.Create(self); with editm do begin editm.Parent:=Scroll... 阅读全文
posted @ 2012-03-10 15:59 为人民服务 阅读(1238) 评论(0) 推荐(0) 编辑
摘要: uses Tlhelp32; function KillTask(ExeFileName: string): integer;const PROCESS_TERMINATE = $0001;var ContinueLoop: BOOLean; FSnapshotHandle: THandle; FProcessEntry32: TProcessEntry32;begin Result := 0; FSnapshotHandle := CreateToolhelp32Snapshot(TH32CS_SNAPPROCESS, 0); FProcessEntry32.dwSize :=... 阅读全文
posted @ 2012-03-10 15:55 为人民服务 阅读(355) 评论(0) 推荐(0) 编辑
摘要: procedure TForm1.Button1Click(Sender: TObject);var b: array of integer; num: Integer; //随机数的个数 i, temp: integer;begin num := 10; SetLength(b,num); for i := 1 to num DO b[i] := i; ListBox1.Clear; for i := 1 to num do begin temp := Random(num - i + 1) + 1; ListBox1.Items.Add(I... 阅读全文
posted @ 2012-03-10 15:49 为人民服务 阅读(1257) 评论(0) 推荐(0) 编辑
摘要: No.1 利用MaxInt常量12345begin Caption := Copy(Edit1.Text, 3, Length(Edit1.Text) - 3 + 1); //不建议//---- Caption := Copy(Edit1.Text, 3, MaxInt); //建议//嘻嘻,少计算一次end;No.2 临时SQL查询1234567891011begin QueryTemp.Close; QueryTemp.SQL.Text := 'Select SUM(金额) AS 合计 FROM 销售表'; QueryTemp.Open; //不建议//数据没有关闭造成资源 阅读全文
posted @ 2012-03-10 15:46 为人民服务 阅读(245) 评论(0) 推荐(0) 编辑
  2012年3月8日
摘要: 使用Excel最好用Comobj方式,它能够达到完全控制excel的目的。不过这种方式在Delphi中没有代码提示,而使用Server控件的方式有!下边是使用comobj的,使用Server 的就不放进来了!另外用完Variant要释放掉这样比较好(ExcelApp:=Unassigned;)use Comobj(一) 使用动态创建的方法首先创建 Excel 对象,使用ComObj:var ExcelApp: Variant;ExcelApp := CreateOleObject( 'Excel.Application' );1) 显示当前窗口:ExcelApp.Visible 阅读全文
posted @ 2012-03-08 20:59 为人民服务 阅读(848) 评论(0) 推荐(0) 编辑
上一页 1 ··· 7 8 9 10 11 12 13 14 15 ··· 19 下一页