Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

How to get another process window handle using qt



  • Hi,

    I am trying to get the window handle of the mstsc window using qt.
    In win32 I can do it using win32 api HWND hMSTSCWindow = FindWindow(L"TSSHELLWND", NULL);
    is there something similar exist in qt, same stuff I would like to try in Linux as well, there I will be looking for XRDP window handle

    Regards
    Ashish



  • "QWidget::winId() ":/doc/qt-4.8/qwidget.html#winId could be what you need.



  • I'm not sure that QWidget::winId() is useable in his case. He want non-application window.
    eg. for embedding firefox into qt app, so I guess that he need direct calls to X11.



  • In that case, there is no Qt method to retrieve the id. One will have to resort to platform dependent code.



  • ok if this is the case then I can write a code for separate plattform.
    But is it possible to make my qt application window as a child of another win32/X11 application.

    Actually I wanted to move my qt application in mstsc window.
    I have seen a method in QWidget named as setParent(QWidget *). But even I use plattform specific code to get the window id, can we make qt application as a child of this using qt api only?

    Currently I hace achieved this using plattform specific code as setParent under windows , it works well but I am looking for qt way to do this.



  • No Qt does not have such ability. You have to do it on your own for each platform separatelly (but it's possible).



  • Is your problem solved ?



  • Hi,

    Thanks for your suggestion, I wrote code for windows and it works well,
    I am able to move my qtApp as a child of mstsc, yet to give a try for X11 system.

    Regards
    Ashish



  • Hello Guys,

    I was just browsing thru and came to this question.
    Although it seems that Ashish's problem is solved - still I think you all would be interested in going thru this link about the QxtWindowSystem Class:
    http://libqxt.bitbucket.org/doc/0.6/qxtwindowsystem.html

    I hope I've added a useful link to the discussion.

    Regards,
    zeFree


Log in to reply