Autor Beitrag
Martok
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 3661
Erhaltene Danke: 604

Win 8.1, Win 10 x64
Pascal: Lazarus Snapshot, Delphi 7,2007; PHP, JS: WebStorm
BeitragVerfasst: So 24.09.06 20:26 
Hallo,

Ich habe ein Programm, das GPS-Daten ausliest. Nun möchte ich gerne diese Koordinaten in Google Earth anzeigen. Maps ist kein Problem, das hab ich auch schon. Allerdings sind ja bei GE die Daten besser, daher würde ich das bevorzugen.

Nun meine Frage: wie kann ich GE dazu bringen, zu einem Punkt zu gehen?
Im Moment löse ich das über eine verrückte Message-Senderei ins Suchfeld, das klappt aber nur, wenn GE schon läuft.
Was kann man da machen? Vielleicht eine KML basteln, und wie kriegt man den dann dazu zu diesem Punkt zu gehen?

Danke für Lösungsansätze,
Sebastian

PS: Mein bisheriger Code:
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:
procedure TfmMain.btnGoogleEarthClick(Sender: TObject);
var s:string;
    wnd: HWND;
    i:integer;
begin
  s:= LatLonToString( Processor.GPGGA.LatLon );

  wnd :=  FindWindow('QWidget''Google Earth');
  if Wnd=0 then
    shellExecute(Handle,'open',pchar(GoogleEarthPath+'\googleearth.exe'),pchar(s),nil,SW_SHOWNORMAL);
  while wnd=0 do begin
    wnd :=  FindWindow('QWidget''Google Earth');
    Sleep(1000);
  end;
  BringWindowToTop(Wnd);
  wnd :=  FindWindowEx(wnd, 0'QWidget''qt_central_widget');
  wnd :=  FindWindowEx(wnd, 0'QWidget''MainWindowHSplitter');
  wnd :=  FindWindowEx(wnd, 0'QWidget''LeftPanelVSplitter');
  wnd :=  FindWindowEx(wnd, 0'QWidget''Search');
  wnd :=  FindWindowEx(wnd, 0'QWidget''Search');
  wnd :=  FindWindowEx(wnd, 0'QWidget''unnamed');
  wnd :=  FindWindowEx(wnd, 0'QWidget'nil);
  wnd :=  FindWindowEx(wnd, 0'QWidget''searchTabWidget');
  wnd :=  FindWindowEx(wnd, 0'QWidget''tab pages');
  wnd :=  FindWindowEx(wnd, 0'QWidget''fly');
  wnd :=  FindWindowEx(wnd, 0'QWidget''mFlyFrame');
  wnd :=  FindWindowEx(wnd, 0'QWidget''mFlyCombo');
  wnd :=  FindWindowEx(wnd, 0'QWidget''combo edit');
  if wnd <> 0 then
  begin
    while GetForegroundwindow<>wnd do
      Sleep(1000);
    for i:= 1 to length(s) do begin
      PostMessage(Wnd,WM_Char,ord(s[i]),0);
    end;
    PostMessage(Wnd,WM_KEYDOWN,13,0); //'Suchen' betätigen
    PostMessage(Wnd,WM_KEYUP,13,0);
  end;
end;


Die Sleeps sind dazu da, auf das vollständige Starten zu warten. Das funzt aber nicht, je nach dem was ich programmiere kommt eine Endlosschleife oder er kommt zu früh zurück.

_________________
"The phoenix's price isn't inevitable. It's not part of some deep balance built into the universe. It's just the parts of the game where you haven't figured out yet how to cheat."
jakobwenzel
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 1889
Erhaltene Danke: 1

XP home, ubuntu
BDS 2006 Prof
BeitragVerfasst: So 24.09.06 20:35 
Probiers mal über Typbibliothek imporieren und dann Earth 1.0 Typelib und guck dir mal die Eigenschaften von der Typbibliothek an.

_________________
I thought what I'd do was, I'd pretend I was one of those deaf-mutes.
Martok Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 3661
Erhaltene Danke: 604

Win 8.1, Win 10 x64
Pascal: Lazarus Snapshot, Delphi 7,2007; PHP, JS: WebStorm
BeitragVerfasst: So 24.09.06 22:49 
Ähm, gibts bei mir nicht.

Kannst Du mir sagen, aus welcher DLL usw. die kommt? Eventuell hat er die nicht richtig registriert. Ich werd GE mal neu Installieren, vllt hilfts.

Kennt jemand ein Tool zum anzeigen aller installierten ActiveX-Controls? Die Anzeige von Delphi scheint mir etwas buggy zu sein.

_________________
"The phoenix's price isn't inevitable. It's not part of some deep balance built into the universe. It's just the parts of the game where you haven't figured out yet how to cheat."
jakobwenzel
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 1889
Erhaltene Danke: 1

XP home, ubuntu
BDS 2006 Prof
BeitragVerfasst: Mo 25.09.06 14:35 
Probier mal über den Knopf hinzufügen, dann ins Earth-Verzeichnis und dann die Exe nehmen (ggf. Dateifilter anpassen).
Wichtig: Das is kein ACtiveX-Control sondern ne Typbibliothek.

PS: Bei der alten Version fing der Name der Typbibliothel mit Keylink an. Weiter weiß ich nich mehr.

_________________
I thought what I'd do was, I'd pretend I was one of those deaf-mutes.