Create your Gitee Account
Explore and code with more than 12 million developers,Free private repositories !:)
Sign up
文件
Clone or Download
main.cpp 1.19 KB
Copy Edit Raw Blame History
01116284 authored 2019-04-30 12:51 . init
#define WIN32_LEAN_AND_MEAN
#include <windows.h>
#include <iostream>
#include <string.h>
#pragma comment( lib, "kernel32" )
int index = 0;
BOOL CALLBACK EnumMainTVWindow(HWND hwnd, LPARAM lParam) {
if (index <= 1) {
const int BufferSize = 1024;
char BufferContent[BufferSize] = "";
SendMessage(hwnd, WM_GETTEXT, (WPARAM) BufferSize, (LPARAM) BufferContent);
// printf("----------------%s\n", BufferContent);
const int nameSize = 10;
char name[nameSize] = "";
//获取前两个输入框 第一个表示id,第二个为password
GetClassName(hwnd, name, nameSize);
if (strstr(name, "Edit") != NULL) {
if (strlen(BufferContent) == 0) {
return 1;
}
if (index == 0) {
printf("\"id\" : \"%s\",", BufferContent);
} else {
printf("\"password\" : \"%s\"", BufferContent);
}
index++;
}
}
return 1;
}
int main() {
HWND hwndTeamViewer = FindWindow(NULL, "TeamViewer");
printf("{");
if (hwndTeamViewer) {
EnumChildWindows(hwndTeamViewer, EnumMainTVWindow, 0);
}
printf("}");
return 0;
}
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化