Click here to Skip to main content
15,885,914 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
To obtain high point of Google's software and transferred to the program?
C#
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Text;
using System.Windows.Forms;
using System.Runtime.InteropServices;
using EARTHLib;
using System.Threading;

namespace WindowsFormsApplication7
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }
        public delegate int EnumWindowsProc(IntPtr hwnd, int lParam);

        [DllImport("user32", CharSet = CharSet.Auto)]
        public extern static IntPtr GetParent(IntPtr hWnd);

        [DllImport("user32", CharSet = CharSet.Auto)]
      //  public extern static bool MoveWindow(IntPtr hWnd, int X, int Y, int nWidth, int nHeight, bool bRepaint);
        public extern static bool MoveWindow(IntPtr hWnd, int X, int Y, int nWidth, int nHeight, bool bRepaint);
        [DllImport("user32", CharSet = CharSet.Auto)]
        public extern static IntPtr SetParent(IntPtr hWndChild, IntPtr hWndNewParent);

       
        private IntPtr GEHrender = (IntPtr)0;
        private IntPtr GEParentHrender = (IntPtr)0;

        public ApplicationGEClass googleEarth;

      

        public void Unload()
        {
            if (GEParentHrender != (IntPtr)0)
                SetParent(GEHrender, GEParentHrender);
        }

      
        private void Form1_Load(object sender, EventArgs e)
        {
            if (this.DesignMode == false)
            {
                googleEarth = new ApplicationGEClass();

                GEHrender = (IntPtr)googleEarth.GetRenderHwnd();
                GEParentHrender = GetParent(GEHrender);

               // MoveWindow(GEHrender, 0, 0, this.Width, this.Height, true);
                MoveWindow(GEHrender, 0, 0, 800, this.Height, true);

                SetParent(GEHrender, this.Handle);
            }
        }
      
      
        private void timer1_Tick(object sender, EventArgs e)
        {
            textBox1.Text = "" + googleEarth.ViewExtents.East;
            textBox2.Text = "" + googleEarth.ViewExtents.North;
            textBox3.Text = "" + googleEarth.ViewExtents.South;
         
            textBox5.Text = "" + googleEarth.ViewExtents.West;
        

        }

North and South, East and West, and it just does not have the elev. Please help.
Posted
Comments
Richard MacCutchan 17-Sep-12 11:16am    
What is "elev" and how does this relate to what you are trying to do?

In case you mean "elevation": what should be the elevation for an area? A point has an elevation, but an area? Ok, except when it is flat... ViewExtents shows an area, not a point.
 
Share this answer
 
What.........??????????????????????????????????????????????.??????
L??
.
 
Share this answer
 
Comments
BillW33 18-Sep-12 10:24am    
You should not post a comment to a solution or question as a "Solution". Instead add a comment to the question by pressing the "Have a Question or Comment?" button. I did not vote, but I thought you should know why this is being downvoted.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900