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. Minimize / Maximize external Qt application

Minimize / Maximize external Qt application

Scheduled Pinned Locked Moved General and Desktop
7 Posts 3 Posters 3.2k 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.
  • ? Offline
    ? Offline
    A Former User
    wrote on last edited by
    #1

    Hello, I am trying to minimize and maximize external application from my own using function ShowWindow()...

    I tested code below with two Qt applications and it works, however, for some reason it does not work with one Qt application... I also asked on MSDN forum and they told me to ask here... Any idea why my code works with two qt applications but does not work with third?

    Here is my post on "MSDN":http://social.msdn.microsoft.com/Forums/vstudio/en-US/d88c751b-2bcb-4f69-b212-ccb7368bfb22/minimize-maximize-external-application-c?forum=vcgeneral

    @HWND hwnd = FindWindow(L"Qt5QWindowIcon", L"test1234");

    if (hwnd != 0)
    {
    ui.label->setText("Window exist");
    ShowWindow(hwnd, SW_MINIMIZE);
    }
    else
    {
    ui.label->setText("Window does not exist");
    }@

    1 Reply Last reply
    0
    • M Offline
      M Offline
      messi
      wrote on last edited by
      #2

      Can this be your solution:
      SW_FORCEMINIMIZE
      11
      Minimizes a window, even if the thread that owns the window is not responding._ This flag should only be used when minimizing windows from a different thread._

      1 Reply Last reply
      0
      • ? Offline
        ? Offline
        A Former User
        wrote on last edited by
        #3

        Does not work either...

        1 Reply Last reply
        0
        • M Offline
          M Offline
          messi
          wrote on last edited by
          #4

          Hmm. Strange.
          But you are sure that you enter the if() clause and not the else
          clause?

          Have you wrote a test program for that?

          Best regards

          Juergen

          1 Reply Last reply
          0
          • ? Offline
            ? Offline
            A Former User
            wrote on last edited by
            #5

            I tested code written above with all parameters (SW_MINIMIZE, SW_MAXIMIZE, SW_FORCEMINIMIZE...)

            One guy successfully minimized that app with FindWindow function... I don't understand why it does not work in my app...

            1 Reply Last reply
            0
            • A Offline
              A Offline
              andreyc
              wrote on last edited by
              #6
              • Do you have access to the source code of that "bad behaving" Qt application?
              • What version of Qt does that application use?
              • Can you trace the events that comes to the target app?
              1 Reply Last reply
              0
              • ? Offline
                ? Offline
                A Former User
                wrote on last edited by
                #7
                1. No
                2. Qt 5
                3. I don't understand the question...
                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