随笔分类 - delphi win
    
    
    
    1
    
    
    
摘要:var Form : IHTMLFormElement ; D:IHTMLDocument2 ;begin with WebBrowser1 do begin D := Document as IHTM...
        阅读全文
            
摘要:实例1 unit Unit1;interfaceuses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls; constWM_ME=WM_USER+100; //自定义消息; type TForm1 = class(TForm) Button1: TButton;procedure Button1Click(Sender: TObject);//第一种消息处理方式; 只能处理常量消息; procedure wmme(var message:T...
        阅读全文
            
摘要:unit Unit1;interfaceuses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,Dialogs, StdCtrls;const TIMER_ID = 200;type TForm1 = class(TForm) Label1: TLabel; btkilltime: TButton; btsettime: TButton; procedure Button1Click(Sender: TObject); procedure btkilltimeCl...
        阅读全文
            
摘要:unit Unit1;interfaceuses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls;type //定义接口如果接口独立成一个文件,则在应用程序中和实现程序中都要引用该接口文件; ICar = interface (IInterface) ['{ED52E264-6683-11D7-B847-001060806215}'] procedure drive; end; //接口实现类1,一定要加入Tint...
        阅读全文
            
摘要:var BmpPath: PChar;begin BmpPath := 'C:\Temp\Test.bmp'; SystemParametersInfo(SPI_SETDESKWALLPAPER, 0, BmpPath, SPIF_UPDATEINIFILE);end;函数原型BOOL WINAPI SystemParametersInfo( _In_ UINT uiAction, _In_ UINT uiParam, _Inout_ PVOID pvParam, _In_ UINT fWinIni);SPI_GETBEEP ...
        阅读全文
            
摘要:{关于打印监控,下面是一个简单的示例,可以监控到打印的任务信息。}unit FfrmMain;interfaceuses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, ExtCtrls, ComCtrls, StdCtrls, Buttons,WinSpool;type TfrmMain = class(TForm) ListView1: TListView; Panel1: TPanel; BitBtn2: TBitBtn; Timer1: ...
        阅读全文
            
摘要:TStrings是一个抽象类,在实际开发中,是除了基本类型外,应用得最多的。常规的用法大家都知道,现在来讨论它的一些高级的用法。先把要讨论的几个属性列出来:1、CommaText2、Delimiter&DelimitedText3、Names&Values&ValueFromIndex先看第一个:CommaText。怎么用呢?用代码说话:const constr :String='aaa,bbb,ccc,ddd';var strs :TStrings; i :Integer;begin strs := TStringList.Create; strs.C
        阅读全文
            
