Google earth HWND and python

FlyBoy michael at nospam.com
Mon Dec 3 05:40:15 EST 2007


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)

----------------------------------------------
Posted with NewsLeecher v1.0 beta 25
 * Binary Usenet Leeching Made Easy
 * http://www.newsleecher.com/?usenet
----------------------------------------------




More information about the Python-list mailing list