Hello,

I have a simple Win32 application, with mainwindow hWnd. Nothing special, just a sample Win32 app with a main window created with the VC++ 2005 wizard.

Then I added this:

Qt Code:
  1. QWinWidget * pWinWidget_ = new QWinWidget(hWnd);
  2. QDialog * pDialog_ = new QDialog(pWinWidget_, Qt::FramelessWindowHint);
  3. pDialog_->setWindowModality(Qt::NonModal);
  4. pDialog_->setLayout(new QGridLayout() );
  5.  
  6. QTextEdit * pTextEdit_ = new QTextEdit(pDialog_);
  7. pDialog_->layout()->setMargin(0);
  8. pDialog_->layout()->addWidget(pTextEdit_);
  9.  
  10. pTextEdit_->show();
  11. pDialog_->show();
To copy to clipboard, switch view to plain text mode 

When clicking the editbox, the mainwindow will de-activate. In other words: to minimize it, I have to click twice on the mainwindow. 1 time to activate the main window and 1 time to minimize it.

I want the dialog to behave modeless and it must - not - deactivate the parent.

Is that possible?

Arthur