Google earth HWND and python

F

FlyBoy

Hi,
I'm working on a little program to export gps data to KML file. This
program is up and running however reading the documentation of Google
Earth I came across an interesting possibilities. I have found a couple of
examples on controlling Google Earth in python. I have experimented with
code using the example below. Reading the Google EarthCom/Api I found
another interesting feature.

GetRenderHwnd ( [out, retval] OLE_HANDLE * hwnd ) Returns
Windows handle for Google Earth's render window. This is useful for:
Getting and setting render window dimensions. Needed for converting
between pixel coordinates and screen coordinates. Also helpful for resizing
the window for screenshots or videos. Drawing things on top of the render
window. Other things requiring Win32 functions.

Has anyone had any experience in using this feature? I'm I correct to
assume that the hwnd can be used in TK/Wx? Is it possible to embed the
output of google earth into a Tkinter/wx Window? Yes there are a lot of
questions but I'd like to know.

Kind Regards,
Michael


#################
Example code
import win32com.client

googleEarth = win32com.client.Dispatch("GoogleEarth.ApplicationGE")
while not googleEarth.IsInitialized():
print "waiting for Google Earth to initialize"

##for opening a kml file
##googleEarth.OpenKmlFile("test.kml")
#For opening a location
googleEarth.SetCameraParams( 41.487942634608913, -
81.686570904088171, 0.0, 1,
150.00011938469936, 70.000000000947935, -127.30257903894255,
100)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,070
Latest member
BiogenixGummies

Latest Threads

Top