Minimize / Maximize external Qt application
-
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");
}@ -
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._ -
Does not work either...
-
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
-
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...
-
- 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?
-
- No
- Qt 5
- I don't understand the question...