Click here to Skip to main content
15,891,253 members
Home / Discussions / C#
   

C#

 
GeneralRe: Geometry problem with c# .net Pin
Richard MacCutchan29-May-16 2:12
mveRichard MacCutchan29-May-16 2:12 
GeneralRe: Geometry problem with c# .net Pin
avisotorisher30-May-16 18:35
avisotorisher30-May-16 18:35 
AnswerRe: Geometry problem with c# .net Pin
Patrice T29-May-16 7:13
mvePatrice T29-May-16 7:13 
GeneralRe: Geometry problem with c# .net Pin
Sascha Lefèvre29-May-16 9:30
professionalSascha Lefèvre29-May-16 9:30 
GeneralRe: Geometry problem with c# .net Pin
Patrice T29-May-16 13:36
mvePatrice T29-May-16 13:36 
AnswerRe: Geometry problem with c# .net Pin
avisotorisher30-May-16 17:29
avisotorisher30-May-16 17:29 
QuestionLooking the best GPS tracking Application until now Pin
Dr Kasa29-May-16 0:12
Dr Kasa29-May-16 0:12 
AnswerRe: Looking the best GPS tracking Application until now Pin
Eddy Vluggen29-May-16 0:20
professionalEddy Vluggen29-May-16 0:20 
GeneralRe: Looking the best GPS tracking Application until now Pin
Dr Kasa20-Apr-17 3:34
Dr Kasa20-Apr-17 3:34 
AnswerRe: Looking the best GPS tracking Application until now Pin
PraveenDora31-May-16 6:41
PraveenDora31-May-16 6:41 
GeneralRe: Looking the best GPS tracking Application until now Pin
Dr Kasa20-Apr-17 3:33
Dr Kasa20-Apr-17 3:33 
QuestionSystem.Windows.Forms Issue Pin
jkadjthegamegadhguaet27-May-16 15:44
jkadjthegamegadhguaet27-May-16 15:44 
AnswerRe: System.Windows.Forms Issue Pin
OriginalGriff27-May-16 20:52
mveOriginalGriff27-May-16 20:52 
AnswerRe: System.Windows.Forms Issue Pin
BillWoodruff28-May-16 2:44
professionalBillWoodruff28-May-16 2:44 
GeneralRe: System.Windows.Forms Issue Pin
jkadjthegamegadhguaet28-May-16 5:08
jkadjthegamegadhguaet28-May-16 5:08 
GeneralRe: System.Windows.Forms Issue Pin
Richard MacCutchan28-May-16 6:02
mveRichard MacCutchan28-May-16 6:02 
QuestionRe: System.Windows.Forms Issue Pin
Eddy Vluggen29-May-16 0:00
professionalEddy Vluggen29-May-16 0:00 
GeneralRe: System.Windows.Forms Issue Pin
CHill6028-May-16 5:49
mveCHill6028-May-16 5:49 
GeneralRe: System.Windows.Forms Issue Pin
Richard MacCutchan28-May-16 6:03
mveRichard MacCutchan28-May-16 6:03 
GeneralRe: System.Windows.Forms Issue Pin
OriginalGriff28-May-16 6:23
mveOriginalGriff28-May-16 6:23 
QuestionGetting response from Outlook and then sending to asp .net application MVC Pin
Member 1248807427-May-16 3:22
Member 1248807427-May-16 3:22 
SuggestionRe: Getting response from Outlook and then sending to asp .net application MVC Pin
Richard Deeming27-May-16 3:56
mveRichard Deeming27-May-16 3:56 
Questionhow can i show google earth in winform c# Pin
Member 1252559627-May-16 2:37
Member 1252559627-May-16 2:37 
AnswerRe: how can i show google earth in winform c# Pin
Eddy Vluggen27-May-16 2:56
professionalEddy Vluggen27-May-16 2:56 
GeneralRe: it is show SetParent but i wanna to show placemark,polygon,etc.. how can i create it?Guide me Sir :(( Pin
Member 1252559627-May-16 3:52
Member 1252559627-May-16 3:52 
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Threading;
using System.Diagnostics;
using System.Runtime.InteropServices;
using EARTHLib;
using UnityEngine;
using System.Resources;
namespace simulation
{
public partial class Frmexe : Form
{
[DllImport("user32.dll")]
private static extern int SetParent(
int hWndChild,
int hWndParent);

[DllImport("user32.dll")]
private static extern bool ShowWindowAsync(
int hWnd,
int nCmdShow);

[DllImport("user32.dll", SetLastError = true)]
private static extern bool PostMessage(
int hWnd,
uint Msg,
int wParam,
int lParam);

[DllImport("user32.dll", EntryPoint = "SetWindowPos")]
private static extern bool SetWindowPos(
int hWnd,
int hWndInsertAfter,
int X,
int Y,
int cx,
int cy,
uint uFlags);


[DllImport("user32.dll")]
private static extern int SendMessage(
int hWnd,
uint Msg,
int wParam,
int lParam);

private const int HWND_TOP = 0x0;
private const int WM_COMMAND = 0x0112;
private const int WM_QT_PAINT = 0xC2DC;
private const int WM_PAINT = 0x000F;
private const int WM_SIZE = 0x0005;
private const int SWP_FRAMECHANGED = 0x0020;
private EARTHLib.ApplicationGE ge = null;

public Frmexe()
{
InitializeComponent();
ge = new ApplicationGE();
SendMessage(ge.GetMainHwnd(), WM_COMMAND, WM_PAINT, 0);
PostMessage(ge.GetMainHwnd(), WM_QT_PAINT, 0, 0);

SetWindowPos(ge.GetRenderHwnd(), HWND_TOP, 0, 0, (int)this.Width,
(int)this.Height-50, SWP_FRAMECHANGED);

SendMessage(ge.GetMainHwnd(), WM_COMMAND, WM_SIZE, 0);

ShowWindowAsync(ge.GetMainHwnd(), 0);
SetParent(ge.GetRenderHwnd(), this.Handle.ToInt32());
ResizeGoogleControl();

}




private void Frmexe_Resize(object sender, EventArgs e)
{
ResizeGoogleControl();
}
private void ResizeGoogleControl()
{
try
{

SendMessage(ge.GetMainHwnd(), WM_COMMAND, WM_PAINT, 0);
PostMessage(ge.GetMainHwnd(), WM_QT_PAINT, 0, 0);

SetWindowPos(ge.GetRenderHwnd(), HWND_TOP, 0, 0, (int)this.Width,
(int)this.Height-50, SWP_FRAMECHANGED);

SendMessage(ge.GetMainHwnd(), WM_COMMAND, WM_SIZE, 0);



}
catch { }

}

private void Frmexe_FormClosing(object sender, FormClosingEventArgs e)
{
System.Diagnostics.Process[] ge = System.Diagnostics.Process.GetProcessesByName("googleearth");
ge[0].Kill();
}

modified 27-May-16 10:29am.

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.