Assume no frictional/parasitic loss... An impulse was provided to the bullet from the expanding gas. The force that projected the bullet is equal and opposite to the force provided to the hand gun. Since we ignore loss, the momentum of the bullet is completely conserved until it hits the glass, at this point the bullet contributes an impulse to the glass equal to its momentum over the period of time it went from top speed to stopped. You can assume that the time from gun powder combustion to the bullet leaving the barrel is approximately equal to the time that the bullet hit the glass to when it stopped moving forward. Same force, same impulse... conservation of momentum.