问题
I am trying to create a software(Qt/C++). In which I need a functionality that hiding other application windows based on their window titles. Hiding means invisible not minimize. Can any body say how to achieve this?. I am currently working on Windows platform.
Note: If you provide a solution via Qt, it will give more comfort. Because it provides the platform independency.
回答1:
For Windows, if you have an HWND
to another application's window, you can call the ShowWindow function, like this:
ShowWindow(hWnd, SW_HIDE);
You can get an HWND
to another application's window using the FindWindow API function.
Interacting with other applications like this is necessarily platform-specific. There is no generic way to do this using Qt, because Qt is a framework for your application, not anybody else's.
回答2:
Here you can find a tutorial on how to make a window transparent on windows.
As mentionied before, you must find the window's handle by it's title using the API.
来源:https://stackoverflow.com/questions/6093062/c-how-to-hide-other-applications-window