thanks those were good starting points that lead me to      but the problem is that all those posts including this latest one does not detect if the secondary monitor is on. if i turn my secondary monitor then off, it still thinks its on and gives me wrong dimensions.