summaryrefslogtreecommitdiff
path: root/plugins/HistoryPlusPlus
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/HistoryPlusPlus')
-rw-r--r--plugins/HistoryPlusPlus/EmptyHistoryForm.pas20
-rw-r--r--plugins/HistoryPlusPlus/GlobalSearch.pas4
-rw-r--r--plugins/HistoryPlusPlus/HistoryForm.pas12
-rw-r--r--plugins/HistoryPlusPlus/hpp_contacts.pas45
-rw-r--r--plugins/HistoryPlusPlus/hpp_externalgrid.pas8
5 files changed, 45 insertions, 44 deletions
diff --git a/plugins/HistoryPlusPlus/EmptyHistoryForm.pas b/plugins/HistoryPlusPlus/EmptyHistoryForm.pas
index 39c3ce7ee8..f1faa55e6c 100644
--- a/plugins/HistoryPlusPlus/EmptyHistoryForm.pas
+++ b/plugins/HistoryPlusPlus/EmptyHistoryForm.pas
@@ -64,16 +64,16 @@ type
procedure FormShow(Sender: TObject);
procedure btYesClick(Sender: TObject);
private
- FContact: THandle;
- FContacts: Array of THandle;
+ FContact: TMCONTACT;
+ FContacts: Array of TMCONTACT;
procedure TranslateForm;
procedure PrepareForm;
- procedure SetContact(const Value: THandle);
- procedure EmptyHistory(hContact: THandle);
+ procedure SetContact(const Value: TMCONTACT);
+ procedure EmptyHistory(hContact: TMCONTACT);
protected
function GetFormText: String;
public
- property Contact: THandle read FContact write SetContact;
+ property Contact: TMCONTACT read FContact write SetContact;
end;
implementation
@@ -217,9 +217,9 @@ begin
end;
end;
-procedure TEmptyHistoryFrm.SetContact(const Value: THandle);
+procedure TEmptyHistoryFrm.SetContact(const Value: TMCONTACT);
var
- hContact: THandle;
+ hContact: TMCONTACT;
Proto: AnsiString;
i,num: Integer;
begin
@@ -228,10 +228,10 @@ begin
GetContactProto(FContact,hContact,Proto);
if Value <> hContact then
begin
- num := CallService(MS_MC_GETNUMCONTACTS,FContact,0);
+ num := db_mc_getSubCount(FContact);
for i := 0 to num-1 do
begin
- hContact := CallService(MS_MC_GETSUBCONTACT,FContact,i);
+ hContact := db_mc_getSub(FContact,i);
if hContact <> THandle(-1) then
begin
SetLength(FContacts,Length(FContacts)+1);
@@ -248,7 +248,7 @@ begin
btYes.Default := true;
end;
-procedure TEmptyHistoryFrm.EmptyHistory(hContact: THandle);
+procedure TEmptyHistoryFrm.EmptyHistory(hContact: TMCONTACT);
var
hDBEvent,prevhDbEvent: THandle;
begin
diff --git a/plugins/HistoryPlusPlus/GlobalSearch.pas b/plugins/HistoryPlusPlus/GlobalSearch.pas
index a51daf10f0..aa8db4368d 100644
--- a/plugins/HistoryPlusPlus/GlobalSearch.pas
+++ b/plugins/HistoryPlusPlus/GlobalSearch.pas
@@ -394,7 +394,7 @@ uses
function TfmGlobalSearch.AddContact(hContact: THandle): THPPContactInfo;
var
ci: THPPContactInfo;
- SubContact: THandle;
+ SubContact: TMCONTACT;
SubProtocol: AnsiString;
begin
ci := THPPContactInfo.Create;
@@ -1779,7 +1779,7 @@ procedure TfmGlobalSearch.HMNickChanged(var M: TMessage);
var
ci: THPPContactInfo;
i: Integer;
- SubContact: THandle;
+ SubContact: TMCONTACT;
SubProtocol: AnsiString;
begin
{ wParam - hContact; lParam - zero }
diff --git a/plugins/HistoryPlusPlus/HistoryForm.pas b/plugins/HistoryPlusPlus/HistoryForm.pas
index a0e1f53b3c..0ce99caf3d 100644
--- a/plugins/HistoryPlusPlus/HistoryForm.pas
+++ b/plugins/HistoryPlusPlus/HistoryForm.pas
@@ -328,7 +328,7 @@ type
DelayedFilter: TMessageTypes;
StartTimestamp: DWord;
EndTimestamp: DWord;
- FhContact, FhSubContact: THandle;
+ FhContact, FhSubContact: TMCONTACT;
FProtocol, FSubProtocol: AnsiString;
SavedLinkUrl: String;
SavedFileDir: String;
@@ -359,7 +359,7 @@ type
procedure OpenDetails(Item: Integer);
procedure TranslateForm;
- procedure SethContact(const Value: THandle);
+ procedure SethContact(const Value: TMCONTACT);
procedure LoadInOptions();
function IsFileEvent(Index: Integer): Boolean;
@@ -432,9 +432,9 @@ type
procedure FillBookmarks;
procedure HMBookmarkChanged(var M: TMessage); message HM_NOTF_BOOKMARKCHANGED;
- property hContact: THandle read FhContact write SethContact;
+ property hContact: TMCONTACT read FhContact write SethContact;
property Protocol: AnsiString read FProtocol;
- property hSubContact: THandle read FhSubContact;
+ property hSubContact: TMCONTACT read FhSubContact;
property SubProtocol: AnsiString read FSubProtocol;
published
procedure AlignControls(Control: TControl; var ARect: TRect); override;
@@ -1062,7 +1062,7 @@ end;
procedure THistoryFrm.HMMetaDefaultChanged(var M: TMessage);
var
- newSubContact: THandle;
+ newSubContact: TMCONTACT;
newSubProtocol: AnsiString;
begin
if THandle(M.wParam) <> hContact then
@@ -3100,7 +3100,7 @@ begin
end;
end;
-procedure THistoryFrm.SethContact(const Value: THandle);
+procedure THistoryFrm.SethContact(const Value: TMCONTACT);
begin
// if FhContact = Value then exit;
FhContact := Value;
diff --git a/plugins/HistoryPlusPlus/hpp_contacts.pas b/plugins/HistoryPlusPlus/hpp_contacts.pas
index d0beee248b..e2a68e7ac3 100644
--- a/plugins/HistoryPlusPlus/hpp_contacts.pas
+++ b/plugins/HistoryPlusPlus/hpp_contacts.pas
@@ -48,29 +48,30 @@ interface
uses
Windows, SysUtils,
Forms,
+ m_api,
hpp_global;
-function GetContactDisplayName(hContact: THandle; Proto: AnsiString = ''; Contact: boolean = false): String;
-function GetContactProto(hContact: THandle): AnsiString; overload;
-function GetContactProto(hContact: THandle; var SubContact: THandle; var SubProtocol: AnsiString): AnsiString; overload;
-function GetContactID(hContact: THandle; Proto: AnsiString = ''; Contact: boolean = false): AnsiString;
-function GetContactCodePage(hContact: THandle; const Proto: AnsiString = ''): Cardinal; overload;
-function GetContactCodePage(hContact: THandle; const Proto: AnsiString; var UsedDefault: boolean): Cardinal; overload;
-function WriteContactCodePage(hContact: THandle; CodePage: Cardinal; Proto: AnsiString = ''): boolean;
-function GetContactRTLMode(hContact: THandle; Proto: AnsiString = ''): boolean;
-function GetContactRTLModeTRTL(hContact: THandle; Proto: AnsiString = ''): TRTLMode;
-function WriteContactRTLMode(hContact: THandle; RTLMode: TRTLMode; Proto: AnsiString = ''): boolean;
+function GetContactDisplayName(hContact: TMCONTACT; Proto: AnsiString = ''; Contact: boolean = false): String;
+function GetContactProto(hContact: TMCONTACT): AnsiString; overload;
+function GetContactProto(hContact: TMCONTACT; var SubContact: TMCONTACT; var SubProtocol: AnsiString): AnsiString; overload;
+function GetContactID(hContact: TMCONTACT; Proto: AnsiString = ''; Contact: boolean = false): AnsiString;
+function GetContactCodePage(hContact: TMCONTACT; const Proto: AnsiString = ''): Cardinal; overload;
+function GetContactCodePage(hContact: TMCONTACT; const Proto: AnsiString; var UsedDefault: boolean): Cardinal; overload;
+function WriteContactCodePage(hContact: TMCONTACT; CodePage: Cardinal; Proto: AnsiString = ''): boolean;
+function GetContactRTLMode(hContact: TMCONTACT; Proto: AnsiString = ''): boolean;
+function GetContactRTLModeTRTL(hContact: TMCONTACT; Proto: AnsiString = ''): TRTLMode;
+function WriteContactRTLMode(hContact: TMCONTACT; RTLMode: TRTLMode; Proto: AnsiString = ''): boolean;
implementation
-uses hpp_database, hpp_options, m_api;
+uses hpp_database, hpp_options;
-function GetContactProto(hContact: THandle): AnsiString;
+function GetContactProto(hContact: TMCONTACT): AnsiString;
begin
Result := PAnsiChar(CallService(MS_PROTO_GETCONTACTBASEPROTO, hContact, 0));
end;
-function GetContactProto(hContact: THandle; var SubContact: THandle; var SubProtocol: AnsiString): AnsiString;
+function GetContactProto(hContact: TMCONTACT; var SubContact: TMCONTACT; var SubProtocol: AnsiString): AnsiString;
begin
Result := PAnsiChar(CallService(MS_PROTO_GETCONTACTBASEPROTO, hContact, 0));
if (Result = META_PROTO) then
@@ -85,7 +86,7 @@ begin
end;
end;
-function GetContactDisplayName(hContact: THandle; Proto: AnsiString = ''; Contact: boolean = false): String;
+function GetContactDisplayName(hContact: TMCONTACT; Proto: AnsiString = ''; Contact: boolean = false): String;
var
ci: TContactInfo;
RetPWideChar, UW: PChar;
@@ -122,7 +123,7 @@ begin
end;
end;
-function GetContactID(hContact: THandle; Proto: AnsiString = ''; Contact: boolean = false): AnsiString;
+function GetContactID(hContact: TMCONTACT; Proto: AnsiString = ''; Contact: boolean = false): AnsiString;
var
uid: PAnsiChar;
dbv: TDBVARIANT;
@@ -162,7 +163,7 @@ begin
end;
end;
-function WriteContactCodePage(hContact: THandle; CodePage: Cardinal; Proto: AnsiString = ''): boolean;
+function WriteContactCodePage(hContact: TMCONTACT; CodePage: Cardinal; Proto: AnsiString = ''): boolean;
begin
Result := false;
if Proto = '' then
@@ -173,7 +174,7 @@ begin
Result := True;
end;
-function _GetContactCodePage(hContact: THandle; Proto: AnsiString; var UsedDefault: boolean) : Cardinal;
+function _GetContactCodePage(hContact: TMCONTACT; Proto: AnsiString; var UsedDefault: boolean) : Cardinal;
begin
if Proto = '' then
Proto := GetContactProto(hContact);
@@ -190,14 +191,14 @@ begin
end;
end;
-function GetContactCodePage(hContact: THandle; const Proto: AnsiString = ''): Cardinal;
+function GetContactCodePage(hContact: TMCONTACT; const Proto: AnsiString = ''): Cardinal;
var
def: boolean;
begin
Result := _GetContactCodePage(hContact, Proto, def);
end;
-function GetContactCodePage(hContact: THandle; const Proto: AnsiString; var UsedDefault: boolean): Cardinal; overload;
+function GetContactCodePage(hContact: TMCONTACT; const Proto: AnsiString; var UsedDefault: boolean): Cardinal; overload;
begin
Result := _GetContactCodePage(hContact, Proto, UsedDefault);
end;
@@ -206,7 +207,7 @@ end;
// Changed default RTL mode from SysLocale.MiddleEast to
// Application.UseRightToLeftScrollBar because it's more correct and
// doesn't bug on MY SYSTEM!
-function GetContactRTLMode(hContact: THandle; Proto: AnsiString = ''): boolean;
+function GetContactRTLMode(hContact: TMCONTACT; Proto: AnsiString = ''): boolean;
var
Temp: Byte;
begin
@@ -226,7 +227,7 @@ begin
end;
end;
-function WriteContactRTLMode(hContact: THandle; RTLMode: TRTLMode; Proto: AnsiString = ''): boolean;
+function WriteContactRTLMode(hContact: TMCONTACT; RTLMode: TRTLMode; Proto: AnsiString = ''): boolean;
begin
Result := false;
if Proto = '' then
@@ -241,7 +242,7 @@ begin
Result := True;
end;
-function GetContactRTLModeTRTL(hContact: THandle; Proto: AnsiString = ''): TRTLMode;
+function GetContactRTLModeTRTL(hContact: TMCONTACT; Proto: AnsiString = ''): TRTLMode;
var
Temp: Byte;
begin
diff --git a/plugins/HistoryPlusPlus/hpp_externalgrid.pas b/plugins/HistoryPlusPlus/hpp_externalgrid.pas
index c0ee6c38e5..7001eda5e5 100644
--- a/plugins/HistoryPlusPlus/hpp_externalgrid.pas
+++ b/plugins/HistoryPlusPlus/hpp_externalgrid.pas
@@ -93,7 +93,7 @@ type
FGridState: TGridState;
SaveDialog: TSaveDialog;
RecentFormat: TSaveFormat;
- FSubContact: THandle;
+ FSubContact: TMCONTACT;
FSubProtocol: AnsiString;
function GetGridHandle: HWND;
@@ -144,7 +144,7 @@ type
public
constructor Create(AParentWindow: HWND; ControlID: Cardinal = 0);
destructor Destroy; override;
- procedure AddEvent(hContact, hDBEvent: THandle; Codepage: Integer; RTL: Boolean; DoScroll: Boolean);
+ procedure AddEvent(hContact:TMCONTACT; hDBEvent: THandle; Codepage: Integer; RTL: Boolean; DoScroll: Boolean);
procedure AddCustomEvent(hContact: THandle; const CustomItem: TExtCustomItem;
Codepage: Integer; RTL: Boolean; DoScroll: Boolean);
procedure SetPosition(x, y, cx, cy: Integer);
@@ -277,7 +277,7 @@ begin
Result := M.Result;
end;
-procedure TExternalGrid.AddEvent(hContact, hDBEvent: THandle; Codepage: Integer; RTL: Boolean;
+procedure TExternalGrid.AddEvent(hContact:TMCONTACT; hDBEvent: THandle; Codepage: Integer; RTL: Boolean;
DoScroll: Boolean);
var
RTLMode: TRTLMode;
@@ -1110,7 +1110,7 @@ end;
procedure TExternalGrid.HMMetaDefaultChanged(var M: TMessage);
var
- newSubContact: THandle;
+ newSubContact: TMCONTACT;
newSubProtocol: AnsiString;
begin
if Grid.Contact <> M.WParam then