mardi 8 mai 2018

C++ cant find cmd using FindWindow()

#include<iostream>
#include<Windows.h>

using namespace std;

int main()
{
    HWND handle = FindWindow("ConsoleWindowClass","C:\WINDOWS\system32\cmd.exe");
    if (handle == NULL)
        cout << "Window not found" << endl;
    else
        cout << "Window found " << endl;

    system("pause");
    return 0;

}

I tried using this code to find handle of the running cmd application , But FindWindow() is unable to find the handle.It shows Winodw not found.Pls help.

Aucun commentaire:

Enregistrer un commentaire