I have a window into which I would like to run Google Earth.
With CreateProcess Google Earth runs but outside my program.
How could I do?
I thought searching for the window hadle of Google Earth and setting it has a child window of my program.
Is it a solution?
Do you mean something like this?void DoTest(HWND hWnd)
{
WinExec(TEXT("notepad.exe"), SW_HIDE);
Sleep(500);
HWND hWndChild = FindWindow(TEXT("Notepad"), NULL);
SetParent(hWndChild, hWnd);
RECT rect;
GetClientRect(hWnd, &rect);
MoveWindow(hWndChild, 0, 0, rect.right, rect.bottom, 0);
ShowWindow(hWndChild, SW_SHOW);
}
Here is what I did :
WM_CREATE :
hGoogleEarth = FindWindow("Qt5QWindowIcon",NULL) ;
SetParent(hGoogleEarth,hMainWindow) ;
into WM_DESTROY :
SetParent(hGoogleEarth,hMainWindow) ;
(https://www.mediafire.com/convkey/a5b6/8o83yhzxm5mqset6g.jpg)
The rest is into WM_SIZE
Thank you MS SPY.
Thank You Timo too.
My Blog for it (https://md5finder.blogspot.com/2019/10/trajets-france.html) (Sorry, in French)