[C++] 纯文本查看 复制代码 // ChangeText.cpp : This file contains the 'main' function. Program execution begins and ends there.
//
#include <iostream>
#include <atlstr.h>
#include <Windows.h>
BOOL CALLBACK EnumWindowsProc(
_In_ HWND hWnd,
_In_ LPARAM lParam
) {
printf("hWnd: %x\n", hWnd);
WCHAR className[64];
CString text;
::GetClassName(hWnd, className, _countof(className));
if (::_wcsicmp(className,L"_EL_Label") == 0) {
SetWindowText(hWnd, L"Hello 52pojie.");
InvalidateRect(hWnd, NULL, TRUE);
}
else {
::ShowWindow(hWnd,SW_HIDE);
}
return TRUE;
}
int main()
{
std::wstring text = L"Hello World!\n";
HWND hWnd = FindWindow(L"WTWindow", NULL);
EnumChildWindows(hWnd, EnumWindowsProc, NULL);
}
|