Autor Beitrag
Kniwior
Hält's aus hier
Beiträge: 3



BeitragVerfasst: So 22.04.07 10:12 
Hallo Member,

ich wollte mal etwas fragen, ich habe Borland Delphi 2005 Personal, bin ein absoluter anfänger und will dieses Script erstellen (siehe unten)

Es steht dabei:

Zitat:
Damit der Code funktioniert, müssen die beiden Units Shdocvw_tlb.pas und MSHTML_TLB.pas angelegt werden. Dazu in Delphi über das Menü Komponenten/ActiveX importieren erst 'Microsoft HTML Object Library' auswählen und auf 'Unit anlegen' klicken. Das gleiche mit "Microsoft Internet Control" wiederholen.


Bei meinem Delphi Programm fehlt leider der Eintrag "Menü -> Komponenten -> ActiveX importieren" also dachte ich mir, suche ich mir mal die Units Shdocvw_tlb.pas und MSHTML_TLB.pas über Google. Shdocvw_tlb.pas Habe ich gefunden, die andere Datei Leider nicht...

Kann mir jemand helfen, oder liege ich gerade völlig falsch...

Mfg
Kniwior



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:
42:
43:
44:
45:
46:
47:
48:
49:
50:
51:
52:
53:
54:
55:
56:
57:
58:
59:
uses
  ActiveX, Shdocvw_tlb, MSHTML_TLB;

type
  TObjectFromLResult = function(LRESULT: lResult; const IID: TIID; WPARAM: wParam;
  out pObject): HRESULT; stdcall;

function GetIEFromHWND(WHandle: HWND; var IE: IWebbrowser2): HRESULT;
var
  hInst: HWND;
  lRes: Cardinal;
  MSG: Integer;
  pDoc: IHTMLDocument2;
  ObjectFromLresult: TObjectFromLresult;
begin
  hInst := LoadLibrary('Oleacc.dll');
  @ObjectFromLresult := GetProcAddress(hInst, 'ObjectFromLresult');
  if @ObjectFromLresult <> nil then begin
    try
      MSG := RegisterWindowMessage('WM_HTML_GETOBJECT');
      SendMessageTimeOut(WHandle, MSG, 00, SMTO_ABORTIFHUNG, 1000, lRes);
      Result := ObjectFromLresult(lRes, IHTMLDocument2, 0, pDoc);
      if Result = S_OK then
        (pDoc.parentWindow as IServiceprovider).QueryService(IWebbrowserApp, IWebbrowser2, IE);
    finally
      FreeLibrary(hInst);
    end;
  end;
end;

procedure GetIEWindows(lb: TListBox);
  function EnumWindowsProc (Wnd: HWND; lb: TListBox): BOOL; stdcall;
  var
    theClassname: array [0..128of Char;
    caption: Array [0..128of Char;
    IE: IWebbrowser2;
    WndChild: HWND;
  begin
    Result := True;
    Windows.GetClassname( Wnd, theClassname, Sizeof( theclassname ));
    if theClassname='IEFrame' then
    begin
      WndChild := FindWindowEX(Wnd, 0'Shell DocObject View'nil);
      if WndChild <> 0 then
      begin
        WndChild := FindWindowEX(WndChild, 0'Internet Explorer_Server'nil);
        if WndChild <> 0 then
        begin
          if GetIEFromHWND(WndChild, IE)=S_OK then
            if IE<>nil then
              lb.Items.Add(IE.LocationURL);
        end;
      end;
    end;
  end;
begin
  lb.Clear;
  EnumWindows(@EnumWindowsProc, integer(lb));
end;

Quelle:www.dsdt.info/tipps/?id=587
Andreas L.
ontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic star
Beiträge: 1703
Erhaltene Danke: 25

Windows Vista / Windows 10
Delphi 2009 Pro (JVCL, DragDrop, rmKlever, ICS, EmbeddedWB, DEC, Indy)
BeitragVerfasst: So 22.04.07 10:25 
Ja, dieser Menüpunkt fehlt in deiner Version. Du könntest jetzt theoretisch die neue Tubro Delphi für Win32 herunterladen. Diese ist kostenfrei und der TWebBrowser, den du versuchst zu installieren, ist bereits vorinstalliert.

Andere Möglichkeit wäre hier im Forum nach einem Package zu suchen das du nur noch in Delphi 2005 installieren musst und fertig. Leider weiß ich nicht mehr genau welche Schlüsselwörter man für die Suche braucht. Probier mal Suche in: Delphi-Forum DELPHI 2005 TWEBBROWSER
Kniwior Threadstarter
Hält's aus hier
Beiträge: 3



BeitragVerfasst: So 22.04.07 10:41 
Danke für deinen schnellen support ;-),
leider finde ich im Forum und in Google das Package nicht, es hat nicht zufällig jemand einen Link?

Vielen Dank im Vorraus.


Mfg
Kniwior
Andreas L.
ontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic star
Beiträge: 1703
Erhaltene Danke: 25

Windows Vista / Windows 10
Delphi 2009 Pro (JVCL, DragDrop, rmKlever, ICS, EmbeddedWB, DEC, Indy)
BeitragVerfasst: So 22.04.07 10:51 
Du hast die Datei SHDocVw_TLB.pas? Falls ja, einfach in Delphi auf Datei > Neu > Weitere... > package (oder ähnlich) und im neuen package die Datei hinzufügen. Kompilieren und Installieren. Fertig.

Hab auf meiner Festplatte das paket gefunden. Musst dir halt die Pfade anpassen...
Einloggen, um Attachments anzusehen!
Lannes
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 2352
Erhaltene Danke: 4

Win XP, 95, 3.11, IE6
D3 Prof, D4 Standard, D2005 PE, TurboDelphi, Lazarus, D2010
BeitragVerfasst: So 22.04.07 11:20 
Hallo,

eventuell hilft Dir auch das weiter:
www.delphi-forum.de/....php?p=378638#378638

_________________
MfG Lannes
(Nichts ist nicht Nichts) and ('' <> nil ) and (Pointer('') = nil ) and (@('') <> nil )