MrComan
Onaylı Üye
C++:
#include <iostream>
#include <windows.h>
#include <Windows.h>
// FindWindows();
// GetWindowThreadProcessId();
// OpenProcess();
//WriteProcessMemory();
using namespace std;
int main()
{
int newValue = 500;
HWND hWnd = FindWindow(0, "ac_Clinet");
if (hWnd == 0) {
cerr << ("Cannot find file") << endl;
}
else {
DWORD pId;
GetWindowThreadProcessId(hWnd, &pId);
HANDLE hProc = OpenProcess(PROCESS_ALL_ACCESS, FALSE, pId);
if (!hProc) {
cerr << ("Cannot open Process") << endl;
}
else
{
int isSussessful = WriteProcessMemory(hProc, (LPVOID)0X00EDA5D8, &newValue, (DWORD)sizeof(newValue), NULL);
if (isSussessful > 0)
{
clog << "Process Memory Written." << endl;
}
else
{
cerr << ("Cannot Write Process Memory.") << endl;
}
CloseHandle(hProc);
}
}
return 0;
}
Burda program ismini hatalı gösteriyor erorlar bunlar : E0167 VE C2664
Hata (etkin) E0167 "const char *" türündeki bağımsız değişken "LPCWSTR" türü parametre ile uyumsuz1
Hata C2664 'HWND FindWindowW(LPCWSTR,LPCWSTR)' : 2 bağımsız değişkeni 'const char [10]' değerinden 'LPCWSTR' değerine dönüştürülemez