Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. How to get another process window handle using qt
Qt 6.11 is out! See what's new in the release blog

How to get another process window handle using qt

Scheduled Pinned Locked Moved General and Desktop
9 Posts 5 Posters 16.1k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • A Offline
    A Offline
    aashish.lg
    wrote on last edited by
    #1

    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

    1 Reply Last reply
    0
    • G Offline
      G Offline
      goetz
      wrote on last edited by
      #2

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

      http://www.catb.org/~esr/faqs/smart-questions.html

      1 Reply Last reply
      0
      • Z Offline
        Z Offline
        zeljko
        wrote on last edited by
        #3

        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.

        1 Reply Last reply
        0
        • G Offline
          G Offline
          goetz
          wrote on last edited by
          #4

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

          http://www.catb.org/~esr/faqs/smart-questions.html

          1 Reply Last reply
          0
          • A Offline
            A Offline
            aashish.lg
            wrote on last edited by
            #5

            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.

            1 Reply Last reply
            0
            • Z Offline
              Z Offline
              zeljko
              wrote on last edited by
              #6

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

              1 Reply Last reply
              0
              • H Offline
                H Offline
                hdarama
                wrote on last edited by
                #7

                Is your problem solved ?

                http://www.d-programming-language.org/

                1 Reply Last reply
                0
                • A Offline
                  A Offline
                  aashish.lg
                  wrote on last edited by
                  #8

                  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

                  1 Reply Last reply
                  0
                  • Z Offline
                    Z Offline
                    zeFree
                    wrote on last edited by
                    #9

                    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

                    1 Reply Last reply
                    0

                    • Login

                    • Login or register to search.
                    • First post
                      Last post
                    0
                    • Categories
                    • Recent
                    • Tags
                    • Popular
                    • Users
                    • Groups
                    • Search
                    • Get Qt Extensions
                    • Unsolved