what is wrong with this code?when i run my program with this code, it says "has encountered an error and needs to close", the last line is causing the error Code: wstring windowNameWstr = L"Untitled - Notepad"; HWND windowHandle = FindWindowW(NULL, windowNameWstr.c_str()); cout << windowHandle; DWORD* procID; GetWindowThreadProcessId(windowHandle, procID); what is wrong?
@_corn_ i dont know but try replacing HWND windowHandle = FindWindowW(NULL, windowNameWstr.c_str()); with HWND windowHandle = FindWindowA(NULL,"Untitled - Notepad")