私は、Microsoft リモート アシスタンス (msra.exe) を使用するときの生活を楽にする小さなプログラムに取り組んでいます。C++ を使用して、msra.exe を開き、ウィンドウ ハンドルを見つけることができます。次に、子ウィンドウ(ボタン)を見つけて、それらと対話したいと考えています。ただし、必要なボタンが見つからないという問題があるようです。Spy++ は、ボタンに次のテキストがあることを示しています。
Window 004902F4 「信頼できる人に助けを求める」ボタン。
私のプログラムは、この文字列を検索すると、ボタンが存在しないことを返します。誰にもアイデアはありますか?コードは次のとおりです。
#include "stdafx.h"
#include <windows.h>
#include <string>
#include <sys/types.h>
#include <stdlib.h>
#include <Windows.h>
#include <process.h>
using std::string;
void openRA(void * dummy);
int _tmain(int argc, _TCHAR* argv[])
{
_beginthread(openRA, 0, NULL);
Sleep(1000);
HWND handle = NULL;
handle = FindWindow(NULL, TEXT("Windows Remote Assistance"));
if(handle == NULL){
printf("handle was null\n");
}
else{
printf("handle was not null\n");
}
HWND button1 = NULL;
Sleep(1000);
button1 = FindWindowEx(handle, 0, 0, TEXT("Invite someone you trust to help you"));
if(button1 == NULL){
printf("Button1 was null");
}
else{
printf("I found he button!");
}
fflush(stdout);
return 0;
}
void openRA( void * dummy){
printf("I'm inside this function\n");
system("msra.exe &");
}
編集:
これは、spy++ が表示するイメージです。