Something tells me you might find AdjustWindowRect() helpful.