!D.X_Vsize / !D.Y_Vsize

Reports the height and width of the current graphics window in pixels. The values are updated when the window is resized.