You can get the screen resolution using the function GetDeviceCaps with HORZRES and VERTRES