请问各位老兄!我在程序中用到两个函数,一个是获得内存信息函数:globalmemorystatus(meminfo);可是在编译的时候就出现错误;
还有一个是获得硬盘信息:
getdiskfreespaceex('c:',freebytesavailabletocaller,totalsize,@freesize);
也是在编译时出错!请问都是什么原因!个参数都是什么意识,什么类型!
谢谢指教1请详细讲解!万分感谢!!!
还有一个是获得硬盘信息:
getdiskfreespaceex('c:',freebytesavailabletocaller,totalsize,@freesize);
也是在编译时出错!请问都是什么原因!个参数都是什么意识,什么类型!
谢谢指教1请详细讲解!万分感谢!!!
解决方案 »
- 通过滚轮使鼠标正下方控件的滚动条移动
- 在Delphi的MDI程序中如何实现类似WPS2000的文件切换标签
- 刚开始学Delphi,学到数据库操作的时候,有关close的一个问题,请教一下
- 不解中????急救-----waiting for you!!!!
- 效率,效率!dbf 插入 oracle
- 各位大哥请进!!UP有分
- DELPHI6和C++ BUILDER6装在一起的问题
- 我想编一个能记录鼠标移动的整个过程,把他记录下来,求代码!分不够再加200。
- 一个小问题~~~!!!
- 急!关于database desktop的restructure命令,很简单。绝对给分
- 如何把 一段代码 赋给 一个过程! (散分)急啊! 不知道大家这样做过没?
- 在delphi 中如何调用*.wav文件!大虾帮忙!!
procedure TGlobalMemoryStatusForm.ButtonGlobalMemoryStatusClick(
Sender: TObject);
var
GlobalMemoryInfo : TMemoryStatus; // holds the global memory status information
begin
{set the size of the structure before the call.}
GlobalMemoryInfo.dwLength := SizeOf(GlobalMemoryInfo); {retrieve the global memory status...}
GlobalMemoryStatus(GlobalMemoryInfo); {and display the information} Label1.caption := 'Results of GlobalMemoryStatus:';
Label2.caption := 'Record structure size: '+IntToStr(
GlobalMemoryInfo.dwLength)+' bytes';
Label3.caption := 'Current memory load: '+IntToStr(
GlobalMemoryInfo.dwMemoryLoad)+'%';
Label4.caption := 'Total physical memory: '+Format('%.0n',[
GlobalMemoryInfo.dwTotalPhys/1])+' bytes';
Label5.caption := 'Total available physical memory: '+Format('%.0n',[ GlobalMemoryInfo.dwAvailPhys/1])+' bytes';
Label6.caption := 'Total paging file size: '+Format('%.0n',[
GlobalMemoryInfo.dwTotalPageFile/1])+' bytes';
Label7.Caption := 'Total available paging file memory: '+Format('%.0n',[
GlobalMemoryInfo.dwAvailPageFile/1])+' bytes';
Label8.caption := 'Total virtual memory: '+Format('%.0n',[
GlobalMemoryInfo.dwTotalVirtual/1])+' bytes';
Label9.caption := 'Total available virtual memory: '+Format('%.0n',[ GlobalMemoryInfo.dwAvailVirtual/1])+' bytes';
end;
getdiskfreespaceex例子
procedure TForm1.Button1Click(Sender: Tobject);
var
SectorsPerCluster, // holds the sectors per cluster
BytesPerSector, // holds the bytes per sector
FreeClusters, // holds the number of free clusters
Clusters: DWORD; // holds the total number of disk clusters
begin
{retrieve the disk space information}
if GetDiskFreeSpace('C:\',SectorsPerCluster,BytesPerSector, FreeClusters,Clusters) then
begin
{display the disk space information}
Panel2.Caption := IntToStr(SectorsPerCluster);
Panel3.Caption := IntToStr(BytesPerSector);
Panel4.Caption := IntToStr(FreeClusters);
Panel5.Caption := IntToStr(Clusters);
Panel6.Caption := IntToStr(FreeClusters*BytesPerSector*SectorsPerCluster);
Panel7.Caption := IntToStr(Clusters*BytesPerSector*SectorsPerCluster); end;
end;