首先十分感謝你的使用.
同時也希望你能擴充這個功能包...發佈你的擴充後的版本.
-------------------------------------------------- -------
^^
聲明這個元件包只能在delphi7上正常安裝.
如果您用的是delphi6.則會在安裝時發生錯誤。
-------------------------------------------------
作者:李金浩
QQ:67260745
E-mail:[email protected]
功能包中的大部分功能模組為本人自己所寫。 。部分收錄我的網友的作品及網路比較精典的程式段。
Function HexBCDToint(sHexBCD:Byte):integer;
Function IntToBCD(Int:Byte):word;
Function MinuteToTime(Minute:Double):TdateTime;overload;//分鐘到標準時間的轉換Function MinuteToTime(Minute:Double;var DayCount:integer):TdateTime;overload;
//------------------------------------------------ ------------------------------
Function GetWeekOfChina(dDay:TdateTime):string;//得到星期Function GetWeekOfNum(dDay:TdateTime):integer;
//------------------------------------------------ ------------------------------
Function IsStrAsNumber(NumStr:string):Bool;//判斷字串是否有效數字在字串Function IsStrInOtherStr(mainStr,FindStr:string):Bool;//偵測在一個字串中是否包含另一個字串function IsCOMClassRegistered (GUID:TGUID):Boolean;//判斷一個COM物件是否已註冊Function IsBDEInstalled:boolean;//查看BDE是否安裝function GetPYIndexChar( hzchar:string):char;///得到漢字的首字母Function Squ(X ,Y:integer):integer;overload;//計算x的Y次方Function Squ(X:Double;Y:integer):Double;overload;//計算x的Y次方Function RandomNumByGUID:String;
//--------------系統功能------------
Function AppRunOnce:Boolean;//讓程式只能執行一個實例procedure AutoRunByReg(FileName:string= );//讓程式自動執行procedure DelAutoRunByReg(KeyName:string= );//刪除一個自啟動項目procedure MoveWindow(Reg(handle:string= );//刪除一個自啟動項procedure MoveWindow(handle: Thandle);overload;//托動無標題窗體Function GetAppPath(AddLastName:string= ):string;//得到程式的目前目錄Procedure ReMoveWinTitle(Form:Tform);//移去窗體的Title;
procedure BeepEx(Freq:Word;MSecs:LongInt); //DoBeep呼叫procedure ClickStartMenu;//透過程式碼擊活開始功能表procedure OpenScreenSave;//開啟螢幕保護// procedure DelTree(DirName:String);//刪除目錄procedure DeleteDir(SourcePath: String); //刪除指定資料夾(含子資料夾),資料夾及其夾內檔案可以具有唯讀或隱藏屬性procedure DelSelfApp;//程式在運作完後就刪除自己(*- ----------------*)
procedure HideTaskBar(bHide:boolean=False);//顯示或遮蔽TaskBar
procedure DisplayOFFON(SW: boolean);//關閉和開啟顯示器procedure HideDesktop(sw:Boolean=false);//顯示和隱藏桌面procedure HideDesktopAndTaskBar(sw:Boolean=false);//同時隱藏桌面和工作列(sw:Boolean=false);//隱藏系統通知區域procedure HideWinButton(sw:Boolean=false);//隱藏開始按鈕procedure HideQuickLaunchBar(sw:Boolean=false);//隱藏快速啟動按鈕列// procedure HAppInTastWinideAppInTastWinideAppInTastWinideAppInTastWinideAppInTastWinideAppInTastWinideAppInTastWinideAppInTastWinideAppInTastWinideAppInTastWinideAppInTastWinideAppInTastWinideAppInTastWinideAppInTastWinideAppInTastWinideAppInTastWinideAppInTastWinideAppInTastWinideAppInTastWinideAppInTastWinideAppInTastWinideAppInTastWinideAppInTastWinideAppInTastWinideAppInTastWinideAppInTastWinideAppInTastWinideAppInTastWinideAppInTastWinideAppInTastWinideTAppInTastWinideTAppInTastWinideHAppInTastWinideTAppInTastWinideTAppInT》 (sw:Boolean=False);//使程式在工作管理員中隱藏procedure DisbleQuikKey(sw:boolean=false);//屏蔽ALT+F4和ALT+Ctrl+Del
Function GetTaskBarHeight:integer;//得到工作列的高度
//------------------------------------------------ ------------------------------
function GetDesktopListViewHandle: THandle; { 得到桌面清單試圖的句柄}
procedure MinWinAll;//最小化所有的窗體procedure CloseWinAll;//關閉所有窗體procedure DrawWindowRect(handle: Thandle;wColor: Tcolor=clBlack;PenWidth:integer=1);//給窗體加個邊框Procedure Set (Sender:TObject;const defFont:Tfont=nil);//設定parent窗體的預設字型{得到memo中遊標所在的位置,行號,行長}
procedure GetMemoMousePos(m:Tmemo;var posValue:TmemoPos);overload;
procedure GetMemoMousePos(m:TRichEdit;var posValue:TmemoPos);overload;
//Memo翻頁procedure setScrollPos(MHandle:Thandle;const pos:TClickType=PageDown);overload;
//得到指定窗體的大小procedure GetWinRect(const WinHandle:HWND;var winRect:TwinRect);
procedure TimeDelay(DT:Dword);//精確毫秒延時procedure SetIPaddress(SIP: TNetValue;const isAuto:boolean=false);//設定網路Ip位址Function GetLocalIP:string;//取得本機的IP位址Procedure OpenURL(URL:string);//開啟1個web URL
//================================================ ================================
// 這部分的函數摘自其他作者處.姓名不詳
//================================================ ================================
function GetDisplayFrequency: Integer; //取得顯示刷新率function GetIdeSerialNumber: String; //取得第一個硬碟的序號function GetCPUSpeed: Double; //取得目前CPU速率Function GetCPUID:string; //取得CPU ID
Function GetCPUVendor: string; //取得CPU 類型Function GetFileLastAccessTime(sFileName:string):TDateTime; //取得檔案最後存取日期和時間Function GetFileCreateTime(const strFileName:string):TDateTime; //取得檔案建立時間Function GetFileModifyTime(constst strFileName:string):TDateTime; //取得檔案修改時間Function GetDNSTOIP(DNSName:String):String; //把網域名稱轉換成IP位址Function GetDNSName(IPAddress:String):String; //把IP位址轉換成網域
//================================================ ================================
// 摘用部分結束
//================================================ ================================
//--------------------------------
// procedure GetNetConf
//----------INI檔案操作集-----------
(*_讀ini檔_*)
Function ReadIniFile(const FileName,Section, Ident:string; Default: string):string; overload;
Function ReadIniFile(const FileName,Section, Ident:string; Default: integer):integer; overload;
Function ReadIniFile(const FileName,Section, Ident:string; Default: Double):Double; overload;
Function ReadIniFile(const FileName,Section, Ident:string; Default: Boolean):Boolean; overload;
Function ReadIniFile(const FileName,Section, Ident:string; Default: TdateTime):TdateTime; overload;
(*_寫INI檔_*)
procedure WriteIniFile(const FileName,Section, Ident:string; Value:string);overload;
procedure WriteIniFile(const FileName,Section, Ident:string; Value:integer);overload;
procedure WriteIniFile(const FileName,Section, Ident:string; Value:Double);overload;
procedure WriteIniFile(const FileName,Section, Ident:string; Value:Boolean);overload;
procedure WriteIniFile(const FileName,Section, Ident:string; Value:TdateTime);overload;
//--------------------------
(*模擬滑鼠點選*)
procedure SendMouseClick(const WinHandle:HWND;const PosX,PosY:integer;const ClickFlag:TClickType=vKeyclick);
(*模擬鍵盤按鍵*)
procedure SendKey(const WinHandle:HWND;const Vkey:word;const KeyClickFlag:TClickType=vkeyDown);
procedure SendComBoKey(const CtrlKey,FnKey:word);//如:發送ALT+F4
//-------------------------
{在指定的chart控制項上畫1條數直線,並傳回mouse所在的index}
Function ChartMoveLine(Chart:Tobject;MousePos_X:Integer;LineColor:TColor=clRed):integer;
procedure DataToExcelCSV(SaveFileName:string;DataSet:TDataSet;ShowCompleteBoX:Boolean=True;GroupCount:integer=1);
(*---------聲音DoBeep發聲----------*)
// procedure Destroy;
{------------------------------------------------- ------------------------------
作者: 不死鳥^^me 的好朋友提供的部分代碼日期: 2004.03.31
-------------------------------------------------- -----------------------------}
//將資料轉為Excel文件,TDataSet中visible為False的欄位不加入// function DataToExcel(myExcelName: String; myDataSet: TDataSet): Boolean;
function ToBigRMB(RMB: string): string; //小寫金額轉大寫function IsRightDate(mInputDate:String):Boolean;//輸入的日期是否正確//字串簡單加密、解密函數key=1時為加密,0為解密,利用xor操作function Decrypt(const s: string; key:Byte=1): string;
function RightCopy(S: string; Index,count:Integer): string; //從右第Index位元複製Count個字符