Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Video Resolution
Message
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00125079
Message ID:
00125089
Views:
20
>Hi,
>
>Is there any way to know which is the video resolution that is being used in a computer ? And the installed memory ?
>
>Regards,

Hi again Jose,

I forgot about the installed physical memory. While there isn't a VFP function that will tell you, you can get it from the Windows API. You'll need the following:
* Simulate MEMORYSTATUS structure
lcmemstatus = SPACE(32)
* Declare the function
DECLARE GlobalMemoryStatus IN Win32API;
  STRING @lpBuffer
= GlobalMemoryStatus(@lcmemstatus)
* Total Physical Memory is in bytes 9-12
lctotalmem = SUBSTR(lcmemstatus, 9, 4)
Once this is done you'll need to covert the above portion of the string to a numeric value. Something like this:
lnresult = 0
FOR lni = 1 TO 4
  lnresult = lnresult + ASC(SUBSTR(lctotalmem, lni, 1)) * (256 ^ (lni - 1))
NEXT
lnresult will accurately contain the number of bytes in installed memory.
George

Ubi caritas et amor, deus ibi est
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform