⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 xkernel.txt

📁 我自己用的Delphi函数单元 具体说明见打包文件的HELP目录下面
💻 TXT
字号:
unit xKernel;


//从指定的窗口句柄取得建立此窗口的模块文件名。
function GetApplicationFileName(Wnd: HWND): string;

//取得本地计算机名
function GetLocalComputerName: string;

//取得本地用户名
function GetLocalUserName: string;

//调用这个函数的程序在退出之后会自动删除自身。
procedure DeleteMe;

//把快捷键变成一个字符串
function ShortCutToString(const HotKey:word):string;

//删除到垃级筒
function DeleteToRecycleBin(hWindow: HWND; sFileName: string): Boolean;

//通过外壳执行,调用ShellExecute
function ExecuteByShell(const sAction, sFileName, sPara: string): Boolean;

//执行进程
function Execute(const Command: string; bWait: Boolean; bShow: Boolean; PI: PProcessInformation): Boolean;

//执行子进程,等待返回
function ExecAndWait(const Command: String; bShow: Boolean = True): Boolean;

//执行子进程,立即返回
function ExecAndGo(const Command: String; bShow: Boolean = True): Boolean;

//重定向执行子进程,等待执行后返回,SL中存储重定向信息。
function ExecRedirect(const Command: String; SL: TStrings): Boolean;

//启动一个进程
function StartProcess(const sFilePath: String): Boolean;
//关闭一个进程
procedure CloseProcess(const sWndClass:string);
//查找一个进程
function FindProcess(const sWndClass:string):Boolean;


//输出到的操作系统的调试信息。若程序在IDE环境中执行,则输出到Event Log。
//bSystem = True时,输出到操作系统;
//bSystem = False时,向自定义调试终端发送调试信息
procedure DebugStr(S: string ; bSystem : Boolean = True);

//输出到的操作系统的带格式的调试信息。格式信息与SysUtils.Format相同。
//bSystem = True时,输出到操作系统;
//bSystem = False时,向自定义调试终端发送调试信息
//如: DebugStrFmt('%d %s',[ResponesNo,ReceiveMessage]);
procedure DebugStrFmt(const Format: string; const Args: array of const ; bSystem : Boolean = True);

//将任意值转换为调试信息,发送。bSystem指示发往自定义调试器,还是系统调试器。
procedure DebugStrVar(const V: Variant; bSystem : Boolean = True);


//向自定义调试终端发送调试信息
procedure Debug(S: string);
procedure DebugEx(const Format: string; const Args: array of const);
procedure DebugV(const V: Variant);

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -