Delphi-PRAXiS

Delphi-PRAXiS (https://www.delphipraxis.net/forum.php)
-   Win32/Win64 API (native code) (https://www.delphipraxis.net/17-win32-win64-api-native-code/)
-   -   Delphi InternetExplorer OLE (https://www.delphipraxis.net/75601-internetexplorer-ole.html)

API 22. Aug 2006 08:56


InternetExplorer OLE
 
ich erstelle per
Delphi-Quellcode:
CreateOleObject('InternetExplorer.Application');
ein IE Objekt. Wie kann ich dieses in den Vordergrund bringen?
(das Taskicon flasht nur...?)

mkinzler 22. Aug 2006 09:18

Re: InternetExplorer OLE
 
Warum nimmst du kein TWebBrowser?

API 22. Aug 2006 09:22

Re: InternetExplorer OLE
 
Ich möchte einfach gewisse Links extern öffnen nur über CreateOleObject

mkinzler 22. Aug 2006 09:39

Re: InternetExplorer OLE
 
Zitat:

Wie kann ich dieses in den Vordergrund bringen?
Kommt auf das Objekt an. Schon mit .Show usw versucht?

Daniel B 22. Aug 2006 09:41

Re: InternetExplorer OLE
 
mal schnell und hässlich ;)

Delphi-Quellcode:
procedure ieopen;
var
  ieo : olevariant;
begin
  ieo := CreateOleObject('InternetExplorer.Application');
  ieo.visible := true;
  //hier rest
end;

procedure TForm1.Button1Click(Sender: TObject);
begin
ieopen;
end;
ups, ne url bruachst auch noch:
Delphi-Quellcode:
procedure ieopen;
var
  ieo : olevariant;
begin
  ieo := CreateOleObject('InternetExplorer.Application');
  ieo.visible := true;
  //hier rest
  ieo.navigate('http://bmw.de');
end;

API 22. Aug 2006 09:43

Re: InternetExplorer OLE
 
Danke Daniel, soweit war ich ja auch nur was schreibe ich bei "hier rest", damit es nicht flasht?

Daniel B 22. Aug 2006 09:44

Re: InternetExplorer OLE
 
Ich weiss nicht was Du für ein Problem mit dem flashen hast, bei mir öffnet sich der IE ganz normal und zeigt mir die gewünschte Seite an. Der Code an sich funktioniert ja...

API 22. Aug 2006 09:46

Re: InternetExplorer OLE
 
es flasht auch so noch:
Delphi-Quellcode:
SetForegroundWindow(ieo.HWND);

API 28. Aug 2006 16:24

Re: InternetExplorer OLE
 
*PUSH* nach 6 Tagen. Problem immer noch nicht gelöst.

DP-Maintenance 28. Aug 2006 16:36

DP-Maintenance
 
Dieses Thema wurde von "Phoenix" von "Internet / LAN / ASP.NET" nach "Windows API / MS.NET Framework API" verschoben.
Hat eher mit COM/DCOM-Problematik zu tun, nicht wirklich mit Internet, auch wenns um das Internet-Explorer Objekt geht.

himitsu 28. Aug 2006 16:39

Re: InternetExplorer OLE
 
Zitat:

Ich möchte einfach gewisse Links extern öffnen
(hoffe ich hab das jetzt nicht falsch verstanden)



schonmal ShellExecute versucht?

einfach statt 'ner Datei die URL angeben.

Vorteil: der Link wird im Standardbrowser geöffnet (also nicht unbedingt im IE)



Ansonsten könnte man die URL auch an die IExplor.exe (oder so ähnlich) als Parameter übergeben.


Und für die verschiedenen Varianten mit ShellExecute gibt es massig Threads hier im Forum (falls dazu noch Fragen auftauchen) ^^

API 28. Aug 2006 17:18

Re: InternetExplorer OLE
 
Zitat:

Zitat von API
Ich möchte einfach gewisse Links extern öffnen nur über CreateOleObject

Shellexecute werde ich nur im Notfall nehmen. Denn so hätte ich keinen direkten Zugriff auf den "Internet Explorer_Server"

API 12. Sep 2006 08:14

Re: InternetExplorer OLE
 
*PUSH*

TKC 12. Sep 2006 08:18

Re: InternetExplorer OLE
 
Zitat:

Zitat von API
es flasht auch so noch:

Was genau ist denn dein Problem ???

API 12. Sep 2006 08:23

Re: InternetExplorer OLE
 
Zitat:

Zitat von API
ich erstelle per
Delphi-Quellcode:
CreateOleObject('InternetExplorer.Application');
ein IE Objekt. Wie kann ich dieses in den Vordergrund bringen?
(das Taskicon flasht nur...?)


mkinzler 12. Sep 2006 08:30

Re: InternetExplorer OLE
 
Hast du mal geschaut, ob das Control ne Methode .Show() o.ä. besitzt?

API 12. Sep 2006 08:33

Re: InternetExplorer OLE
 
Zitat:

Zitat von mkinzler
Hast du mal geschaut, ob das Control ne Methode .Show() o.ä. besitzt?

angezeigt wird es ja, nur nicht im Vordergrund. Das Objekt heisst IWebBrowser2

TKC 12. Sep 2006 08:39

Re: InternetExplorer OLE
 
Wie wärs damit ?

Delphi-Quellcode:
procedure ieopen(Url:string);
var
  ieo                        : olevariant;
begin
  ieo := CreateOleObject('InternetExplorer.Application');
  ieo.visible := true;
  BringWindowToTop(ieo.HWND);
  ieo.navigate(Url);
end;

TKC 14. Sep 2006 14:17

Re: InternetExplorer OLE
 
war ja klar das da keine Antwort kommt .. nachdem er aller 5 Minuten nen neuen Thread erstellt hat.

Lun 17. Nov 2006 09:50

Re: InternetExplorer OLE
 
@ ACE-ppc

Nicht, schlimm. Es hat sich trotzdem gelohnt das Du es gepostet hast. Ich brauchte das heute und es funktioniert :)

thx

greetz Lun

API 17. Nov 2006 10:07

Re: InternetExplorer OLE
 
Zitat:

Zitat von ACE-ppc
war ja klar das da keine Antwort kommt .. nachdem er aller 5 Minuten nen neuen Thread erstellt hat.

Sorry, hab's übersehen. Hilft aber leider auch nicht.

Lun 17. Nov 2006 10:24

Re: InternetExplorer OLE
 
@API

Also bei mir funtzt es:

Code:

ieo := CreateOleObject('InternetExplorer.Application');
              BringWindowToTop(ieo.HWND);
              ieo.navigate(URL);
              ieo.visible := false;
Ich starte den I-net Explorer aus meiner Anwendung. Ohne das BringWindowToTop(ieo.HWND); läuft der IE hinter meiner
Anwendung. Mit dem BringWindowToTop(ieo.HWND); springt der IE vor die Anwendung.

Vielleicht verstehe ich auch den Begriff "es flasht nur" falsch.

greetz Lun

shmia 17. Nov 2006 12:00

Re: InternetExplorer OLE
 
Zitat:

Zitat von Lun
Vielleicht verstehe ich auch den Begriff "es flasht nur" falsch.

Bei älteren Windows Versionen (win 95/98 ...) konnte jeder Prozess sich problemlos in den Vordergrund
drängen nach dem Motto: "ICH bin wichtig, ich will ganz vorne sein"
Jedes Prozess konnte also den Benutzer bevormunden, indem es sich in den Vordergrund drängte.
MS hat das Problem erkannt und ab Win2000 blinkt (=flashen) eine Anwendung, die etwas will, nur in der Taskleiste.
Der Benutzer muss den blinkenden Prozess anklicken, damit dieser in den Vordergrund kommt.
Man könnte es ja mal mit SetForegroundWindow versuchen:

Zitat:

the SetForegroundWindow function puts the thread that created the specified window into the foreground and activates the window. Keyboard input is directed to the window, and various visual cues are changed for the user.
In a preemptive multitasking environment, you should generally let the user control which window is the foreground window. However, an application can call SetForegroundWindow if it wants to put itself into the foreground to display a critical error or information that requires the user's immediate attention. A good example is a debugger when it hits a breakpoint.


Alle Zeitangaben in WEZ +1. Es ist jetzt 02:21 Uhr.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024 by Thomas Breitkreuz