Assuming your making a app not a DLL you will need to use WriteProcessMemory.
For more Info : WriteProcessMemory
also need the handle witch I would use OpenProcess
Some old code I found to help you
[php]
void hookwarrock ()
{
int pcheck = 1;
while ( pcheck == 1 ){
HWND hWnd = FindWindow(0, "WarRock");
if(hWnd == NULL)
{
Sleep(50) ;
}
else
{
pcheck = 2;
GetWindowThreadProcessId(hWnd, &proc_id);
hProcess = OpenProcess(PROCESS_ALL_ACCESS, FALSE, proc_id);
}
}
}
[/php]
This was compiled with Dev-C++ so you mite need to change some stuff but that should get you started.
also A good tutorial [Tutorial] - C++ Trainer Tutorial[Updated] - *************