Autor Beitrag
gdv
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 16


D7 Enterp
BeitragVerfasst: Di 22.02.05 15:52 
Hallo,
ich möchte in meinem Programmfenster den Arcobat-viewer anzeigen.
Dieser soll Kind-Eigenschaften aufweisen so wie das beim Aufruf eines forms möglich ist.(Begrenzung innerhalb des Programmfensters).
Bisher habe ich es über die Funktion createprocess aufgerufen. Allerdings erscheint es dabei immer in einem eigenen Fenster, bei dem ich nur grob die Größe minimal,maximal default und die Startposition xy beeinflussen kann.

ausblenden volle Höhe Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
38:
39:
40:
41:
procedure TForm1.Button1Click(Sender: TObject);
var
  ErrorCode,ProcID: Cardinal;
begin
  StartAssociatedExe('d:\entwicklung\pdf\schaltpläne.pdf', ErrorCode);
end;

function StartAssociatedExe(FileName: stringvar ErrorCode: Cardinal): Boolean;
var
  Prg: string;
  ProcessInfo: TProcessInformation;
  StartupInfo: TStartupInfo;
begin
  SetLength(Prg, MAX_PATH);
  Result := False;
  ErrorCode := FindExecutable(PChar(FileName), nil, PChar(Prg));
  if ErrorCode >= 32 then
  begin
    SetLength(Prg, StrLen(PChar(Prg)));
    FillChar(StartupInfo, SizeOf(TStartupInfo), 0);
    with StartupInfo do

    begin
      cb := SizeOf(TStartupInfo);
      wShowWindow := SW_SHOW;
      dwX:=50;
      dwY:=50;
    end;
    if CreateProcess(PChar(Prg), PChar(Format('%s %s', [Prg, FileName])),
      nilnil, False, NORMAL_PRIORITY_CLASS, nilnil,StartupInfo, ProcessInfo) then
    begin
      WaitForSingleObject(ProcessInfo.hProcess, INFINITE);
      GetExitCodeProcess(ProcessInfo.hProcess, ErrorCode);
      CloseHandle(ProcessInfo.hProcess);
      CloseHandle(ProcessInfo.hThread);
      Result := True;
    end
    else
      ErrorCode := GetLastError;
  end;
end;


Ich hoffe es kann mir jemand von Euch weiterhelfen.

Moderiert von user profile iconChristian S.: Code- durch Delphi-Tags ersetzt.
retnyg
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 2754

SNES, GB, GBA, CPC, A500, 486/66, P4/3.0HT: NintendOS, AmigaOS, DoS
Delphi 5, Delphi 7
BeitragVerfasst: Di 22.02.05 16:02 
du könntest einen api-hook auf CreateWindowEx setzen.
wenn das von dir gewünschte window erzeugt wird übergibst du halt dann das handle deiner anzeigekomponente als parent.
SchelmVomElm
ontopic starontopic starontopic starontopic starontopic starofftopic starofftopic starofftopic star
Beiträge: 154

W2K Pro
D5 Pro
BeitragVerfasst: Di 22.02.05 16:04 
Mach's doch anders:

Komponente -> ActiveX importieren

Dann "Acrobat Control für ActiveX" auswählen und installieren.

Dann solltest Du im Register "ActiveX" eine Komponente TPdf haben.

_________________
for(;P("\n"),R--;P("|"))for(e=C;e--;P("_"+(*u++/8)%2))P("|"+(*u/4)%2);
Grendel
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 443

Gentoo Linux, MacOS X, Win 2000
D5 Ent, D7 Ent, Lazarus, Anjuta, MonoDevelop
BeitragVerfasst: Di 22.02.05 16:04 
Bau das ActiveX Control des Acrobats ein.

Dazu einfach folgendes machen:
Komponente -> ActiveX importieren -> "Acrobat Control for Active X" auswählen und weitere Einstellungen vornehmen -> Installieren
Und schon hast Du eine PDF Komponente mit dem Namen, den Du unter "Klassennamen" eingegeben hast.

Bis neulich ...

edit: Mist zu langsam
jasocul
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 6393
Erhaltene Danke: 147

Windows 7 + Windows 10
Sydney Prof + CE
BeitragVerfasst: Di 22.02.05 16:07 
Aber Vorsicht!
ActiveX der Version 7 ist nicht abwärts-kompatibel.
Das Programm soll im schlimmsten Fall abstürzen (hatte ich noch nicht). Es gibt aber mindestens eine Fehlermeldung.
SchelmVomElm
ontopic starontopic starontopic starontopic starontopic starofftopic starofftopic starofftopic star
Beiträge: 154

W2K Pro
D5 Pro
BeitragVerfasst: Di 22.02.05 16:07 
QGrendel: Ätschi Bätsch :D

_________________
for(;P("\n"),R--;P("|"))for(e=C;e--;P("_"+(*u++/8)%2))P("|"+(*u/4)%2);
gdv Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 16


D7 Enterp
BeitragVerfasst: Di 22.02.05 16:23 
vielen Dank,
genauso habe ich es mir vorgestellt.
mit dem pdf.ocx funzt es.
Thorsten :lol: