GetWindowRect and GetSystemMetrics - Programmers Heaven

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

GetWindowRect and GetSystemMetrics

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

  • AsmGuru62AsmGuru62 Posts: 6,519Member
    [b][red]This message was edited by AsmGuru62 at 2002-10-11 6:48:42[/red][/b][hr]
    : 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]


Sign In or Register to comment.