Moinmoin,
als hauptsächlicher C++-Linuxcoder will ich mich im Moment doch nochmal an Windows probieren. Folgender Code bereitet mir Kopfschmerzen:
Als Ausgabe kommt 0012FC74. Ich hätte aber viel lieber "Mozilla Firefox" oder irgendwie sowas. Wodran liegts?
Viele Grüße
als hauptsächlicher C++-Linuxcoder will ich mich im Moment doch nochmal an Windows probieren. Folgender Code bereitet mir Kopfschmerzen:
Code:
#include <Windows.h>
#include <iostream>
#include <atlbase.h>
using namespace std;
int main(int argc, char* argv[])
{
POINT punkt;
GetCursorPos(&punkt);
Sleep(1000);
HWND handle = WindowFromPoint(punkt);
TCHAR szWindowText[100]; // darin wird der Titel gespeichert
GetWindowText(hKonsole, szWindowText, 100); // Titel mit hwnd holen cout << szWindowText << endl;
Als Ausgabe kommt 0012FC74. Ich hätte aber viel lieber "Mozilla Firefox" oder irgendwie sowas. Wodran liegts?
Viele Grüße