Try changing long variables in FindWindowExA to integer .