引用 unit Unit1; interface uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls; type TForm1 = class(TForm) Label1: TLabel; Label2: TLabel; Edit1: TEdit; Edit2: TEdit; Button1: TButton; Button2...
以前写的几个 Base64 与 Quoted-Printable的解码与编码函数。贴出来给有用的朋友参考一下。 { Quoted-Printable 解码 } function DecodeQuotedPrintable(Str: String): String; { Quoted-Printable 编码 } function Encode...
//加密函数 Function EncrypKey(Src: String; Key: String): string; var idx: integer; KeyLen: integer; KeyPos: integer; offset: integer; dest: string; SrcPos: integer; SrcAsc: integer; TmpSrcAsc: integer; Range: integer; begin KeyLen := Le...
// 假如程式路徑在 c:\projects\bin\project1.exe ShowMessage( 'Drive = ' +ExtractFileDrive (Application . Exename)); //C: ShowMessage( 'Dir = ' +ExtractFileDir (Application . Exename)); //c:\projects\bin ShowMessage( 'Path = ' +Extract...
try//尝试执行 {SomeCode} except//出错的时候执行, Except有特定的错误类型 {SomeCode} end; try//尝试执行 {SomeCode} finally//无论如何都强制执行 {SomeCode} end; 例: try Age:=StrToInt(Edit1.Text); ShowMessage(For...
当Close是一个主窗体时,程序会退出. Close会发生FormClose事件,FormCloseQuery事件 Halt会发生FormDestory事件, Application.Terminate以上三个事件都不会发生 Application.Terminate就是程序结束了。整个程序...
var hwnd: hwnd;//句柄 PostMessage(hwnd,WM_SYSCOMMAND, SC_MINIMIZE,0); //最小化 PostMessage(hwnd,WM_SYSCOMMAND, SC_MAXIMIZE,0);//最大化 PostMessage(hwnd,WM_SYSCOMMAND, SC_CLOSE,0);//关闭 窗口最小化时将释放占用的资源 P...
防止程序被重复执行(第一法) Windows95的程序一般都可以重复执行,例如你按下WIN+E组合键即启动资 源管理器,如果再按WIN+E组合键又会出现一个资源管理器,这两个程序互不干 扰。有...
Delphi使程序的窗口出现在最前面并激活 var pt, OldPt, NewPt: TPoint; begin //判断Application是否最小化,而不是主窗口的Handle, 使用Restore来还原 if IsIconic(Application.Handle) then Application.Restore; SetWi...
1。在工程单元中引用windows单元。 2。定义一个变量,类型为hMutex:THandle. 3. hMutex := CreateMutex(nil, False, 'TheStandard'); 4.if GetLastError = ERROR_ALREADY_EXISTS then begin CloseHandle(hMutex); ShowMessage('本软件...