#include <iostream>
#include <Windows.h>

using namespace std;

int main()
{
  EnumWindows([](HWND hwnd, LPARAM lParam)  {
	DWORD  pid = 0;
	GetWindowThreadProcessId(hwnd, &pid);
	if (pid == GetCurrentProcessId()) // 判断pid
	{
		char text[1024];
		GetWindowTextA(hwnd, (LPSTR)text, 1024); // 必须含有标题文字
		if (strlen(text) != 0 && IsWindowVisible(hwnd))
		{
			// printf("%s\n", text);
			targetWindow = hwnd;
			return FALSE;
		}
	}
	return TRUE;
  }, 7632);

  return 0;
}

相关文章:

  • 2022-01-31
  • 2021-05-15
  • 2021-12-27
  • 2021-12-10
  • 2022-12-23
猜你喜欢
  • 2021-12-12
  • 2021-10-03
  • 2022-12-23
  • 2022-03-09
  • 2022-01-08
相关资源
相似解决方案