Hook a QT Application with C++ to capture textname of the application
来源:互联网 发布:淘宝商品白底素材原图 编辑:程序博客网 时间:2024/06/05 15:47
原文地址::http://stackoverflow.com/questions/3278415/hook-a-qt-application-with-c-to-capture-textname-of-the-application
相关文章
1、Is it possible to use Win32 Hooks in Qt applications----http://stackoverflow.com/questions/2167876/is-it-possible-to-use-win32-hooks-in-qt-applications
I have a simple QT application running on Win32 platform. I need to write a C++ program described as: the input is the windows handle of that QT application, which is already available, the output is the text name ( AKA caption ) of the application. I hope someone will show me the way to do this right. Thanks a lot. Smile
2 Answers
I don't know if I completely understand your question, but you could simply use the GetWindowText
function (part of the Windows API) to obtain the title of a window. You must of course pass a native window handle (HWND
) to this function, QWidget::winID()
is the Qt way to retrieve it.
http://doc.trolltech.com/4.6/qwidget.html#windowTitle-prop
This property holds the window title (caption).This property only makes sense for top-level widgets, such as windowsand dialogs. If no caption has been set, the title is based of the windowFilePath. If neither of these is set, then the title is an empty string.
so, just ask the QMainWindow you are using about the windowTitle()
.
I have a simple QT application running on Win32 platform. I need to write a C++ program described as: the input is the windows handle of that QT application, which is already available, the output is the text name ( AKA caption ) of the application. I hope someone will show me the way to do this right. Thanks a lot. Smile
2 Answers
I don't know if I completely understand your question, but you could simply use the GetWindowText
function (part of the Windows API) to obtain the title of a window. You must of course pass a native window handle (HWND
) to this function, QWidget::winID()
is the Qt way to retrieve it.
http://doc.trolltech.com/4.6/qwidget.html#windowTitle-prop
This property holds the window title (caption).This property only makes sense for top-level widgets, such as windowsand dialogs. If no caption has been set, the title is based of the windowFilePath. If neither of these is set, then the title is an empty string.
so, just ask the QMainWindow you are using about the windowTitle()
.
- Hook a QT Application with C++ to capture textname of the application
- Cannot connect to X server :0.0 with a Qt application
- How to Hook the Mouse to Catch Events Outside of your application
- How to capture application log
- Application windows are expected to have a root view controller at the end of application launch
- Application windows are expected to have a root view controller at the end of application launch
- 'Application windows are expected to have a root view controller at the end of application launch'
- Application windows are expected to have a root view controller at the end of application launch
- 'Application windows are expected to have a root view controller at the end of application launch'
- “Application windows are expected to have a root view controller at the end of application launch”
- Application windows are expected to have a root view controller at the end of application launch'
- Application windows are expected to have a root view controller at the end of application launch
- 'Application windows are expected to have a root view controller at the end of application launch'
- Application windows are expected to have a root view controller at the end of application launch
- 'Application windows are expected to have a root view controller at the end of application launch' [
- Bring application to foreground with a keypress
- Hook API of Console Application
- Unable to find a version of the runtime to run this application.【matlab】
- 齐次线性方程组
- 设计模式之----单例(Singleton )
- Spring AOP四种实现方式Demo详解与相关知识探究
- 特征值与特征向量
- Mac下 monkey配置
- Hook a QT Application with C++ to capture textname of the application
- 图像金字塔
- 仿射变换
- UE4 缓存过大的问题
- Failure [INSTALL_FAILED_UID_CHANGED]
- Cross-Entropy Loss 与Accuracy的数值关系
- 关于行列式
- Spring工作机制及为什么要用
- 2016书单