请知道的提示一下,谢谢
解决方案 »
- delphi 摄像头捕捉图像传输 如何解决闪烁问题?
- WebBrowser(小问题送分)
- 为什么我的下载进度会有问题?这样写不对吗?
- 挑战2----------如何在sqlserver2000中实现两个数据表的合并!!!
- 高难sql语句问题,高手请看过来(200分送上---1)
- 这是什么意思,ConnectionOpen(create())报错
- 进来看看这一段小程序,解决后马上给分的!up就给分!
- 怎样在桌面上写字
- 【求救】,Delphi怎么实现英文短信收发,在线等。。。
- 支持断点续传----新手不可不看-高手更要看
- 紧急求救:如何只使treeview的叶子节点显示选择框(checkbox功能),而所有的有子节点的父节点均不带选择框。
- 请问去那里下载Raize Components ?????急……
dwLength: DWORD;
dwMemoryLoad: DWORD;
dwTotalPhys: DWORD;
dwAvailPhys: DWORD;
dwTotalPageFile: DWORD;
dwAvailPageFile: DWORD;
dwTotalVirtual: DWORD;
dwAvailVirtual: DWORD;Function called to populate TMemoryStatus:procedure GlobalMemoryStatus(var lpBuffer: TMemoryStatus); stdcall;WINAPI help for said function: VOID GlobalMemoryStatus(
// pointer to the memory status structure
LPMEMORYSTATUS lpBuffer
); Code for populating a TMemo with Information about system resources:unit Unit1;interfaceuses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls;type
TForm1 = class(TForm)
Button1: TButton;
Memo1: TMemo;
procedure Button1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;var
Form1: TForm1;implementation{$R *.DFM}procedure TForm1.Button1Click(Sender: TObject);
var
MemoryStatus: TMemoryStatus;begin Memo1.Lines.Clear; MemoryStatus.dwLength := SizeOf(MemoryStatus); GlobalMemoryStatus(MemoryStatus); with MemoryStatus do
begin
// Size of MemoryStatus record
Memo1.Lines.Add(IntToStr(dwLength) +
' Size of ''MemoryStatus'' record');
// Per-Cent of Memory in use by your system
Memo1.Lines.Add(IntToStr(dwMemoryLoad) +
'% memory in use');
// The amount of Total Physical memory allocated to your system.
Memo1.Lines.Add(IntToStr(dwTotalPhys) +
' Total Physical Memory in bytes');
// The amount available of physical memory in your system.
Memo1.Lines.Add(IntToStr(dwAvailPhys) +
' Available Physical Memory in bytes');
// The amount of Total Bytes allocated to your page file.
Memo1.Lines.Add(IntToStr(dwTotalPageFile) +
' Total Bytes of Paging File');
// The amount of available bytes in your page file.
Memo1.Lines.Add(IntToStr(dwAvailPageFile) +
' Available bytes in paging file');
// The amount of Total bytes allocated to this program
// (generally 2 gigabytes of virtual space).
Memo1.Lines.Add(IntToStr(dwTotalVirtual) +
' User Bytes of Address space');
// The amount of avalable bytes that is left to your program to use.
Memo1.Lines.Add(IntToStr(dwAvailVirtual) +
' Available User bytes of address space');
end; // with
end; // procedureend.
var
t, mhi, mlo, nhi, nlo: dword;
shr32 : comp;
begin
shr32 := 65536;
shr32 := shr32 * 65536;
t := GetTickCount;
while t = GetTickCount do ;
asm
DB 0FH,031H // rdtsc
mov mhi,edx
mov mlo,eax
end;
while GetTickCount < (t + 1000) do ;
asm
DB 0FH,031H // rdtsc
mov nhi,edx
mov nlo,eax
end;
Result := ((nhi * shr32 + nlo) - (mhi * shr32 + mlo)) / 1E6;
end;
function GetWindowsVersion : string;
var
OsVinfo : TOSVERSIONINFO;
HelpStr : array[0..50] of char;
begin
ZeroMemory(@OsVinfo,sizeOf(OsVinfo));
OsVinfo.dwOSVersionInfoSize := sizeof(TOSVERSIONINFO);
if GetVersionEx(OsVinfo) then
begin
if OsVinfo.dwPlatformId = VER_PLATFORM_WIN32_WINDOWS then
begin
if (OsVinfo.dwMajorVersion = 4) and
(OsVinfo.dwMinorVersion > 0) then
StrFmt(HelpStr, 'Windows 98 - Version %d.%.2d.%d',
[OsVinfo.dwMajorVersion, OsVinfo.dwMinorVersion,
OsVinfo.dwBuildNumber and $FFFF])
else
StrFmt(HelpStr, 'Windows 95 - Version %d.%d Build %d',
[OsVinfo.dwMajorVersion, OsVinfo.dwMinorVersion,
OsVinfo.dwBuildNumber and $FFFF]);
end;
if OsVinfo.dwPlatformId = VER_PLATFORM_WIN32_NT then
StrFmt(HelpStr, 'Microsoft Windows NT Version %d.%.2d.%d',
[OsVinfo.dwMajorVersion, OsVinfo.dwMinorVersion,
OsVinfo.dwBuildNumber and $FFFF]);
end
else
StrCopy(HelpStr, 'GetversionEx() Error');
Result := string(HelpStr);
end;检测内存
var memory:TMemoryStatus;
begin
memory.dwLength:=sizeof(memory);
GlobalMemoryStatus(memory);
label10.Caption:='共:'+inttostr(trunc(memory.dwTotalPhys/(1024)))+'K/可用:'
+inttostr(trunc(memory.dwAvailPhys/(1024)))+'K';
label5.Caption:=syscfg.Provider;
label9.Caption:=inttostr(trunc(GetCpuSpeed));
label12.Caption:=GetWindowsVersion;
label14.Caption:=inttostr(screen.Width)+'*'+inttostr(screen.Height);
end;