UPD: DialogAPI - DialogBoxParam function

This commit is contained in:
Alexander Koblov 2023-12-23 23:54:57 +03:00
commit 3ba096d853
5 changed files with 9 additions and 9 deletions

View file

@ -53,7 +53,7 @@ begin
with gStartupInfo do
begin
Result := DialogBoxParam(ResData, ResSize, @DlgProc, DB_LRS, @AText, nil);
Result := (DialogBoxParam(ResData, ResSize, @DlgProc, DB_LRS, @AText, nil) > 0);
end;
end;
end;

View file

@ -108,7 +108,7 @@ typedef int (DCPCALL *tMsgChoiceBoxProc)(char* Text, char* Caption, char** Butto
typedef BOOL (DCPCALL *tDialogBoxLFMProc)(intptr_t LFMData, unsigned long DataSize, tDlgProc DlgProc);
typedef BOOL (DCPCALL *tDialogBoxLRSProc)(intptr_t LRSData, unsigned long DataSize, tDlgProc DlgProc);
typedef BOOL (DCPCALL *tDialogBoxLFMFileProc)(char* LFMFileName, tDlgProc DlgProc);
typedef BOOL (DCPCALL *tDialogBoxParamProc)(void* Data, uint32_t DataSize, tDlgProc DlgProc, uint32_t Flags, void *UserData, void* Reserved);
typedef uintptr_t (DCPCALL *tDialogBoxParamProc)(void* Data, uint32_t DataSize, tDlgProc DlgProc, uint32_t Flags, void *UserData, void* Reserved);
typedef int (DCPCALL *tTranslateStringProc)(void *Translation, const char *Identifier, const char *Original, char *Output, int OutLen);
#pragma pack(push)

View file

@ -115,7 +115,7 @@ type
TDialogBoxLFMProc = function(LFMData: Pointer; DataSize: LongWord; DlgProc: TDlgProc): LongBool; {$IFDEF MSWINDOWS}stdcall{$ELSE}cdecl{$ENDIF};
TDialogBoxLRSProc = function(LRSData: Pointer; DataSize: LongWord; DlgProc: TDlgProc): LongBool; {$IFDEF MSWINDOWS}stdcall{$ELSE}cdecl{$ENDIF};
TDialogBoxLFMFileProc = function(lfmFileName: PAnsiChar; DlgProc: TDlgProc): LongBool; {$IFDEF MSWINDOWS}stdcall{$ELSE}cdecl{$ENDIF};
TDialogBoxParamProc = function(Data: Pointer; DataSize: LongWord; DlgProc: TDlgProc; Flags: LongWord; UserData, Reserved: Pointer): LongBool; {$IFDEF MSWINDOWS}stdcall{$ELSE}cdecl{$ENDIF};
TDialogBoxParamProc = function(Data: Pointer; DataSize: LongWord; DlgProc: TDlgProc; Flags: LongWord; UserData, Reserved: Pointer): UIntPtr; {$IFDEF MSWINDOWS}stdcall{$ELSE}cdecl{$ENDIF};
TTranslateStringProc = function(Translation: Pointer; Identifier, Original: PAnsiChar; Output: PAnsiChar; OutLen: Integer): Integer {$IFDEF MSWINDOWS}stdcall{$ELSE}cdecl{$ENDIF};
type

View file

@ -116,7 +116,7 @@ function MsgChoiceBox(Text, Caption: PAnsiChar; Buttons: PPAnsiChar; BtnDef, Btn
function DialogBoxLFM(LFMData: Pointer; DataSize: LongWord; DlgProc: TDlgProc): LongBool; dcpcall;
function DialogBoxLRS(LRSData: Pointer; DataSize: LongWord; DlgProc: TDlgProc): LongBool; dcpcall;
function DialogBoxLFMFile(lfmFileName: PAnsiChar; DlgProc: TDlgProc): LongBool; dcpcall;
function DialogBoxParam(Data: Pointer; DataSize: LongWord; DlgProc: TDlgProc; Flags: UInt32; UserData, Reserved: Pointer): LongBool; dcpcall;
function DialogBoxParam(Data: Pointer; DataSize: LongWord; DlgProc: TDlgProc; Flags: UInt32; UserData, Reserved: Pointer): UIntPtr; dcpcall;
function SendDlgMsg(pDlg: PtrUInt; DlgItemName: PAnsiChar; Msg, wParam, lParam: PtrInt): PtrInt; dcpcall;
implementation
@ -228,12 +228,12 @@ begin
end;
function DialogBoxParam(Data: Pointer; DataSize: LongWord;
DlgProc: TDlgProc; Flags: UInt32; UserData, Reserved: Pointer): LongBool; dcpcall;
DlgProc: TDlgProc; Flags: UInt32; UserData, Reserved: Pointer): UIntPtr; dcpcall;
var
DataString: String;
begin
if (Data = nil) then Exit(False);
if (DataSize = 0) then Exit(False);
if (Data = nil) then Exit(0);
if (DataSize = 0) then Exit(0);
SetString(DataString, Data, DataSize);
if (Flags and DB_LRS = 0) then
@ -245,7 +245,7 @@ begin
DataString:= LFMToLRS(mbReadFileToString(DataString));
end;
Result:= DialogBox(DataString, DlgProc, UserData);
Result:= UIntPtr(DialogBox(DataString, DlgProc, UserData));
end;
function SendDlgMsg(pDlg: PtrUInt; DlgItemName: PAnsiChar; Msg, wParam, lParam: PtrInt): PtrInt; dcpcall;

View file

@ -75,7 +75,7 @@ end;
procedure TDcxModule.InitializeExtension(StartupInfo: PExtensionStartupInfo);
const
VERSION_API = 2;
VERSION_API = 3;
var
Language: String;
AFileName, APath: String;