Forum Replies Created
-
AuthorPosts
-
April 8, 2002 at 3:28 am in reply to: BeginPeakTime and EndPeakTime – How to convert the BeginPeakTime and EndPeakTime values. #4608Michael CessnaMember
It worked! Here’s the code, using Delphi:
function GetBeginPeakTime: TTime;
var
vRegistry : TRegistry;
vTimeVal : Integer;
vHour : Word;
vMin : Word;
vSec : Word;
vMSec : Word;
begin
Result := 0;
vRegistry := TRegistry.Create;
try
vRegistry.RootKey := HKEY_LOCAL_MACHINE;
vRegistry.Access := KEY_READ;
if vRegistry.OpenKeyReadOnly(‘SOFTWAREDelrinaWinFax7.0Peak Times’) then
begin
vTimeVal := vRegistry.ReadInteger(‘BeginPeakTime’); { Do not localize. }
if vTimeVal > 0 then
begin
vHour := (vTimeVal and $F800) shr 11;
vMin := (vTimeVal and ทE0) shr 5;
vSec := (vTimeVal and 財F) shl 1;
vMSec := 0;
Result := EncodeTime(vHour, vMin, vSec, vMSec);
end;
end;
finally
vRegistry.Free;
end;
end;function GetEndPeakTime: TTime;
var
vRegistry : TRegistry;
vTimeVal : Integer;
vHour : Word;
vMin : Word;
vSec : Word;
vMSec : Word;
begin
Result := 0;
vRegistry := TRegistry.Create;
try
vRegistry.RootKey := HKEY_LOCAL_MACHINE;
vRegistry.Access := KEY_READ;
if vRegistry.OpenKeyReadOnly(‘SOFTWAREDelrinaWinFax7.0Peak Times’) then
begin
vTimeVal := vRegistry.ReadInteger(‘EndPeakTime’); { Do not localize. }
if vTimeVal > 0 then
begin
vHour := (vTimeVal and $F800) shr 11;
vMin := (vTimeVal and ทE0) shr 5;
vSec := (vTimeVal and 財F) shl 1;
vMSec := 0;
Result := EncodeTime(vHour, vMin, vSec, vMSec);
end;
end;
finally
vRegistry.Free;
end;
end;Thank you!
Mike
April 8, 2002 at 3:08 am in reply to: BeginPeakTime and EndPeakTime – How to convert the BeginPeakTime and EndPeakTime values. #4607Michael CessnaMemberAwesome, I’ll give it a go!
Thanks.
Mike
Michael CessnaMemberThank you for your help.
Michael CessnaMemberDoes this mean it only has to be rebuilt once?…or must it be rebuilt each time someone selects a default cover page, other than the default pages defined on installation?
Thanks.
Mike
Michael CessnaMemberThanks. Since I’m having to integrate WinFax into a commercial application, the solution posted can’t be used, but I appreciate it. What I ended up doing was create a counter from 1..1000 and then when I get an access violation, I know I’ve come to the end of the list. This is very ugly, indeed, but since the WinFax stuff is broke, there’s very little one can do. If the WinFax stuff used standard COM collections it would be much easier.
-
AuthorPosts