I have a plan for make a simple trainer console with C++ but first step I've got problem with FindWindow()
#include <stdio.h>
#include <cstdlib>
#include <windows.h>
#include <winuser.h>
#include <conio.h>
LPCTSTR WindowName = "Mozilla Firefox";
HWND Find = FindWindow(NULL,WindowName);
int main(){
if(Find)
{
printf("FOUND
");
getch();
}
else{
printf("NOT FOUND");
getch();
}
}
The above code I use to try whether the command FindWindow() but when I execute the output always show
NOT FOUND
I've replaced Character Set on property Project from
Use Unicode Character Set
to
Use Multi-Byte Character Set
and
LPCTSTR
to
LPCSTR
or
LPCWSTR
but the result always the same, I hope anyone can help me.
See Question&Answers more detail:os