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. [SOLVED] Show HWND from a win32 application in a QMdiSubwindow

[SOLVED] Show HWND from a win32 application in a QMdiSubwindow

Scheduled Pinned Locked Moved General and Desktop
4 Posts 3 Posters 1.3k Views
  • 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.
  • S Offline
    S Offline
    Stefan
    wrote on last edited by Stefan
    #1

    Hello everyone,

    my job is to replace the GUI of a win32 application by Qt. The application is quite complex and we want a step by step integration of the graphical elements. Is it possible to show a HWND from an existing win32 application in a QMdiSubwindow?

    I have found the QWinHost Documentation, but I am not sure if this is the right approach. Does anyone have experience with it?

    Thanks in advance.

    Stefan

    1 Reply Last reply
    0
    • R Offline
      R Offline
      Rondog
      wrote on last edited by Rondog
      #2

      That link is old (Qt 3.x). This class might not exist in current versions of Qt.

      I assume you want to minimize changes to the parts of the program that use SendMessage() as much as possible. I believe you can get the HWND value for all widgets (winId() ?) although I have not tried this. You will need to setup a callback function as well to monitor for messages.

      I would avoid this if I were you. Hopefully your application separated the GUI from the program which will help when porting (usually is not the case). The signal/slot from Qt would be the replacement for SendMessage() for user defined messages.

      1 Reply Last reply
      1
      • JKSHJ Offline
        JKSHJ Offline
        JKSH
        Moderators
        wrote on last edited by
        #3

        Hi @Stefan, and welcome to the Qt Dev Net!

        That functionality is not officially supported in Qt 5. It's kind of possible, but it's buggy.

        See here for an example: https://forum.qt.io/topic/43708/can-t-receive-key-and-mouse-wheel-events-after-qwidget-createwindowcontainer

        Qt Doc Search for browsers: forum.qt.io/topic/35616/web-browser-extension-for-improved-doc-searches

        1 Reply Last reply
        0
        • S Offline
          S Offline
          Stefan
          wrote on last edited by
          #4

          Thank you for your advice, i guess we have to refactor parts of the code to meet our goal.

          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