diff options
Diffstat (limited to 'plugins')
41 files changed, 332 insertions, 1511 deletions
diff --git a/plugins/Actman30/actman30.dpr b/plugins/Actman30/actman30.dpr index 404b2f1054..2f7a24e573 100644 --- a/plugins/Actman30/actman30.dpr +++ b/plugins/Actman30/actman30.dpr @@ -28,8 +28,8 @@ library actman; uses
// fastmm4,
- m_api,
Windows,
+ m_api,
messages,
commctrl,
common,
diff --git a/plugins/Actman30/hooks/i_opt_dlg.inc b/plugins/Actman30/hooks/i_opt_dlg.inc index 69c59c7cc2..8fac1007a1 100644 --- a/plugins/Actman30/hooks/i_opt_dlg.inc +++ b/plugins/Actman30/hooks/i_opt_dlg.inc @@ -157,7 +157,7 @@ procedure CheckButtons(Dialog:HWND); var
b:bool;
begin
- b:=ListView_GetItemCount(GetDlgItem(Dialog,IDC_HOOKLIST))>0;
+ b:=SendDlgItemMessage(Dialog,IDC_HOOKLIST,LVM_GETITEMCOUNT, 0, 0)>0;
EnableWindow(GetDlgItem(Dialog,IDC_EVENTLIST ),b);
EnableWindow(GetDlgItem(Dialog,IDC_ACTIONLIST ),b);
@@ -190,13 +190,14 @@ end; function DeleteHook(Dialog:HWND):integer;
var
wnd:HWND;
- i:integer;
+ i,j:integer;
begin
result:=0;
wnd:=GetDlgItem(Dialog,IDC_HOOKLIST);
- for i:=ListView_GetItemCount(wnd)-1 downto 0 do
+ j:=SendMessage(wnd,LVM_GETITEMCOUNT,0,0);
+ for i:=j-1 downto 0 do
begin
- if ListView_GetItemState(wnd,i,LVIS_SELECTED)<>0 then
+ if SendMessage(wnd,LVM_GETITEMSTATE,i,LVIS_SELECTED)<>0 then
SendMessage(wnd,LVM_DELETEITEM,i,0);
end;
Listview_SetItemState(wnd,0,
@@ -302,8 +303,6 @@ end; function DlgProcOpt(Dialog:HWnd;hMessage:UINT;wParam:WPARAM;lParam:LPARAM):lresult; stdcall;
var
- wnd:HWND;
- lv:LV_COLUMNW;
i:integer;
tmp:pAnsiChar;
buf:array [0..255] of AnsiChar;
@@ -330,7 +329,7 @@ begin FillActionList(GetDlgItem(Dialog,IDC_ACTIONLIST));
CreateHKTable(Dialog);
- FillHookList(wnd);
+ FillHookList(GetDlgItem(Dialog,IDC_HOOKLIST));
ShowHookData(Dialog);
CheckButtons(Dialog);
diff --git a/plugins/Actman30/i_cnst_service.inc b/plugins/Actman30/i_cnst_service.inc deleted file mode 100644 index 2e5f0cca83..0000000000 --- a/plugins/Actman30/i_cnst_service.inc +++ /dev/null @@ -1,12 +0,0 @@ -const
- IDC_FLAG_WPAR = 2154;
- IDC_FLAG_LPAR = 2155;
- IDC_EDIT_WPAR = 2156;
- IDC_EDIT_LPAR = 2157;
- IDC_EDIT_SERVICE = 2159;
- IDC_WSTRUCT = 2160;
- IDC_LSTRUCT = 2161;
-
- IDC_SRV_RESULT = 2255;
- IDC_RES_FREEMEM = 2256;
- IDC_RES_UNICODE = 2257;
diff --git a/plugins/Actman30/i_opt_dlg.inc b/plugins/Actman30/i_opt_dlg.inc index 62a0a6c66f..e7a9e206ef 100644 --- a/plugins/Actman30/i_opt_dlg.inc +++ b/plugins/Actman30/i_opt_dlg.inc @@ -17,7 +17,7 @@ var i:integer;
begin
result:=0;
- NoDescription:=TranslateW('No Description');
+ NoDescription:=TranslateW('No description');
StrCopyW(xmlfilename,'c:\export.xml');
diff --git a/plugins/Actman30/i_opt_dlg2.inc b/plugins/Actman30/i_opt_dlg2.inc index 330be64780..3a816a481a 100644 --- a/plugins/Actman30/i_opt_dlg2.inc +++ b/plugins/Actman30/i_opt_dlg2.inc @@ -225,7 +225,7 @@ begin while p<>nil do
begin
StrCopy(StrCopyE(@buf,IcoLibPrefix),p^.Name);
- ImageList_AddIcon(il,CallService(MS_SKIN2_GETICON,0,lparam(@buf)));
+ ImageList_ReplaceIcon(il,-1,CallService(MS_SKIN2_GETICON,0,lparam(@buf)));
cbei.pszText :=TranslateW(FastAnsiToWideBuf(p^.Name,buf));
cbei.iItem :=i;
diff --git a/plugins/Actman30/i_sparam_const.inc b/plugins/Actman30/i_sparam_const.inc deleted file mode 100644 index 5571dd96e0..0000000000 --- a/plugins/Actman30/i_sparam_const.inc +++ /dev/null @@ -1,10 +0,0 @@ -const
- IDC_FLAG_PAR = 2150;
- IDC_EDIT_PAR = 2151;
- IDC_STRUCT = 2152;
- IDC_STAT_PAR = 2153;
-
- IDC_RES_TYPE = 2160;
- IDC_RES_FREEMEM = 2161;
- IDC_RES_GROUP = 2162;
- IDC_RES_STAT = 2163;
diff --git a/plugins/Actman30/iac_call.pas b/plugins/Actman30/iac_call.pas index 9b0c8dbe3a..33208fb16a 100644 --- a/plugins/Actman30/iac_call.pas +++ b/plugins/Actman30/iac_call.pas @@ -57,17 +57,6 @@ const ACF_CACHE_NOW = $00000002;
ACF_CACHE_MACRO = $00000004;
-// param flags, same as for service
-const
- ACF_RSTRING = $00010000; // Service result is string
- ACF_RUNICODE = $00020000; // Service result is Widestring
- ACF_RSTRUCT = $00040000; // Service result in structure
- ACF_RFREEMEM = $00080000; // Need to free memory
-
- ACF_SCRIPT_PARAM = $00001000;
- // dummy
- ACF_STRING = 0;
-
type
sp0 = function:int_ptr; stdcall;
sp1 = function(arg1:int_ptr):int_ptr; stdcall;
@@ -144,7 +133,7 @@ begin for i:=0 to argcount-1 do
begin
largv[i]:=argv[i];
- PreProcess(argf[i],LPARAM(largv[i]),WorkData);
+//!! PreProcess(argf[i],LPARAM(largv[i]),WorkData);
end;
// call function
case argcount of
@@ -206,7 +195,7 @@ begin ClearResult(WorkData);
// result type processing
- if (flags and ACF_RSTRING)<>0 then
+ if (flags and (ACF_RSTRING or ACF_UNICODE))<>0 then
begin
if (flags and ACF_RUNICODE)=0 then
AnsiToWide(pAnsiChar(res),pWideChar(WorkData.LastResult),MirandaCP)
@@ -659,7 +648,8 @@ begin pt.x:=rc.left;
pt.y:=rc.bottom;
ScreenToClient(Dialog,pt);
- SetWindowLongPtrW(wnd1,GWLP_USERDATA,CreateParamBlock(Dialog,0,pt.y+2,168));
+ GetClientRect(wnd1,rc);
+ SetWindowLongPtrW(wnd1,GWLP_USERDATA,CreateParamBlock(Dialog,0,pt.y+2,rc.right));
CheckDlgButton(Dialog,IDC_CLOSE_RES,BST_UNCHECKED);
wnd:=GetDlgItem(Dialog,IDC_CLOSE_RES); // count offset from initial pos
@@ -668,7 +658,7 @@ begin pt.x:=rc.left;
pt.y:=rc.bottom;
ScreenToClient(Dialog,pt);
- wnd1:=CreateResultBlock(Dialog,0,pt.y+2,168);
+ wnd1:=CreateResultBlock(Dialog,0,pt.y+2,rc.right-rc.left,ACF_NOVISUAL);
SetWindowLongPtrW(wnd,GWLP_USERDATA,wnd1);
ShowWindow(wnd1,SW_HIDE);
diff --git a/plugins/Actman30/iac_contact.pas b/plugins/Actman30/iac_contact.pas index eb9a5790cd..1ab918e43f 100644 --- a/plugins/Actman30/iac_contact.pas +++ b/plugins/Actman30/iac_contact.pas @@ -24,7 +24,7 @@ const type
tContactAction = class(tBaseAction)
private
- contact:THANDLE;
+ contact:HCONTACT;
public
constructor Create(uid:dword);
// function Clone:tBaseAction; override;
diff --git a/plugins/Actman30/iac_contact.rc b/plugins/Actman30/iac_contact.rc index b3923502b3..65a7d2843e 100644 --- a/plugins/Actman30/iac_contact.rc +++ b/plugins/Actman30/iac_contact.rc @@ -7,7 +7,7 @@ STYLE DS_SETFONT | DS_FIXEDSYS | WS_CHILD | WS_VISIBLE EXSTYLE WS_EX_CONTROLPARENT
FONT 8, "MS Shell Dlg", 0, 0
{
- RTEXT "Choose Contact", -1 , 0, 2, 160, 10
+ RTEXT "Choose contact", -1 , 0, 2, 160, 10
CONTROL "Refresh",IDC_CNT_REFRESH,"MButtonClass",WS_TABSTOP,1,12,16,16,$18000000
COMBOBOX IDC_CONTACTLIST, 19, 14, 148, 128, CBS_DROPDOWNLIST | CBS_SORT | WS_VSCROLL
AUTOCHECKBOX "Keep handle only", IDC_CNT_KEEP , 1, 31, 160, 11
diff --git a/plugins/Actman30/iac_dbrw.pas b/plugins/Actman30/iac_dbrw.pas index 0c9e0ad502..96a44b3f7f 100644 --- a/plugins/Actman30/iac_dbrw.pas +++ b/plugins/Actman30/iac_dbrw.pas @@ -68,7 +68,7 @@ const type
tDataBaseAction = class(tBaseAction)
private
- dbcontact:THANDLE;
+ dbcontact:HCONTACT;
dbmodule :PWideChar;
dbsetting:PWideChar;
dbvalue :PWideChar; // keep all in unicode (str to int translation fast)
@@ -129,7 +129,7 @@ var ambuf,asbuf:array [0..127] of AnsiChar;
ls,tmp:pWideChar;
tmpa,tmpa1:pAnsiChar;
- hContact:THANDLE;
+ hContact:THCONTACT;
proto:pAnsiChar;
avalue:uint_ptr;
begin
diff --git a/plugins/Actman30/iac_global.pas b/plugins/Actman30/iac_global.pas index 1d7957a3bc..cba955d762 100644 --- a/plugins/Actman30/iac_global.pas +++ b/plugins/Actman30/iac_global.pas @@ -89,8 +89,8 @@ procedure InsertString(wnd:HWND;num:dword;str:PAnsiChar); function GetLink(hash:dword):pActModule;
function GetLinkByName(name:pAnsiChar):pActModule;
-function ImportContact (node:HXML ):THANDLE;
-function ImportContactINI(node:pointer):THANDLE;
+function ImportContact (node:HXML ):HCONTACT;
+function ImportContactINI(node:pointer):HCONTACT;
implementation
@@ -301,7 +301,7 @@ const ioCUID = 'cuid';
ioCUIDType = 'cuidtype';
-function ImportContact(node:HXML):THANDLE;
+function ImportContact(node:HXML):HCONTACT;
var
proto:pAnsiChar;
tmpbuf:array [0..63] of AnsiChar;
@@ -352,7 +352,7 @@ begin end;
end;
-function ImportContactINI(node:pointer):THANDLE;
+function ImportContactINI(node:pointer):HCONTACT;
{
var
proto:pAnsiChar;
@@ -441,48 +441,84 @@ type const
actDLLCache: tDLLCache = nil;
-function GetDllHandle(dllname:pAnsiChar;mode:dword=0):THANDLE;
+function GetDllHandle(adllname:pAnsiChar;mode:dword=0):THANDLE;
var
- i:integer;
+ i,zero:integer;
begin
- result:=LoadLibraryA(dllname);
-exit;
+ // 1 - search that name in cache
i:=0;
+ zero:=-1;
while i<=HIGH(actDLLCache) do
begin
- if StrCmp(actDLLCache[i].DllName,dllname)=0 then
+ with actDLLCache[i] do
begin
- result:=actDLLCache[i].DllHandle;
- // check mode
- exit;
+ // remember first empty slot
+ if DllHandle=0 then
+ begin
+ if zero<0 then
+ zero:=i;
+ end
+ else if StrCmp(DllName,adllname)=0 then
+ begin
+ result:=DllHandle;
+ inc(count);
+ if mode=3 then // per-session
+ flags:=3;
+ exit;
+ end;
end;
inc(i);
end;
- result:=LoadLibraryA(dllname);
- // check mode
- SetLength(actDLLCache,i);
- StrDup(actDLLCache[i].DllName,dllname);
- actDLLCache[i].DllHandle:=result;
-// actDLLCache.flags:=;
+ // 2 - not found, load library
+ result:=LoadLibraryA(adllname);
+ // 3 - add to cache if not per-action
+ if mode<>0 then
+ begin
+ if zero>=0 then
+ i:=zero
+ else
+ begin
+ SetLength(actDLLCache,i);
+ dec(i);
+ end;
+
+ with actDLLCache[i] do
+ begin
+ StrDup(DllName,adllname);
+ DllHandle:=result;
+ count :=0;
+ flags :=mode;
+ end;
+ end;
end;
procedure CloseDllHandle(handle:THANDLE);
var
i:integer;
begin
- FreeLibrary(handle);
-exit;
- i:=0;
- while i<=HIGH(actDLLCache) do
+ i:=HIGH(actDLLCache);
+ while i>=0 do
begin
- if actDLLCache[i].DllHandle=handle then
+ with actDLLCache[i] do
begin
- // check mode
- FreeLibrary(actDLLCache[i].DllHandle);
- exit;
+ if DllHandle=handle then
+ begin
+ dec(count);
+ if count=0 then
+ begin
+ if flags=2 then // per-macro+not needed -> free
+ begin
+ FreeLibrary(DllHandle);
+ DllHandle:=0;
+ mFreeMem(DllName);
+ end;
+ end;
+ exit;
+ end;
end;
- inc(i);
+ dec(i);
end;
+ // if not found in cache
FreeLibrary(handle);
end;
@@ -490,10 +526,17 @@ procedure FreeDllHandleCache; var
i:integer;
begin
- i:=0;
- while i<=HIGH(actDLLCache) do
+ i:=HIGH(actDLLCache);
+ while i>=0 do
begin
+ if actDLLCache[i].DllHandle<>0 then
+ begin
+ FreeLibrary(actDLLCache[i].DllHandle);
+ mFreeMem(actDLLCache[i].DllName);
+ end;
+ dec(i);
end;
+ SetLength(actDLLCache,0);
end;
end.
diff --git a/plugins/Actman30/iac_inout.pas b/plugins/Actman30/iac_inout.pas index 999d3fccaf..c64b96e669 100644 --- a/plugins/Actman30/iac_inout.pas +++ b/plugins/Actman30/iac_inout.pas @@ -85,7 +85,7 @@ var tmp:PWideChar;
blob,p:PAnsiChar;
w:PWideChar;
- hContact:THANDLE;
+ hContact:THCONTACT;
wnd:HWND;
fexist:bool;
dbei:TDBEVENTINFO;
diff --git a/plugins/Actman30/iac_service.pas b/plugins/Actman30/iac_service.pas index 67a565c477..b31ab403b1 100644 --- a/plugins/Actman30/iac_service.pas +++ b/plugins/Actman30/iac_service.pas @@ -10,9 +10,9 @@ uses m_api,
sedit,strans,mApiCardM,
mirutils,dbsettings, editwrapper,
+ sparam,srvblock,
syswin,wrapper,common;
-{$include i_cnst_service.inc}
{$resource iac_service.res}
const
@@ -254,7 +254,7 @@ begin ClearResult(WorkData);
// result type processing
- if (flags and ACF_RSTRING)<>0 then
+ if (flags and (ACF_RSTRING or ACF_UNICODE))<>0 then
begin
//!! delete old or not?
if (flags and ACF_RUNICODE)=0 then
@@ -467,420 +467,62 @@ end; //----- Dialog realization -----
-const
- ptNumber = 0;
- ptString = 1;
- ptUnicode = 2;
- ptCurrent = 3;
- ptResult = 4;
- ptParam = 5;
- ptStruct = 6;
-const
- sresInt = 0;
- sresString = 1;
- sresStruct = 2;
-
-procedure MakeResultTypeList(wnd:HWND);
-begin
- SendMessage(wnd,CB_RESETCONTENT,0,0);
- InsertString(wnd,sresInt ,'Integer');
- InsertString(wnd,sresString,'String');
- InsertString(wnd,sresStruct,'Structure');
- SendMessage(wnd,CB_SETCURSEL,0,0);
-end;
-
-procedure MakeParamTypeList(wnd:HWND);
-begin
- SendMessage(wnd,CB_RESETCONTENT,0,0);
- InsertString(wnd,ptNumber ,'number value');
- InsertString(wnd,ptString ,'ANSI string');
- InsertString(wnd,ptUnicode,'Unicode string');
- InsertString(wnd,ptCurrent,'current contact');
- InsertString(wnd,ptResult ,'last result');
- InsertString(wnd,ptParam ,'parameter');
- InsertString(wnd,ptStruct ,'structure');
- SendMessage(wnd,CB_SETCURSEL,0,0);
-end;
-
-var
- ApiCard:tmApiCard;
-
-function FixParam(Dialog:HWND;buf:PAnsiChar;flag:integer):integer;
-begin
- if StrCmp(buf,Translate('hContact' ))=0 then result:=ptCurrent
- else if StrCmp(buf,Translate('parameter' ))=0 then result:=ptParam
- else if StrCmp(buf,Translate('result' ))=0 then result:=ptResult
- else if StrCmp(buf,Translate('structure' ))=0 then result:=ptStruct
- else if StrCmp(buf,Translate('Unicode text'))=0 then result:=ptUnicode
- else
- begin
- if (buf[0] in ['0'..'9']) or ((buf[0]='-') and (buf[1] in ['0'..'9'])) or
- ((buf[0]='$') and (buf[1] in sHexNum)) or
- ((buf[0]='0') and (buf[1]='x') and (buf[2] in sHexNum)) then
- result:=ptNumber
- else
- result:=ptString;
- end;
-
- CB_SelectData(Dialog,flag,result);
-// SendDlgItemMessage(Dialog,flag,CB_SETCURSEL,result,0);
- SendMessage(Dialog,WM_COMMAND,(CBN_SELCHANGE shl 16) or flag,GetDlgItem(Dialog,flag));
-end;
-
-procedure ReloadService(Dialog:HWND;setvalue:boolean);
-var
- pc:pAnsiChar;
- buf,buf1:array [0..127] of AnsiChar;
- wnd:hwnd;
- i:integer;
- struct:pAnsiChar;
-// bufw:array [0..MaxDescrLen] of WideChar;
-begin
- wnd:=GetDlgItem(Dialog,IDC_EDIT_SERVICE);
- SendMessageA(wnd,CB_GETLBTEXT,SendMessage(wnd,CB_GETCURSEL,0,0),tlparam(@buf));
- ApiCard.Service:=@buf;
-
- pc:=ApiCard.FillParams(GetDlgItem(Dialog,IDC_EDIT_WPAR),true);
- if pc<>nil then
- begin
- if GetDlgItemTextA(Dialog,IDC_EDIT_WPAR,buf1,SizeOf(buf1))>0 then
- case FixParam(Dialog,@buf1,IDC_FLAG_WPAR) of
- ptStruct: begin
- if setvalue then
- begin
- struct:=pAnsiChar(SetWindowLongPtrW(GetDlgItem(Dialog,IDC_WSTRUCT),GWLP_USERDATA,
- long_ptr(StrDup(struct,StrScan(pc,'|')+1))));
- mFreeMem(struct);
- end;
-
-{ struct:=pAnsiChar(GetWindowLongPtrW(GetDlgItem(Dialog,IDC_WSTRUCT),GWLP_USERDATA));
- mFreeMem(struct);
- StrDup(struct,StrScan(pc,'|')+1);
- SetWindowLongPtrW(GetDlgItem(Dialog,IDC_WSTRUCT),GWLP_USERDATA,long_ptr(struct));
-// AnsiToWide(StrScan(pc,'|')+1,wstruct,MirandaCP);
-}
- end;
- end;
- mFreeMem(pc);
- end;
-
- pc:=ApiCard.FillParams(GetDlgItem(Dialog,IDC_EDIT_LPAR),false);
- if pc<>nil then
- begin
- if GetDlgItemTextA(Dialog,IDC_EDIT_LPAR,buf1,SizeOf(buf1))>0 then
- case FixParam(Dialog,@buf1,IDC_FLAG_LPAR) of
- ptStruct: begin
- if setvalue then
- begin
- struct:=pAnsiChar(SetWindowLongPtrW(GetDlgItem(Dialog,IDC_LSTRUCT),GWLP_USERDATA,
- long_ptr(StrDup(struct,StrScan(pc,'|')+1))));
- mFreeMem(struct);
- end;
-{
- struct:=pAnsiChar(GetWindowLongPtrW(GetDlgItem(Dialog,IDC_LSTRUCT),GWLP_USERDATA));
- mFreeMem(struct);
- StrDup(struct,StrScan(pc,'|')+1);
- SetWindowLongPtrW(GetDlgItem(Dialog,IDC_LSTRUCT),GWLP_USERDATA,long_ptr(struct));
-// AnsiToWide(StrScan(pc,'|')+1,lstruct,MirandaCP);
-}
- end;
- end;
- mFreeMem(pc);
- end;
-
- pc:=ApiCard.ResultType;
- i:=sresInt;
- if pc<>nil then
- begin
- if lstrcmpia(pc,'struct')=0 then i:=sresStruct
- else if lstrcmpia(pc,'str')=0 then
- begin
- i:=sresString;
- CheckDlgButton(Dialog,IDC_RES_UNICODE,BST_UNCHECKED);
- end
- else if lstrcmpia(pc,'wide')=0 then
- begin
- i:=sresString;
- CheckDlgButton(Dialog,IDC_RES_UNICODE,BST_CHECKED);
- end;
- mFreeMem(pc);
- end;
- CB_SelectData(Dialog,IDC_SRV_RESULT,i);
-// ApiCard.Show;
-end;
-
-// true - need to show structure
-function SetParam(Dialog:HWND; aflags:dword; id:integer; aparam:pWideChar):integer;
-var
- wnd:HWND;
-begin
- wnd:=GetDlgItem(Dialog,id);
- if (aflags and ACF_PARAM)<>0 then
- begin
- EnableWindow(wnd,false);
- result:=ptParam;
- end
- else if (aflags and ACF_RESULT)<>0 then
- begin
- EnableWindow(wnd,false);
- result:=ptResult;
- end
- else if (aflags and ACF_CURRENT)<>0 then
- begin
- EnableWindow(wnd,false);
- result:=ptCurrent;
- end
- else if (aflags and ACF_PARNUM)<>0 then
- begin
- result:=ptNumber;
- SetDlgItemTextW(Dialog,id,aparam);
- end
- else if (aflags and ACF_STRUCT)<>0 then
- begin
- result:=ptStruct;
- end
- else if (aflags and ACF_UNICODE)<>0 then
- begin
- result:=ptUnicode;
- SetDlgItemTextW(Dialog,id,aparam);
- end
- else
- begin
- result:=ptString;
- SetDlgItemTextW(Dialog,id,aparam);
- end;
- SetEditFlags(wnd,EF_SCRIPT,ord((aflags and ACF_SCRIPT_PARAM)<>0));
-end;
-
-procedure ClearFields(Dialog:HWND);
-var
- wnd:HWND;
-begin
- ShowWindow(GetDlgItem(Dialog,IDC_WSTRUCT),SW_HIDE);
- wnd:=GetDlgItem(Dialog,IDC_EDIT_WPAR);
- ShowEditField (wnd,SW_SHOW);
- EnableEditField(wnd,true);
- SendMessage (wnd,CB_RESETCONTENT,0,0);
-//?? SetDlgItemTextW(Dialog,IDC_EDIT_WPAR,nil);
- CB_SelectData(GetDlgItem(Dialog,IDC_FLAG_WPAR),ptNumber);
- SetEditFlags(wnd,EF_ALL,0);
-
- ShowWindow (GetDlgItem(Dialog,IDC_LSTRUCT),SW_HIDE);
- wnd:=GetDlgItem(Dialog,IDC_EDIT_LPAR);
- ShowEditField (wnd,SW_SHOW);
- EnableEditField(wnd,true);
- SendMessage (wnd,CB_RESETCONTENT,0,0);
-//?? SetDlgItemTextW(Dialog,IDC_EDIT_LPAR,nil);
- CB_SelectData(GetDlgItem(Dialog,IDC_FLAG_LPAR),ptNumber);
- SetEditFlags(wnd,EF_ALL,0);
-
- ShowWindow(GetDlgItem(Dialog,IDC_RES_FREEMEM),SW_HIDE);
- ShowWindow(GetDlgItem(Dialog,IDC_RES_UNICODE),SW_HIDE);
- CheckDlgButton(Dialog,IDC_RES_FREEMEM,BST_UNCHECKED);
- CheckDlgButton(Dialog,IDC_RES_UNICODE,BST_UNCHECKED);
-
- CB_SelectData(Dialog,IDC_SRV_RESULT,sresInt);
-end;
-
function DlgProc(Dialog:HWnd;hMessage:UINT;wParam:WPARAM;lParam:LPARAM):lresult; stdcall;
-const
- NoProcess:boolean=true;
var
- i:integer;
- pc,pc1:pAnsiChar;
- wnd,wnd1:HWND;
- pcw:PWideChar;
+ ServiceBlock:HWND;
+ rc:TRECT;
+ sv:tServiceValue;
begin
result:=0;
case hMessage of
WM_DESTROY: begin
- ApiCard.Free;
- pc:=pAnsiChar(GetWindowLongPtrW(GetDlgItem(Dialog,IDC_WSTRUCT),GWLP_USERDATA));
- mFreeMem(pc);
- pc:=pAnsiChar(GetWindowLongPtrW(GetDlgItem(Dialog,IDC_LSTRUCT),GWLP_USERDATA));
- mFreeMem(pc);
end;
WM_INITDIALOG: begin
- MakeResultTypeList(GetDlgItem(Dialog,IDC_SRV_RESULT));
- MakeParamTypeList(GetDlgItem(Dialog,IDC_FLAG_WPAR));
- MakeParamTypeList(GetDlgItem(Dialog,IDC_FLAG_LPAR));
+ GetClientRect(Dialog,rc);
+ ServiceBlock:=CreateServiceBlock(Dialog,0,0,rc.right,rc.bottom,ACF_NOVISUAL or ACF_SCRIPT_EXPAND);
+ SetWindowLongPtrW(Dialog,GWLP_USERDATA,ServiceBlock);
+ SetServiceListMode(ServiceBlock,DBReadByte(0,DBBranch,'SrvListMode'));
TranslateDialogDefault(Dialog);
-
-//??
- MakeEditField(Dialog,IDC_EDIT_SERVICE);
- MakeEditField(Dialog,IDC_EDIT_WPAR);
- MakeEditField(Dialog,IDC_EDIT_LPAR);
-
- ApiCard:=CreateServiceCard(Dialog);
- ApiCard.FillList(GetDlgItem(Dialog,IDC_EDIT_SERVICE),
- DBReadByte(0,DBBranch,'SrvListMode'));
end;
WM_ACT_SETVALUE: begin
- NoProcess:=true;
- ClearFields(Dialog);
-
+ ServiceBlock:=GetWindowLongPtrW(Dialog,GWLP_USERDATA);
with tServiceAction(lParam) do
begin
- if CB_SelectData(Dialog,IDC_EDIT_SERVICE,Hash(service,StrLen(service)))<>CB_ERR then
-// if SendDlgItemMessageA(Dialog,IDC_EDIT_SERVICE,CB_SELECTSTRING,twparam(-1),tlparam(service))<>CB_ERR then
- ReloadService(Dialog,false)
- else
- SetDlgItemTextA(Dialog,IDC_EDIT_SERVICE,service);
-//!!
- SetEditFlags(GetDlgItem(Dialog,IDC_EDIT_SERVICE),EF_SCRIPT,
- ord((flags and ACF_SCRIPT_SERVICE)<>0));
-
- // RESULT
- if (flags and ACF_RSTRUCT)<>0 then
- i:=sresStruct
- else if (flags and ACF_RSTRING)<>0 then
- begin
- i:=sresString;
- if (flags and ACF_RUNICODE)<>0 then CheckDlgButton(Dialog,IDC_RES_UNICODE,BST_CHECKED);
- if (flags and ACF_RFREEMEM)<>0 then CheckDlgButton(Dialog,IDC_RES_FREEMEM,BST_CHECKED);
- end
- else
- begin
- i:=sresInt;
- end;
- CB_SelectData(Dialog,IDC_SRV_RESULT,i);
-
- // WPARAM
- i:=SetParam(Dialog,flags,IDC_EDIT_WPAR,pWideChar(wparam));
- if i=ptStruct then
- begin
- ShowEditField(GetDlgItem(Dialog,IDC_EDIT_WPAR),SW_HIDE);
- ShowWindow (GetDlgItem(Dialog,IDC_WSTRUCT ),SW_SHOW);
-
-{
- p:=pAnsiChar(GetWindowLongPtrW(GetDlgItem(Dialog,IDC_WSTRUCT),GWLP_USERDATA));
- mFreeMem(p);
-}
- SetWindowLongPtrW(GetDlgItem(Dialog,IDC_WSTRUCT),GWLP_USERDATA,
- long_ptr(StrDup(pc,pAnsiChar(wparam))));
- end;
- CB_SelectData(GetDlgItem(Dialog,IDC_FLAG_WPAR),i);
-
- // LPARAM
- i:=SetParam(Dialog,flags2,IDC_EDIT_LPAR,pWideChar(lparam));
- if i=ptStruct then
- begin
- ShowEditField(GetDlgItem(Dialog,IDC_EDIT_LPAR),SW_HIDE);
- ShowWindow (GetDlgItem(Dialog,IDC_LSTRUCT ),SW_SHOW);
-
-{
- p:=pAnsiChar(GetWindowLongPtrW(GetDlgItem(Dialog,IDC_LSTRUCT),GWLP_USERDATA));
- mFreeMem(p);
-}
- SetWindowLongPtrW(GetDlgItem(Dialog,IDC_LSTRUCT),GWLP_USERDATA,
- long_ptr(StrDup(pc,pAnsiChar(lparam))));
- end;
- CB_SelectData(GetDlgItem(Dialog,IDC_FLAG_LPAR),i);
-
+ sv.service:=service;
+ sv.w_flag :=flags;
+ sv.wparam :=wparam;
+ sv.l_flag :=flags2;
+ sv.lparam :=lparam;
+ sv.flags :=flags;
end;
- NoProcess:=false;
+ SetSrvBlockValue(ServiceBlock,sv);
end;
WM_ACT_RESET: begin
- NoProcess:=true;
- ClearFields(Dialog);
- SetDlgItemTextW(Dialog,IDC_EDIT_SERVICE,nil);
- SetDlgItemTextW(Dialog,IDC_EDIT_WPAR,'0');
- SetDlgItemTextW(Dialog,IDC_EDIT_LPAR,'0');
-{
- ShowWindow(GetDlgItem(Dialog,IDC_WSTRUCT),SW_HIDE);
- ShowWindow(GetDlgItem(Dialog,IDC_LSTRUCT),SW_HIDE);
-}
- NoProcess:=false;
+ ClearServiceBlock(GetWindowLongPtrW(Dialog,GWLP_USERDATA));
end;
WM_ACT_SAVE: begin
with tServiceAction(lParam) do
begin
- //WPARAM
- wnd:=GetDlgItem(Dialog,IDC_EDIT_WPAR);
- case CB_GetData(GetDlgItem(Dialog,IDC_FLAG_WPAR)) of
- ptParam: begin
- flags:=flags or ACF_PARAM
- end;
- ptResult: begin
- flags:=flags or ACF_RESULT
- end;
- ptCurrent: begin
- flags:=flags or ACF_CURRENT
- end;
- ptNumber: begin
- flags:=flags or ACF_PARNUM;
- wparam:=GetDlgText(wnd);
- end;
- ptStruct: begin
- flags:=flags or ACF_STRUCT;
- StrDup(pAnsiChar(wparam),
- pAnsiChar(GetWindowLongPtrW(GetDlgItem(Dialog,IDC_WSTRUCT),GWLP_USERDATA)));
- end;
- ptUnicode: begin
- flags:=flags or ACF_UNICODE;
- wparam:=GetDlgText(wnd);
- end;
- ptString: wparam:=GetDlgText(wnd);
- end;
- if (GetEditFlags(wnd) and EF_SCRIPT)<>0 then
- flags:=flags or ACF_SCRIPT_PARAM;
-
- // LPARAM
- wnd:=GetDlgItem(Dialog,IDC_EDIT_LPAR);
- case CB_GetData(GetDlgItem(Dialog,IDC_FLAG_LPAR)) of
- ptParam: begin
- flags2:=flags2 or ACF_PARAM
- end;
- ptResult: begin
- flags2:=flags2 or ACF_RESULT
- end;
- ptCurrent: begin
- flags2:=flags2 or ACF_CURRENT
- end;
- ptNumber: begin
- flags2:=flags2 or ACF_PARNUM;
- lparam:=GetDlgText(wnd);
- end;
- ptStruct: begin
- flags2:=flags2 or ACF_STRUCT;
- StrDup(pAnsiChar(lparam),
- pAnsiChar(GetWindowLongPtrW(GetDlgItem(Dialog,IDC_LSTRUCT),GWLP_USERDATA)));
- end;
- ptUnicode: begin
- flags2:=flags2 or ACF_UNICODE;
- lparam:=GetDlgText(wnd);
- end;
- ptString: lparam:=GetDlgText(wnd);
- end;
- if (GetEditFlags(wnd) and EF_SCRIPT)<>0 then
- flags2:=flags2 or ACF_SCRIPT_PARAM;
-
- // RESULT
- case CB_GetData(GetDlgItem(Dialog,IDC_SRV_RESULT)) of
- sresString: begin
- flags:=flags or ACF_RSTRING;
- if IsDlgButtonChecked(Dialog,IDC_RES_UNICODE)=BST_CHECKED then
- flags:=flags or ACF_RUNICODE;
- if IsDlgButtonChecked(Dialog,IDC_RES_FREEMEM)=BST_CHECKED then
- flags:=flags or ACF_RFREEMEM;
- end;
- sresStruct: flags:=flags or ACF_RSTRUCT;
- end;
-
- service:=ApiCard.NameFromList(GetDlgItem(Dialog,IDC_EDIT_SERVICE));
-//!!
- if (GetEditFlags(Dialog,IDC_EDIT_SERVICE) and EF_SCRIPT)<>0 then
- flags:=flags or ACF_SCRIPT_SERVICE;
+ ServiceBlock:=GetWindowLongPtrW(Dialog,GWLP_USERDATA);
+ GetSrvBlockValue(ServiceBlock,sv);
+
+ service:=sv.service;
+ wparam :=sv.wparam;
+ lparam :=sv.lparam;
+ flags2 :=sv.l_flag;
+ flags :=sv.flags or sv.w_flag;
end;
end;
+ //??
WM_SHOWWINDOW: begin
+{
// hide window by ShowWindow function
if (lParam=0) and (wParam=0) then
begin
@@ -889,100 +531,15 @@ begin pc:=pAnsiChar(SetWindowLongPtrW(GetDlgItem(Dialog,IDC_LSTRUCT),GWLP_USERDATA,0));
mFreeMem(pc);
end;
+}
end;
-
+{
WM_COMMAND: begin
- case wParam shr 16 of
-{ CBN_EDITUPDATE,
-}
- CBN_EDITCHANGE,
- EN_CHANGE: if not NoProcess then
- SendMessage(GetParent(GetParent(Dialog)),PSM_CHANGED,0,0);
-
- CBN_SELCHANGE: begin
- case loword(wParam) of
- IDC_SRV_RESULT: begin
- i:=CB_GetData(lParam);
- case i of
- sresInt,sresStruct: begin
- ShowWindow(GetDlgItem(Dialog,IDC_RES_FREEMEM),SW_HIDE);
- ShowWindow(GetDlgItem(Dialog,IDC_RES_UNICODE),SW_HIDE);
- end;
- sresString: begin
- ShowWindow(GetDlgItem(Dialog,IDC_RES_FREEMEM),SW_SHOW);
- ShowWindow(GetDlgItem(Dialog,IDC_RES_UNICODE),SW_SHOW);
- end;
- end;
- end;
-
- IDC_FLAG_WPAR,IDC_FLAG_LPAR: begin
- if loword(wParam)=IDC_FLAG_WPAR then
- begin
- wnd :=GetDlgItem(Dialog,IDC_EDIT_WPAR);
- wnd1:=GetDlgItem(Dialog,IDC_WSTRUCT);
- end
- else
- begin
- wnd :=GetDlgItem(Dialog,IDC_EDIT_LPAR);
- wnd1:=GetDlgItem(Dialog,IDC_LSTRUCT);
- end;
- i:=CB_GetData(GetDlgItem(Dialog,loword(wParam)));
-
- if i=ptStruct then
- begin
- ShowEditField(wnd,SW_HIDE);
- ShowWindow(wnd1,SW_SHOW);
- end
- else
- begin
- ShowEditField(wnd,SW_SHOW);
- ShowWindow(wnd1,SW_HIDE);
- if i in [ptCurrent,ptResult,ptParam] then
- EnableEditField(wnd,false)
- else
- begin
- if i=ptNumber then
- begin
- pcw:='0';
- SendMessageW(wnd,WM_SETTEXT,0,TLParam(pcw));
- end;
- EnableEditField(wnd,true);
- end;
- end;
- end;
-
- IDC_EDIT_SERVICE: ReloadService(Dialog,true);
- end;
- if not NoProcess then
- SendMessage(GetParent(GetParent(Dialog)),PSM_CHANGED,0,0);
- end;
-
- BN_CLICKED: begin
- case loword(wParam) of
- IDC_WSTRUCT, IDC_LSTRUCT: begin
- pc:=pAnsiChar(GetWindowLongPtrW(lParam,GWLP_USERDATA));
-//!!!!
- pc1:=EditStructure(pAnsiChar(pc),Dialog);
- if pc1<>nil then
- begin
- mFreeMem(pc);
- SetWindowLongPtrW(lParam,GWLP_USERDATA,long_ptr(pc1));
- SendMessage(GetParent(GetParent(Dialog)),PSM_CHANGED,0,0);
- end;
- end;
- else
- SendMessage(GetParent(GetParent(Dialog)),PSM_CHANGED,0,0);
- end;
- end;
-
- end;
end;
-
+}
WM_HELP: begin
- pc:=ApiCard.NameFromList(GetDlgItem(Dialog,IDC_EDIT_SERVICE));
- ApiCard.Service:=pc;
- mFreeMem(pc);
- ApiCard.Show;
+ ServiceBlock:=GetWindowLongPtrW(Dialog,GWLP_USERDATA);
+ SendMessage(ServiceBlock,WM_HELP,0,0);
result:=1;
end;
diff --git a/plugins/Actman30/iac_service.rc b/plugins/Actman30/iac_service.rc index 10160c5361..ff9f972ff4 100644 --- a/plugins/Actman30/iac_service.rc +++ b/plugins/Actman30/iac_service.rc @@ -1,4 +1,3 @@ -#include "i_cnst_service.inc"
LANGUAGE 0,0
@@ -7,26 +6,6 @@ STYLE DS_SETFONT | DS_FIXEDSYS | WS_CHILD | WS_VISIBLE EXSTYLE WS_EX_CONTROLPARENT
FONT 8, "MS Shell Dlg", 0, 0
{
- GROUPBOX "Result" , -1, 1, 0, 166, 64, WS_GROUP
- RTEXT "Result type" , -1 , 4, 10, 159, 11
- COMBOBOX IDC_SRV_RESULT , 4, 21, 159, 76, CBS_DROPDOWN | WS_VSCROLL | CBS_AUTOHSCROLL
- AUTOCHECKBOX "Free memory" , IDC_RES_FREEMEM, 4, 38, 159, 11
- AUTOCHECKBOX "Unicode string", IDC_RES_UNICODE, 4, 50, 159, 11
-
- RTEXT "Service name", -1, 1, 68, 160, 8
- COMBOBOX IDC_EDIT_SERVICE , 1, 78, 166, 96, CBS_DROPDOWN | WS_VSCROLL | CBS_AUTOHSCROLL | CBS_SORT
-
- RTEXT "wParam type", -1, 1, 101, 63, 14, SS_CENTERIMAGE
- COMBOBOX IDC_FLAG_WPAR, 66, 101, 102, 56, CBS_DROPDOWNLIST | WS_VSCROLL
-// RTEXT "wParam" , -1, 1, 116, 160, 8
- COMBOBOX IDC_EDIT_WPAR, 1, 116, 166, 76, CBS_DROPDOWN | WS_VSCROLL | CBS_AUTOHSCROLL
- PUSHBUTTON "Structure" , IDC_WSTRUCT , 1, 116, 166, 14
-
- RTEXT "lParam type", -1, 1, 142, 63, 14, SS_CENTERIMAGE
- COMBOBOX IDC_FLAG_LPAR, 66, 142, 102, 56, CBS_DROPDOWNLIST | WS_VSCROLL
-// RTEXT "lParam" , -1, 1, 157, 160, 8
- COMBOBOX IDC_EDIT_LPAR, 1, 157, 166, 76, CBS_DROPDOWN | WS_VSCROLL | CBS_AUTOHSCROLL
- PUSHBUTTON "Structure" , IDC_LSTRUCT , 1, 157, 166, 14
}
IDI_SERVICE ICON "ico\service.ico"
diff --git a/plugins/Actman30/services.ini b/plugins/Actman30/services.ini index 853155450d..f40d814f67 100644 --- a/plugins/Actman30/services.ini +++ b/plugins/Actman30/services.ini @@ -11,10 +11,10 @@ ;if "return" starts from int/hex/str/struct then separator, result type will set
-;[Event:Event (name or constant]
+;[Event:Event (name or constant)]
;alias=constant name
;descr=text
-;plugin=placement (including "core" and empty = "unknown"
+;plugin=placement (including "core" and empty = "unknown")
;wparam=
;lparam=
@@ -23,6 +23,14 @@ ;descr: structure description
;plugin: where defined
+[Service:DB/UI/ChangePassword]
+alias=MS_DB_CHANGEPASSWORD
+wparam=0
+lparam=0
+return=0
+descr=Show window for new/changed profile password
+plugin=db3x_mmap
+
[Service:CListFrames/HideALLFramesTB]
alias=MS_CLIST_FRAMES_HIDEALLFRAMESTB
wparam=0
@@ -280,7 +288,14 @@ alias=MS_PROTO_CALLCONTACTSERVICE wparam=0
lparam=structure|0|native|b.ptr|native|native|
return=result of protocol service call
-descr=send a general request through the protocol chain for a contact
+descr=Send a general request through the protocol chain for a contact
+
+[Service:Proto/GetContactBaseAccount]
+alias=MS_PROTO_GETCONTACTBASEACCOUNT
+wparam=hContact
+lparam=0
+return=str, account name
+descr=Return account name associated to contact (no need to free it)
[Service:Protos/ShowAccountManager]
alias=MS_PROTO_SHOWACCMGR
@@ -464,7 +479,7 @@ lparam=0 [Event:CList/DoubleClicked]
alias=ME_CLIST_DOUBLECLICKED
plugin=contact list
-descr='Double click on the CList'
+descr='Double click on the contact list'
wparam=hContact
lparam=0
diff --git a/plugins/Actman30/sparam.pas b/plugins/Actman30/sparam.pas deleted file mode 100644 index e29d375ae4..0000000000 --- a/plugins/Actman30/sparam.pas +++ /dev/null @@ -1,708 +0,0 @@ -unit sparam;
-
-interface
-
-uses windows,iac_global;
-
-const
- ACF_PARNUM = $00000001; // Param is number
- ACF_UNICODE = $00000002; // Param is Unicode string
- ACF_CURRENT = $00000004; // Param is ignored, used current user handle
- // from current message window
- ACF_RESULT = $00000008; // Param is previous action result
- ACF_PARAM = $00000010; // Param is Call parameter
- ACF_STRUCT = $00000020;
- ACF_PARTYPE = ACF_PARNUM or ACF_UNICODE or
- ACF_CURRENT or ACF_RESULT or
- ACF_PARAM or ACF_STRUCT;
- ACF_TEMPLATE = $00000800;
- ACF_SCRIPT_PARAM = $00001000;
- // dummy
- ACF_STRING = 0;
-
- ACF_RSTRING = $00010000; // Service result is string
- ACF_RUNICODE = $00020000; // Service result is Widestring
- ACF_RSTRUCT = $00040000; // Service result in structure
- ACF_RFREEMEM = $00080000; // Need to free memory
-
-function CreateParamBlock(parent:HWND;x,y,width:integer):THANDLE;
-procedure ClearParamFields(Dialog:HWND);
-function FillParam (Dialog:HWND;txt:pAnsiChar):integer;
-function SetParamValue (Dialog:HWND; flags:dword; value:pointer):boolean;
-function GetParamValue (Dialog:HWND;var flags:dword;var value:pointer):boolean;
-
-procedure ClearParam (flags:dword; var param);
-function DuplicateParam(flags:dword; var sparam,dparam):dword;
-
-procedure PreProcess(flags:dword;var l_param:LPARAM;const WorkData:tWorkData);
-
-function CreateResultBlock(parent:HWND;x,y,width:integer):THANDLE;
-procedure ClearResultFields(Dialog:HWND);
-function SetResultValue(Dialog:HWND;flags:dword):integer;
-function GetResultValue(Dialog:HWND):dword;
-
-implementation
-
-uses
- messages,
- common, editwrapper, wrapper, syswin,
- m_api, sedit, strans, mirutils;
-
-{$include i_sparam_const.inc}
-{$resource sparam.res}
-
-const
- ptNumber = 0;
- ptString = 1;
- ptUnicode = 2;
- ptCurrent = 3;
- ptResult = 4;
- ptParam = 5;
- ptStruct = 6;
-
-const
- sresInt = 0;
- sresString = 1;
- sresWide = 2;
- sresStruct = 3;
-
-//----- Processing functions -----
-
-procedure PreProcess(flags:dword;var l_param:LPARAM;const WorkData:tWorkData);
-var
- tmp1:pWideChar;
-begin
- with WorkData do
- begin
- if (flags and ACF_STRUCT)<>0 then
- begin
- l_param:=uint_ptr(MakeStructure(pAnsiChar(l_param),Parameter,LastResult,ResultType))
- end
- else if (flags and ACF_PARAM)<>0 then
- begin
- l_param:=Parameter;
- end
- else if (flags and ACF_RESULT)<>0 then
- begin
- l_param:=LastResult;
- end
- else if (flags and ACF_CURRENT)<>0 then
- begin
- l_param:=WndToContact(WaitFocusedWndChild(GetForegroundwindow){GetFocus});
- end
- else
- begin
- if (flags and ACF_SCRIPT_PARAM)<>0 then
- l_param:=uint_ptr(ParseVarString(pWideChar(l_param),Parameter));
-
- tmp1:=pWideChar(l_param);
- if (flags and ACF_PARNUM)=0 then
- begin
- if (flags and ACF_UNICODE)=0 then
- WideToAnsi(tmp1,pAnsiChar(l_param),MirandaCP)
- else
- StrDupW(pWideChar(l_param),tmp1);
- end
- else
- l_param:=NumToInt(tmp1);
-
- if (flags and ACF_SCRIPT_PARAM)<>0 then
- mFreeMem(tmp1);
- end;
- end;
-end;
-
-procedure PostProcess(flags:dword;var l_param:LPARAM; var WorkData:tWorkData);
-var
- code:integer;
- len:integer;
- pc:pAnsiChar;
-begin
- if (flags and ACF_STRUCT)<>0 then
- begin
- with WorkData do
- begin
- LastResult:=GetStructureResult(l_param,@code,@len);
- case code of
-{
- SST_LAST: begin
- result:=LastResult;
- end;
-}
- SST_PARAM: begin //??
- LastResult:=Parameter;
- ResultType:=rtInt;
- end;
- SST_BYTE,SST_WORD,SST_DWORD,
- SST_QWORD,SST_NATIVE: begin
- ResultType:=rtInt;
- end;
- SST_BARR: begin
- StrDup(pAnsiChar(pc),pAnsiChar(LastResult),len);
- AnsiToWide(pAnsiChar(pc),PWideChar(LastResult),MirandaCP);
- mFreeMem(pAnsiChar(pc));
- ResultType:=rtWide;
- end;
- SST_WARR: begin
- StrDupW(pWideChar(LastResult),pWideChar(LastResult),len);
- ResultType:=rtWide;
- end;
- SST_BPTR: begin
- AnsiToWide(pAnsiChar(LastResult),pWideChar(LastResult),MirandaCP);
- ResultType:=rtWide;
- end;
- SST_WPTR: begin
- StrDupW(pWideChar(LastResult),pWideChar(LastResult));
- ResultType:=rtWide;
- end;
- end;
- FreeStructure(l_param);
- l_param:=0;
- end
- end;
-end;
-
-//----- Dialog functions -----
-
-procedure MakeParamTypeList(wnd:HWND);
-begin
- SendMessage(wnd,CB_RESETCONTENT,0,0);
- InsertString(wnd,ptNumber ,'number value');
- InsertString(wnd,ptString ,'ANSI string');
- InsertString(wnd,ptUnicode,'Unicode string');
- InsertString(wnd,ptCurrent,'current contact');
- InsertString(wnd,ptResult ,'last result');
- InsertString(wnd,ptParam ,'parameter');
- InsertString(wnd,ptStruct ,'structure');
- SendMessage(wnd,CB_SETCURSEL,0,0);
-end;
-
-function IsParamNumber(txt:pAnsiChar):boolean;
-begin
- if (txt[0] in ['0'..'9']) or ((txt[0]='-') and (txt[1] in ['0'..'9'])) or
- ((txt[0]='$') and (txt[1] in sHexNum)) or
- ((txt[0]='0') and (txt[1]='x') and (txt[2] in sHexNum)) then
- result:=true
- else
- result:=false;
-end;
-
-// Set parameter type by parameter template
-function FixParam(buf:PAnsiChar):integer;
-begin
- if StrCmp(buf,'hContact' )=0 then result:=ptCurrent
- else if StrCmp(buf,'parameter' )=0 then result:=ptParam
- else if StrCmp(buf,'result' )=0 then result:=ptResult
- else if StrCmp(buf,'structure' )=0 then result:=ptStruct
- else if StrCmp(buf,'Unicode text')=0 then result:=ptUnicode
- else result:=ptString;
-end;
-
-// get line from template
-function GetParamLine(src:pAnsiChar;dst:pWideChar;var ltype:integer):pAnsiChar;
-var
- pp,pc:pAnsiChar;
- savechar:AnsiChar;
- j:integer;
-begin
- pc:=StrScan(src,'|');
-
- if pc<>nil then
- begin
- savechar:=pc^;
- pc^:=#0;
- end;
-
- if IsParamNumber(src) then
- begin
- j:=0;
- pp:=src;
- repeat
- dst[j]:=WideChar(pp^);
- inc(j); inc(pp);
- until (pp^=#0) or (pp^=' ');
- dst[j]:=WideChar(pp^); // anyway, #0 or " " needs
- if pp^<>#0 then
- begin
- dst[j+1]:='-'; dst[j+2]:=' '; inc(j,3);
- FastAnsitoWideBuf(pp+1,dst+j);
- StrCopyW(dst+j,TranslateW(dst+j));
- end;
- ltype:=ptNumber;
- end
- else
- begin
- ltype:=FixParam(src);
- StrCopyW(dst,TranslateW(FastAnsitoWideBuf(src,dst)));
- end;
-
- if pc<>nil then
- begin
- pc^:=savechar;
- inc(pc);
- end;
-
- result:=pc;
-end;
-
-// Set parameter value by parameter template
-function FillParam(Dialog:HWND;txt:pAnsiChar):integer;
-var
- bufw:array [0..2047] of WideChar;
- wnd:HWND;
- p,pc:PAnsiChar;
- ltype:integer;
-begin
- wnd:=GetDlgItem(Dialog,IDC_EDIT_PAR);
- SendMessage(wnd,CB_RESETCONTENT,0,0);
- if (txt<>nil) and (txt^<>#0) then
- begin
- result:=-1;
- p:=txt;
- repeat
- pc:=GetParamLine(p,bufw,ltype);
- if result<0 then
- result:=ltype;
- SendMessageW(wnd,CB_ADDSTRING,0,lparam(@bufw));
-
- if result=ptStruct then
- break
- else
- p:=pc;
- until pc=nil;
- end
- else
- result:=ptNumber;
- SendMessage(wnd,CB_SETCURSEL,0,0);
-end;
-
-procedure ClearParamFields(Dialog:HWND);
-var
- wnd:HWND;
-begin
- ShowWindow(GetDlgItem(Dialog,IDC_STRUCT),SW_HIDE);
- wnd:=GetDlgItem(Dialog,IDC_EDIT_PAR);
- ShowEditField (wnd,SW_SHOW);
- EnableEditField(wnd,true);
- SendMessage (wnd,CB_RESETCONTENT,0,0);
- SetEditFlags (wnd,EF_ALL,0);
- CB_SelectData(Dialog,IDC_FLAG_PAR,ptNumber);
-end;
-
-function ParamDlgResizer(Dialog:HWND;lParam:LPARAM;urc:PUTILRESIZECONTROL):int; cdecl;
-begin
- case urc^.wId of
- IDC_FLAG_PAR: result:=RD_ANCHORX_WIDTH or RD_ANCHORY_TOP; //RD_ANCHORX_RIGHT
- IDC_EDIT_PAR: result:=RD_ANCHORX_WIDTH or RD_ANCHORY_TOP;
- IDC_STRUCT: result:=RD_ANCHORX_WIDTH or RD_ANCHORY_TOP;
- IDC_STAT_PAR: result:=RD_ANCHORX_LEFT or RD_ANCHORY_TOP;
-// IDC_CLOSE: result:=RD_ANCHORX_WIDTH or RD_ANCHORY_TOP;
- else
- result:=0;
- end;
-end;
-
-function DlgParamProc(Dialog:HWnd;hMessage:uint;wParam:WPARAM;lParam:LPARAM):lresult; stdcall;
-var
- wnd,wnd1:HWND;
- i:integer;
- pcw:pWideChar;
- pc:pAnsiChar;
- urd:TUTILRESIZEDIALOG;
-begin
- result:=0;
-
- case hMessage of
- WM_DESTROY: begin
- pc:=pAnsiChar(GetWindowLongPtrW(GetDlgItem(Dialog,IDC_STRUCT),GWLP_USERDATA));
- mFreeMem(pc);
- end;
-
- WM_INITDIALOG: begin
- MakeEditField(Dialog,IDC_EDIT_PAR);
-
- MakeParamTypeList(GetDlgItem(Dialog,IDC_FLAG_PAR));
- end;
-
- WM_SIZE: begin
- FillChar(urd,SizeOf(TUTILRESIZEDIALOG),0);
- urd.cbSize :=SizeOf(urd);
- urd.hwndDlg :=Dialog;
- urd.hInstance :=hInstance;
- urd.lpTemplate:=MAKEINTRESOURCEA('IDD_SPARAM');
- urd.lParam :=0;
- urd.pfnResizer:=@ParamDlgResizer;
- CallService(MS_UTILS_RESIZEDIALOG,0,tlparam(@urd));
- end;
-
- WM_SHOWWINDOW: begin
- // hide window by ShowWindow function
- if (lParam=0) and (wParam=0) then
- begin
- pc:=pAnsiChar(SetWindowLongPtrW(GetDlgItem(Dialog,IDC_STRUCT),GWLP_USERDATA,0));
- mFreeMem(pc);
- end;
- end;
-
- WM_COMMAND: begin
- case wParam shr 16 of
- CBN_EDITCHANGE,
- EN_CHANGE: begin
- SendMessage(GetParent(Dialog),WM_COMMAND,CBN_EDITCHANGE shl 16,Dialog);
- end;
-
- CBN_SELCHANGE: begin
- SendMessage(GetParent(Dialog),WM_COMMAND,CBN_EDITCHANGE shl 16,Dialog);
- case loword(wParam) of
- IDC_FLAG_PAR: begin
- wnd :=GetDlgItem(Dialog,IDC_EDIT_PAR);
- wnd1:=GetDlgItem(Dialog,IDC_STRUCT);
-
- i:=CB_GetData(GetDlgItem(Dialog,loword(wParam)));
-
- if i=ptStruct then
- begin
- ShowEditField(wnd ,SW_HIDE);
- ShowWindow (wnd1,SW_SHOW);
- end
- else
- begin
- ShowEditField(wnd ,SW_SHOW);
- ShowWindow (wnd1,SW_HIDE);
-
- if i in [ptCurrent,ptResult,ptParam] then
- EnableEditField(wnd,false)
- else
- begin
- if i=ptNumber then
- begin
- pcw:='0';
- SendMessageW(wnd,WM_SETTEXT,0,TLParam(pcw));
- end;
- EnableEditField(wnd,true);
- end;
- end;
- end;
- end;
- end;
- end;
- end;
- end;
-end;
-
-//----- Common interface functions -----
-
-function CreateParamBlock(parent:HWND;x,y,width:integer):THANDLE;
-var
- rc,rc1:TRECT;
-begin
- SetRect(rc,x,y,x+width,y+0{dlgheight});
- MapDialogRect(parent,rc);
-
- result:=CreateDialogW(hInstance,'IDD_SPARAM',parent,@DlgParamProc);
- GetClientRect(result,rc1);
- SetWindowPos(result,0,
- x,y{rc.left,rc.top},rc.right-rc.left,rc1.bottom-rc1.top,
- SWP_NOZORDER);
-end;
-
-// if separate
-function DestroyBlock(block:pointer):integer;
-begin
- result:=0;
-end;
-
-function SetParamValue(Dialog:HWND;flags:dword;value:pointer):boolean;
-var
- wnd,wnd1:HWND;
- pc:pAnsiChar;
- vtype:integer;
-begin
- result:=true;
-//?? Check for "Apply" activation
-
- wnd:=GetDlgItem(Dialog,IDC_EDIT_PAR);
- if (flags and ACF_TEMPLATE)<>0 then
- begin
- vtype:=FillParam(Dialog,value);
- end
- else if (flags and ACF_PARAM)<>0 then
- begin
- SendMessageW(wnd,WM_SETTEXT,0,LPARAM(TranslateW('Parameter')));
- EnableWindow(wnd,false);
- vtype:=ptParam;
- end
- else if (flags and ACF_RESULT)<>0 then
- begin
- SendMessageW(wnd,WM_SETTEXT,0,LPARAM(TranslateW('Last result')));
- EnableWindow(wnd,false);
- vtype:=ptResult;
- end
- else if (flags and ACF_CURRENT)<>0 then
- begin
- SendMessageW(wnd,WM_SETTEXT,0,LPARAM(TranslateW('Current user')));
- EnableWindow(wnd,false);
- vtype:=ptCurrent;
- end
- else if (flags and ACF_STRUCT)<>0 then
- begin
- vtype:=ptStruct;
-
- ShowEditField(wnd,SW_HIDE);
- wnd1:=GetDlgItem(Dialog,IDC_STRUCT);
- ShowWindow(wnd1,SW_SHOW);
- // delete old value
- pc:=pAnsiChar(GetWindowLongPtrW(wnd1,GWLP_USERDATA));
- mFreeMem(pc);
- // set newly allocated
- SetWindowLongPtrW(wnd1,GWLP_USERDATA,long_ptr(StrDup(pc,pAnsiChar(value))));
-//!!!!!!!!
- end
- else if (flags and ACF_PARNUM)<>0 then
- begin
- vtype:=ptNumber;
- SendMessageW(wnd,WM_SETTEXT,0,LPARAM(value));
- end
- else if (flags and ACF_UNICODE)<>0 then
- begin
- vtype:=ptUnicode;
- SendMessageW(wnd,WM_SETTEXT,0,LPARAM(value));
- end
- else
- begin
- vtype:=ptString;
- SendMessageW(wnd,WM_SETTEXT,0,LPARAM(value));
- end;
- SetEditFlags(wnd,EF_SCRIPT,ord((flags and ACF_SCRIPT_PARAM)<>0));
-
- CB_SelectData(GetDlgItem(Dialog,IDC_FLAG_PAR),vtype);
-end;
-
-function GetParamValue(Dialog:HWND;var flags:dword;var value:pointer):boolean;
-var
- wnd:HWND;
-begin
- result:=true;
- flags:=0;
- value:=nil;
- wnd:=GetDlgItem(Dialog,IDC_EDIT_PAR);
- case CB_GetData(GetDlgItem(Dialog,IDC_FLAG_PAR)) of
- ptParam: begin
- flags:=flags or ACF_PARAM
- end;
- ptResult: begin
- flags:=flags or ACF_RESULT
- end;
- ptCurrent: begin
- flags:=flags or ACF_CURRENT
- end;
- ptNumber: begin
- flags:=flags or ACF_PARNUM;
- value:=GetDlgText(wnd);
- end;
- ptStruct: begin
- flags:=flags or ACF_STRUCT;
- StrDup(pAnsiChar(value),
- pAnsiChar(GetWindowLongPtrW(GetDlgItem(Dialog,IDC_STRUCT),GWLP_USERDATA)));
- end;
- ptUnicode: begin
- flags:=flags or ACF_UNICODE;
- value:=GetDlgText(wnd);
- end;
- ptString: value:=GetDlgText(wnd);
- end;
- if (GetEditFlags(wnd) and EF_SCRIPT)<>0 then
- flags:=flags or ACF_SCRIPT_PARAM;
-end;
-
-procedure ClearParam(flags:dword; var param);
-begin
- if (flags and (ACF_CURRENT or ACF_RESULT or ACF_PARAM))=0 then
- mFreeMem(pointer(param));
-end;
-
-function DuplicateParam(flags:dword; var sparam,dparam):dword;
-var
- tmpdst:array [0..2047] of WideChar;
- ltype:integer;
-begin
- mFreeMem(dparam);
-
- if (flags and ACF_TEMPLATE)<>0 then
- begin
- flags:=flags and not (ACF_TEMPLATE or ACF_PARTYPE);
- GetParamLine(pAnsiChar(sparam),tmpdst,ltype);
- case ltype of
- ptNumber: begin
- flags:=flags or ACF_PARNUM;
- StrDupW(pWideChar(dparam),pWideChar(@tmpdst));
- end;
- ptString: begin
- flags:=flags or ACF_STRING;
- StrDupW(pWideChar(dparam),pWideChar(@tmpdst));
- end;
- ptUnicode: begin
- flags:=flags or ACF_UNICODE;
- StrDupW(pWideChar(dparam),pWideChar(@tmpdst));
- end;
- ptStruct: begin
- flags:=flags or ACF_STRUCT;
- StrDup(pAnsiChar(dparam),pAnsiChar(sparam)+10); //10=StrLen('structure|')
- end;
- ptCurrent: flags:=flags or ACF_CURRENT;
- ptResult : flags:=flags or ACF_RESULT;
- ptParam : flags:=flags or ACF_PARAM;
- end;
- end
- else if (flags and (ACF_CURRENT or ACF_RESULT or ACF_PARAM))=0 then
- begin
- if (flags and ACF_PARNUM)<>0 then
- StrDupW(pWideChar(dparam),pWideChar(sparam))
- else if (flags and ACF_STRUCT)<>0 then
- StrDup(pAnsiChar(dparam),pAnsiChar(sparam))
- else if (flags and ACF_UNICODE)<>0 then
- StrDupW(pWideChar(dparam),pWideChar(sparam))
- else
- StrDupW(pWideChar(dparam),pWideChar(sparam));
- end;
- result:=flags;
-end;
-
-//----- result block -----
-
-procedure MakeResultTypeList(wnd:HWND);
-begin
- SendMessage(wnd,CB_RESETCONTENT,0,0);
- InsertString(wnd,sresInt ,'Integer');
- InsertString(wnd,sresString,'String');
- InsertString(wnd,sresWide ,'Wide String');
- InsertString(wnd,sresStruct,'Structure');
- SendMessage(wnd,CB_SETCURSEL,0,0);
-end;
-
-function ResultDlgResizer(Dialog:HWND;lParam:LPARAM;urc:PUTILRESIZECONTROL):int; cdecl;
-begin
- case urc^.wId of
- IDC_RES_TYPE : result:=RD_ANCHORX_WIDTH or RD_ANCHORY_TOP; //RD_ANCHORX_RIGHT
- IDC_RES_FREEMEM: result:=RD_ANCHORX_WIDTH or RD_ANCHORY_TOP;
- IDC_RES_STAT : result:=RD_ANCHORX_LEFT or RD_ANCHORY_TOP;
- IDC_RES_GROUP : result:=RD_ANCHORX_WIDTH or RD_ANCHORY_TOP;
- else
- result:=0;
- end;
-end;
-
-procedure ClearResultFields(Dialog:HWND);
-begin
- CheckDlgButton(Dialog,IDC_RES_FREEMEM,BST_UNCHECKED);
- ShowWindow(GetDlgItem(Dialog,IDC_RES_FREEMEM),SW_HIDE);
- CB_SelectData(Dialog,IDC_RES_TYPE,sresInt);
-end;
-
-function DlgResultProc(Dialog:HWnd;hMessage:uint;wParam:WPARAM;lParam:LPARAM):lresult; stdcall;
-var
- urd:TUTILRESIZEDIALOG;
- i:integer;
-begin
- result:=0;
-
- case hMessage of
- WM_INITDIALOG: begin
- MakeResultTypeList(GetDlgItem(Dialog,IDC_RES_TYPE));
- end;
-
- WM_SIZE: begin
- FillChar(urd,SizeOf(TUTILRESIZEDIALOG),0);
- urd.cbSize :=SizeOf(urd);
- urd.hwndDlg :=Dialog;
- urd.hInstance :=hInstance;
- urd.lpTemplate:=MAKEINTRESOURCEA('IDD_SRESULT');
- urd.lParam :=0;
- urd.pfnResizer:=@ResultDlgResizer;
- CallService(MS_UTILS_RESIZEDIALOG,0,tlparam(@urd));
- end;
-
- WM_COMMAND: begin
- case wParam shr 16 of
- CBN_SELCHANGE: begin
- case loword(wParam) of
- IDC_RES_TYPE: begin
- case CB_GetData(lParam) of
- sresInt,sresStruct: begin
- i:=SW_HIDE;
- end;
- sresString,sresWide: begin
- i:=SW_SHOW;
- end;
- end;
- ShowWindow(GetDlgItem(Dialog,IDC_RES_FREEMEM),i);
- end;
- end;
- end;
- end;
- end;
- end;
-end;
-
-function CreateResultBlock(parent:HWND;x,y,width:integer):THANDLE;
-var
- rc,rc1:TRECT;
-begin
- SetRect(rc,x,y,x+width,y+0{dlgheight});
- MapDialogRect(parent,rc);
-
- result:=CreateDialogW(hInstance,'IDD_SRESULT',parent,@DlgResultProc);
- GetClientRect(result,rc1);
- SetWindowPos(result,0,
- x,y{rc.left,rc.top},rc.right-rc.left,rc1.bottom-rc1.top,
- SWP_NOZORDER);
-end;
-
-function SetResultValue(Dialog:HWND;flags:dword):integer;
-var
- btn:integer;
-begin
- // RESULT
- if (flags and ACF_RSTRUCT)<>0 then
- result:=sresStruct
- else if (flags and ACF_RSTRING)<>0 then
- begin
- if (flags and ACF_RFREEMEM)<>0 then
- btn:=BST_CHECKED
- else
- btn:=BST_UNCHECKED;
- CheckDlgButton(Dialog,IDC_RES_FREEMEM,btn);
-
- if (flags and ACF_RUNICODE)<>0 then
- result:=sresWide
- else
- result:=sresString;
- end
- else
- begin
- result:=sresInt;
- end;
- CB_SelectData(Dialog,IDC_RES_TYPE,result);
-end;
-
-function GetResultValue(Dialog:HWND):dword;
-begin
- case CB_GetData(GetDlgItem(Dialog,IDC_RES_TYPE)) of
- sresString: begin
- result:=ACF_RSTRING;
- if IsDlgButtonChecked(Dialog,IDC_RES_FREEMEM)=BST_CHECKED then
- result:=result or ACF_RFREEMEM;
- end;
- sresWide: begin
- result:=ACF_RSTRING or ACF_RUNICODE;
- if IsDlgButtonChecked(Dialog,IDC_RES_FREEMEM)=BST_CHECKED then
- result:=result or ACF_RFREEMEM;
- end;
- sresStruct: result:=ACF_RSTRUCT;
- else
- result:=0;
- end;
-
-end;
-
-end.
diff --git a/plugins/Actman30/sparam.rc b/plugins/Actman30/sparam.rc deleted file mode 100644 index a36fc5b680..0000000000 --- a/plugins/Actman30/sparam.rc +++ /dev/null @@ -1,27 +0,0 @@ -#include "i_sparam_const.inc"
-
-LANGUAGE 0,0
-
-IDD_SPARAM DIALOGEX 0, 0, 168, 31, 0
-STYLE DS_SETFONT | DS_FIXEDSYS | WS_CHILD | WS_VISIBLE
-EXSTYLE WS_EX_CONTROLPARENT
-FONT 8, "MS Shell Dlg", 0, 0
-{
-// PUSHBUTTON "open/close" , IDC_CLOSE , 1, 116, 166, 14
- RTEXT "wParam type", IDC_STAT_PAR, 1, 1, 63, 14, SS_CENTERIMAGE
- COMBOBOX IDC_FLAG_PAR, 66, 1, 102, 56, CBS_DROPDOWNLIST | WS_VSCROLL
-// RTEXT "wParam" , -1, 1, 116, 160, 8
- COMBOBOX IDC_EDIT_PAR, 1, 16, 166, 76, CBS_DROPDOWN | WS_VSCROLL | CBS_AUTOHSCROLL
- PUSHBUTTON "Structure" , IDC_STRUCT , 1, 16, 166, 14
-}
-
-IDD_SRESULT DIALOGEX 0, 0, 168, 53, 0
-STYLE DS_SETFONT | DS_FIXEDSYS | WS_CHILD | WS_VISIBLE
-EXSTYLE WS_EX_CONTROLPARENT
-FONT 8, "MS Shell Dlg", 0, 0
-{
- GROUPBOX "Result" , IDC_RES_GROUP , 1, 0, 166, 50, WS_GROUP
- RTEXT "Result type" , IDC_RES_STAT , 4, 9, 159, 11
- COMBOBOX IDC_RES_TYPE , 4, 20, 159, 76, CBS_DROPDOWN | WS_VSCROLL | CBS_AUTOHSCROLL
- AUTOCHECKBOX "Free memory" , IDC_RES_FREEMEM, 4, 36, 159, 11
-}
diff --git a/plugins/Actman30/tasks/i_opt_dlg.inc b/plugins/Actman30/tasks/i_opt_dlg.inc index c8025c278d..e6797e3a9a 100644 --- a/plugins/Actman30/tasks/i_opt_dlg.inc +++ b/plugins/Actman30/tasks/i_opt_dlg.inc @@ -275,13 +275,14 @@ function DeleteTask(Dialog:HWND):integer; var
li:LV_ITEM;
wnd:HWND;
- i:integer;
+ i,j:integer;
begin
result:=0;
wnd:=GetDlgItem(Dialog,IDC_TASK_NAME);
- for i:=ListView_GetItemCount(wnd)-1 downto 0 do
+ j:=SendMessage(wnd,LVM_GETITEMCOUNT,0,0);
+ for i:=j-1 downto 0 do
begin
- if ListView_GetItemState(wnd,i,LVIS_SELECTED)<>0 then
+ if SendMessage(wnd,LVM_GETITEMSTATE,i,LVIS_SELECTED)<>0 then
begin
li.iItem :=i;
li.mask :=LVIF_PARAM;
diff --git a/plugins/Actman30/ua/i_opt_dlg.inc b/plugins/Actman30/ua/i_opt_dlg.inc index b7ff28483a..643aa253b7 100644 --- a/plugins/Actman30/ua/i_opt_dlg.inc +++ b/plugins/Actman30/ua/i_opt_dlg.inc @@ -372,7 +372,7 @@ begin li.iItem :=i;
li.lParam :=i;
li.pszText :=UActionList[i].szActDescr;
- li.iImage:=ImageList_AddIcon(il,
+ li.iImage:=ImageList_ReplaceIcon(il, -1,
HICON(CallService(MS_SKIN2_GETICONBYHANDLE,0,LPARAM(UActionList[i].hIcolibIcon))));
li.iItem :=SendMessageW(wnd,LVM_INSERTITEMW,0,LPARAM(@li));
@@ -405,7 +405,7 @@ begin li.mask :=LVIF_IMAGE;
li.iSubItem:=0;
li.iItem :=i;
- li.iImage:=ImageList_AddIcon(il,
+ li.iImage:=ImageList_ReplaceIcon(il, -1,
HICON(CallService(MS_SKIN2_GETICONBYHANDLE,0,TLPARAM(UActionList[i].hIcolibIcon))));
SendMessageW(wnd,LVM_SETITEM,0,TLPARAM(@li));
end;
diff --git a/plugins/Actman30/ua/i_uaplaces.inc b/plugins/Actman30/ua/i_uaplaces.inc index bbd6571aaa..4bd8d18bd0 100644 --- a/plugins/Actman30/ua/i_uaplaces.inc +++ b/plugins/Actman30/ua/i_uaplaces.inc @@ -463,7 +463,7 @@ begin end;
-function PreBuildMenu(mtype:tMenuType;hContact:THANDLE=0):int;
+function PreBuildMenu(mtype:tMenuType;hContact:HCONTACT=0):int;
var
i:integer;
mi:TCListMenuItem;
diff --git a/plugins/ExternalAPI/delphi/m_smileyadd.inc b/plugins/ExternalAPI/delphi/m_smileyadd.inc index ecb3ebb7d1..4562f575f1 100644 --- a/plugins/ExternalAPI/delphi/m_smileyadd.inc +++ b/plugins/ExternalAPI/delphi/m_smileyadd.inc @@ -33,15 +33,15 @@ type cbSize :uint; // size of the structure
hwndRichEditControl:HWND; // handle to the rich edit control
rangeToReplace :PCHARRANGE; // same meaning as for normal Richedit use (NULL = replaceall)
- Protocolname :PAnsiChar; // protocol to use... if you have defined a
+ Protocolname :PAnsiChar; // protocol to use... if you have defined a
// protocol, u can use your own protocol name. SmileyAdd will
// automatically select the smileypack that is defined for your protocol.
// Or, use "Standard" for standard smiley set. Or "ICQ", "MSN"
// if you prefer those icons.
// If not found or NULL, "Standard" will be used
- flags :uint; // Flags (SAFLRE_*) that define the behaivior
- disableRedraw :BOOL; // Parameter have been depricated, have no effect on operation
- hContact :THANDLE; // Contact handle
+ flags :uint; // Flags (SAFLRE_*) that define the behaivior
+ disableRedraw :BOOL; // Parameter have been depricated, have no effect on operation
+ hContact :HCONTACT; // Contact handle
end;
{
@@ -63,17 +63,15 @@ type // Or, use "Standard" for standard smiley set. Or "ICQ", "MSN"
// if you prefer those icons.
// If not found or NULL: "Standard" will be used
- xPosition : int; // Postition to place the selectwindow
+ xPosition : int; // Postition to place the selectwindow
yPosition : int;
- Direction : int; // Direction (i.e. size upwards/downwards/etc) of
- // the window 0, 1, 2, 3
- hwndTarget : HWND; // Window, where to send the message when smiley
- // is selected.
- targetMessage: uint; // Target message, to be sent.
- targetWParam : LPARAM; // Target WParam to be sent (LParam will be PAnsiChar to
- // select smiley) see the example file.
- hwndParent : HWND; // Parent window for smiley dialog
- hContact : THANDLE; // Contact handle
+ Direction : int; // Direction (i.e. size upwards/downwards/etc) of the window 0, 1, 2, 3
+ hwndTarget : HWND; // Window, where to send the message when smiley is selected.
+ targetMessage: uint; // Target message, to be sent.
+ targetWParam : LPARAM; // Target WParam to be sent (LParam will be PAnsiChar to
+ // select smiley) see the example file.
+ hwndParent : HWND; // Parent window for smiley dialog
+ hContact : HCONTACT; // Contact handle
end;
{
@@ -93,14 +91,14 @@ const type
PSMADD_INFO2 = ^TSMADD_INFO2;
TSMADD_INFO2 = record
- cbSize : int; // size of the structure
+ cbSize : int; // size of the structure
Protocolname : PAnsiChar;
- ButtonIcon : HICON; // RETURN VALUE: this is filled with the
+ ButtonIcon : HICON; // RETURN VALUE: this is filled with the
// icon handle of the smiley that can be used on the button
// do not destroy! NULL if the buttonicon is not defined...
- NumberOfVisibleSmileys: int; // Number of visible smileys defined.
- NumberOfSmileys : int; // Number of total smileys defined
- hContact : THANDLE; //Contact handle
+ NumberOfVisibleSmileys: int; // Number of visible smileys defined.
+ NumberOfSmileys : int; // Number of total smileys defined
+ hContact : HCONTACT; //Contact handle
end;
const
@@ -120,18 +118,18 @@ type TSMADD_BATCHPARSE2 = record
cbSize :uint; // size of the structure
Protocolname:PAnsiChar; // protocol to use... if you have defined a protocol, u can
- // use your own protocol name. Smiley add wil automatically
- // select the smileypack that is defined for your protocol.
- // Or, use "Standard" for standard smiley set. Or "ICQ", "MSN"
- // if you prefer those icons.
- // If not found or NULL: "Standard" will be used
- str :TChar; // String to parse
- flag :uint; // One of the SAFL_ flags specifies parsing requirements
- // This parameter should be filled by the user
- numSmileys :uint; // Number of Smileys found, this parameter filled by SmileyAdd
- oflag :uint; // One of the SAFL_ flags specifies content of the parse results
- // this parameter filled by SmileyAdd
- hContact :THANDLE; // Contact handle
+ // use your own protocol name. Smiley add wil automatically
+ // select the smileypack that is defined for your protocol.
+ // Or, use "Standard" for standard smiley set. Or "ICQ", "MSN"
+ // if you prefer those icons.
+ // If not found or NULL: "Standard" will be used
+ str :TChar; // String to parse
+ flag :uint; // One of the SAFL_ flags specifies parsing requirements
+ // This parameter should be filled by the user
+ numSmileys :uint; // Number of Smileys found, this parameter filled by SmileyAdd
+ oflag :uint; // One of the SAFL_ flags specifies content of the parse results
+ // this parameter filled by SmileyAdd
+ hContact :HCONTACT; // Contact handle
end;
type
@@ -239,9 +237,9 @@ const type
SMADD_CONT = record
cbSize :uint;
- hContact:THANDLE;
- _type :int; // 0 - directory, 1 - file;
- path :TChar; // smiley category name for reference
+ hContact:HCONTACT;
+ _type :int; // 0 - directory, 1 - file;
+ path :TChar; // smiley category name for reference
end;
const
//Loads all smileys for the contact
diff --git a/plugins/ExternalAPI/delphi/m_tipper.inc b/plugins/ExternalAPI/delphi/m_tipper.inc index d9fea8208d..452904113d 100644 --- a/plugins/ExternalAPI/delphi/m_tipper.inc +++ b/plugins/ExternalAPI/delphi/m_tipper.inc @@ -10,7 +10,7 @@ {$IFNDEF M_TIPPER}
{$DEFINE M_TIPPER}
type
- TranslateFunc = function (hContact:THANDLE;module:PAnsiChar;setting_or_prefix:PAnsiChar;
+ TranslateFunc = function (hContact:HCONTACT;module:PAnsiChar;setting_or_prefix:PAnsiChar;
buff:pWideChar;bufflen:int):pWideChar; cdecl;
type
diff --git a/plugins/ExternalAPI/delphi/m_variables.inc b/plugins/ExternalAPI/delphi/m_variables.inc index bcc1f9889f..3d4f1ae940 100644 --- a/plugins/ExternalAPI/delphi/m_variables.inc +++ b/plugins/ExternalAPI/delphi/m_variables.inc @@ -56,7 +56,7 @@ type szExtraText:TCHAR; // Extra, context-specific string (can be NULL) ->
// The field "extratext" will be replaced by this
// string. (Previously szSource).
- hContact :THANDLE; // Handle to contact (can be NULL) -> The field "subject"
+ hContact :HCONTACT; // Handle to contact (can be NULL) -> The field "subject"
// represents this contact.
pCount :int; // (output) Number of succesful parsed tokens, needs to
// be set to 0 before the call
@@ -67,13 +67,6 @@ type cbTemporaryVarsSize:int; // Number of elements in szaTemporaryVars array
end;
-const
-// FORMATINFOV2_SIZE = (SizeOf(int)*4+SizeOf(pointer)*2 + SizeOf(THANDLE));
- {$IFNDEF WIN64}
- FORMATINFOV2_SIZE = 28;
- {$ELSE}
- FORMATINFOV2_SIZE = SIZEOF(TFORMATINFO);
- {$ENDIF}
const
// Possible flags:
diff --git a/plugins/QuickSearch/i_ok.inc b/plugins/QuickSearch/i_ok.inc index 52c617b66d..40708b8901 100644 --- a/plugins/QuickSearch/i_ok.inc +++ b/plugins/QuickSearch/i_ok.inc @@ -209,7 +209,7 @@ begin end;
-function DoMeta(hContact:THANDLE):pointer;
+function DoMeta(hContact:HCONTACT):pointer;
var
pw:pWideChar;
i:integer;
@@ -433,7 +433,7 @@ end; //----- Initial table filling -----
-procedure AddContact(num:integer;hContact:THANDLE);
+procedure AddContact(num:integer;hContact:HCONTACT);
var
col:pcolumnitem;
tmpstr:array [0..63] of AnsiChar;
@@ -476,7 +476,7 @@ end; function PrepareToFill:boolean;
var
cnt,cnt1:integer;
- hContact:THANDLE;
+ hContact:THCONTACT;
i:integer;
begin
result:=false;
diff --git a/plugins/QuickSearch/sr_window.pas b/plugins/QuickSearch/sr_window.pas index b9d94ef2d0..fd241bb3d4 100644 --- a/plugins/QuickSearch/sr_window.pas +++ b/plugins/QuickSearch/sr_window.pas @@ -51,7 +51,7 @@ type end;
pQSFRec = ^tQSFRec;
tQSFRec = record // row (contact)
- contact:THANDLE;
+ contact:HCONTACT;
proto :uint_ptr;
flags :dword;
status :dword;
@@ -115,7 +115,7 @@ begin end;
end;
-procedure AddContactToList(hContact:THANDLE;num:integer);
+procedure AddContactToList(hContact:HCONTACT;num:integer);
var
li:LV_ITEMW;
i:integer;
@@ -337,7 +337,7 @@ end; //----- contacts actions -----
-function GetFocusedhContact:THANDLE;
+function GetFocusedhContact:HCONTACT;
var
i:integer;
begin
@@ -348,7 +348,7 @@ begin result:=FlagBuf[i].contact;
end;
-procedure ShowContactMsgDlg(hContact:THANDLE);
+procedure ShowContactMsgDlg(hContact:HCONTACT);
begin
if hContact<>0 then
begin
@@ -357,7 +357,7 @@ begin end;
end;
-procedure DeleteOneContact(hContact:THANDLE);
+procedure DeleteOneContact(hContact:HCONTACT);
begin
if ServiceExists(strCListDel)>0 then
CallService(strCListDel,hContact,0)
@@ -388,8 +388,8 @@ end; procedure ConvertToMeta;
var
- hMeta:THANDLE;
- tmp:THANDLE;
+ hMeta:HCONTACT;
+ tmp:HCONTACT;
i,j:integer;
begin
j:=ListView_GetItemCount(grid)-1;
@@ -438,7 +438,7 @@ end; procedure UpdateLVCell(item,column:integer;text:pWideChar=pWideChar(-1));
var
li:LV_ITEMW;
- contact:THANDLE;
+ contact:HCONTACT;
row:integer;
begin
contact:=FlagBuf[LV_GetLParam(grid,item)].contact;
@@ -469,7 +469,7 @@ end; procedure MoveToGroup(group:PWideChar);
var
- contact:THANDLE;
+ contact:HCONTACT;
i,j,grcol,row:integer;
begin
j:=ListView_GetItemCount(grid)-1;
@@ -512,7 +512,7 @@ end; procedure MoveToContainer(container:PWideChar);
var
- contact:THANDLE;
+ contact:HCONTACT;
i,j,grcol,row:integer;
begin
j:=ListView_GetItemCount(grid)-1;
@@ -784,7 +784,7 @@ begin UpdateLVCell(SendMessage(grid,LVM_GETNEXTITEM,-1,LVNI_FOCUSED),cmcolumn,qsr.text);
end;
-function ShowContactMenu(wnd:HWND;hContact:THANDLE;col:integer=-1):HMENU;
+function ShowContactMenu(wnd:HWND;hContact:HCONTACT;col:integer=-1):HMENU;
var
mi:TCListMenuItem;
pt:tpoint;
diff --git a/plugins/Utils.pas/contact.pas b/plugins/Utils.pas/contact.pas index 9dc959c91f..697c603591 100644 --- a/plugins/Utils.pas/contact.pas +++ b/plugins/Utils.pas/contact.pas @@ -3,21 +3,21 @@ unit contact; interface
-uses windows;
+uses windows, m_api;
procedure FillContactList(list:hwnd; filter:boolean=true;format:pWideChar=nil);
-function FindContact(list:hwnd;contact:THANDLE):integer;
+function FindContact(list:hwnd;contact:HCONTACT):integer;
implementation
-uses messages, common, m_api, dbsettings, mirutils;
+uses messages, common, dbsettings, mirutils;
const
defformat = '%name% - %uid% (%account%:%group%)';
procedure FillContactList(list:hwnd; filter:boolean=true;format:pWideChar=nil);
var
- hContact:THANDLE;
+ hContact:THCONTACT;
buf:array [0..511] of WideChar;
buf1:array [0..63] of WideChar;
p:PWideChar;
@@ -109,7 +109,7 @@ begin end;
end;
-function FindContact(list:hwnd;contact:THANDLE):integer;
+function FindContact(list:hwnd;contact:HCONTACT):integer;
var
j:integer;
begin
diff --git a/plugins/Utils.pas/dbsettings.pas b/plugins/Utils.pas/dbsettings.pas index dcd880175b..dfbdd8ee69 100644 --- a/plugins/Utils.pas/dbsettings.pas +++ b/plugins/Utils.pas/dbsettings.pas @@ -4,78 +4,78 @@ interface uses windows,m_api;
-function DBReadByte (hContact:THANDLE;szModule:PAnsiChar;szSetting:PAnsiChar;default:byte =0):byte;
-function DBReadWord (hContact:THANDLE;szModule:PAnsiChar;szSetting:PAnsiChar;default:word =0):word;
-function DBReadDWord(hContact:THANDLE;szModule:PAnsiChar;szSetting:PAnsiChar;default:dword=0):dword;
+function DBReadByte (hContact:HCONTACT;szModule:PAnsiChar;szSetting:PAnsiChar;default:byte =0):byte;
+function DBReadWord (hContact:HCONTACT;szModule:PAnsiChar;szSetting:PAnsiChar;default:word =0):word;
+function DBReadDWord(hContact:HCONTACT;szModule:PAnsiChar;szSetting:PAnsiChar;default:dword=0):dword;
-function DBReadSetting (hContact:THANDLE;szModule:PAnsiChar;szSetting:PAnsiChar;dbv:PDBVARIANT):int_ptr;
-function DBReadSettingStr(hContact:THANDLE;szModule:PAnsiChar;szSetting:PAnsiChar;dbv:PDBVARIANT):int_ptr;
+function DBReadSetting (hContact:HCONTACT;szModule:PAnsiChar;szSetting:PAnsiChar;dbv:PDBVARIANT):int_ptr;
+function DBReadSettingStr(hContact:HCONTACT;szModule:PAnsiChar;szSetting:PAnsiChar;dbv:PDBVARIANT):int_ptr;
-function DBReadStringLength(hContact:THANDLE;szModule:PAnsiChar;szSetting:PAnsiChar):integer;
-function DBReadString (hContact:THANDLE;szModule:PAnsiChar;szSetting:PAnsiChar;
+function DBReadStringLength(hContact:HCONTACT;szModule:PAnsiChar;szSetting:PAnsiChar):integer;
+function DBReadString (hContact:HCONTACT;szModule:PAnsiChar;szSetting:PAnsiChar;
default:PAnsiChar=nil;enc:integer=DBVT_ASCIIZ):PAnsiChar;
-function DBReadUTF8 (hContact:THANDLE;szModule:PAnsiChar;szSetting:PAnsiChar;default:PAnsiChar=nil):PAnsiChar;
-function DBReadUnicode(hContact:THANDLE;szModule:PAnsiChar;szSetting:PAnsiChar;default:PWideChar=nil):PWideChar;
+function DBReadUTF8 (hContact:HCONTACT;szModule:PAnsiChar;szSetting:PAnsiChar;default:PAnsiChar=nil):PAnsiChar;
+function DBReadUnicode(hContact:HCONTACT;szModule:PAnsiChar;szSetting:PAnsiChar;default:PWideChar=nil):PWideChar;
-function DBReadStruct (hContact:THANDLE;szModule:PAnsiChar;szSetting:PAnsiChar;
+function DBReadStruct (hContact:HCONTACT;szModule:PAnsiChar;szSetting:PAnsiChar;
ptr:pointer;size:dword):uint_ptr;
-function DBWriteStruct(hContact:THANDLE;szModule:PAnsiChar;szSetting:PAnsiChar;
+function DBWriteStruct(hContact:HCONTACT;szModule:PAnsiChar;szSetting:PAnsiChar;
ptr:pointer;size:dword):Integer;
-function DBWriteSetting(hContact:THANDLE;szModule:PAnsiChar;szSetting:PAnsiChar;dbv:PDBVARIANT):int_ptr;
-function DBWriteByte (hContact:THANDLE;szModule:PAnsiChar;szSetting:PAnsiChar;val:Byte ):int_ptr;
-function DBWriteWord (hContact:THANDLE;szModule:PAnsiChar;szSetting:PAnsiChar;val:Word ):int_ptr;
-function DBWriteDWord(hContact:THANDLE;szModule:PAnsiChar;szSetting:PAnsiChar;val:dword):int_ptr;
+function DBWriteSetting(hContact:HCONTACT;szModule:PAnsiChar;szSetting:PAnsiChar;dbv:PDBVARIANT):int_ptr;
+function DBWriteByte (hContact:HCONTACT;szModule:PAnsiChar;szSetting:PAnsiChar;val:Byte ):int_ptr;
+function DBWriteWord (hContact:HCONTACT;szModule:PAnsiChar;szSetting:PAnsiChar;val:Word ):int_ptr;
+function DBWriteDWord(hContact:HCONTACT;szModule:PAnsiChar;szSetting:PAnsiChar;val:dword):int_ptr;
-function DBWriteString (hContact:THANDLE;szModule:PAnsiChar;szSetting:PAnsiChar;
+function DBWriteString (hContact:HCONTACT;szModule:PAnsiChar;szSetting:PAnsiChar;
val:PAnsiChar;enc:integer=DBVT_ASCIIZ):int_ptr;
-function DBWriteUTF8 (hContact:THANDLE;szModule:PAnsiChar;szSetting:PAnsiChar;val:PAnsiChar):int_ptr;
-function DBWriteUnicode(hContact:THANDLE;szModule:PAnsiChar;szSetting:PAnsiChar;val:PWideChar):int_ptr;
+function DBWriteUTF8 (hContact:HCONTACT;szModule:PAnsiChar;szSetting:PAnsiChar;val:PAnsiChar):int_ptr;
+function DBWriteUnicode(hContact:HCONTACT;szModule:PAnsiChar;szSetting:PAnsiChar;val:PWideChar):int_ptr;
-function DBFreeVariant(dbv:PDBVARIANT):int_ptr;
-function DBDeleteSetting(hContact:THANDLE;szModule:PAnsiChar;szSetting:PAnsiChar):int_ptr;
+//function DBFreeVariant(dbv:PDBVARIANT):int_ptr;
+function DBDeleteSetting(hContact:HCONTACT;szModule:PAnsiChar;szSetting:PAnsiChar):int_ptr;
-function DBDeleteGroup(hContact:THANDLE;szModule:PAnsiChar;prefix:pAnsiChar=nil):int_ptr;
+function DBDeleteGroup(hContact:HCONTACT;szModule:PAnsiChar;prefix:pAnsiChar=nil):int_ptr;
function DBDeleteModule(szModule:PAnsiChar):integer; // 0.8.0+
-function DBGetSettingType(hContact:THANDLE;szModule:PAnsiChar;szSetting:PAnsiChar):integer;
+function DBGetSettingType(hContact:HCONTACT;szModule:PAnsiChar;szSetting:PAnsiChar):integer;
implementation
uses common;
-function DBReadByte(hContact:THANDLE;szModule:PAnsiChar;szSetting:PAnsiChar;default:byte=0):byte;
+function DBReadByte(hContact:HCONTACT;szModule:PAnsiChar;szSetting:PAnsiChar;default:byte=0):byte;
{$IFDEF AllowInline}inline;{$ENDIF}
begin
result:=db_get_b(hContact, szModule, szSetting, default);
end;
-function DBReadWord(hContact:THANDLE;szModule:PAnsiChar;szSetting:PAnsiChar;default:word=0):word;
+function DBReadWord(hContact:HCONTACT;szModule:PAnsiChar;szSetting:PAnsiChar;default:word=0):word;
{$IFDEF AllowInline}inline;{$ENDIF}
begin
result:=db_get_w(hContact, szModule, szSetting, default);
end;
-function DBReadDWord(hContact:THANDLE;szModule:PAnsiChar;szSetting:PAnsiChar;default:dword=0):dword;
+function DBReadDWord(hContact:HCONTACT;szModule:PAnsiChar;szSetting:PAnsiChar;default:dword=0):dword;
{$IFDEF AllowInline}inline;{$ENDIF}
begin
result:=db_get_dw(hContact, szModule, szSetting, default);
end;
-function DBReadSetting(hContact:THANDLE;szModule:PAnsiChar;szSetting:PAnsiChar;dbv:PDBVARIANT):int_ptr;
+function DBReadSetting(hContact:HCONTACT;szModule:PAnsiChar;szSetting:PAnsiChar;dbv:PDBVARIANT):int_ptr;
{$IFDEF AllowInline}inline;{$ENDIF}
begin
result:=db_get(hContact, szModule, szSetting, dbv);
end;
-function DBReadSettingStr(hContact:THANDLE;szModule:PAnsiChar;szSetting:PAnsiChar;dbv:PDBVARIANT):int_ptr;
+function DBReadSettingStr(hContact:HCONTACT;szModule:PAnsiChar;szSetting:PAnsiChar;dbv:PDBVARIANT):int_ptr;
{$IFDEF AllowInline}inline;{$ENDIF}
begin
result:=db_get_s(hContact, szModule, szSetting, dbv, DBVT_ASCIIZ);
end;
-function DBReadStringLength(hContact:THANDLE;szModule:PAnsiChar;szSetting:PAnsiChar):integer;
+function DBReadStringLength(hContact:HCONTACT;szModule:PAnsiChar;szSetting:PAnsiChar):integer;
var
dbv:TDBVARIANT;
i:int_ptr;
@@ -86,10 +86,11 @@ begin result:=0
else
result:=StrLen(dbv.szVal.a);
+
DBFreeVariant(@dbv);
end;
-function DBReadString(hContact:THANDLE;szModule:PAnsiChar;szSetting:PAnsiChar;
+function DBReadString(hContact:HCONTACT;szModule:PAnsiChar;szSetting:PAnsiChar;
default:PAnsiChar=nil;enc:integer=DBVT_ASCIIZ):PAnsiChar;
var
dbv:TDBVARIANT;
@@ -108,13 +109,13 @@ begin DBFreeVariant(@dbv);
end;
-function DBReadUTF8(hContact:THANDLE;szModule:PAnsiChar;szSetting:PAnsiChar;default:PAnsiChar=nil):PAnsiChar;
+function DBReadUTF8(hContact:HCONTACT;szModule:PAnsiChar;szSetting:PAnsiChar;default:PAnsiChar=nil):PAnsiChar;
{$IFDEF AllowInline}inline;{$ENDIF}
begin
result:=DBReadString(hContact,szModule,szSetting,default,DBVT_UTF8);
end;
-function DBReadUnicode(hContact:THANDLE;szModule:PAnsiChar;szSetting:PAnsiChar;default:PWideChar=nil):PWideChar;
+function DBReadUnicode(hContact:HCONTACT;szModule:PAnsiChar;szSetting:PAnsiChar;default:PWideChar=nil):PWideChar;
var
dbv:TDBVARIANT;
i:int_ptr;
@@ -132,7 +133,7 @@ begin DBFreeVariant(@dbv);
end;
-function DBReadStruct(hContact:THANDLE;szModule:PAnsiChar;szSetting:PAnsiChar;
+function DBReadStruct(hContact:HCONTACT;szModule:PAnsiChar;szSetting:PAnsiChar;
ptr:pointer;size:dword):uint_ptr;
var
dbv:TDBVariant;
@@ -153,63 +154,57 @@ begin result:=0;
end;
-function DBWriteStruct(hContact:THANDLE;szModule:PAnsiChar;szSetting:PAnsiChar;
+function DBWriteStruct(hContact:HCONTACT;szModule:PAnsiChar;szSetting:PAnsiChar;
ptr:pointer;size:dword):Integer;
{$IFDEF AllowInline}inline;{$ENDIF}
begin
result:=db_set_blob(hContact, szModule, szSetting, ptr, size);
end;
-function DBWriteSetting(hContact:THANDLE;szModule:PAnsiChar;szSetting:PAnsiChar;dbv:PDBVARIANT):int_ptr;
+function DBWriteSetting(hContact:HCONTACT;szModule:PAnsiChar;szSetting:PAnsiChar;dbv:PDBVARIANT):int_ptr;
{$IFDEF AllowInline}inline;{$ENDIF}
begin
Result:=db_set(hContact, szModule, szSetting, dbv);
end;
-function DBWriteByte(hContact:THANDLE;szModule:PAnsiChar;szSetting:PAnsiChar;val:Byte):int_ptr;
+function DBWriteByte(hContact:HCONTACT;szModule:PAnsiChar;szSetting:PAnsiChar;val:Byte):int_ptr;
{$IFDEF AllowInline}inline;{$ENDIF}
begin
result:=db_set_b(hContact, szModule, szSetting, val);
end;
-function DBWriteWord(hContact:THANDLE;szModule:PAnsiChar;szSetting:PAnsiChar;val:Word):int_ptr;
+function DBWriteWord(hContact:HCONTACT;szModule:PAnsiChar;szSetting:PAnsiChar;val:Word):int_ptr;
{$IFDEF AllowInline}inline;{$ENDIF}
begin
result:=db_set_w(hContact, szModule, szSetting, val);
end;
-function DBWriteDWord(hContact:THANDLE;szModule:PAnsiChar;szSetting:PAnsiChar;val:dword):int_ptr;
+function DBWriteDWord(hContact:HCONTACT;szModule:PAnsiChar;szSetting:PAnsiChar;val:dword):int_ptr;
{$IFDEF AllowInline}inline;{$ENDIF}
begin
result:=db_set_dw(hContact, szModule, szSetting, val);
end;
-function DBWriteString(hContact:THANDLE;szModule:PAnsiChar;szSetting:PAnsiChar;
+function DBWriteString(hContact:HCONTACT;szModule:PAnsiChar;szSetting:PAnsiChar;
val:PAnsiChar;enc:integer=DBVT_ASCIIZ):int_ptr;
{$IFDEF AllowInline}inline;{$ENDIF}
begin
result:=db_set_s(hContact, szModule, szSetting, val);
end;
-function DBWriteUTF8(hContact:THANDLE;szModule:PAnsiChar;szSetting:PAnsiChar;val:PAnsiChar):int_ptr;
+function DBWriteUTF8(hContact:HCONTACT;szModule:PAnsiChar;szSetting:PAnsiChar;val:PAnsiChar):int_ptr;
{$IFDEF AllowInline}inline;{$ENDIF}
begin
result:=db_set_utf(hContact, szModule, szSetting, val);
end;
-function DBWriteUnicode(hContact:THANDLE;szModule:PAnsiChar;szSetting:PAnsiChar;val:PWideChar):int_ptr;
+function DBWriteUnicode(hContact:HCONTACT;szModule:PAnsiChar;szSetting:PAnsiChar;val:PWideChar):int_ptr;
{$IFDEF AllowInline}inline;{$ENDIF}
begin
result:=db_set_ws(hContact, szModule, szSetting, val);
end;
-function DBFreeVariant(dbv:PDBVARIANT):int_ptr;
- {$IFDEF AllowInline}inline;{$ENDIF}
-begin
- result:=db_free(dbv);
-end;
-
-function DBDeleteSetting(hContact:THandle;szModule:PAnsiChar;szSetting:PAnsiChar):int_ptr;
+function DBDeleteSetting(hContact:HCONTACT;szModule:PAnsiChar;szSetting:PAnsiChar):int_ptr;
{$IFDEF AllowInline}inline;{$ENDIF}
begin
result:=db_unset(hContact, szModule, szSetting);
@@ -231,7 +226,7 @@ begin result:=0;
end;
-function DBDeleteGroup(hContact:THANDLE;szModule:PAnsiChar;prefix:pAnsiChar=nil):int_ptr;
+function DBDeleteGroup(hContact:HCONTACT;szModule:PAnsiChar;prefix:pAnsiChar=nil):int_ptr;
var
ces:TDBCONTACTENUMSETTINGS;
p:PAnsiChar;
@@ -319,7 +314,7 @@ begin CallService(MS_DB_MODULE_DELETE,0,lParam(szModule));
end;
-function DBGetSettingType(hContact:THANDLE;szModule:PAnsiChar;szSetting:PAnsiChar):integer;
+function DBGetSettingType(hContact:HCONTACT;szModule:PAnsiChar;szSetting:PAnsiChar):integer;
var
ldbv:TDBVARIANT;
begin
diff --git a/plugins/Utils.pas/editwrapper.pas b/plugins/Utils.pas/editwrapper.pas index a3cd58debc..ff3c77a423 100644 --- a/plugins/Utils.pas/editwrapper.pas +++ b/plugins/Utils.pas/editwrapper.pas @@ -2,7 +2,7 @@ unit EditWrapper; interface
-uses windows;
+uses windows,m_api;
// exported flags
const
@@ -32,7 +32,7 @@ function ShowEditBox(parent:HWND;var text:pWideChar;title:pWideChar):int_ptr; implementation
-uses messages,commctrl,common,wrapper,m_api;
+uses messages,commctrl,common,wrapper;
{$R editwrapper.res}
{$include 'i_text_const.inc'}
diff --git a/plugins/Utils.pas/mirutils.pas b/plugins/Utils.pas/mirutils.pas index e5e761b24b..920a969b49 100644 --- a/plugins/Utils.pas/mirutils.pas +++ b/plugins/Utils.pas/mirutils.pas @@ -20,10 +20,10 @@ function RegisterSingleIcon(resname,ilname,descr,group:PAnsiChar):int; // others
-function ConvertFileName(src:pAnsiChar;hContact:THANDLE=0):pAnsiChar; overload;
-function ConvertFileName(src:pWideChar;hContact:THANDLE=0):pWideChar; overload;
-function ConvertFileName(src:pAnsiChar;dst:pAnsiChar;hContact:THANDLE=0):pAnsiChar; overload;
-function ConvertFileName(src:pWideChar;dst:pWideChar;hContact:THANDLE=0):pWideChar; overload;
+function ConvertFileName(src:pAnsiChar;hContact:HCONTACT=0):pAnsiChar; overload;
+function ConvertFileName(src:pWideChar;hContact:HCONTACT=0):pWideChar; overload;
+function ConvertFileName(src:pAnsiChar;dst:pAnsiChar;hContact:HCONTACT=0):pAnsiChar; overload;
+function ConvertFileName(src:pWideChar;dst:pWideChar;hContact:HCONTACT=0):pWideChar; overload;
procedure ShowPopupW(text:pWideChar;title:pWideChar=nil);
function GetAddonFileName(prefix,altname,path:PAnsiChar;ext:PAnsiChar):PAnsiChar;
@@ -31,31 +31,31 @@ function TranslateA2W(sz:PAnsiChar):PWideChar; function MirandaCP:integer;
function isVarsInstalled:bool;
-function ParseVarString(astr:pAnsiChar;aContact:THANDLE=0;extra:pAnsiChar=nil):pAnsiChar; overload;
-function ParseVarString(astr:pWideChar;aContact:THANDLE=0;extra:pWideChar=nil):pWideChar; overload;
+function ParseVarString(astr:pAnsiChar;aContact:HCONTACT=0;extra:pAnsiChar=nil):pAnsiChar; overload;
+function ParseVarString(astr:pWideChar;aContact:HCONTACT=0;extra:pWideChar=nil):pWideChar; overload;
function ShowVarHelp(dlg:HWND;id:integer=0):integer;
-function IsChat(hContact:THANDLE):bool;
-procedure SendToChat(hContact:THANDLE;pszText:PWideChar);
-
-function LoadContact(group,setting:PAnsiChar):THANDLE;
-function SaveContact(hContact:THANDLE;group,setting:PAnsiChar):integer;
-
-function SetCListSelContact(hContact:THANDLE):THANDLE;
-function GetCListSelContact:THANDLE; {$IFDEF DELPHI_10_UP}inline;{$ENDIF}
-function GetContactProtoAcc(hContact:THANDLE):PAnsiChar;
-function IsMirandaUser(hContact:THANDLE):integer; // >0=Miranda; 0=Not miranda; -1=unknown
-procedure ShowContactDialog(hContact:THANDLE;DblClk:boolean=true;anystatus:boolean=true);
-function FindContactHandle(proto:pAnsiChar;const dbv:TDBVARIANT;is_chat:boolean=false):THANDLE;
-function WndToContact(wnd:hwnd):THANDLE; overload;
-function WndToContact:THANDLE; overload;
-function GetContactStatus(hContact:THANDLE):integer;
+function IsChat(hContact:HCONTACT):bool;
+procedure SendToChat(hContact:HCONTACT;pszText:PWideChar);
+
+function LoadContact(group,setting:PAnsiChar):HCONTACT;
+function SaveContact(hContact:HCONTACT;group,setting:PAnsiChar):integer;
+
+function SetCListSelContact(hContact:HCONTACT):HCONTACT;
+function GetCListSelContact:HCONTACT; {$IFDEF DELPHI_10_UP}inline;{$ENDIF}
+function GetContactProtoAcc(hContact:HCONTACT):PAnsiChar;
+function IsMirandaUser(hContact:HCONTACT):integer; // >0=Miranda; 0=Not miranda; -1=unknown
+procedure ShowContactDialog(hContact:HCONTACT;DblClk:boolean=true;anystatus:boolean=true);
+function FindContactHandle(proto:pAnsiChar;const dbv:TDBVARIANT;is_chat:boolean=false):HCONTACT;
+function WndToContact(wnd:hwnd):HCONTACT; overload;
+function WndToContact:HCONTACT; overload;
+function GetContactStatus(hContact:HCONTACT):integer;
// -2 - deleted account, -1 - disabled account, 0 - hidden
// 1 - metacontact, 2 - submetacontact, positive - active
// proto - ASSIGNED buffer
-function IsContactActive(hContact:THANDLE;proto:pAnsiChar=nil):integer;
+function IsContactActive(hContact:HCONTACT;proto:pAnsiChar=nil):integer;
-function CreateGroupW(name:pWideChar;hContact:THANDLE):integer;
+function CreateGroupW(name:pWideChar;hContact:HCONTACT):integer;
function MakeGroupMenu(idxfrom:integer=100):HMENU;
function GetNewGroupName(parent:HWND):pWideChar;
@@ -95,7 +95,7 @@ begin SendMessage(btn,BM_SETIMAGE,IMAGE_ICON,result);
end;
-function ConvertFileName(src:pWideChar;dst:pWideChar;hContact:THANDLE=0):pWideChar; overload;
+function ConvertFileName(src:pWideChar;dst:pWideChar;hContact:HCONTACT=0):pWideChar; overload;
var
pc:pWideChar;
begin
@@ -115,7 +115,7 @@ begin end;
end;
-function ConvertFileName(src:pWideChar;hContact:THANDLE=0):pWideChar; overload;
+function ConvertFileName(src:pWideChar;hContact:HCONTACT=0):pWideChar; overload;
var
buf1:array [0..511] of WideChar;
begin
@@ -125,7 +125,7 @@ begin result:=nil;
end;
-function ConvertFileName(src:pAnsiChar;dst:pAnsiChar;hContact:THANDLE=0):pAnsiChar; overload;
+function ConvertFileName(src:pAnsiChar;dst:pAnsiChar;hContact:HCONTACT=0):pAnsiChar; overload;
var
pc:pAnsiChar;
begin
@@ -145,7 +145,7 @@ begin end;
end;
-function ConvertFileName(src:pAnsiChar;hContact:THANDLE=0):pAnsiChar; overload;
+function ConvertFileName(src:pAnsiChar;hContact:HCONTACT=0):pAnsiChar; overload;
var
buf1:array [0..511] of AnsiChar;
begin
@@ -165,7 +165,7 @@ begin result:=MirCP;
end;
-function IsChat(hContact:THANDLE):bool;
+function IsChat(hContact:HCONTACT):bool;
begin
result:=DBReadByte(hContact,
PAnsiChar(CallService(MS_PROTO_GETCONTACTBASEPROTO,hContact,0)),
@@ -173,16 +173,19 @@ begin end;
function isVarsInstalled:bool;
+{$IFDEF AllowInline}inline;{$ENDIF}
begin
result:=ServiceExists(MS_VARS_FORMATSTRING)<>0;
end;
-function ParseVarString(astr:pAnsiChar;aContact:THANDLE=0;extra:pAnsiChar=nil):pAnsiChar;
+function ParseVarString(astr:pAnsiChar;aContact:HCONTACT=0;extra:pAnsiChar=nil):pAnsiChar;
var
tfi:TFORMATINFO;
tmp,pc:pAnsiChar;
dat:TREPLACEVARSDATA;
begin
+ if (astr=nil) or (astr^=#0) then exit;
+
if ServiceExists(MS_UTILS_REPLACEVARS)<>0 then
begin
FillChar(dat,SizeOf(TREPLACEVARSDATA),0);
@@ -214,12 +217,14 @@ begin mir_free(pc);
end;
-function ParseVarString(astr:pWideChar;aContact:THANDLE=0;extra:pWideChar=nil):pWideChar;
+function ParseVarString(astr:pWideChar;aContact:HCONTACT=0;extra:pWideChar=nil):pWideChar;
var
tfi:TFORMATINFO;
tmp,pc:pWideChar;
dat:TREPLACEVARSDATA;
begin
+ if (astr=nil) or (astr^=#0) then exit;
+
if ServiceExists(MS_UTILS_REPLACEVARS)<>0 then
begin
FillChar(dat,SizeOf(TREPLACEVARSDATA),0);
@@ -251,7 +256,6 @@ begin StrDupW(result,astr);
end;
mir_free(pc); // forced!
-// mFreeMem(pc);
end;
function ShowVarHelp(dlg:HWND;id:integer=0):integer;
@@ -310,7 +314,7 @@ begin end;
end;
-function GetContactProtoAcc(hContact:THANDLE):PAnsiChar;
+function GetContactProtoAcc(hContact:HCONTACT):PAnsiChar;
begin
if ServiceExists(MS_PROTO_GETCONTACTBASEACCOUNT)<>0 then
result:=PAnsiChar(CallService(MS_PROTO_GETCONTACTBASEACCOUNT,hContact,0))
@@ -318,7 +322,7 @@ begin result:=PAnsiChar(CallService(MS_PROTO_GETCONTACTBASEPROTO,hContact,0));
end;
-function IsMirandaUser(hContact:THANDLE):integer; // >0=Miranda; 0=Not miranda; -1=unknown
+function IsMirandaUser(hContact:HCONTACT):integer; // >0=Miranda; 0=Not miranda; -1=unknown
var
sz:PAnsiChar;
begin
@@ -333,7 +337,7 @@ begin result:=-1;
end;
-function SetCListSelContact(hContact:THANDLE):THANDLE;
+function SetCListSelContact(hContact:HCONTACT):HCONTACT;
var
wnd:HWND;
begin
@@ -349,7 +353,7 @@ begin result:=SendMessageW(CallService(MS_CLUI_GETHWNDTREE,0,0),CLM_GETSELECTION,0,0);
end;
-function LoadContact(group,setting:PAnsiChar):THANDLE;
+function LoadContact(group,setting:PAnsiChar):HCONTACT;
var
p,proto:pAnsiChar;
section:array [0..63] of AnsiChar;
@@ -374,7 +378,7 @@ begin mFreeMem(dbv.szVal.W);
end;
-function SaveContact(hContact:THANDLE;group,setting:PAnsiChar):integer;
+function SaveContact(hContact:HCONTACT;group,setting:PAnsiChar):integer;
var
p,proto,uid:pAnsiChar;
cws:TDBVARIANT;
@@ -416,9 +420,9 @@ begin end;
end;
-function WndToContact(wnd:hwnd):THANDLE; overload;
+function WndToContact(wnd:hwnd):HCONTACT; overload;
var
- hContact:THANDLE;
+ hContact:THCONTACT;
mwid:TMessageWindowInputData;
mwod:TMessageWindowOutputData;
begin
@@ -446,7 +450,7 @@ begin result:=0;
end;
-function WndToContact:THANDLE; overload;
+function WndToContact:HCONTACT; overload;
var
wnd:HWND;
begin
@@ -461,7 +465,7 @@ begin result:=GetCListSelContact;
end;
-function GetContactStatus(hContact:THANDLE):integer;
+function GetContactStatus(hContact:HCONTACT):integer;
var
szProto:PAnsiChar;
begin
@@ -551,7 +555,7 @@ begin end;
end;
-procedure ShowContactDialog(hContact:THANDLE;DblClk:boolean=true;anystatus:boolean=true);
+procedure ShowContactDialog(hContact:HCONTACT;DblClk:boolean=true;anystatus:boolean=true);
var
pc:array [0..127] of AnsiChar;
begin
@@ -605,7 +609,7 @@ begin CallServiceSync(MS_GC_EVENT,0,lparam(@gce));
end;
-procedure SendToChat(hContact:THANDLE;pszText:PWideChar);
+procedure SendToChat(hContact:HCONTACT;pszText:PWideChar);
var
gci:TGC_INFO;
pszModule:PAnsiChar;
@@ -618,7 +622,7 @@ begin while i<cnt do
begin
gci.iItem:=i;
- gci.Flags:=GCI_BYINDEX+GCI_HCONTACT+GCI_ID;
+ gci.Flags:=GCF_BYINDEX+GCF_HCONTACT+GCF_ID;
CallService(MS_GC_GETINFO,0,lparam(@gci));
if gci.hContact=hContact then
begin
@@ -629,11 +633,11 @@ begin end;
end;
-function FindContactHandle(proto:pAnsiChar;const dbv:TDBVARIANT;is_chat:boolean=false):THANDLE;
+function FindContactHandle(proto:pAnsiChar;const dbv:TDBVARIANT;is_chat:boolean=false):HCONTACT;
var
uid:pAnsiChar;
ldbv:TDBVARIANT;
- hContact:THANDLE;
+ hContact:THCONTACT;
pw:pWideChar;
begin
result:=0;
@@ -688,7 +692,7 @@ begin end;
end;
-function IsContactActive(hContact:THANDLE;proto:pAnsiChar=nil):integer;
+function IsContactActive(hContact:HCONTACT;proto:pAnsiChar=nil):integer;
var
p:PPROTOACCOUNT;
name: array [0..31] of AnsiChar;
@@ -737,7 +741,7 @@ begin end;
// Import plugin function adaptation
-function CreateGroupW(name:pWideChar;hContact:THANDLE):integer;
+function CreateGroupW(name:pWideChar;hContact:HCONTACT):integer;
var
groupId:integer;
groupIdStr:array [0..10] of AnsiChar;
diff --git a/plugins/Utils.pas/sparam.pas b/plugins/Utils.pas/sparam.pas index 5a686aa4a8..80a7b150db 100644 --- a/plugins/Utils.pas/sparam.pas +++ b/plugins/Utils.pas/sparam.pas @@ -2,7 +2,7 @@ unit sparam; interface
-uses windows;
+uses windows, m_api;
const
// parameter flags
@@ -50,7 +50,7 @@ function SetParamLabel (Dialog:HWND; lbl:pWideChar):HWND; procedure ClearParam (flags:dword; var param);
function DuplicateParam(flags:dword; var sparam,dparam):dword;
-function TranslateParam(param:uint_ptr;flags:dword;hContact:THANDLE):uint_ptr;
+function TranslateParam(param:uint_ptr;flags:dword;hContact:HCONTACT):uint_ptr;
function CreateResultBlock(parent:HWND;x,y,width:integer;flags:dword=0):THANDLE;
function ClearResultFields(Dialog:HWND):HWND;
@@ -62,7 +62,7 @@ implementation uses
messages,
common, editwrapper, wrapper, syswin,
- m_api, sedit, strans,
+ sedit, strans,
mirutils;
const
@@ -651,7 +651,7 @@ begin result:=flags;
end;
-function TranslateParam(param:uint_ptr;flags:dword;hContact:THANDLE):uint_ptr;
+function TranslateParam(param:uint_ptr;flags:dword;hContact:HCONTACT):uint_ptr;
var
tmp1:pWideChar;
begin
diff --git a/plugins/Utils.pas/structopts.rc b/plugins/Utils.pas/structopts.rc index f7e4a2750e..f4ee41cc7a 100644 --- a/plugins/Utils.pas/structopts.rc +++ b/plugins/Utils.pas/structopts.rc @@ -45,9 +45,10 @@ FONT 8, "MS Shell Dlg", 0, 0 EDITTEXT IDC_DATA_EDTN, 186, 55, 160, 11
#ifdef Miranda
CONTROL "V" ,IDC_VAR_HELP ,"MButtonClass",WS_TABSTOP,328,137,16,16,$18000000
- AUTOCHECKBOX "Use Variables", IDC_DATA_VARS, 186, 138, 142, 14
- AUTOCHECKBOX "Use MMI" , IDC_DATA_MMI , 186, 152, 160, 14
+ AUTOCHECKBOX "Use Variables", IDC_DATA_VARS , 186, 138, 142, 14
+ AUTOCHECKBOX "Use MMI" , IDC_DATA_MMI , 186, 153, 160, 14
#endif
+ AUTOCHECKBOX "Structure size", IDC_DATA_SIZE, 186, 153, 160, 14
DEFPUSHBUTTON "&Change", IDC_DATA_CHANGE, 186, 168, 46, 14//, WS_GROUP
PUSHBUTTON "&OK" , IDOK , 250, 168, 46, 14
diff --git a/plugins/Utils.pas/structopts.res b/plugins/Utils.pas/structopts.res Binary files differindex ec27d88e3e..b97d2fff3c 100644 --- a/plugins/Utils.pas/structopts.res +++ b/plugins/Utils.pas/structopts.res diff --git a/plugins/Utils.pas/wrapper.pas b/plugins/Utils.pas/wrapper.pas index 25b23a05f0..a663f5fa9c 100644 --- a/plugins/Utils.pas/wrapper.pas +++ b/plugins/Utils.pas/wrapper.pas @@ -540,11 +540,13 @@ var hfo :HFONT;
tm :TTEXTMETRIC;
size:TSIZE;
+ tmp :pWideChar;
begin
dc:=GetDC(wnd);
hfo:=SelectObject(dc,SendMessage(wnd,WM_GETFONT,0,0));
GetTextMetrics(dc,tm);
- GetTextExtentPoint32(dc,'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz',52,size);
+ tmp:='ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz';
+ GetTextExtentPoint32W(dc,tmp,52,size);
SelectObject(dc,hfo);
ReleaseDC(wnd,dc);
baseUnitX:=(size.cx div 26+1) div 2;
diff --git a/plugins/Watrack/proto/proto.pas b/plugins/Watrack/proto/proto.pas index f1c6eff06b..9509c706e1 100644 --- a/plugins/Watrack/proto/proto.pas +++ b/plugins/Watrack/proto/proto.pas @@ -57,7 +57,7 @@ var {$include i_proto_opt.inc}
{$include i_proto_dlg.inc}
-procedure AddEvent(hContact:THANDLE;atype,flag:integer;data:pointer;size:integer;time:dword=0);
+procedure AddEvent(hContact:HCONTACT;atype,flag:integer;data:pointer;size:integer;time:dword=0);
var
dbeo:TDBEVENTINFO;
begin
@@ -206,7 +206,7 @@ begin end;
*)
-function ReceiveMessageProcW(wParam:WPARAM; lParam:LPARAM):integer; cdecl;
+function ReceiveMessageProcW(wParam:WPARAM; lParam:LPARAM):int_ptr; cdecl;
const
bufsize = 4096*SizeOf(WideChar);
var
@@ -390,7 +390,7 @@ begin mFreeMem(buf);
end;
-function SendRequest(hContact:WPARAM;lParam:LPARAM):integer; cdecl;
+function SendRequest(hContact:WPARAM;lParam:LPARAM):int_ptr; cdecl;
var
buf:array [0..2047] of AnsiChar;
begin
@@ -404,7 +404,7 @@ end; procedure RegisterContacts;
var
- hContact:integer;
+ hContact:THCONTACT;
begin
hContact:=db_find_first();
while hContact<>0 do
@@ -415,7 +415,7 @@ begin end;
end;
-function HookAddUser(hContact:WPARAM;lParam:LPARAM):integer; cdecl;
+function HookAddUser(hContact:WPARAM;lParam:LPARAM):int; cdecl;
begin
result:=0;
if not IsChat(hContact) then
diff --git a/plugins/Watrack/watrack.dpr b/plugins/Watrack/watrack.dpr index 0664dfa8f2..ca63bb7fa8 100644 --- a/plugins/Watrack/watrack.dpr +++ b/plugins/Watrack/watrack.dpr @@ -113,7 +113,7 @@ begin result:=int_ptr(ReturnInfo(wParam,lParam));
end;
-function WATGetFileInfo(wParam:WPARAM;lParam:LPARAM):int;cdecl;
+function WATGetFileInfo(wParam:WPARAM;lParam:LPARAM):int_ptr;cdecl;
var
// si:TSongInfo;
dst:pSongInfo;
@@ -163,7 +163,7 @@ begin end;
end;
-function WATGetMusicInfo(wParam:WPARAM;lParam:LPARAM):int;cdecl;
+function WATGetMusicInfo(wParam:WPARAM;lParam:LPARAM):int_ptr;cdecl;
type
ppointer = ^pointer;
const
diff --git a/plugins/mRadio/i_myservice.inc b/plugins/mRadio/i_myservice.inc index 4f50cf573c..e4cf178a5c 100644 --- a/plugins/mRadio/i_myservice.inc +++ b/plugins/mRadio/i_myservice.inc @@ -4,7 +4,7 @@ function Service_RadioPlayStop(wParam:WPARAM;lParam:LPARAM):int;cdecl; var
p:PAnsiChar;
lnew:bool;
- hContact:THANDLE;
+ hContact:THCONTACT;
cni:TCONTACTINFO;
i:integer;
begin
@@ -145,7 +145,7 @@ end; //----- Import-export -----
-function ImportOneStation(group:PAnsiChar;section:pointer):int;
+function ImportOneStation(group:PAnsiChar;section:pointer):HCONTACT;
var
p:pWideChar;
pc:pAnsiChar;
@@ -218,7 +218,7 @@ begin end;
end;
-procedure ExportRadioContact(num:integer;fname:PAnsiChar;hContact:THANDLE);
+procedure ExportRadioContact(num:integer;fname:PAnsiChar;hContact:HCONTACT);
var
pc:pAnsiChar;
section:array [0..15] of AnsiChar;
@@ -257,7 +257,7 @@ end; function ExportAll(wParam:WPARAM;lParam:LPARAM):int; cdecl;
var
dst:array [0..MAX_PATH-1] of AnsiChar;
- hContact:THANDLE;
+ hContact:THCONTACT;
begin
result:=0;
if lParam<>0 then
diff --git a/plugins/mRadio/i_search.inc b/plugins/mRadio/i_search.inc index bcbe6662a7..d585c72d73 100644 --- a/plugins/mRadio/i_search.inc +++ b/plugins/mRadio/i_search.inc @@ -276,7 +276,7 @@ end; function Service_AddToList(wParam:WPARAM;lParam:LPARAM):int_ptr;cdecl;
var
- hContact:THANDLE;
+ hContact:THCONTACT;
p:PWideChar;
lurl:pWideChar;
begin
diff --git a/plugins/mRadio/i_service.inc b/plugins/mRadio/i_service.inc index fbc644711e..e1a528d84f 100644 --- a/plugins/mRadio/i_service.inc +++ b/plugins/mRadio/i_service.inc @@ -27,7 +27,7 @@ begin result:=0;
end;
-procedure GetAwayMsgProc(hContact:THANDLE); cdecl;
+procedure GetAwayMsgProc(hContact:HCONTACT); cdecl;
var
buf,p:PWideChar;
begin
@@ -131,7 +131,7 @@ begin if wParam<>ID_STATUS_OFFLINE then
wParam:=ID_STATUS_ONLINE;
- if wParam=PluginStatus then
+ if wParam=TWPARAM(PluginStatus) then
exit;
PluginStatus:=ID_STATUS_OFFLINE;
diff --git a/plugins/mRadio/rccenter.pas b/plugins/mRadio/rccenter.pas index 6f75ef48ae..ac8c762228 100644 --- a/plugins/mRadio/rccenter.pas +++ b/plugins/mRadio/rccenter.pas @@ -4,14 +4,14 @@ unit rccenter; interface
uses
- windows;
+ windows,m_api;
function ControlCenter(code:WPARAM;arg:LPARAM):int_ptr; cdecl;
implementation
uses
- common, m_api,
+ common,
dbsettings, playlist, mirutils,
rglobal, rbass,
Dynamic_Bass,
diff --git a/plugins/mRadio/rframeapi.pas b/plugins/mRadio/rframeapi.pas index 0aba02c517..471f8ccf71 100644 --- a/plugins/mRadio/rframeapi.pas +++ b/plugins/mRadio/rframeapi.pas @@ -220,7 +220,7 @@ begin height :=tr.bottom-tr.top+2;
Flags :=F_VISIBLE or F_NOBORDER or F_UNICODE;
name.w :=cPluginName;
- TBName.w:=cPluginName + ' volume control';
+ TBName.w:=TranslateW(cPluginName + ' volume control');
end;
FrameId:=CallService(MS_CLIST_FRAMES_ADDFRAME,wparam(@Frame),0);
diff --git a/plugins/mRadio/rglobal.pas b/plugins/mRadio/rglobal.pas index 283daae17c..d914d4dc21 100644 --- a/plugins/mRadio/rglobal.pas +++ b/plugins/mRadio/rglobal.pas @@ -6,6 +6,7 @@ interface uses
windows,
Dynamic_Bass,
+ m_api,
playlist;
{$include m_radio.inc}
@@ -20,7 +21,7 @@ const const
chan :HSTREAM = 0;
- ActiveContact:THANDLE = 0;
+ ActiveContact:HCONTACT = 0;
ActiveURL :PWideChar = nil;
const
@@ -158,7 +159,7 @@ const function MakeMessage:pWideChar;
-procedure SetStatus(hContact:THANDLE;status:integer);
+procedure SetStatus(hContact:HCONTACT;status:integer);
function GetDefaultRecPath:pWideChar;
function GetStatusText(status:integer;toCList:boolean=false):PWideChar;
@@ -166,9 +167,9 @@ function GetStatusText(status:integer;toCList:boolean=false):PWideChar; implementation
uses
- m_api, common, dbsettings;
+ common, dbsettings;
-procedure SetStatus(hContact:THANDLE;status:integer);
+procedure SetStatus(hContact:HCONTACT;status:integer);
begin
// if Status=ID_STATUS_OFFLINE then
// MyStopBass;
|