Código:
main.obj : error LNK2028: se hace referencia al símbolo (token) sin resolver (0A00003E) "extern "C" int __stdcall MessageBoxA(struct HWND__ *,char const *,char const *,unsigned int)" (?MessageBoxA@@$$J216YGHPAUHWND__@@PBD1I@Z) en la función "extern "C" int __cdecl MessageBox(struct HWND__ *,char const *,char const *,unsigned int)" (?MessageBox@@$$J0YAHPAUHWND__@@PBD1I@Z)[code]
nose q mas probar porfavor ayuda xD (cambiando de unicode a multibyte tmapoco se soluciona) Pd: si lo compilo con devc++ funciona perfect el code es el siguiente:
[code]#include <windows.h>
int main()
{
HWND hWnd = FindWindow(0, "Calculator");
if(hWnd == 0)
{
MessageBox(0, "Error cannot find window.", "Error", MB_OK|MB_ICONERROR);
}
else
{
DWORD proccess_ID;
GetWindowThreadProcessId(hWnd, &proccess_ID);
HANDLE hProcess = OpenProcess(PROCESS_ALL_ACCESS, FALSE, proccess_ID);
if(!hProcess)
{
MessageBox(0, "Could not open the process!", "Error!", MB_OK|MB_ICONERROR);
}
else
{
int newdata = 500;
DWORD newdatasize = sizeof(newdata);
if(WriteProcessMemory(hProcess, (LPVOID)0x57C2A4, &newdata, newdatasize, NULL))
{
MessageBox(NULL, "WriteProcessMemory worked.", "Success", MB_OK + MB_ICONINFORMATION);
}
else
{
MessageBox(NULL, "Error cannot WriteProcessMemory!", "Error", MB_OK + MB_ICONERROR);
}
CloseHandle(hProcess);
}
}
return 0;
}