bool unlockcursor= false;
if(GetAsyncKeyState(VK_INSERT)<0){
if(unlockcursor){
PTC("CursorCenter 0");
unlockcursor = false;
} else {
PTC("CursorCenter 1");
unlockcursor = true;
}
}
void UnlockArrow()
{
HMODULE hMyMod = NULL;
hMyMod = GetModuleHandle("USER32.dll");
if(hMyMod){
DWORD dwTemp = NULL;
dwTemp = (DWORD)GetProcAddress(hMyMod, "SetCursorPos");
if(dwTemp){
DWORD dwProtect;
VirtualProtect((void*)dwTemp, 3, PAGE_EXECUTE_READWRITE, &dwProtect);
memcpy((void*)dwTemp, &UnlockMouse, 3);
VirtualProtect((void*)dwTemp, 3, dwProtect, &dwProtect);