易截截图软件、单文件、免安装、纯绿色、仅160KB

Delphi Pubic Function

function GetFileSizeString(const pFileName: String):String;
var
iFileSize: Int64;
begin
Result := '0';
iFileSize := FileSizeByName(pFileName);
Result := IntToStr(iFileSize);
end;
  function WinExecAndWait(strFileName: string; uCmdShow: UINT): DWORD;
var
cAppName: array[0..512] of char;
cCurDir: array[0..255] of char;
strWorkDir: string;
StartupInfo: TStartupInfo;
ProcessInfo: TProcessInformation;
begin
StrPCopy(cAppName, strFileName);
GetDir(0, strWorkDir);
StrPCopy(cCurDir, strWorkDir);
FillChar(StartupInfo, Sizeof(StartupInfo), #0);
StartupInfo.cb := SizeOf(StartupInfo);
StartupInfo.dwFlags := STARTF_USESHOWWINDOW;
StartupInfo.wShowWindow := uCmdShow;
if not CreateProcess(nil, cAppName, nil, nil, true, CREATE_NEW_CONSOLE or NORMAL_PRIORITY_CLASS,
nil, nil, StartupInfo, ProcessInfo) then
Result := INFINITE
else
begin
WaitforSingleObject(ProcessInfo.hProcess, INFINITE);
GetExitCodeProcess(ProcessInfo.hProcess, Result);
CloseHandle(ProcessInfo.hProcess);
CloseHandle(ProcessInfo.hThread);
end;
end;


相关文档:

Delphi Shl与Shr 移位操作介绍

 格式:操作数 Shl/Shr 移动位数
说明:操作数与返回值都是整数
例子:16(10) = 10000(2)
     16(10) Shr 1 = 10000(2) Shr 1 = 1000(2) = 8(10)
     16(10) Shr 2 = 10000(2) Shr 2 = 100(2) = 4(10)
说明:一个整数(I)按位左移一位,相当于把它乘以2,即 I * 2
&n ......

delphi启动服务停止服务新建服务的方法

 
unit Servicescontrol;
   
interface  
uses Windows,Messages,SysUtils,Winsvc,Dialogs;
   
function StartServices(Const SvrName:String):Boolean;
function StopServices(Const SvrName:String):Boolean;
function QueryServiceStatu(Const SvrName:  ......

翻译一半的Delphi汇编帮助

 The built-in assembler allows you to write assembly code within Delphi programs. It has the following features:
内嵌的汇编器允许在delphi程序中书写汇编代码,他有如下特性:
Allows for inline assembly
允许内嵌汇编
    Supports all instructions found in the Intel Pentium III, In ......

delphi发送焦点移动消息的函数及参数


procedure TForm_BaseMDI.FormKeyPress(Sender: TObject; var Key: Char);
begin
  if Key = #13 then
     begin
     Key := #0;
     SendMessage(Handle, 48384, 9, 0);     
     end;
end; ......

Delphi编译指令说明

《Delphi下深入Windows核心编程》(附录A Delphi编译指令说明)
摘抄人:麻子 qq:71892967
Delphi快速高小的编译器主要来自Object PASCAL的严谨,使用Delphi随时都在与编译器交流,大部分情况下不需要干涉编译器的运行,但是有时也需要对编译器进行必要的设置。
*************************************************** ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号