C++ - How to hide other application's window

落爺英雄遲暮 提交于 2019-12-10 23:51:06

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!