Determine window dimensions based on client area instead of hardcoded values.

This also fixes a bug I experienced in Windows 8.1 64-bit wherein the drawn image extended past the edge of the window bounds. For example, the right and bottom scroll bars were not completely visible.
Add support for Visual Studio 2013.