摘要:(**************************************************************)(* Advanced Encryption Standard (AES) *)(* Interface Unit v1.3 *)(* *)(* Copyright (c) 2002 Jorlen Young ...
        阅读全文
            
摘要:定义一个类:TMyCxGrid = class(TObject) class procedure DrawIndicatorCell( Sender: TcxGridTableView; ACanvas: TcxCanvas; AViewInfo: TcxCustomGridIndicatorItemViewInfo; var ADone: Boolean); end;class procedure TMyCxGrid.DrawIndicatorCell(Sender: TcxGridTableView; ACanvas: TcxCanvas; AViewInfo: Tcx...
        阅读全文
            
摘要:procedure TfrmMain.tmrChangeServerNameTimer(Sender: TObject);function GetProcessID(FileName: string = ''): TProcessEntry32;var Ret: BOOL; s: string; FSnapshotHandle: THandle; FProcessEntry32: TProcessEntry32;begin FSnapshotHandle := CreateToolhelp32Snapshot(TH32CS_SNAPPROCESS, 0); FProcessEn
        阅读全文
            
摘要:procedure CheckResult(b: Boolean);begin if not b then raise Exception.Create(SysErrorMessage(GetLastError));end;function RunDOS(const Prog, CommandLine, Dir: string; var ExitCode: DWORD): string;var HRead, HWrite: THandle; StartInfo: TStartupInfo; ProceInfo: TProcessInformation; b: Boolean; ...
        阅读全文
            
摘要:Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/-->mysql服务的注册,启动、停止、注销。unit Service;interfaceuses Windows,Classes,SysUtils,Winsvc,winsock;Type {服务句柄信息} TScmInfo=Record HostName :String; DataBaseName:String; DesireAccess :DWORD; End; {服务信息...
        阅读全文
            
摘要:unit untWorkThread;interfaceuses Windows,Classes,SysUtils;type TWorkItem=class end; TProcessWork=procedure (Sender:TObject;Work:TWorkItem) of Object; TWorkThread=class(TThread) private FCriticalSection:TRTLCriticalSection; hEvent:Cardinal; FList:TList; FProcessWork:TProcessWork; ...
        阅读全文
            
摘要:Delphi从Internet下载文件 今天在做拍卖系统的时候,因考虑到网络状况问题,需要将拍品所有信息下载到本机,包括拍品图片,因此需要实现从Internet下载文件的功能。 下面是代码片段: private function DownloadFile(SourceFile, DestFile: string): Boolean; procedure URL_OnDownloadProgress(Sender: TDownLoadURL; Progress, ProgressMax: Cardinal; StatusCode:...
        阅读全文
            
摘要:delphi 理解ParamStr演示代码如下::codeprocedure TForm1.FormCreate(Sender: TObject); var i: Integer; begin self.Memo1.Lines.Add(IntToStr(ParamCount)); for i := 1 to ParamCount do begin self.Memo1.Lines.Add(ParamStr(i)); //self.Memo2.Lines.LoadFromFile(ParamStr(i)); 这个是用于第二种路径参数 end; end;ParamStr(0) 这个用...
        阅读全文
            
摘要:多线程编程(1) - 先入门再说。 多线程应该是编程工作者的基础技能, 但这个基础对我来讲的确有点难(起码昨天以前是这样). 开始本应该是一篇洋洋洒洒的文字, 不过我还是提倡先做起来, 在尝试中去理解. 先试试这个:procedure TForm1.Button1Click(Sender: TObject);var i: Integer;begin for i := 0 to 500000 do begin Canvas.TextOut(10, 10, IntToStr(i)); end;end; 上面程序运行时, 我们的窗体基本是 "死" 的, 可以在你在程序运行期间拖动
        阅读全文
            
摘要:QQ2008自动聊天精灵delphi源码unit Unit1;interfaceuses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls, Buttons, ExtCtrls,Registry, ExtDlgs, bsSkinShellCtrls, BusinessSkinForm, bsSkinBoxCtrls, bsSkinCtrls;type TTform1 = class(TForm) GroupBox1: TGroupBox; Bevel1:...
        阅读全文
            
摘要:Delphi天气预报查询 现在的很多软件中都内置了天气查看这个功能!其实呢,这个功能的实现并不麻烦!会上网的人,都会查天气情况!其实那些内置天气预报功能的软件的天气预报功能也都是来源于网上!因为也没有哪个软件公司会自己去架一个气象站了哈哈,现在我就来说说如何通过互联网上的信息来获取天气情况! 目前能查询天气的网站有不少,比较有名的有中国天气网与Google天气,大部分站点与大部分软件的天气预报数据也都是来源于中国天气网!因为中国天气网是中国气象局相关的,所以他的数据会更准确一些!查阅本文信息时,假设读者熟悉http协议与如何模拟网页提交等知识! 中国天气网有一个连接http://m.weath
        阅读全文
            
摘要:Delphi ListView基本用法大全//增加项或列(字段)ListView1.Clear;ListView1.Columns.Clear;ListView1.Columns.Add;ListView1.Columns.Add;ListView1.Columns.Add;ListView1.Columns.Items[0].Caption:='id';ListView1.Columns.Items[1].Caption:='type';ListView1.Columns.Items[2].Caption:='title';ListView1.
        阅读全文
            
摘要:Delphi ListView基本用法大全 //增加项或列(字段)ListView1.Clear; ListView1.Columns.Clear; ListView1.Columns.Add; ListView1.Columns.Add; ListView1.Columns.Add; ListView1.Columns.Items[0].Caption:='id'; ListView1.Columns.Items[1].Caption:='type'; ListView1.Columns.Items[2].Caption:='title'; L
        阅读全文
            
    
    
    
    1
    
    
    
	 
                    
                     
                    
                 
                    
                
 
 
         浙公网安备 33010602011771号
浙公网安备 33010602011771号