The following method demonstrates how we can close any kind of window, using its PID.
Use the "Get Details of Element in Window" Action in order to get the details of a random element within the window of interest.
In the Advanced tab of the Action's properties window, set the Attribute Name to processid.
The output of the above will be the PID.
Now close the window by terminating the corresponding windows process, using the "Terminate Process" Action. Configure the Action's properties window as follows:
Specify Process by: Process ID
Process ID: output of the previous Action