孤独的猫

  博客园 :: 首页 :: 博问 :: 闪存 :: 新随笔 :: 联系 :: 订阅 订阅 :: 管理 ::

随笔分类 -  DELPHI

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

摘要:varsei:TSHELLEXECUTEINFO;beginZeroMemory(@sei,sizeof(sei))sei.cbSize :=Sizeof(sei);sei.lpFile :=''C:\1.txt';sei.lpVerb :='properties';sei.fMask :=SEE_MASK_INVOKEIDLIST;ShellExecuteEx(@sei);end; 阅读全文
posted @ 2008-09-12 21:25 孤独的猫 阅读(261) 评论(0) 推荐(0) 编辑

摘要:function URLInfo(sBrowserPrgFile,sServiceName:string;NetScape:boolean;var Title:string):pchar;varDdeClientConv:TDDEClientConv;StartPtr,EndPtr:pchar;browseWinName:string;{参数说明}{sBrowserPrgFile:浏览器EXE文件的完整路径名sServiceName:浏览器的DDE-Service名字,如Netscape是Netscape,IE是'iexplore' Title:返回当前网页的Title 返回值 阅读全文
posted @ 2008-09-12 21:12 孤独的猫 阅读(830) 评论(0) 推荐(0) 编辑

摘要:vars:string;beginAllocConsole;tryWrite('Type here your words and press Enter');Readln(s);ShowMessage(Format('You typed: "%s"',[s]));finallyFreeConsole;end;end; 阅读全文
posted @ 2008-09-12 21:07 孤独的猫 阅读(167) 评论(0) 推荐(0) 编辑

摘要:function IsFileInUse(fName:string):Boolean;varHFileRes:HFile;beginResult :=False;if not FileExists(fname) then exit;HFileRes :=CreateFile(pchar(fName),GENERIC_READ or GENERIC_WRITE,0,nil,OPEN_EXISTING,FILE_ATTRIBUTE_NORMAL,0);Result :=(HFileRes=INVALID_HANDLE_VALUE);if not Result thenCloseHandle(HFi 阅读全文
posted @ 2008-09-12 21:03 孤独的猫 阅读(236) 评论(0) 推荐(0) 编辑

摘要:1.在private定义消息函数 procedure WMNCPaint(var Msg:TWMNCPaint);message WM_NCPaint;2.WMNCPaint函数为procedure TForm1.WMNCPaint(var Msg:TWMNCPaint);vardc:hDc;Pen:hPen;OldPen:hPen;OldBrush:hBrush;begininherited;dc :=GetWindowDC(handle);Pen :=CreatePen(PS_SOLID,1,RGB(255,0,0));OldPen :=SelectObject(dc,Pen);OldBr 阅读全文
posted @ 2008-09-12 20:25 孤独的猫 阅读(190) 评论(0) 推荐(0) 编辑

摘要:一 窗体设计object Form1: TForm1 Left = 0 Top = 0 Caption = 'Form1' ClientHeight = 397 ClientWidth = 530 Color = clNone Font.Charset = DEFAULT_CHARSET Font.Color = clWindowText Font.Height = -11 Font.Name = 'Tahoma' Font.Style = [] OldCreateOrder = False OnCreate = FormCreate OnDestroy = F 阅读全文
posted @ 2008-09-11 20:45 孤独的猫 阅读(293) 评论(0) 推荐(0) 编辑

摘要:在窗体上放入以Timer控件,在控件的Timer事件中写入varBrushPt:TPoint;BrushHandl,OldBrush:HBRUSH;FormDC:HDC;BrushOffset:Integer;beginBrushOffset:=0;FormDC:=GetDC(Form1.Handle);Inc(BrushOffset);BrushHandl:=CreateHatchBrush(HS_DIAGCROSS,clRed);SetBrushOrgEx(FormDC,BrushOffset,BrushOffset,nil);//设置画刷为网格形式OldBrush:=Select Obj 阅读全文
posted @ 2008-09-11 13:46 孤独的猫 阅读(189) 评论(0) 推荐(0) 编辑

摘要:一 新建一工程,设保存为OpenGLApp.dpr,窗口为Form1二 在Form1中加入Panel1和Button1,unit1.pas代码为unit Unit1;interfaceusesWindows,messages,Sysutils,classes,graphics,controls,Forms,Dialogs,OpenGL,Exectrs,Stdctrls;typeTForm1=class(TForm)Panel1:TPanel;Button1:TButton;procedure FormCreate(Sender:TObject);procedure PanelResize(Se 阅读全文
posted @ 2008-09-11 13:45 孤独的猫 阅读(237) 评论(0) 推荐(0) 编辑

摘要:procedure Effect_GaussianBlur(Amount:integer;Picture:TBitmap);var BB:TBitmap;beginBB :=TBitmap.Create;BB.PixelFormat :=pf24bit;BB.Assign(Picture.Bitmap);GaussianBlur(BB,Amount);Picture.Bitmap.Assign(BB);BB.Free;end;procedure GaussianBlur(var clip:TBitmap;Amount:integer);vari:integer;beginfor i:=Amou 阅读全文
posted @ 2008-09-10 21:51 孤独的猫 阅读(191) 评论(0) 推荐(0) 编辑

摘要:procedure EnumPorts(PortList:TStringList);varMaxPorts:integer;hPort:THandle;PortNumber:integer;PortName:integer;beginif PortList=nil then Exit;case WIN32PlatForm ofVER_PLATFORM_WIN32_NT: MaxPorts:=256;VER_PLATFORM_WIN32_WINDOWS: MaxPorts:=9;end;for PortNumber :=1 to MaxPorts dobeginif PortNumber> 阅读全文
posted @ 2008-09-10 21:50 孤独的猫 阅读(191) 评论(0) 推荐(0) 编辑

摘要:注:TFTP为窗体类名procedure TFTP.Button1Click(Sender:TObject);beginbutton1.Enabled:=false;NMFTP1.Host:='www.wh-ccic.com.cn';NMFTP1.Port :=21;NMFTP1.TimeOut:=5000;NMFTP1.UserID :=UserTxt.Text;NMFTP1.Password :=PassTxt.Text;tryNMFTP1.Connect;exceptExit;end;NMFTP1.InputFileMode:=False;NMFTP1.OutputFil 阅读全文
posted @ 2008-09-10 21:50 孤独的猫 阅读(271) 评论(0) 推荐(0) 编辑

摘要:unit uWebCracker;interfaceuses mshtml,SHdocvw,classes,SysUtils,StrUtils;constMAXPAGECOUNT=20;typeTWebPageRecord=recordURL:string;Title:string;Text:string;end;typeTWebCracker=class(TObject)privateFWebPageRecordArray:array[0..MAXPAGECOUNT-1] of TWebPageRecord;FWebPageCount:integer;publicconstructor Cr 阅读全文
posted @ 2008-09-10 21:49 孤独的猫 阅读(291) 评论(0) 推荐(0) 编辑

摘要:procedure Effect_Emboss(Picture:TBitmap);varBB1,BB2:TBitmap;beginBB1:=TBitmap.Create;BB1.PixelFormat :=pf24bit;BB1.Assign(Picture.Bitmap);BB2:=TBitmap.Create;BB2.PixelFormat:=pf24bit;BB2.Assign(BB1);Emboss(BB2);Picture.Bitmap.Assigned(BB2);BB1.Free;BB2.Free;end;procedure Emboss(var Bmp:TBitmap);varx 阅读全文
posted @ 2008-09-10 21:48 孤独的猫 阅读(176) 评论(0) 推荐(0) 编辑

摘要:unit CMOS;InterfaceconstClockSec = $00; { RTclock seconds }ClockMin = $02; { RTclock minutes }ClockHour = $04; { RTclock hours }ClockDOW = $06; { RTclock day of week }ClockDay = $07; { RTclock day in month }ClockMon = $08; { RTclock month }ClockYear = $09; { RTclock year (mod 100)}AlarmSec = $01; { 阅读全文
posted @ 2008-09-10 21:46 孤独的猫 阅读(240) 评论(0) 推荐(0) 编辑

摘要:unit MySys;interfaceuses Windows, shlObj, Variants, StdCtrls, ComObj, Classes, SysUtils, Controls,Printers, Messages, mmSystem, ComCtrls, UrlMon, winsock, TLhelp32, Registry,Forms, Graphics, IniFiles, ADODB, StrUtils, ExtCtrls, jpeg, ShellAPI, Math,MSHTML,IdStack,OleCtrls, SHDocVw,ActiveX,WinInet;ty 阅读全文
posted @ 2008-09-10 21:46 孤独的猫 阅读(1008) 评论(0) 推荐(0) 编辑

摘要:unit algebra;interfaceconst MaxN=30;{You can increase it up to 100,not greaterbut each matrix variable would have size ofsqr(MaxN)*sizeof(Real). It is possible to writeunit for work with dinamically sized matrices,but i have no needs to do this.You can work with matrices with size less that MaxN,but 阅读全文
posted @ 2008-09-10 21:45 孤独的猫 阅读(297) 评论(0) 推荐(0) 编辑

摘要:unit HugeUtil;interfaceconst HugeMax = $8000-16;type Huge = recordlen : word;dat : array[1..HugeMax] of word;end;HugePtr = ^Huge;procedure AddHuge (var Answer, Add : Huge);procedure MulHuge (var A : Huge; Mul : integer; var Answer : Huge);procedure DivHuge (var A : Huge; Del : integer; var Answer : 阅读全文
posted @ 2008-09-10 21:44 孤独的猫 阅读(267) 评论(0) 推荐(0) 编辑

摘要:UNIT ComplexOps; { see demo at end }{This UNIT provides complex arithmetic and transcendental functions.(C) Copyright 1990, 1992, Earl F. Glynn, Overland Park, KS. Compuserve 73257,3527.All rights reserved. This program may be freely distributed only fornon-commercial use.Some ideas in this UNIT wer 阅读全文
posted @ 2008-09-10 21:43 孤独的猫 阅读(300) 评论(0) 推荐(0) 编辑

摘要:一 编写DLL新建一dpr文件library PDLL;usesSysutils,classes,main in 'main.pas';{$E plg.} //定义后缀名为plgexportsDescribePlugin,InitPlugin;beginend;main.pas为:unit maininterfaceuses Dialogs,Menus,Classes;typeTHolder=classpublicprocedure ClickHandler(Sender:TObject);endprocedure DescribePlugin(var Desc:pchar); 阅读全文
posted @ 2008-09-10 18:55 孤独的猫 阅读(230) 评论(0) 推荐(0) 编辑

摘要:procedure ParseStrToStrings(AStrings:TStrings;S:String;iType:integer;seperator:string);vari:integer;beginif (iType<0) or (iType>5) thenExit;if iType=4 thenbeginAStrings.CommaText :=s;Exit;end;case iType of0: Seperator :=',';1: Seperator :=';';2: Seperator :=' ';3: Seper 阅读全文
posted @ 2008-09-10 18:50 孤独的猫 阅读(182) 评论(0) 推荐(0) 编辑

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