I posted an earlier question about screen size, as i tested GetDesktopWindow and getWindowRect i notice that getWindowRect will give me the same width and height as GetSystemMetrics for SM_CXSCREEN and SM_CYSCREEN. So now i am wondering is there a difference between the two APIs ? What i mean is, why would one use one function instead of the other or better when would one would pick one versus the other.
Thanks much.
Comments
: I posted an earlier question about screen size, as i tested GetDesktopWindow and getWindowRect i notice that getWindowRect will give me the same width and height as GetSystemMetrics for SM_CXSCREEN and SM_CYSCREEN. So now i am wondering is there a difference between the two APIs ? What i mean is, why would one use one function instead of the other or better when would one would pick one versus the other.
: Thanks much.
:
[blue]1. Logically, [b]GetSystemMetrics()[/b] should be used, because it talks about the system, [b]GetWindowRect()[/b] on the other hand will work with [b]HWND[/b].
2. Besides, with [b]GetWindowRect()[/b] you have to call also [b]GetDesktopWindow()[/b] - so you call 2 functions instead of one. It is slower... and more code to write. All programming principles (faster and smaller code) are not in agreement.[/blue]