1:如何得到硬盘,cpu的序列号?
以下代码(硬盘)为什么不行呢:
function Tregform.Getfirstno(DiskChar:Char):string;
var
SerialNum:pdword;
a,b:dword;
Buffer:array [0..255] of char;
begin
result:='';
if GetVolumeInformation(PChar(diskchar+':\'),Buffer,SizeOf(Buffer),SerialNum,a,b,nil,0) then
Result:=IntToStr(SerialNum^);
end; 调用:eidt1.text:=getfirstno(c);2.如何让一个窗体改变大小到一定值后,不能再小。象“超级解霸”,“金山词霸”等?
以下代码(硬盘)为什么不行呢:
function Tregform.Getfirstno(DiskChar:Char):string;
var
SerialNum:pdword;
a,b:dword;
Buffer:array [0..255] of char;
begin
result:='';
if GetVolumeInformation(PChar(diskchar+':\'),Buffer,SizeOf(Buffer),SerialNum,a,b,nil,0) then
Result:=IntToStr(SerialNum^);
end; 调用:eidt1.text:=getfirstno(c);2.如何让一个窗体改变大小到一定值后,不能再小。象“超级解霸”,“金山词霸”等?
你要是
要的的话
可以发邮件给我
我自己写了
个DLL可以给你
这些问题
都是
老生常谈了
:)
[email protected]
public
procedure onminsize(var msg:twmsyscommand);message wm_syscommand;
procedure TForm1.onminsize(var msg: twmsyscommand);
begin
if msg.CmdType=SC_MINIMIZE then
begin
form1.Width:=100;
form1.Height:=100;
form1.Left:=100;
form1.Top:=300;
exit;
end;
inherited;
end;
re:使用属性:
TForm.Constraints.MaxHeight
TForm.Constraints.MinHeight
TForm.Constraints.MaxWidth
TForm.Constraints.MinWidth可以控制
begin
if self.Height < 300 then self.Height :=300 ;
if self.Width < 400 then self.Width :=400 ;
end;
function cpuid:longint;assembler;register;
var
temp:longint;
begin
asm
push ebx
push edi
mov edi,eax
mov eax,1
dw $a20f
mov temp,edx
pop edi
pop ebx
end;
result:=temp;
end;
begin
result:=inttohex(cpuid,8);
end;