STM32F4 HAL Library Button Interrupt
@Bence
I checked MXCube generated code and it solved the problem much easier. 
It does not require the "callback" function, only "handler".

@Tut
Yes you're right. It requires a loop in main code.

Changes in my code:

1)

void HAL_GPIO_EXTI_Callback (uint16_t GPIO_Pin)


Deleted

2)

void EXTI0_IRQHandler(void)


Changed to

void EXTI0_IRQHandler(void)
{
  /* USER CODE BEGIN EXTI0_IRQn 0 */
    if(HAL_GPIO_ReadPin(GPIOA, GPIO_PIN_0)) HAL_GPIO_TogglePin(GPIOD, 
GPIO_PIN_12);
  HAL_Delay(50);
    /* USER CODE END EXTI0_IRQn 0 */
  HAL_GPIO_EXTI_IRQHandler(GPIO_PIN_0);
  /* USER CODE BEGIN EXTI0_IRQn 1 */

  /* USER CODE END EXTI0_IRQn 1 */


}

3)
Added

while(1)
{

}


4)
Button pull options is changed to "GPIO_NOPULL".