I found the code that prints the names of all the windows open in the system. But I still can not get handle to any window in the system. My function always returns false. Why?
oh.. to make a virtual keyboard their is an easy technique... look for windows hooks. you just need to hook the key board and in the hook function, just change the character to what you want.
now when your hook program runs, who ever writes using the keyboard will get what your program will produce.
bool _WindowOperation::getWindow(char nameWindow[1024]){ // a char pointer
if ( !( nphWnd = FindWindow( (LPCWSTR)nameWindow, NULL ) ) ) // is NOT a LPCWSTR!!!!!
returnfalse;
returntrue;
}
The compiler was giving you an error for a reason. Your cast didn't solve the error, it just told the compiler to shut up.
Don't cast around compiler errors!
The solution here is to be Unicode friendly, or to not use the Unicode version of these functions. IE: remove the cast, and call FindWindowA instead of FindWindow.