Time <- 1000 : 1초
 
procedure delay(Time: Integer);
var
  PastCount: LongInt;
begin
  PastCount := GetTickCount;
  repeat
    Application.ProcessMessages;
  until ((GetTickCount-PastCount) >= LongInt(Time));
end;
 

 

- 호출부
SendMessage(호출되는 handle,  WM_SampleCall, AHandle.Handle, DWORD(PChar(ADescription)));

- 수신부
(선언)
procedure _SampleCall(var Message: TMessage); message WM_SampleCall;
(구현)
procedure TfrmMain.SampleCall(var Message: TMessage);
var
  sMsg : PChar;
begin
  sMsg := PChar(Message.lParam);
  Message.Result := 1;
  ShowWait(nil, sMsg);
end;


uses Soap.EncdDecd;
(bpl : soaprtl240.bpl)

function EncodeFile(const FileName: string): AnsiString;
var
  msStream: TMemoryStream;
begin
  msStream := TMemoryStream.Create;
  try
    msStream.LoadFromFile(Filename);
    Result := EncodeBase64(msStream.Memory, msStream.Size);
  finally
    FreeAndNil(msStream);
  end;
end;


+ Recent posts