summaryrefslogtreecommitdiff
path: root/plugins/Utils.pas
diff options
context:
space:
mode:
authorAlexey Kulakov <panda75@bk.ru>2014-03-08 13:10:05 +0000
committerAlexey Kulakov <panda75@bk.ru>2014-03-08 13:10:05 +0000
commitd83baeb842ea828eaee90a0cd6575872a95240e8 (patch)
tree8d775bb8920446118011093658caf7d9c0d61ed4 /plugins/Utils.pas
parent0da38f608c271216398052dc0030b901951143ec (diff)
Pascal-style type correction
Letter case correction small fixes Actman UA part dialog slightly changed git-svn-id: http://svn.miranda-ng.org/main/trunk@8473 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/Utils.pas')
-rw-r--r--plugins/Utils.pas/common.pas35
-rw-r--r--plugins/Utils.pas/contact.pas12
-rw-r--r--plugins/Utils.pas/dbsettings.pas88
-rw-r--r--plugins/Utils.pas/editwrapper.pas6
-rw-r--r--plugins/Utils.pas/io.pas8
-rw-r--r--plugins/Utils.pas/kolsizer.pas24
-rw-r--r--plugins/Utils.pas/mApiCardM.pas8
-rw-r--r--plugins/Utils.pas/mirutils.pas98
-rw-r--r--plugins/Utils.pas/msninfo.pas2
-rw-r--r--plugins/Utils.pas/playlist.pas2
-rw-r--r--plugins/Utils.pas/protocols.pas16
-rw-r--r--plugins/Utils.pas/sedit.pas8
-rw-r--r--plugins/Utils.pas/sparam.pas14
-rw-r--r--plugins/Utils.pas/srvblock.pas7
-rw-r--r--plugins/Utils.pas/syswin.pas40
-rw-r--r--plugins/Utils.pas/uRect.pas68
-rw-r--r--plugins/Utils.pas/wrapdlgs.pas42
-rw-r--r--plugins/Utils.pas/wrapper.pas70
-rw-r--r--plugins/Utils.pas/zwrapper.pas6
19 files changed, 289 insertions, 265 deletions
diff --git a/plugins/Utils.pas/common.pas b/plugins/Utils.pas/common.pas
index 056ac7af6a..37d9400cbf 100644
--- a/plugins/Utils.pas/common.pas
+++ b/plugins/Utils.pas/common.pas
@@ -13,7 +13,6 @@ windows
{$ENDIF}
;
-
Const {- Character sets -}
sBinNum = ['0'..'1'];
sOctNum = ['0'..'7'];
@@ -65,10 +64,10 @@ function mGetMem (var dst;size:integer):pointer;
procedure mFreeMem(var ptr);
function mReallocMem(var dst; size:integer):pointer;
procedure FillWord(var buf;count:cardinal;value:word); register;
-function CompareMem(P1, P2: Pointer; Length: Integer): Boolean;
+function CompareMem(P1, P2: pointer; Length: integer): Boolean;
procedure ShowDump(ptr:pbyte;len:integer);
function BSwap(value:dword):dword;
-function Hash(s:pointer; len:integer{const Seed: LongWord=$9747b28c}): LongWord;
+function Hash(s:pointer; len:integer{const Seed: longword=$9747b28c}): LongWord;
type
tSortProc = function (First,Second:integer):integer;
@@ -76,6 +75,7 @@ type
procedure ShellSort(size:integer;Compare,Swap:tSortProc);
//----- String processing -----
+
function FormatStrW(fmt:pWideChar; arr:array of pWideChar):pWideChar;
function FormatSimpleW(fmt:pWideChar; arr:array of const):pWideChar;
@@ -183,7 +183,7 @@ const
// Days between Unix time_t basis (1/1/1970) and Windows timestamp (1/1/1601)
WinDateDelta = 134774; //
-function IsLeapYear(Year:Word):Boolean;
+function IsLeapYear(Year:word):Boolean;
function EncodeTime(Hour, Minute, Sec: cardinal):TDateTime;
function EncodeDate(Year, Month , Day: cardinal):TDateTime;
@@ -505,7 +505,7 @@ end;
function PasteFromClipboard(Ansi:boolean;cp:dword=CP_ACP):pointer;
var
p:pWideChar;
- fh:tHandle;
+ fh:THANDLE;
begin
result:=nil;
if OpenClipboard(0) then
@@ -881,7 +881,7 @@ end;
{$ENDIF}
// from SysUtils
{ Delphi 7.0
-function CompareMem(P1, P2: Pointer; Length: Integer): Boolean; assembler;
+function CompareMem(P1, P2: pointer; Length: integer): Boolean; assembler;
asm
PUSH ESI
PUSH EDI
@@ -905,7 +905,7 @@ end;
{$IFNDEF WIN64}
// Delphi 2009 realization
-function CompareMem(P1, P2: Pointer; Length: Integer): Boolean; assembler;
+function CompareMem(P1, P2: pointer; Length: integer): Boolean; assembler;
asm
add eax, ecx
add edx, ecx
@@ -969,7 +969,7 @@ asm
pop ebx
end;
{$ELSE}
-function CompareMem(P1, P2: Pointer; Length: Integer): Boolean;
+function CompareMem(P1, P2: pointer; Length: integer): Boolean;
var
i:integer;
begin
@@ -1006,7 +1006,7 @@ begin
{$ELSE}
FreeMem(pointer(ptr));
{$ENDIF}
- Pointer(ptr):=nil;
+ pointer(ptr):=nil;
end;
end;
@@ -1050,10 +1050,10 @@ begin
end;
// Murmur 2.0
-function Hash(s:pointer; len:integer{const Seed: LongWord=$9747b28c}): LongWord;
+function Hash(s:pointer; len:integer{const Seed: longword=$9747b28c}): longword;
var
- lhash: LongWord;
- k: LongWord;
+ lhash: longword;
+ k: longword;
tmp,data: pByte;
const
// 'm' and 'r' are mixing constants generated offline.
@@ -1089,17 +1089,17 @@ begin
begin
tmp:=data;
inc(tmp,2);
- lhash := lhash xor (LongWord(tmp^) shl 16);
+ lhash := lhash xor (longword(tmp^) shl 16);
end;
if len >= 2 then
begin
tmp:=data;
inc(tmp);
- lhash := lhash xor (LongWord(tmp^) shl 8);
+ lhash := lhash xor (longword(tmp^) shl 8);
end;
if len >= 1 then
begin
- lhash := lhash xor (LongWord(data^));
+ lhash := lhash xor (longword(data^));
lhash := lhash * m;
end;
@@ -1394,6 +1394,7 @@ begin
end;
// ----- base string functions -----
+
function StrDup(var dst:PAnsiChar;src:PAnsiChar;len:cardinal=0):PAnsiChar;
var
l:cardinal;
@@ -2126,7 +2127,7 @@ const
((31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31),
(31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31));
-function IsLeapYear(Year:Word):Boolean;
+function IsLeapYear(Year:word):Boolean;
begin
Result:=(Year mod 4=0) and ((Year mod 100<>0) or (Year mod 400=0));
end;
@@ -2177,7 +2178,7 @@ var
ll:uint64;
begin
ll := (int64(WinDateDelta)*SecondsPerDay + ts) * 10000000;
- pft.dwLowDateTime := DWORD(ll);
+ pft.dwLowDateTime := dword(ll);
pft.dwHighDateTime := ll shr 32;
end;
diff --git a/plugins/Utils.pas/contact.pas b/plugins/Utils.pas/contact.pas
index 3d0289cb34..128d4fa6a7 100644
--- a/plugins/Utils.pas/contact.pas
+++ b/plugins/Utils.pas/contact.pas
@@ -5,8 +5,8 @@ interface
uses windows, m_api;
-procedure FillContactList(list:hwnd; filter:boolean=true;format:pWideChar=nil);
-function FindContact(list:hwnd;contact:MCONTACT):integer;
+procedure FillContactList(list:HWND; filter:boolean=true;format:pWideChar=nil);
+function FindContact(list:HWND;contact:TMCONTACT):integer;
implementation
@@ -15,9 +15,9 @@ uses messages, common, dbsettings, mirutils;
const
defformat = '%name% - %uid% (%account%:%group%)';
-procedure FillContactList(list:hwnd; filter:boolean=true;format:pWideChar=nil);
+procedure FillContactList(list:HWND; filter:boolean=true;format:pWideChar=nil);
var
- hContact:MCONTACT;
+ hContact:TMCONTACT;
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:MCONTACT):integer;
+function FindContact(list:HWND;contact:TMCONTACT):integer;
var
j:integer;
begin
@@ -118,7 +118,7 @@ begin
while j>0 do
begin
dec(j);
- if THANDLE(SendMessage(list,CB_GETITEMDATA,j,0))=contact then
+ if TMCONTACT(SendMessage(list,CB_GETITEMDATA,j,0))=contact then
begin
result:=j;
break;
diff --git a/plugins/Utils.pas/dbsettings.pas b/plugins/Utils.pas/dbsettings.pas
index d8c2566c5d..1963248587 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:MCONTACT;szModule:PAnsiChar;szSetting:PAnsiChar;default:byte =0):byte;
-function DBReadWord (hContact:MCONTACT;szModule:PAnsiChar;szSetting:PAnsiChar;default:word =0):word;
-function DBReadDWord(hContact:MCONTACT;szModule:PAnsiChar;szSetting:PAnsiChar;default:dword=0):dword;
+function DBReadByte (hContact:TMCONTACT;szModule:PAnsiChar;szSetting:PAnsiChar;default:byte =0):byte;
+function DBReadWord (hContact:TMCONTACT;szModule:PAnsiChar;szSetting:PAnsiChar;default:word =0):word;
+function DBReadDWord(hContact:TMCONTACT;szModule:PAnsiChar;szSetting:PAnsiChar;default:dword=0):dword;
-function DBReadSetting (hContact:MCONTACT;szModule:PAnsiChar;szSetting:PAnsiChar;dbv:PDBVARIANT):int_ptr;
-function DBReadSettingStr(hContact:MCONTACT;szModule:PAnsiChar;szSetting:PAnsiChar;dbv:PDBVARIANT):int_ptr;
+function DBReadSetting (hContact:TMCONTACT;szModule:PAnsiChar;szSetting:PAnsiChar;dbv:PDBVARIANT):int_ptr;
+function DBReadSettingStr(hContact:TMCONTACT;szModule:PAnsiChar;szSetting:PAnsiChar;dbv:PDBVARIANT):int_ptr;
-function DBReadStringLength(hContact:MCONTACT;szModule:PAnsiChar;szSetting:PAnsiChar):integer;
-function DBReadString (hContact:MCONTACT;szModule:PAnsiChar;szSetting:PAnsiChar;
+function DBReadStringLength(hContact:TMCONTACT;szModule:PAnsiChar;szSetting:PAnsiChar):integer;
+function DBReadString (hContact:TMCONTACT;szModule:PAnsiChar;szSetting:PAnsiChar;
default:PAnsiChar=nil;enc:integer=DBVT_ASCIIZ):PAnsiChar;
-function DBReadUTF8 (hContact:MCONTACT;szModule:PAnsiChar;szSetting:PAnsiChar;default:PAnsiChar=nil):PAnsiChar;
-function DBReadUnicode(hContact:MCONTACT;szModule:PAnsiChar;szSetting:PAnsiChar;default:PWideChar=nil):PWideChar;
+function DBReadUTF8 (hContact:TMCONTACT;szModule:PAnsiChar;szSetting:PAnsiChar;default:PAnsiChar=nil):PAnsiChar;
+function DBReadUnicode(hContact:TMCONTACT;szModule:PAnsiChar;szSetting:PAnsiChar;default:PWideChar=nil):PWideChar;
-function DBReadStruct (hContact:MCONTACT;szModule:PAnsiChar;szSetting:PAnsiChar;
+function DBReadStruct (hContact:TMCONTACT;szModule:PAnsiChar;szSetting:PAnsiChar;
ptr:pointer;size:dword):uint_ptr;
-function DBWriteStruct(hContact:MCONTACT;szModule:PAnsiChar;szSetting:PAnsiChar;
- ptr:pointer;size:dword):Integer;
+function DBWriteStruct(hContact:TMCONTACT;szModule:PAnsiChar;szSetting:PAnsiChar;
+ ptr:pointer;size:dword):integer;
-function DBWriteSetting(hContact:MCONTACT;szModule:PAnsiChar;szSetting:PAnsiChar;dbv:PDBVARIANT):int_ptr;
-function DBWriteByte (hContact:MCONTACT;szModule:PAnsiChar;szSetting:PAnsiChar;val:Byte ):int_ptr;
-function DBWriteWord (hContact:MCONTACT;szModule:PAnsiChar;szSetting:PAnsiChar;val:Word ):int_ptr;
-function DBWriteDWord(hContact:MCONTACT;szModule:PAnsiChar;szSetting:PAnsiChar;val:dword):int_ptr;
+function DBWriteSetting(hContact:TMCONTACT;szModule:PAnsiChar;szSetting:PAnsiChar;dbv:PDBVARIANT):int_ptr;
+function DBWriteByte (hContact:TMCONTACT;szModule:PAnsiChar;szSetting:PAnsiChar;val:byte ):int_ptr;
+function DBWriteWord (hContact:TMCONTACT;szModule:PAnsiChar;szSetting:PAnsiChar;val:word ):int_ptr;
+function DBWriteDWord(hContact:TMCONTACT;szModule:PAnsiChar;szSetting:PAnsiChar;val:dword):int_ptr;
-function DBWriteString (hContact:MCONTACT;szModule:PAnsiChar;szSetting:PAnsiChar;
+function DBWriteString (hContact:TMCONTACT;szModule:PAnsiChar;szSetting:PAnsiChar;
val:PAnsiChar;enc:integer=DBVT_ASCIIZ):int_ptr;
-function DBWriteUTF8 (hContact:MCONTACT;szModule:PAnsiChar;szSetting:PAnsiChar;val:PAnsiChar):int_ptr;
-function DBWriteUnicode(hContact:MCONTACT;szModule:PAnsiChar;szSetting:PAnsiChar;val:PWideChar):int_ptr;
+function DBWriteUTF8 (hContact:TMCONTACT;szModule:PAnsiChar;szSetting:PAnsiChar;val:PAnsiChar):int_ptr;
+function DBWriteUnicode(hContact:TMCONTACT;szModule:PAnsiChar;szSetting:PAnsiChar;val:PWideChar):int_ptr;
//function DBFreeVariant(dbv:PDBVARIANT):int_ptr;
-function DBDeleteSetting(hContact:MCONTACT;szModule:PAnsiChar;szSetting:PAnsiChar):int_ptr;
+function DBDeleteSetting(hContact:TMCONTACT;szModule:PAnsiChar;szSetting:PAnsiChar):int_ptr;
-function DBDeleteGroup(hContact:MCONTACT;szModule:PAnsiChar;prefix:pAnsiChar=nil):int_ptr;
+function DBDeleteGroup(hContact:TMCONTACT;szModule:PAnsiChar;prefix:pAnsiChar=nil):int_ptr;
function DBDeleteModule(szModule:PAnsiChar):integer; // 0.8.0+
-function DBGetSettingType(hContact:MCONTACT;szModule:PAnsiChar;szSetting:PAnsiChar):integer;
+function DBGetSettingType(hContact:TMCONTACT;szModule:PAnsiChar;szSetting:PAnsiChar):integer;
implementation
uses common;
-function DBReadByte(hContact:MCONTACT;szModule:PAnsiChar;szSetting:PAnsiChar;default:byte=0):byte;
+function DBReadByte(hContact:TMCONTACT;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:MCONTACT;szModule:PAnsiChar;szSetting:PAnsiChar;default:word=0):word;
+function DBReadWord(hContact:TMCONTACT;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:MCONTACT;szModule:PAnsiChar;szSetting:PAnsiChar;default:dword=0):dword;
+function DBReadDWord(hContact:TMCONTACT;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:MCONTACT;szModule:PAnsiChar;szSetting:PAnsiChar;dbv:PDBVARIANT):int_ptr;
+function DBReadSetting(hContact:TMCONTACT;szModule:PAnsiChar;szSetting:PAnsiChar;dbv:PDBVARIANT):int_ptr;
{$IFDEF AllowInline}inline;{$ENDIF}
begin
result:=db_get(hContact, szModule, szSetting, dbv);
end;
-function DBReadSettingStr(hContact:MCONTACT;szModule:PAnsiChar;szSetting:PAnsiChar;dbv:PDBVARIANT):int_ptr;
+function DBReadSettingStr(hContact:TMCONTACT;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:MCONTACT;szModule:PAnsiChar;szSetting:PAnsiChar):integer;
+function DBReadStringLength(hContact:TMCONTACT;szModule:PAnsiChar;szSetting:PAnsiChar):integer;
var
dbv:TDBVARIANT;
i:int_ptr;
@@ -90,7 +90,7 @@ begin
DBFreeVariant(@dbv);
end;
-function DBReadString(hContact:MCONTACT;szModule:PAnsiChar;szSetting:PAnsiChar;
+function DBReadString(hContact:TMCONTACT;szModule:PAnsiChar;szSetting:PAnsiChar;
default:PAnsiChar=nil;enc:integer=DBVT_ASCIIZ):PAnsiChar;
var
dbv:TDBVARIANT;
@@ -109,13 +109,13 @@ begin
DBFreeVariant(@dbv);
end;
-function DBReadUTF8(hContact:MCONTACT;szModule:PAnsiChar;szSetting:PAnsiChar;default:PAnsiChar=nil):PAnsiChar;
+function DBReadUTF8(hContact:TMCONTACT;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:MCONTACT;szModule:PAnsiChar;szSetting:PAnsiChar;default:PWideChar=nil):PWideChar;
+function DBReadUnicode(hContact:TMCONTACT;szModule:PAnsiChar;szSetting:PAnsiChar;default:PWideChar=nil):PWideChar;
var
dbv:TDBVARIANT;
i:int_ptr;
@@ -133,7 +133,7 @@ begin
DBFreeVariant(@dbv);
end;
-function DBReadStruct(hContact:MCONTACT;szModule:PAnsiChar;szSetting:PAnsiChar;
+function DBReadStruct(hContact:TMCONTACT;szModule:PAnsiChar;szSetting:PAnsiChar;
ptr:pointer;size:dword):uint_ptr;
var
dbv:TDBVariant;
@@ -154,57 +154,57 @@ begin
result:=0;
end;
-function DBWriteStruct(hContact:MCONTACT;szModule:PAnsiChar;szSetting:PAnsiChar;
- ptr:pointer;size:dword):Integer;
+function DBWriteStruct(hContact:TMCONTACT;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:MCONTACT;szModule:PAnsiChar;szSetting:PAnsiChar;dbv:PDBVARIANT):int_ptr;
+function DBWriteSetting(hContact:TMCONTACT;szModule:PAnsiChar;szSetting:PAnsiChar;dbv:PDBVARIANT):int_ptr;
{$IFDEF AllowInline}inline;{$ENDIF}
begin
Result:=db_set(hContact, szModule, szSetting, dbv);
end;
-function DBWriteByte(hContact:MCONTACT;szModule:PAnsiChar;szSetting:PAnsiChar;val:Byte):int_ptr;
+function DBWriteByte(hContact:TMCONTACT;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:MCONTACT;szModule:PAnsiChar;szSetting:PAnsiChar;val:Word):int_ptr;
+function DBWriteWord(hContact:TMCONTACT;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:MCONTACT;szModule:PAnsiChar;szSetting:PAnsiChar;val:dword):int_ptr;
+function DBWriteDWord(hContact:TMCONTACT;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:MCONTACT;szModule:PAnsiChar;szSetting:PAnsiChar;
+function DBWriteString(hContact:TMCONTACT;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:MCONTACT;szModule:PAnsiChar;szSetting:PAnsiChar;val:PAnsiChar):int_ptr;
+function DBWriteUTF8(hContact:TMCONTACT;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:MCONTACT;szModule:PAnsiChar;szSetting:PAnsiChar;val:PWideChar):int_ptr;
+function DBWriteUnicode(hContact:TMCONTACT;szModule:PAnsiChar;szSetting:PAnsiChar;val:PWideChar):int_ptr;
{$IFDEF AllowInline}inline;{$ENDIF}
begin
result:=db_set_ws(hContact, szModule, szSetting, val);
end;
-function DBDeleteSetting(hContact:MCONTACT;szModule:PAnsiChar;szSetting:PAnsiChar):int_ptr;
+function DBDeleteSetting(hContact:TMCONTACT;szModule:PAnsiChar;szSetting:PAnsiChar):int_ptr;
{$IFDEF AllowInline}inline;{$ENDIF}
begin
result:=db_unset(hContact, szModule, szSetting);
@@ -226,7 +226,7 @@ begin
result:=0;
end;
-function DBDeleteGroup(hContact:MCONTACT;szModule:PAnsiChar;prefix:pAnsiChar=nil):int_ptr;
+function DBDeleteGroup(hContact:TMCONTACT;szModule:PAnsiChar;prefix:pAnsiChar=nil):int_ptr;
var
ces:TDBCONTACTENUMSETTINGS;
p:PAnsiChar;
@@ -314,7 +314,7 @@ begin
CallService(MS_DB_MODULE_DELETE,0,lParam(szModule));
end;
-function DBGetSettingType(hContact:MCONTACT;szModule:PAnsiChar;szSetting:PAnsiChar):integer;
+function DBGetSettingType(hContact:TMCONTACT;szModule:PAnsiChar;szSetting:PAnsiChar):integer;
var
ldbv:TDBVARIANT;
begin
diff --git a/plugins/Utils.pas/editwrapper.pas b/plugins/Utils.pas/editwrapper.pas
index ff3c77a423..0a6d13d1d5 100644
--- a/plugins/Utils.pas/editwrapper.pas
+++ b/plugins/Utils.pas/editwrapper.pas
@@ -80,7 +80,7 @@ begin
end;
// if need to change button text, will pass button (not edit field) handle as parameter
-function EditWndProc(Dialog:HWnd;hMessage:uint;wParam:WPARAM;lParam:LPARAM):lresult; stdcall;
+function EditWndProc(Dialog:HWND;hMessage:uint;wParam:WPARAM;lParam:LPARAM):LRESULT; stdcall;
var
pc:pWideChar;
btnwnd:HWND;
@@ -253,7 +253,7 @@ end;
//----- Edit button processing -----
-function EditControlProc(Dialog:HWnd;hMessage:uint;wParam:WPARAM;lParam:LPARAM):lresult; stdcall;
+function EditControlProc(Dialog:HWND;hMessage:uint;wParam:WPARAM;lParam:LPARAM):LRESULT; stdcall;
var
oldproc:pointer;
ptr:pUserData;
@@ -395,7 +395,7 @@ type
text :pWideChar;
end;
-function EditWndProcSep(Dialog:HWnd;hMessage:uint;wParam:WPARAM;lParam:LPARAM):lresult; stdcall;
+function EditWndProcSep(Dialog:HWND;hMessage:uint;wParam:WPARAM;lParam:LPARAM):LRESULT; stdcall;
var
pc:pWideChar;
wnd,wnd1:HWND;
diff --git a/plugins/Utils.pas/io.pas b/plugins/Utils.pas/io.pas
index 9a587c660f..d772781144 100644
--- a/plugins/Utils.pas/io.pas
+++ b/plugins/Utils.pas/io.pas
@@ -216,7 +216,7 @@ end;
function DirectoryExists(Directory:PAnsiChar):Boolean;
var
- Code: Integer;
+ Code: integer;
begin
Code := GetFileAttributesA(Directory);
Result := (Code<>-1) and ((Code and FILE_ATTRIBUTE_DIRECTORY)<>0);
@@ -224,7 +224,7 @@ end;
function DirectoryExists(Directory:PWideChar):Boolean;
var
- Code: Integer;
+ Code: integer;
begin
Code := GetFileAttributesW(Directory);
Result := (Code<>-1) and ((Code and FILE_ATTRIBUTE_DIRECTORY)<>0);
@@ -232,7 +232,7 @@ end;
function FileExists(fname:PAnsiChar):Boolean;
var
- Code: Integer;
+ Code: integer;
begin
Code := GetFileAttributesA(fname);
Result := (Code<>-1) and ((Code and FILE_ATTRIBUTE_DIRECTORY)=0);
@@ -240,7 +240,7 @@ end;
function FileExists(fname:PWideChar):Boolean;
var
- Code: Integer;
+ Code: integer;
begin
Code := GetFileAttributesW(fname);
Result := (Code<>-1) and ((Code and FILE_ATTRIBUTE_DIRECTORY)=0);
diff --git a/plugins/Utils.pas/kolsizer.pas b/plugins/Utils.pas/kolsizer.pas
index 28361a4585..1004e1de57 100644
--- a/plugins/Utils.pas/kolsizer.pas
+++ b/plugins/Utils.pas/kolsizer.pas
@@ -37,8 +37,8 @@ type
function GetFlags(aControl:pControl):cardinal;
protected
procedure init;virtual;
- procedure DoKeyUp( Sender: PControl; var Key: Longint; Shift: DWORD);
- procedure DoChar( Sender: PControl; var Key: KOLChar; Shift: DWORD);
+ procedure DoKeyUp( Sender: PControl; var Key: Longint; Shift: dword);
+ procedure DoChar( Sender: PControl; var Key: KOLChar; Shift: dword);
public
destructor destroy;virtual;
procedure Connect(aName: KOLString; aControl: pControl; flags:cardinal=0);
@@ -98,7 +98,7 @@ type
var
LocalDesigner:PDesigner=nil;
-function DesignHandlerProc(Sender: PControl; var Msg: TMsg; var Rslt: Integer): Boolean;
+function DesignHandlerProc(Sender: PControl; var Msg: TMsg; var Rslt: integer): Boolean;
//var MouseData:TMouseEventData;
begin
Result:=false;
@@ -136,10 +136,10 @@ begin
end;
// TSizerControl methods
-function WndProcSizer( Sender: PControl; var Msg: TMsg; var Rslt: Integer ): Boolean;
+function WndProcSizer( Sender: PControl; var Msg: TMsg; var Rslt: integer ): Boolean;
var
Pt: TPoint;
- i: Integer;
+ i: integer;
R:Trect;
Data:PSizerData;
begin
@@ -247,7 +247,7 @@ end;
procedure TSizerData.DoPaint(sender:pControl;DC:HDC);
var
- i: Integer;
+ i: integer;
begin
// I simply use the current pen and brush
for i := 0 to 7 do
@@ -284,7 +284,7 @@ end;
procedure TDesigner.PaintGrid(Sender: pControl; DC: HDC);
var
- i, j: Integer;
+ i, j: integer;
begin
i := 0;
j := 0;
@@ -367,7 +367,7 @@ end;
procedure TDesigner.DisConnect(aControl: pControl);
var
- index: Integer;
+ index: integer;
begin
index := IndexOfObj(aControl);
if index = -1 then
@@ -417,16 +417,16 @@ begin
FOnControlChange(sender);
end;
-procedure TDesigner.DoChar( Sender: PControl; var Key: KOLChar; Shift: DWORD);
+procedure TDesigner.DoChar( Sender: PControl; var Key: KOLChar; Shift: dword);
begin
// messagebox(0,'444','',0);
end;
-procedure TDesigner.DoKeyUp(Sender: PControl; var Key: Integer; Shift: DWORD);
+procedure TDesigner.DoKeyUp(Sender: PControl; var Key: integer; Shift: dword);
procedure DeleteControl(Index:integer);
var
- i: Integer;
+ i: integer;
C:PControl;
begin
C:=PControl(Objects[index]);
@@ -472,7 +472,7 @@ end;
function TDesigner.UniqueName(aName: KOLString; flags:cardinal): KOLString;
var
- I, J: Integer;
+ I, J: integer;
T: KOLString;
begin
// Strip obj_ prefix and all other prefix+underscores from
diff --git a/plugins/Utils.pas/mApiCardM.pas b/plugins/Utils.pas/mApiCardM.pas
index 9d96fbdbb7..febdf4f783 100644
--- a/plugins/Utils.pas/mApiCardM.pas
+++ b/plugins/Utils.pas/mApiCardM.pas
@@ -44,6 +44,10 @@ function CreateEventCard (parent:HWND=0):tmApiCard;
implementation
+{
+ mirutils unit is for ConvertFileName function only
+ m_api is for TranslateW and TrandlateDialogDefault
+}
uses common,io,m_api,mirutils,memini,wrapper;
{$r mApiCard.res}
@@ -222,7 +226,7 @@ begin
result:=pc;
end;
-procedure tmApiCard.FillList(combo:hwnd; mode:integer=0);
+procedure tmApiCard.FillList(combo:HWND; mode:integer=0);
var
tmpbuf:array [0..127] of AnsiChar;
p,pp,pc:PAnsiChar;
@@ -272,7 +276,7 @@ begin
end;
end;
-function ServiceHelpDlg(Dialog:HWnd;hMessage:uint;wParam:WPARAM;lParam:LPARAM):LRESULT; stdcall;
+function ServiceHelpDlg(Dialog:HWND;hMessage:uint;wParam:WPARAM;lParam:LPARAM):LRESULT; stdcall;
var
buf:PAnsiChar;
tmp:PWideChar;
diff --git a/plugins/Utils.pas/mirutils.pas b/plugins/Utils.pas/mirutils.pas
index 7011b6ed9d..e035b6f8cd 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:MCONTACT=0):pAnsiChar; overload;
-function ConvertFileName(src:pWideChar;hContact:MCONTACT=0):pWideChar; overload;
-function ConvertFileName(src:pAnsiChar;dst:pAnsiChar;hContact:MCONTACT=0):pAnsiChar; overload;
-function ConvertFileName(src:pWideChar;dst:pWideChar;hContact:MCONTACT=0):pWideChar; overload;
+function ConvertFileName(src:pAnsiChar;hContact:TMCONTACT=0):pAnsiChar; overload;
+function ConvertFileName(src:pWideChar;hContact:TMCONTACT=0):pWideChar; overload;
+function ConvertFileName(src:pAnsiChar;dst:pAnsiChar;hContact:TMCONTACT=0):pAnsiChar; overload;
+function ConvertFileName(src:pWideChar;dst:pWideChar;hContact:TMCONTACT=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:MCONTACT=0;extra:pAnsiChar=nil):pAnsiChar; overload;
-function ParseVarString(astr:pWideChar;aContact:MCONTACT=0;extra:pWideChar=nil):pWideChar; overload;
+function ParseVarString(astr:pAnsiChar;aContact:TMCONTACT=0;extra:pAnsiChar=nil):pAnsiChar; overload;
+function ParseVarString(astr:pWideChar;aContact:TMCONTACT=0;extra:pWideChar=nil):pWideChar; overload;
function ShowVarHelp(dlg:HWND;id:integer=0):integer;
-function IsChat(hContact:MCONTACT):bool;
-procedure SendToChat(hContact:MCONTACT;pszText:PWideChar);
-
-function LoadContact(group,setting:PAnsiChar):MCONTACT;
-function SaveContact(hContact:MCONTACT;group,setting:PAnsiChar):integer;
-
-function SetCListSelContact(hContact:MCONTACT):MCONTACT;
-function GetCListSelContact:MCONTACT; {$IFDEF DELPHI_10_UP}inline;{$ENDIF}
-function GetContactProtoAcc(hContact:MCONTACT):PAnsiChar;
-function IsMirandaUser(hContact:MCONTACT):integer; // >0=Miranda; 0=Not miranda; -1=unknown
-procedure ShowContactDialog(hContact:MCONTACT;DblClk:boolean=true;anystatus:boolean=true);
-function FindContactHandle(proto:pAnsiChar;const dbv:TDBVARIANT;is_chat:boolean=false):MCONTACT;
-function WndToContact(wnd:hwnd):MCONTACT; overload;
-function WndToContact:MCONTACT; overload;
-function GetContactStatus(hContact:MCONTACT):integer;
+function IsChat(hContact:TMCONTACT):bool;
+procedure SendToChat(hContact:TMCONTACT;pszText:PWideChar);
+
+function LoadContact(group,setting:PAnsiChar):TMCONTACT;
+function SaveContact(hContact:TMCONTACT;group,setting:PAnsiChar):integer;
+
+function SetCListSelContact(hContact:TMCONTACT):TMCONTACT;
+function GetCListSelContact:TMCONTACT; {$IFDEF DELPHI_10_UP}inline;{$ENDIF}
+function GetContactProtoAcc(hContact:TMCONTACT):PAnsiChar;
+function IsMirandaUser(hContact:TMCONTACT):integer; // >0=Miranda; 0=Not miranda; -1=unknown
+procedure ShowContactDialog(hContact:TMCONTACT;DblClk:boolean=true;anystatus:boolean=true);
+function FindContactHandle(proto:pAnsiChar;const dbv:TDBVARIANT;is_chat:boolean=false):TMCONTACT;
+function WndToContact(wnd:HWND):TMCONTACT; overload;
+function WndToContact:TMCONTACT; overload;
+function GetContactStatus(hContact:TMCONTACT):integer;
// -2 - deleted account, -1 - disabled account, 0 - hidden
// 1 - metacontact, 2 - submetacontact, positive - active
// proto - ASSIGNED buffer
-function IsContactActive(hContact:MCONTACT;proto:pAnsiChar=nil):integer;
+function IsContactActive(hContact:TMCONTACT;proto:pAnsiChar=nil):integer;
-function CreateGroupW(name:pWideChar;hContact:MCONTACT):integer;
+function CreateGroupW(name:pWideChar;hContact:TMCONTACT):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:MCONTACT=0):pWideChar; overload;
+function ConvertFileName(src:pWideChar;dst:pWideChar;hContact:TMCONTACT=0):pWideChar; overload;
var
pc:pWideChar;
begin
@@ -115,7 +115,7 @@ begin
end;
end;
-function ConvertFileName(src:pWideChar;hContact:MCONTACT=0):pWideChar; overload;
+function ConvertFileName(src:pWideChar;hContact:TMCONTACT=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:MCONTACT=0):pAnsiChar; overload;
+function ConvertFileName(src:pAnsiChar;dst:pAnsiChar;hContact:TMCONTACT=0):pAnsiChar; overload;
var
pc:pAnsiChar;
begin
@@ -145,7 +145,7 @@ begin
end;
end;
-function ConvertFileName(src:pAnsiChar;hContact:MCONTACT=0):pAnsiChar; overload;
+function ConvertFileName(src:pAnsiChar;hContact:TMCONTACT=0):pAnsiChar; overload;
var
buf1:array [0..511] of AnsiChar;
begin
@@ -165,7 +165,7 @@ begin
result:=MirCP;
end;
-function IsChat(hContact:MCONTACT):bool;
+function IsChat(hContact:TMCONTACT):bool;
begin
result:=DBReadByte(hContact,
PAnsiChar(CallService(MS_PROTO_GETCONTACTBASEPROTO,hContact,0)),
@@ -178,7 +178,7 @@ begin
result:=ServiceExists(MS_VARS_FORMATSTRING)<>0;
end;
-function ParseVarString(astr:pAnsiChar;aContact:MCONTACT=0;extra:pAnsiChar=nil):pAnsiChar;
+function ParseVarString(astr:pAnsiChar;aContact:TMCONTACT=0;extra:pAnsiChar=nil):pAnsiChar;
var
tfi:TFORMATINFO;
tmp,pc:pAnsiChar;
@@ -217,7 +217,7 @@ begin
mir_free(pc);
end;
-function ParseVarString(astr:pWideChar;aContact:MCONTACT=0;extra:pWideChar=nil):pWideChar;
+function ParseVarString(astr:pWideChar;aContact:TMCONTACT=0;extra:pWideChar=nil):pWideChar;
var
tfi:TFORMATINFO;
tmp,pc:pWideChar;
@@ -314,7 +314,7 @@ begin
end;
end;
-function GetContactProtoAcc(hContact:MCONTACT):PAnsiChar;
+function GetContactProtoAcc(hContact:TMCONTACT):PAnsiChar;
begin
if ServiceExists(MS_PROTO_GETCONTACTBASEACCOUNT)<>0 then
result:=PAnsiChar(CallService(MS_PROTO_GETCONTACTBASEACCOUNT,hContact,0))
@@ -322,7 +322,7 @@ begin
result:=PAnsiChar(CallService(MS_PROTO_GETCONTACTBASEPROTO,hContact,0));
end;
-function IsMirandaUser(hContact:MCONTACT):integer; // >0=Miranda; 0=Not miranda; -1=unknown
+function IsMirandaUser(hContact:TMCONTACT):integer; // >0=Miranda; 0=Not miranda; -1=unknown
var
sz:PAnsiChar;
begin
@@ -337,7 +337,7 @@ begin
result:=-1;
end;
-function SetCListSelContact(hContact:MCONTACT):MCONTACT;
+function SetCListSelContact(hContact:TMCONTACT):TMCONTACT;
var
wnd:HWND;
begin
@@ -348,12 +348,12 @@ begin
// SendMessage(wnd,CLM_ENSUREVISIBLE,hContact,0);
end;
-function GetCListSelContact:MCONTACT;
+function GetCListSelContact:TMCONTACT;
begin
result:=SendMessageW(CallService(MS_CLUI_GETHWNDTREE,0,0),CLM_GETSELECTION,0,0);
end;
-function LoadContact(group,setting:PAnsiChar):MCONTACT;
+function LoadContact(group,setting:PAnsiChar):TMCONTACT;
var
p,proto:pAnsiChar;
section:array [0..63] of AnsiChar;
@@ -378,7 +378,7 @@ begin
mFreeMem(dbv.szVal.W);
end;
-function SaveContact(hContact:MCONTACT;group,setting:PAnsiChar):integer;
+function SaveContact(hContact:TMCONTACT;group,setting:PAnsiChar):integer;
var
p,proto,uid:pAnsiChar;
cws:TDBVARIANT;
@@ -420,9 +420,9 @@ begin
end;
end;
-function WndToContact(wnd:hwnd):MCONTACT; overload;
+function WndToContact(wnd:HWND):TMCONTACT; overload;
var
- hContact:MCONTACT;
+ hContact:TMCONTACT;
mwid:TMessageWindowInputData;
mwod:TMessageWindowOutputData;
begin
@@ -450,7 +450,7 @@ begin
result:=0;
end;
-function WndToContact:MCONTACT; overload;
+function WndToContact:TMCONTACT; overload;
var
wnd:HWND;
begin
@@ -465,7 +465,7 @@ begin
result:=GetCListSelContact;
end;
-function GetContactStatus(hContact:MCONTACT):integer;
+function GetContactStatus(hContact:TMCONTACT):integer;
var
szProto:PAnsiChar;
begin
@@ -555,7 +555,7 @@ begin
end;
end;
-procedure ShowContactDialog(hContact:MCONTACT;DblClk:boolean=true;anystatus:boolean=true);
+procedure ShowContactDialog(hContact:TMCONTACT;DblClk:boolean=true;anystatus:boolean=true);
var
pc:array [0..127] of AnsiChar;
begin
@@ -609,7 +609,7 @@ begin
CallServiceSync(MS_GC_EVENT,0,lparam(@gce));
end;
-procedure SendToChat(hContact:MCONTACT;pszText:PWideChar);
+procedure SendToChat(hContact:TMCONTACT;pszText:PWideChar);
var
gci:TGC_INFO;
pszModule:PAnsiChar;
@@ -633,11 +633,11 @@ begin
end;
end;
-function FindContactHandle(proto:pAnsiChar;const dbv:TDBVARIANT;is_chat:boolean=false):MCONTACT;
+function FindContactHandle(proto:pAnsiChar;const dbv:TDBVARIANT;is_chat:boolean=false):TMCONTACT;
var
uid:pAnsiChar;
ldbv:TDBVARIANT;
- hContact:MCONTACT;
+ hContact:TMCONTACT;
pw:pWideChar;
begin
result:=0;
@@ -692,7 +692,7 @@ begin
end;
end;
-function IsContactActive(hContact:MCONTACT;proto:pAnsiChar=nil):integer;
+function IsContactActive(hContact:TMCONTACT;proto:pAnsiChar=nil):integer;
var
p:PPROTOACCOUNT;
name: array [0..31] of AnsiChar;
@@ -721,8 +721,10 @@ begin
result:=255;
if db_mc_getMeta(hContact)<>0 then
result:=2;
- if StrCmp(PAnsiChar(CallService(MS_PROTO_GETCONTACTBASEPROTO,hContact,0)), META_PROTO)=0 then
- result:=1;
+ if StrCmp(
+ PAnsiChar(CallService(MS_PROTO_GETCONTACTBASEPROTO,hContact,0)),
+ META_PROTO)=0 then
+ result:=1;
end;
if proto<>nil then
StrCopy(proto,@name);
@@ -736,7 +738,7 @@ begin
end;
// Import plugin function adaptation
-function CreateGroupW(name:pWideChar;hContact:MCONTACT):integer;
+function CreateGroupW(name:pWideChar;hContact:TMCONTACT):integer;
var
groupId:integer;
groupIdStr:array [0..10] of AnsiChar;
diff --git a/plugins/Utils.pas/msninfo.pas b/plugins/Utils.pas/msninfo.pas
index 05fef4959b..12629b3305 100644
--- a/plugins/Utils.pas/msninfo.pas
+++ b/plugins/Utils.pas/msninfo.pas
@@ -126,7 +126,7 @@ begin
// WMContentID - not needs
end;
-function dlgMSNHook(Dialog:HWnd;hMessage:UINT;wParam:WPARAM;lParam:LPARAM):lresult; stdcall;
+function dlgMSNHook(Dialog:HWND;hMessage:uint;wParam:WPARAM;lParam:LPARAM):LRESULT; stdcall;
var
pMyCDS:PCOPYDATASTRUCT;
begin
diff --git a/plugins/Utils.pas/playlist.pas b/plugins/Utils.pas/playlist.pas
index fc3199dcfc..12c7cbcf05 100644
--- a/plugins/Utils.pas/playlist.pas
+++ b/plugins/Utils.pas/playlist.pas
@@ -353,7 +353,7 @@ procedure tPlaylist.SetTrackNumber(value:integer);
begin
if value<0 then
value:=0
- else if value>=Integer(plSize) then
+ else if value>=integer(plSize) then
value:=plSize-1;
if fShuffle then
diff --git a/plugins/Utils.pas/protocols.pas b/plugins/Utils.pas/protocols.pas
index 5b4c611e47..c311cb8936 100644
--- a/plugins/Utils.pas/protocols.pas
+++ b/plugins/Utils.pas/protocols.pas
@@ -21,10 +21,10 @@ function GetProtoStatusNum(ProtoNum:uint_ptr):integer;
function GetProtoName (ProtoNum:uint_ptr):PAnsiChar;
function GetProtoAccName (ProtoNum:uint_ptr):PWideChar;
-procedure FillProtoList (list:hwnd;withIcons:bool=false);
-procedure CheckProtoList (list:hwnd);
-procedure FillStatusList (proto:uint_ptr;list:hwnd;withIcons:bool=false);
-procedure CheckStatusList(list:hwnd;ProtoNum:uint_ptr);
+procedure FillProtoList (list:HWND;withIcons:bool=false);
+procedure CheckProtoList (list:HWND);
+procedure FillStatusList (proto:uint_ptr;list:HWND;withIcons:bool=false);
+procedure CheckStatusList(list:HWND;ProtoNum:uint_ptr);
function CreateProtoList(deepscan:boolean=false):integer;
procedure FreeProtoList;
@@ -214,7 +214,7 @@ begin
result:=nil;
end;
-procedure FillProtoList(list:hwnd;withIcons:bool=false);
+procedure FillProtoList(list:HWND;withIcons:bool=false);
var
item:TLVITEMW;
lvc:TLVCOLUMN;
@@ -261,7 +261,7 @@ begin
ListView_SetColumnWidth(list,0,LVSCW_AUTOSIZE);
end;
-procedure CheckProtoList(list:hwnd);
+procedure CheckProtoList(list:HWND);
var
i:integer;
begin
@@ -275,7 +275,7 @@ begin
end;
end;
-procedure FillStatusList(proto:uint_ptr;list:hwnd;withIcons:bool=false);
+procedure FillStatusList(proto:uint_ptr;list:HWND;withIcons:bool=false);
procedure AddString(num:integer;enabled:boolean;cli:PCLIST_INTERFACE);
var
@@ -345,7 +345,7 @@ begin
ListView_SetColumnWidth(list,0,LVSCW_AUTOSIZE);
end;
-procedure CheckStatusList(list:hwnd;ProtoNum:uint_ptr);
+procedure CheckStatusList(list:HWND;ProtoNum:uint_ptr);
procedure SetStatusMask(stat:integer;state:bool);
var
diff --git a/plugins/Utils.pas/sedit.pas b/plugins/Utils.pas/sedit.pas
index 896f880b80..8fef4dcebb 100644
--- a/plugins/Utils.pas/sedit.pas
+++ b/plugins/Utils.pas/sedit.pas
@@ -157,7 +157,7 @@ begin
SendMessageW(hwndTooltip,TTM_ADDTOOLW,0,lparam(@ti));
end;
-function NewLVProc(Dialog:HWnd;hMessage:uint;wParam:WPARAM;lParam:LPARAM):lresult; stdcall;
+function NewLVProc(Dialog:HWND;hMessage:uint;wParam:WPARAM;lParam:LPARAM):LRESULT; stdcall;
begin
result:=0;
case hMessage of
@@ -804,7 +804,7 @@ begin
end;
// Fill table row by data from edit fields
-procedure FillLVRow(Dialog:hwnd;list:HWND;item:integer);
+procedure FillLVRow(Dialog:HWND;list:HWND;item:integer);
var
ltype,j,idc:integer;
idx:integer;
@@ -945,7 +945,7 @@ begin
FreeMem(buf);
end;
-function StructHelp(Dialog:HWnd;hMessage:uint;wParam:WPARAM;lParam:LPARAM):lresult; stdcall;
+function StructHelp(Dialog:HWND;hMessage:uint;wParam:WPARAM;lParam:LPARAM):LRESULT; stdcall;
var
tmp:pWideChar;
pc:pAnsiChar;
@@ -995,7 +995,7 @@ begin
end;
end;
-function StructEdit(Dialog:HWnd;hMessage:uint;wParam:WPARAM;lParam:LPARAM):lresult; stdcall;
+function StructEdit(Dialog:HWND;hMessage:uint;wParam:WPARAM;lParam:LPARAM):LRESULT; stdcall;
var
wnd:HWND;
i:integer;
diff --git a/plugins/Utils.pas/sparam.pas b/plugins/Utils.pas/sparam.pas
index 43007b2c86..00e49ac1ab 100644
--- a/plugins/Utils.pas/sparam.pas
+++ b/plugins/Utils.pas/sparam.pas
@@ -1,3 +1,7 @@
+{
+ Parameter: CBN_EDITCHANGE on fields changing, BN_CLICKED on Struct changes
+ Result : CBN_EDITCHANGE on type changing, BN_CLICKED on option changes
+}
unit sparam;
interface
@@ -50,7 +54,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:MCONTACT):uint_ptr;
+function TranslateParam(param:uint_ptr;flags:dword;hContact:TMCONTACT):uint_ptr;
function CreateResultBlock(parent:HWND;x,y,width:integer;flags:dword=0):THANDLE;
function ClearResultFields(Dialog:HWND):HWND;
@@ -254,7 +258,7 @@ begin
result:=Dialog;
end;
-function DlgParamProc(Dialog:HWnd;hMessage:uint;wParam:WPARAM;lParam:LPARAM):lresult; stdcall;
+function DlgParamProc(Dialog:HWND;hMessage:uint;wParam:WPARAM;lParam:LPARAM):LRESULT; stdcall;
var
wnd,wnd1:HWND;
proc:pointer;
@@ -651,7 +655,7 @@ begin
result:=flags;
end;
-function TranslateParam(param:uint_ptr;flags:dword;hContact:MCONTACT):uint_ptr;
+function TranslateParam(param:uint_ptr;flags:dword;hContact:TMCONTACT):uint_ptr;
var
tmp1:pWideChar;
begin
@@ -707,7 +711,7 @@ begin
SendMessage(wnd,CB_SETCURSEL,0,0);
end;
-function DlgResultProc(Dialog:HWnd;hMessage:uint;wParam:WPARAM;lParam:LPARAM):lresult; stdcall;
+function DlgResultProc(Dialog:HWND;hMessage:uint;wParam:WPARAM;lParam:LPARAM):LRESULT; stdcall;
var
proc:pointer;
wnd:HWND;
@@ -720,6 +724,7 @@ begin
WM_COMMAND: begin
case wParam shr 16 of
BN_CLICKED: begin
+ SendMessage(GetParent(Dialog),WM_COMMAND,BN_CLICKED shl 16,Dialog);
case loword(wParam) of
IDC_RES_SIGNED: begin
if IsDlgButtonChecked(Dialog,IDC_RES_SIGNED)=BST_UNCHECKED then
@@ -747,6 +752,7 @@ begin
end;
CBN_SELCHANGE: begin
+ SendMessage(GetParent(Dialog),WM_COMMAND,CBN_EDITCHANGE shl 16,Dialog);
case loword(wParam) of
IDC_RES_TYPE: begin
case CB_GetData(lParam) of
diff --git a/plugins/Utils.pas/srvblock.pas b/plugins/Utils.pas/srvblock.pas
index debd99cddf..d8e4465f0b 100644
--- a/plugins/Utils.pas/srvblock.pas
+++ b/plugins/Utils.pas/srvblock.pas
@@ -1,3 +1,6 @@
+{
+ in dialog: sends CBN_EDITCHANGE for changes
+}
unit srvblock;
interface
@@ -227,7 +230,7 @@ begin
ReloadService(Dialog,@buf,true);
end;
-function DlgServiceProc(Dialog:HWnd;hMessage:uint;wParam:WPARAM;lParam:LPARAM):lresult; stdcall;
+function DlgServiceProc(Dialog:HWND;hMessage:uint;wParam:WPARAM;lParam:LPARAM):LRESULT; stdcall;
var
proc:pointer;
pc:pAnsiChar;
@@ -264,6 +267,8 @@ begin
IDC_CLOSE_WPAR,
IDC_CLOSE_LPAR,
IDC_CLOSE_RES: ShowBlock(Dialog,loword(wParam));
+ else // from parameter and result
+ SendMessage(GetParent(Dialog),WM_COMMAND,BN_CLICKED shl 16,Dialog);
end;
end;
diff --git a/plugins/Utils.pas/syswin.pas b/plugins/Utils.pas/syswin.pas
index 7cc646184a..9b75f711fa 100644
--- a/plugins/Utils.pas/syswin.pas
+++ b/plugins/Utils.pas/syswin.pas
@@ -24,12 +24,12 @@ function GetAssoc(key:PAnsiChar):PAnsiChar;
function GetFileFromWnd(wnd:HWND;Filter:tFFWFilterProc;
flags:dword=gffdMultiThread+gffdOld;timeout:cardinal=ThreadTimeout):pWideChar;
-function WaitFocusedWndChild(Wnd:HWnd):HWnd;
+function WaitFocusedWndChild(Wnd:HWND):HWND;
function ExecuteWaitW(AppPath:pWideChar; CmdLine:pWideChar=nil; DfltDirectory:PWideChar=nil;
- Show:DWORD=SW_SHOWNORMAL; TimeOut:DWORD=0; ProcID:PDWORD=nil):dword;
+ Show:dword=SW_SHOWNORMAL; TimeOut:dword=0; ProcID:PDWORD=nil):dword;
function ExecuteWait(AppPath:PAnsiChar; CmdLine:PAnsiChar=nil; DfltDirectory:PAnsiChar=nil;
- Show:DWORD=SW_SHOWNORMAL; TimeOut:DWORD=0; ProcID:PDWORD=nil):dword;
+ Show:dword=SW_SHOWNORMAL; TimeOut:dword=0; ProcID:PDWORD=nil):dword;
function GetEXEbyWnd(w:HWND; var dst:pWideChar):pWideChar; overload;
function GetEXEbyWnd(w:HWND; var dst:PAnsiChar):PAnsiChar; overload;
@@ -46,14 +46,20 @@ uses
{$ENDIF}
common,messages;
+{ shellapi import
+function FindExecutableA(FileName, Directory: PAnsiChar; Result: PAnsiChar): HINST; stdcall;
+ external 'shell32.dll' name 'FindExecutableA';
+function FindExecutableW(FileName, Directory: PWideChar; Result: PWideChar): HINST; stdcall;
+ external 'shell32.dll' name 'FindExecutableW';
+}
{$IFDEF COMPILER_16_UP}
type pqword = ^int64;
{$ENDIF}
function ExecuteWaitW(AppPath:pWideChar; CmdLine:pWideChar=nil; DfltDirectory:PWideChar=nil;
- Show:DWORD=SW_SHOWNORMAL; TimeOut:DWORD=0; ProcID:PDWORD=nil):dword;
+ Show:dword=SW_SHOWNORMAL; TimeOut:dword=0; ProcID:PDWORD=nil):dword;
var
- Flags: DWORD;
+ Flags: dword;
{$IFDEF FPC}
Startup: StartupInfo;
{$ELSE}
@@ -114,9 +120,9 @@ begin
end;
function ExecuteWait(AppPath:PAnsiChar; CmdLine:PAnsiChar=nil; DfltDirectory:PAnsiChar=nil;
- Show:DWORD=SW_SHOWNORMAL; TimeOut:DWORD=0; ProcID:PDWORD=nil):dword;
+ Show:dword=SW_SHOWNORMAL; TimeOut:dword=0; ProcID:PDWORD=nil):dword;
var
- Flags: DWORD;
+ Flags: dword;
{$IFDEF FPC}
Startup: StartupInfo;
{$ELSE}
@@ -220,8 +226,8 @@ end;
function GetFocusedChild(wnd:HWND):HWND;
var
- dwTargetOwner:DWORD;
- dwThreadID:DWORD;
+ dwTargetOwner:dword;
+ dwThreadID:dword;
res:boolean;
begin
dwTargetOwner:=GetWindowThreadProcessId(wnd,nil);
@@ -234,10 +240,10 @@ begin
AttachThreadInput(dwThreadID,dwTargetOwner,FALSE);
end;
-function WaitFocusedWndChild(Wnd:HWnd):HWnd;
+function WaitFocusedWndChild(Wnd:HWND):HWND;
var
- T1,T2:Integer;
- W:HWnd;
+ T1,T2:integer;
+ W:HWND;
begin
Sleep(50);
T1:=GetTickCount;
@@ -347,7 +353,7 @@ end;
function GetEXEbyWnd(w:HWND; var dst:pWideChar):pWideChar;
var
hProcess:THANDLE;
- ProcID:DWORD;
+ ProcID:dword;
ModuleName: array [0..300] of WideChar;
begin
dst:=nil;
@@ -369,7 +375,7 @@ end;
function GetEXEbyWnd(w:HWND; var dst:PAnsiChar):PAnsiChar;
var
hProcess:THANDLE;
- ProcID:DWORD;
+ ProcID:dword;
ModuleName: array [0..300] of AnsiChar;
begin
dst:=nil;
@@ -399,7 +405,7 @@ var
i:integer;
begin
result:=false;
- EnumProcesses(pointer(@Processes),nCount*SizeOf(DWORD),nProcess);
+ EnumProcesses(pointer(@Processes),nCount*SizeOf(dword),nProcess);
nProcess:=(nProcess div 4)-1;
for i:=2 to nProcess do //skip Idle & System
begin
@@ -566,7 +572,7 @@ const
type
ptrec = ^trec;
trec = record
- handle:thandle;
+ handle:THANDLE;
fname:pWideChar;
end;
@@ -577,7 +583,7 @@ function GetName(param:pointer):integer; //stdcall;
const
BufSize = $800;
// depends of record align
- offset=SizeOf(Pointer) div 2; // 4 for win64, 2 for win32
+ offset=SizeOf(pointer) div 2; // 4 for win64, 2 for win32
var
TmpBuf:array [0..BufSize-1] of WideChar;
var
diff --git a/plugins/Utils.pas/uRect.pas b/plugins/Utils.pas/uRect.pas
index 6d383ef518..11cb51c8c6 100644
--- a/plugins/Utils.pas/uRect.pas
+++ b/plugins/Utils.pas/uRect.pas
@@ -20,50 +20,50 @@ type
PRect = ^TRect;
TRect = packed record
- case Integer of
+ case integer of
0: (Left, Top, Right, Bottom: Longint);
1: (TopLeft, BottomRight: TPoint);
end;
}
{
--function SetRect(var lprc: TRect; xLeft, yTop, xRight, yBottom: Integer): BOOL; stdcall;
--function CopyRect(var lprcDst: TRect; const lprcSrc: TRect): BOOL; stdcall;
--function InflateRect(var lprc: TRect; dx, dy: Integer): BOOL; stdcall;
-function SubtractRect(var lprcDst: TRect; const lprcSrc1, lprcSrc2: TRect): BOOL; stdcall;
--function SetRectEmpty(var lprc: TRect): BOOL; stdcall;
--function IntersectRect(var lprcDst: TRect; const lprcSrc1, lprcSrc2: TRect): BOOL; stdcall;
--function UnionRect(var lprcDst: TRect; const lprcSrc1, lprcSrc2: TRect): BOOL; stdcall;
--function OffsetRect(var lprc: TRect; dx, dy: Integer): BOOL; stdcall;
--function IsRectEmpty(const lprc: TRect): BOOL; stdcall;
--function EqualRect(const lprc1, lprc2: TRect): BOOL; stdcall;
--function PtInRect(const lprc: TRect; pt: TPoint): BOOL; stdcall;
+-function SetRect(var lprc: TRect; xLeft, yTop, xRight, yBottom: integer): bool; stdcall;
+-function CopyRect(var lprcDst: TRect; const lprcSrc: TRect): bool; stdcall;
+-function InflateRect(var lprc: TRect; dx, dy: integer): bool; stdcall;
+function SubtractRect(var lprcDst: TRect; const lprcSrc1, lprcSrc2: TRect): bool; stdcall;
+-function SetRectEmpty(var lprc: TRect): bool; stdcall;
+-function IntersectRect(var lprcDst: TRect; const lprcSrc1, lprcSrc2: TRect): bool; stdcall;
+-function UnionRect(var lprcDst: TRect; const lprcSrc1, lprcSrc2: TRect): bool; stdcall;
+-function OffsetRect(var lprc: TRect; dx, dy: integer): bool; stdcall;
+-function IsRectEmpty(const lprc: TRect): bool; stdcall;
+-function EqualRect(const lprc1, lprc2: TRect): bool; stdcall;
+-function PtInRect(const lprc: TRect; pt: TPoint): bool; stdcall;
}
-function Point(X, Y: Integer): TPoint; overload;
-procedure Point(var pt:TPoint; X, Y: Integer); overload;
+function Point(X, Y: integer): TPoint; overload;
+procedure Point(var pt:TPoint; X, Y: integer); overload;
-function SmallPoint(X, Y: Integer): TSmallPoint; overload;
-function SmallPoint(XY: LongWord): TSmallPoint; overload;
+function SmallPoint(X, Y: integer): TSmallPoint; overload;
+function SmallPoint(XY: longword): TSmallPoint; overload;
function CenterPoint(const Rect: TRect): TPoint; overload;
procedure CenterPoint(const Rect: TRect; var pt:TPoint); overload;
function PointInRect(const P: TPoint; const Rect: TRect): Boolean;
function PtInRect (const Rect: TRect; const P: TPoint): Boolean;
-function Rect (Left, Top, Right, Bottom: Integer): TRect; overload;
-procedure Rect (var Rect:TRect; Left, Top, Right, Bottom: Integer); overload;
-procedure SetRect(var Rect:TRect; Left, Top, Right, Bottom: Integer);
+function Rect (Left, Top, Right, Bottom: integer): TRect; overload;
+procedure Rect (var Rect:TRect; Left, Top, Right, Bottom: integer); overload;
+procedure SetRect(var Rect:TRect; Left, Top, Right, Bottom: integer);
function CopyRect(var Rect: TRect; const R1: TRect):Boolean;
function SetRectEmpty(var Rect: TRect): Boolean;
-function Bounds(ALeft, ATop, AWidth, AHeight: Integer): TRect; overload;
-procedure Bounds(var Rect:TRect; ALeft, ATop, AWidth, AHeight: Integer); overload;
+function Bounds(ALeft, ATop, AWidth, AHeight: integer): TRect; overload;
+procedure Bounds(var Rect:TRect; ALeft, ATop, AWidth, AHeight: integer); overload;
function EqualRect(const R1, R2: TRect): Boolean;
function IsRectInside(const R1, R2: TRect): Boolean;
function IsRectEmpty(const Rect: TRect): Boolean;
-function InflateRect(var Rect: TRect; dx, dy: Integer): Boolean;
-function OffsetRect(var Rect: TRect; DX: Integer; DY: Integer): Boolean;
+function InflateRect(var Rect: TRect; dx, dy: integer): Boolean;
+function OffsetRect(var Rect: TRect; DX: integer; DY: integer): Boolean;
function IntersectRect(var Rect: TRect; const R1, R2: TRect): Boolean; overload;
function IntersectRect(const R1, R2: TRect): Boolean; overload;
function UnionRect(var Rect: TRect; const R1, R2: TRect): Boolean;
@@ -71,25 +71,25 @@ function UnionRect(var Rect: TRect; const R1, R2: TRect): Boolean;
implementation
-function Point(X, Y: Integer): TPoint;
+function Point(X, Y: integer): TPoint;
begin
Result.X := X;
Result.Y := Y;
end;
-procedure Point(var pt:TPoint; X, Y: Integer);
+procedure Point(var pt:TPoint; X, Y: integer);
begin
pt.X := X;
pt.Y := Y;
end;
-function SmallPoint(X, Y: Integer): TSmallPoint;
+function SmallPoint(X, Y: integer): TSmallPoint;
begin
Result.X := X;
Result.Y := Y;
end;
-function SmallPoint(XY: LongWord): TSmallPoint;
+function SmallPoint(XY: longword): TSmallPoint;
begin
Result.X := SmallInt(XY and $0000FFFF);
Result.Y := SmallInt(XY shr 16);
@@ -133,7 +133,7 @@ end;
//----- TRect -----
-function Rect(Left, Top, Right, Bottom: Integer): TRect;
+function Rect(Left, Top, Right, Bottom: integer): TRect;
begin
Result.Left := Left;
Result.Top := Top;
@@ -141,7 +141,7 @@ begin
Result.Right := Right;
end;
-procedure Rect(var Rect:TRect; Left, Top, Right, Bottom: Integer);
+procedure Rect(var Rect:TRect; Left, Top, Right, Bottom: integer);
begin
Rect.Left := Left;
Rect.Top := Top;
@@ -149,7 +149,7 @@ begin
Rect.Right := Right;
end;
-procedure SetRect(var Rect:TRect; Left, Top, Right, Bottom: Integer);
+procedure SetRect(var Rect:TRect; Left, Top, Right, Bottom: integer);
begin
Rect.Left := Left;
Rect.Top := Top;
@@ -232,7 +232,7 @@ begin
if not Result then FillChar(Rect, SizeOf(Rect), 0);
end;
-function InflateRect(var Rect: TRect; dx, dy: Integer): Boolean;
+function InflateRect(var Rect: TRect; dx, dy: integer): Boolean;
begin
with Rect do
begin
@@ -244,7 +244,7 @@ begin
Result := not IsRectEmpty(Rect);
end;
-function OffsetRect(var Rect: TRect; DX: Integer; DY: Integer): Boolean;
+function OffsetRect(var Rect: TRect; DX: integer; DY: integer): Boolean;
begin
if @Rect <> nil then // Test to increase compatiblity with Windows
begin
@@ -258,7 +258,7 @@ begin
Result := False;
end;
-function Bounds(ALeft, ATop, AWidth, AHeight: Integer): TRect;
+function Bounds(ALeft, ATop, AWidth, AHeight: integer): TRect;
begin
with Result do
begin
@@ -269,7 +269,7 @@ begin
end;
end;
-procedure Bounds(var Rect:TRect; ALeft, ATop, AWidth, AHeight: Integer);
+procedure Bounds(var Rect:TRect; ALeft, ATop, AWidth, AHeight: integer);
begin
with Rect do
begin
diff --git a/plugins/Utils.pas/wrapdlgs.pas b/plugins/Utils.pas/wrapdlgs.pas
index fed2490f85..21dcffd9e5 100644
--- a/plugins/Utils.pas/wrapdlgs.pas
+++ b/plugins/Utils.pas/wrapdlgs.pas
@@ -17,8 +17,8 @@ uses common, messages;
type
PSHItemID = ^TSHItemID;
TSHItemID = packed record
- cb: Word; { Size of the ID (including cb itself) }
- abID: array[0..0] of Byte; { The item ID (variable length) }
+ cb: word; { Size of the ID (including cb itself) }
+ abID: array[0..0] of byte; { The item ID (variable length) }
end;
PItemIDList = ^TItemIDList;
@@ -27,35 +27,35 @@ type
end;
TBrowseInfoA = record
- hwndOwner: HWND;
- pidlRoot: PItemIDList;
- pszDisplayName: PAnsiChar; { Return display name of item selected. }
- lpszTitle: PAnsiChar; { text to go in the banner over the tree. }
- ulFlags: UINT; { Flags that control the return stuff }
- lpfn: Pointer; //TFNBFFCallBack;
- lParam: LPARAM; { extra info that's passed back in callbacks }
- iImage: Integer; { output var: where to return the Image index. }
+ hwndOwner : HWND;
+ pidlRoot : PItemIDList;
+ pszDisplayName: PAnsiChar; { Return display name of item selected. }
+ lpszTitle : PAnsiChar; { text to go in the banner over the tree. }
+ ulFlags : uint; { Flags that control the return stuff }
+ lpfn : pointer; //TFNBFFCallBack;
+ lParam : LPARAM; { extra info that's passed back in callbacks }
+ iImage : integer; { output var: where to return the Image index. }
end;
TBrowseInfoW = record
- hwndOwner: HWND;
- pidlRoot: PItemIDList;
- pszDisplayName: PWideChar; { Return display name of item selected. }
- lpszTitle: PWideChar; { text to go in the banner over the tree. }
- ulFlags: UINT; { Flags that control the return stuff }
- lpfn: Pointer; //TFNBFFCallBack;
- lParam: LPARAM; { extra info that's passed back in callbacks }
- iImage: Integer; { output var: where to return the Image index. }
+ hwndOwner : HWND;
+ pidlRoot : PItemIDList;
+ pszDisplayName: PWideChar; { Return display name of item selected. }
+ lpszTitle : PWideChar; { text to go in the banner over the tree. }
+ ulFlags : uint; { Flags that control the return stuff }
+ lpfn : pointer; //TFNBFFCallBack;
+ lParam : LPARAM; { extra info that's passed back in callbacks }
+ iImage : integer; { output var: where to return the Image index. }
end;
function SHBrowseForFolderA(var lpbi: TBrowseInfoA): PItemIDList; stdcall;
external 'shell32.dll' name 'SHBrowseForFolderA';
function SHBrowseForFolderW(var lpbi: TBrowseInfoW): PItemIDList; stdcall;
external 'shell32.dll' name 'SHBrowseForFolderW';
-function SHGetPathFromIDListA(pidl: PItemIDList; pszPath: PAnsiChar): BOOL; stdcall;
+function SHGetPathFromIDListA(pidl: PItemIDList; pszPath: PAnsiChar): bool; stdcall;
external 'shell32.dll' name 'SHGetPathFromIDListA';
-function SHGetPathFromIDListW(pidl: PItemIDList; pszPath: PWideChar): BOOL; stdcall;
+function SHGetPathFromIDListW(pidl: PItemIDList; pszPath: PWideChar): bool; stdcall;
external 'shell32.dll' name 'SHGetPathFromIDListW';
-procedure CoTaskMemFree(pv: Pointer); stdcall; external 'ole32.dll'
+procedure CoTaskMemFree(pv: pointer); stdcall; external 'ole32.dll'
name 'CoTaskMemFree';
const
diff --git a/plugins/Utils.pas/wrapper.pas b/plugins/Utils.pas/wrapper.pas
index a663f5fa9c..5976df78fa 100644
--- a/plugins/Utils.pas/wrapper.pas
+++ b/plugins/Utils.pas/wrapper.pas
@@ -7,7 +7,7 @@ uses windows;
function CreateHiddenWindow(proc:pointer=nil):HWND;
-function DoInitCommonControls(dwICC:DWORD):boolean;
+function DoInitCommonControls(dwICC:dword):boolean;
function GetScreenRect:TRect;
procedure SnapToScreen(var rc:TRect;dx:integer=0;dy:integer=0{;
@@ -20,25 +20,25 @@ function StringToGUID(const astr:PAnsiChar):TGUID; overload;
function StringToGUID(const astr:PWideChar):TGUID; overload;
// Comboboxes
-function CB_SelectData(cb:HWND;data:lparam):lresult; overload;
-function CB_SelectData(Dialog:HWND;id:cardinal;data:lparam):lresult; overload;
-function CB_GetData (cb:HWND;idx:integer=-1):lresult; overload;
+function CB_SelectData(cb:HWND;data:lparam):LRESULT; overload;
+function CB_SelectData(Dialog:HWND;id:cardinal;data:lparam):LRESULT; overload;
+function CB_GetData (cb:HWND;idx:integer=-1):LRESULT; overload;
function CB_AddStrData (cb:HWND;astr:pAnsiChar;data:lparam=0;idx:integer=-1):HWND; overload;
function CB_AddStrData (Dialog:HWND;id:cardinal;astr:pAnsiChar;data:lparam=0;idx:integer=-1):HWND; overload;
function CB_AddStrDataW(cb:HWND;astr:pWideChar;data:lparam=0;idx:integer=-1):HWND; overload;
function CB_AddStrDataW(Dialog:HWND;id:cardinal;astr:pWideChar;data:lparam=0;idx:integer=-1):HWND; overload;
// CommCtrl - ListView
-Procedure ListView_GetItemTextA(hwndLV:hwnd;i:WPARAM;iSubItem:integer;pszText:Pointer;cchTextMax:integer);
-Procedure ListView_GetItemTextW(hwndLV:hwnd;i:WPARAM;iSubItem:integer;pszText:Pointer;cchTextMax:integer);
-function LV_GetLParam (list:HWND;item:integer=-1):lresult;
-function LV_SetLParam (list:HWND;lParam:LPARAM;item:integer=-1):lresult;
-function LV_ItemAtPos(wnd:HWND;pt:TPOINT;var SubItem:dword):Integer; overload;
-function LV_ItemAtPos(wnd:HWND;x,y:integer;var SubItem:dword):Integer; overload;
-procedure LV_SetItem (handle:hwnd;str:PAnsiChar;item:integer;subitem:integer=0);
-procedure LV_SetItemW(handle:hwnd;str:PWideChar;item:integer;subitem:integer=0);
-function LV_MoveItem(list:hwnd;direction:integer;item:integer=-1):integer;
-function LV_GetColumnCount(list:HWND):lresult;
+Procedure ListView_GetItemTextA(list:HWND;i:WPARAM;iSubItem:integer;pszText:pointer;cchTextMax:integer);
+Procedure ListView_GetItemTextW(list:HWND;i:WPARAM;iSubItem:integer;pszText:pointer;cchTextMax:integer);
+function LV_GetLParam (list:HWND;item:integer=-1):LRESULT;
+function LV_SetLParam (list:HWND;lParam:LPARAM;item:integer=-1):LRESULT;
+function LV_ItemAtPos(list:HWND;pt:TPOINT;var SubItem:dword):integer; overload;
+function LV_ItemAtPos(list:HWND;x,y:integer;var SubItem:dword):integer; overload;
+procedure LV_SetItem (list:HWND;str:PAnsiChar;item:integer;subitem:integer=0);
+procedure LV_SetItemW(list:HWND;str:PWideChar;item:integer;subitem:integer=0);
+function LV_MoveItem(list:HWND;direction:integer;item:integer=-1):integer;
+function LV_GetColumnCount(list:HWND):LRESULT;
function LV_CheckDirection(list:HWND):integer; // bit 0 - can move up, bit 1 - down
// CommDLG - Dialogs
@@ -74,7 +74,7 @@ const
hiddenwindow:HWND = 0;
hwndcount:integer=0;
-function HiddenWindProc(wnd:HWnd; msg:UINT;wParam:WPARAM;lParam:LPARAM):lresult; stdcall;
+function HiddenWindProc(wnd:HWND; msg:uint;wParam:WPARAM;lParam:LPARAM):LRESULT; stdcall;
begin
if msg=WM_CLOSE then
begin
@@ -120,7 +120,7 @@ begin
end;
//----- End of hidden window functions -----
-function DoInitCommonControls(dwICC:DWORD):boolean;
+function DoInitCommonControls(dwICC:dword):boolean;
var
ICC: TInitCommonControlsEx;
begin
@@ -183,7 +183,7 @@ end;
//----- Combobox functions -----
-function CB_SelectData(cb:HWND;data:lparam):lresult; overload;
+function CB_SelectData(cb:HWND;data:lparam):LRESULT; overload;
var
i:integer;
begin
@@ -199,12 +199,12 @@ begin
result:=SendMessage(cb,CB_SETCURSEL,result,0);
end;
-function CB_SelectData(Dialog:HWND;id:cardinal;data:lparam):lresult; overload;
+function CB_SelectData(Dialog:HWND;id:cardinal;data:lparam):LRESULT; overload;
begin
result:=CB_SelectData(GetDlgItem(Dialog,id),data);
end;
-function CB_GetData(cb:HWND;idx:integer=-1):lresult;
+function CB_GetData(cb:HWND;idx:integer=-1):LRESULT;
begin
if idx<0 then
idx:=SendMessage(cb,CB_GETCURSEL,0,0);
@@ -282,27 +282,27 @@ end;
//----- ListView functions -----
-Procedure ListView_GetItemTextA(hwndLV:hwnd;i:WPARAM;iSubItem:integer;pszText:Pointer;cchTextMax:integer);
+Procedure ListView_GetItemTextA(list:HWND;i:WPARAM;iSubItem:integer;pszText:pointer;cchTextMax:integer);
Var
lvi:LV_ITEMA;
Begin
lvi.iSubItem :=iSubItem;
lvi.cchTextMax:=cchTextMax;
lvi.pszText :=pszText;
- SendMessageA(hwndLV,LVM_GETITEMTEXT,i,LPARAM(@lvi));
+ SendMessageA(list,LVM_GETITEMTEXT,i,LPARAM(@lvi));
end;
-Procedure ListView_GetItemTextW(hwndLV:hwnd;i:WPARAM;iSubItem:integer;pszText:Pointer;cchTextMax:integer);
+Procedure ListView_GetItemTextW(list:HWND;i:WPARAM;iSubItem:integer;pszText:pointer;cchTextMax:integer);
Var
lvi:LV_ITEMW;
Begin
lvi.iSubItem :=iSubItem;
lvi.cchTextMax:=cchTextMax;
lvi.pszText :=pszText;
- SendMessageW(hwndLV,LVM_GETITEMTEXT,i,LPARAM(@lvi));
+ SendMessageW(list,LVM_GETITEMTEXT,i,LPARAM(@lvi));
end;
-procedure LV_SetItem(handle:hwnd;str:PAnsiChar;item:integer;subitem:integer=0);
+procedure LV_SetItem(list:HWND;str:PAnsiChar;item:integer;subitem:integer=0);
var
li:LV_ITEMA;
begin
@@ -311,10 +311,10 @@ begin
li.pszText :=str;
li.iItem :=item;
li.iSubItem:=subitem;
- SendMessageA(handle,LVM_SETITEMA,0,lparam(@li));
+ SendMessageA(list,LVM_SETITEMA,0,lparam(@li));
end;
-procedure LV_SetItemW(handle:hwnd;str:PWideChar;item:integer;subitem:integer=0);
+procedure LV_SetItemW(list:HWND;str:PWideChar;item:integer;subitem:integer=0);
var
li:LV_ITEMW;
begin
@@ -323,10 +323,10 @@ begin
li.pszText :=str;
li.iItem :=item;
li.iSubItem:=subitem;
- SendMessageW(handle,LVM_SETITEMW,0,lparam(@li));
+ SendMessageW(list,LVM_SETITEMW,0,lparam(@li));
end;
-function LV_GetLParam(list:HWND;item:integer=-1):lresult;
+function LV_GetLParam(list:HWND;item:integer=-1):LRESULT;
var
li:LV_ITEMW;
begin
@@ -346,7 +346,7 @@ begin
result:=li.lParam;
end;
-function LV_SetLParam(list:HWND;lParam:LPARAM;item:integer=-1):lresult;
+function LV_SetLParam(list:HWND;lParam:LPARAM;item:integer=-1):LRESULT;
var
li:LV_ITEMW;
begin
@@ -367,25 +367,25 @@ begin
result:=lParam;
end;
-function LV_ItemAtPos(wnd:HWND;Pt:TPOINT;var SubItem:dword):Integer;
+function LV_ItemAtPos(list:HWND;Pt:TPOINT;var SubItem:dword):integer;
var
HTI:LV_HITTESTINFO;
begin
HTI.pt.x := pt.X;
HTI.pt.y := pt.Y;
- SendMessage(wnd,LVM_SUBITEMHITTEST,0,lparam(@HTI));
+ SendMessage(list,LVM_SUBITEMHITTEST,0,lparam(@HTI));
Result :=HTI.iItem;
if @SubItem<>nil then
SubItem:=HTI.iSubItem;
end;
-function LV_ItemAtPos(wnd:HWND;x,y:integer;var SubItem:dword):Integer; overload;
+function LV_ItemAtPos(list:HWND;x,y:integer;var SubItem:dword):integer; overload;
var
HTI:LV_HITTESTINFO;
begin
HTI.pt.x := x;
HTI.pt.y := y;
- SendMessage(wnd,LVM_SUBITEMHITTEST,0,lparam(@HTI));
+ SendMessage(list,LVM_SUBITEMHITTEST,0,lparam(@HTI));
Result :=HTI.iItem;
if @SubItem<>nil then
SubItem:=HTI.iSubItem;
@@ -410,7 +410,7 @@ begin
end;
end;
-function LV_MoveItem(list:hwnd;direction:integer;item:integer=-1):integer;
+function LV_MoveItem(list:HWND;direction:integer;item:integer=-1):integer;
begin
if ((direction>0) and (item=(SendMessage(list,LVM_GETITEMCOUNT,0,0)-1))) or
((direction<0) and (item=0)) then
@@ -425,7 +425,7 @@ begin
result:=item+direction;
end;
-function LV_GetColumnCount(list:HWND):lresult;
+function LV_GetColumnCount(list:HWND):LRESULT;
begin
result:=SendMessage(SendMessage(list,LVM_GETHEADER,0,0),HDM_GETITEMCOUNT,0,0);
end;
diff --git a/plugins/Utils.pas/zwrapper.pas b/plugins/Utils.pas/zwrapper.pas
index 7ccffafb14..3d7cfa5f41 100644
--- a/plugins/Utils.pas/zwrapper.pas
+++ b/plugins/Utils.pas/zwrapper.pas
@@ -2,16 +2,16 @@ unit zwrapper;
interface
-function ZDecompressBuf(const inBuffer: Pointer; inSize: Integer; out outBuffer: Pointer; out outSize: Integer; outEstimate: Integer): Integer;
+function ZDecompressBuf(const inBuffer: pointer; inSize: integer; out outBuffer: pointer; out outSize: integer; outEstimate: integer): integer;
implementation
uses zlib;
-function ZDecompressBuf(const inBuffer: Pointer; inSize: Integer; out outBuffer: Pointer; out outSize: Integer; outEstimate: Integer): Integer;
+function ZDecompressBuf(const inBuffer: pointer; inSize: integer; out outBuffer: pointer; out outSize: integer; outEstimate: integer): integer;
var
zstream : TZStreamRec;
- delta : Integer;
+ delta : integer;
begin
FillChar(zstream, SizeOf(TZStreamRec), 0);