[quote author="Andre" date="1330962444"]No idea, especially because you're not showing any of the relevant code of how you even embed the external widget in your Qt application. Show the relevant portions of the code, and perhaps somebody here can help you.[/quote]
Sorry, I thought mentioning SetParent() wouldn't leave much to speculation.
Here's how I start the child program and hook up the two windows.
@// I omitted the ShellExecuteInfo-block here
ShellExecuteEx(&ShExecInfo);
HWND childWindow = NULL;
uwid = ui.externalDock;
uwid->setAttribute(Qt::WA_NativeWindow);
WId activeWidget = uwid->effectiveWinId();
//Try finding the child window up to ten times
int i, nTries = 10;
for (i = 0; childWindow == NULL && i < nTries; i++)
{
childWindow = FindWindowA("ChildWndClass", "ChildName");
Sleep(200);
// Get a handle to the Qt widget serving as the parent window
if (activeWidget == NULL || activeWidget == 0 )
{
activeWidget = uwid->effectiveWinId();
}
}
SetWindowLong(childWindow, GWL_STYLE, WS_VISIBLE);
MoveWindow(childWindow, 0, 0, uwid->width(), uwid->height(), true);
if (childWindow==NULL)
{
emit log_message("ERROR – could not find Qt parent window.");
return;
}
SetParent(childWindow, activeWidget);@