Mahmood_M
چهارشنبه 03 اسفند 1384, 20:37 عصر
1. به دست آوردن نوع فرمت درایو ( NTFS یا FAT ) :
function GetHardDiskPartitionType(const DriveLetter: Char): string;
var
NotUsed: DWORD;
VolumeFlags: DWORD;
VolumeInfo: array[0..MAX_PATH] of Char;
VolumeSerialNumber: DWORD;
PartitionType: array[0..32] of Char;
begin
GetVolumeInformation(PChar(DriveLetter + ':\'),
nil, SizeOf(VolumeInfo), @VolumeSerialNumber, NotUsed,
VolumeFlags, PartitionType, 32);
Result := PartitionType;
end;
procedure TForm1.Button1Click(Sender: TObject);
begin
ShowMessage(GetHardDiskPartitionType('c'));
ShowMessage(GetHardDiskPartitionType('a'));
end;
2. تنظیم صدای یک میکروفون و قطع صدای آن :
function SetMicrophoneVolume(bValue: Word): Boolean;
var
hMix: HMIXER;
mxlc: MIXERLINECONTROLS;
mxcd: TMIXERCONTROLDETAILS;
vol: TMIXERCONTROLDETAILS_UNSIGNED;
mxc: MIXERCONTROL;
mxl: TMixerLine;
intRet: Integer;
nMixerDevs: Integer;
begin
nMixerDevs := mixerGetNumDevs();
if (nMixerDevs < 1) then
begin
Exit;
end;
intRet := mixerOpen(@hMix, 0, 0, 0, 0);
if intRet = MMSYSERR_NOERROR then
begin
mxl.dwComponentType := MIXERLINE_COMPONENTTYPE_SRC_MICROPHONE;
mxl.cbStruct := SizeOf(mxl);
intRet := mixerGetLineInfo(hMix, @mxl, MIXER_GETLINEINFOF_COMPONENTTYPE);
end;
end;
3. تبدیل فایل فلش به فایل اجرایی ( Exe ) :
function Swf2Exe(S, D, F: string): string;
var
SourceStream, DestinyStream, LinkStream: TFileStream;
flag: Cardinal;
SwfFileSize: Integer;
begin
Result := 'something error';
DestinyStream := TFileStream.Create(D, fmCreate);
try
LinkStream := TFileStream.Create(F, fmOpenRead or fmShareExclusive);
try
DestinyStream.CopyFrom(LinkStream, 0);
finally
LinkStream.Free;
end;
SourceStream := TFileStream.Create(S, fmOpenRead or fmShareExclusive);
try
DestinyStream.CopyFrom(SourceStream, 0);
flag := $FA123456;
DestinyStream.WriteBuffer(flag, SizeOf(Integer));
SwfFileSize := SourceStream.Size;
DestinyStream.WriteBuffer(SwfFileSize, SizeOf(Integer));
Result := '';
finally
SourceStream.Free;
end;
finally
DestinyStream.Free;
end;
end;
procedure TForm1.Button1Click(Sender: TObject);
begin
Swf2Exe('c:\ٍExample.swf', 'c:\EXeFile.exe',
'c:\Program Files\Macromedia\Flash MX\Players\SAFlashPlayer.exe');
end;
و اما یک سئوال :
من از برنامه Rave Report برای گزارش گیری استفاده می کنم ...
آیا برای اجرای این فایل گزارش گیری در برنامه خودم و بر روی سیستمی که دلفی ندارد باید از فایل جانبی ای استفاده کنم ؟
چون گزارش گیریهای من در کامپیوترهای دیگه که دلفی نداره اجرا نمی شه ...
اگه جوابم رو بدید ممنون می شم ...
در ضمن شما می تونید کد ها و تابع های خودتون رو توی این تاپیک بزارید.
function GetHardDiskPartitionType(const DriveLetter: Char): string;
var
NotUsed: DWORD;
VolumeFlags: DWORD;
VolumeInfo: array[0..MAX_PATH] of Char;
VolumeSerialNumber: DWORD;
PartitionType: array[0..32] of Char;
begin
GetVolumeInformation(PChar(DriveLetter + ':\'),
nil, SizeOf(VolumeInfo), @VolumeSerialNumber, NotUsed,
VolumeFlags, PartitionType, 32);
Result := PartitionType;
end;
procedure TForm1.Button1Click(Sender: TObject);
begin
ShowMessage(GetHardDiskPartitionType('c'));
ShowMessage(GetHardDiskPartitionType('a'));
end;
2. تنظیم صدای یک میکروفون و قطع صدای آن :
function SetMicrophoneVolume(bValue: Word): Boolean;
var
hMix: HMIXER;
mxlc: MIXERLINECONTROLS;
mxcd: TMIXERCONTROLDETAILS;
vol: TMIXERCONTROLDETAILS_UNSIGNED;
mxc: MIXERCONTROL;
mxl: TMixerLine;
intRet: Integer;
nMixerDevs: Integer;
begin
nMixerDevs := mixerGetNumDevs();
if (nMixerDevs < 1) then
begin
Exit;
end;
intRet := mixerOpen(@hMix, 0, 0, 0, 0);
if intRet = MMSYSERR_NOERROR then
begin
mxl.dwComponentType := MIXERLINE_COMPONENTTYPE_SRC_MICROPHONE;
mxl.cbStruct := SizeOf(mxl);
intRet := mixerGetLineInfo(hMix, @mxl, MIXER_GETLINEINFOF_COMPONENTTYPE);
end;
end;
3. تبدیل فایل فلش به فایل اجرایی ( Exe ) :
function Swf2Exe(S, D, F: string): string;
var
SourceStream, DestinyStream, LinkStream: TFileStream;
flag: Cardinal;
SwfFileSize: Integer;
begin
Result := 'something error';
DestinyStream := TFileStream.Create(D, fmCreate);
try
LinkStream := TFileStream.Create(F, fmOpenRead or fmShareExclusive);
try
DestinyStream.CopyFrom(LinkStream, 0);
finally
LinkStream.Free;
end;
SourceStream := TFileStream.Create(S, fmOpenRead or fmShareExclusive);
try
DestinyStream.CopyFrom(SourceStream, 0);
flag := $FA123456;
DestinyStream.WriteBuffer(flag, SizeOf(Integer));
SwfFileSize := SourceStream.Size;
DestinyStream.WriteBuffer(SwfFileSize, SizeOf(Integer));
Result := '';
finally
SourceStream.Free;
end;
finally
DestinyStream.Free;
end;
end;
procedure TForm1.Button1Click(Sender: TObject);
begin
Swf2Exe('c:\ٍExample.swf', 'c:\EXeFile.exe',
'c:\Program Files\Macromedia\Flash MX\Players\SAFlashPlayer.exe');
end;
و اما یک سئوال :
من از برنامه Rave Report برای گزارش گیری استفاده می کنم ...
آیا برای اجرای این فایل گزارش گیری در برنامه خودم و بر روی سیستمی که دلفی ندارد باید از فایل جانبی ای استفاده کنم ؟
چون گزارش گیریهای من در کامپیوترهای دیگه که دلفی نداره اجرا نمی شه ...
اگه جوابم رو بدید ممنون می شم ...
در ضمن شما می تونید کد ها و تابع های خودتون رو توی این تاپیک بزارید.