Howdy, Stranger!

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

Sign In with Facebook Sign In with Google Sign In with OpenID

Categories

We have migrated to a new platform! Please note that you will need to reset your password to log in (your credentials are still in-tact though). Please contact lee@programmersheaven.com if you have questions.
Welcome to the new platform of Programmer's Heaven! We apologize for the inconvenience caused, if you visited us from a broken link of the previous version. The main reason to move to a new platform is to provide more effective and collaborative experience to you all. Please feel free to experience the new platform and use its exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.

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.