Debian Codegraph @

plugins/wfx/ftp/src/ftppropdlg.pas

raw
1 unit FtpPropDlg;
2
3 {$mode delphi}
4 {$include calling.inc}
5
6 interface
7
8 uses
9 SysUtils, Extension, FtpFunc;
10
11 function ShowPropertiesDlg(const AText: String): Boolean;
12
13 implementation
14
15 {$R ftppropdlg.lfm}
16
17 function DlgProc(pDlg: PtrUInt; DlgItemName: PAnsiChar; Msg, wParam, lParam: PtrInt): PtrInt; dcpcall;
18 var
19 Data: PtrInt;
20 Text: PString absolute Data;
21 begin
22 Result:= 0;
23 with gStartupInfo do
24 begin
25 case Msg of
26 DN_INITDIALOG:
27 begin
28 Data:= SendDlgMsg(pDlg, nil, DM_GETDLGDATA, 0, 0);
29 Data:= PtrInt(PAnsiChar(Text^));
30 SendDlgMsg(pDlg, 'seProperties', DM_SETTEXT, Data, 0);
31 end;
32 end;
33 end; // with
34 end;
35
36 function ShowPropertiesDlg(const AText: String): Boolean;
37 var
38 ResHandle: TFPResourceHandle = 0;
39 ResGlobal: TFPResourceHGLOBAL = 0;
40 ResData: Pointer = nil;
41 ResSize: LongWord;
42 begin
43 Result := False;
44 try
45 ResHandle := FindResource(HINSTANCE, PChar('TfrmFileProperties'), MAKEINTRESOURCE(10) {RT_RCDATA});
46 if ResHandle <> 0 then
47 begin
48 ResGlobal := LoadResource(HINSTANCE, ResHandle);
49 if ResGlobal <> 0 then
50 begin
51 ResData := LockResource(ResGlobal);
52 ResSize := SizeofResource(HINSTANCE, ResHandle);
53
54 with gStartupInfo do
55 begin
56 Result := (DialogBoxParam(ResData, ResSize, @DlgProc, DB_LRS, @AText, nil) > 0);
57 end;
58 end;
59 end;
60
61 finally
62 if ResGlobal <> 0 then
63 begin
64 UnlockResource(ResGlobal);
65 FreeResource(ResGlobal);
66 end;
67 end;
68 end;
69
70 end.
71