如何找出类名和放大器平铺的程序在c ++? [英] How to find out class name & tiled of program in c++?

查看:136
本文介绍了如何找出类名和放大器平铺的程序在c ++?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

问题是如何从运行程序中找出类名。该程序的标题,我知道已经存在一些扫描工具,如窗口或spy ++从visual studio,但我要求你是如何使这些程序像我们自己的源代码,使用什么函数,是有一些开源程序这可以帮助?代码欣赏,链接也:

the question is how to find out class name from running programs & title of that programs, i know that already exist some scanning tools like windowse or spy++ from visual studio, but what i asking you is how to make programs like those in our own source code, what function to use, is there some open source program that can help? Code appreciate, link's also :)

推荐答案


  1. 使用 EnumWindows

将句柄传递到 GetWindowText GetClassName

Pass the handle to GetWindowText and GetClassName to get the window title and window class respectively.

示例:

EnumWindows(EnumProc, 0);

...

BOOL CALLBACK EnumProc(HWND hWnd, LPARAM lParam) {
  TCHAR title[256];
  TCHAR className[256];

  GetWindowText(hWnd, title, 256);
  MessageBox(NULL, title, NULL, MB_OK);

  GetClassName(hWnd, className, 256);
  MessageBox(NULL, className, NULL, MB_OK);

  return TRUE;
}

这篇关于如何找出类名和放大器平铺的程序在c ++?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