Hello, I've got a question:
How I can retrieve the call log on WinCE ?
I try with this code but it doesn't works, I define this
// The IOM enumeration specifies the caller ID type.
// persa, entrante, uscente
type IOM = ( IOM_MISSED, IOM_INCOMING, IOM_OUTGOING );
// tipo chiamante, non disponibile, bloccato, disponibile
type CALLERIDTYPE=( CALLERIDTYPE_UNAVAILABLE,CALLERIDTYPE_BLOCKED,CALLERIDTYPE_AVAILABLE);
// DEFINISCO IL TIPO PER ANALIZZARE IL LOG
type CALLLOGENTRY=record
cbSize:DWORD;
ftStartTime:LONG64;
ftEndTime:LONG64;
iom:IOM;
fOutgoing:boolean; // default 1
fConnected:boolean; // default 1
fEnded:boolean; // default 1
fRoam:boolean; // default 1
cidt:CALLERIDTYPE ;
pszNumber:PLPSTR;
pszName:PLPSTR;
pszNameType:PLPSTR;
pszNote:PLPSTR
end;
type pCALLLOGENTRY=^CALLLOGENTRY;
type ppmci=^pmci;
// funzione per la gestione della storia delle chiamate..
// funzione per collegarsi al log delle chiamate...
function PhoneOpenCallLog(ph:LPHANDLE):HRESULT; stdcall; external 'phone.dll' name 'PhoneOpenCallLog';
// This function closes the call log.
function PhoneCloseCallLog(ph:HANDLE):HRESULT; stdcall; external 'phone.dll' name 'PhoneCloseCallLog';
// recupera l'entrata corrente del registro chiamate..
function PhoneGetCallLogEntry(ph:HANDLE; LogEntry:pCALLLOGENTRY):HRESULT; stdcall; external 'phone.dll' name 'PhoneGetCallLogEntry';
an then I wrote
var hdl:HDESK;
hr:HRESULT;
phoneEntry:CALLLOGENTRY;
begin
// Open Phone log
hdl:= 0;
hr := S_OK;
hr := PhoneOpenCallLog(@hdl);
if hr=S_OK then
begin
// la prima chiamata
with phoneEntry do
Begin
fOutgoing:=true; // default 1
fConnected:=true; // default 1
fEnded:=true; // default 1
fRoam:=true; // default 1
cbSize:=sizeof(phoneEntry);
end;
hr := PhoneGetCallLogEntry(hdl, @phoneEntry);
if hr=S_OK then
begin
case phoneEntry.iom of
IOM_MISSED:
Showmessage('Missed Call');
IOM_INCOMING:
Showmessage('Incoming Call');
IOM_OUTGOING:
Showmessage('Missed Call');
end;
end
else showmessage('Impossibile leggere log delle chiamate'+inttostr(hr))
end
end;
the PhoneOpenCallLog works fine but the PhoneGetCallLogEntry no.
Have you some ideas o some example near this ?
thank's...