Ich möchte gerne den Window Title von einem Programm herausfinden.
Mein Code bis jetzt:
Code:
#include "stdafx.h"
#include <Windows.h>
#include <iostream>
#include <ostream>
#include <iostream>
#include <fstream>
#include <string>
using namespace std;
int main()
{
HWND hWnd = FindWindow(NULL, L"VLC Media Player");
cout << hWnd << endl;
int length = GetWindowTextLength(hWnd);
string WndwTitle[sizeof(length)];
GetWindowText(hWnd, (LPWSTR)WndwTitle, length);
cout << WndwTitle << endl;
cin.get();
return 0;
}
Das soll mal ein Programme werden, dass mir den Song in eine .txt datei schreibt der grade abgespielt wird also wundert euch nicht über die Includes und warum ich den Title herausfinden will.






