Don't hard code viewport extents, they depend on the dc size - highlighted by gdi32...