[Migrated content. Thread originally posted on 02 December 2011]
I am trying to get the screen dimensions using GetSystemMetrics from a remote PC. I am getting zeros. We are in the process of upgrading to 9.0 from 7.2. This was not an issue while using 7.2. The client machine that I am testing on is a Windows 7 64 bit machine. Below are the relevant sections of code. acuthin was actually crashing until I used the SIZE is phrase. This was not needed before...EDIT: I used to also use the DLL_CONVENTION method before, and this does not work now either.
EDIT2: I have tested this on a Windows XP machine and the result is the same.
01 SCREEN-INFO.
03 SI-WIDTH PIC X(04) USAGE IS COMP-N.
03 SI-HEIGHT PIC X(04) USAGE IS COMP-N.
03 RTN-VAL PIC 9(01).
03 SM-CXSCREEN PIC X(04) USAGE IS COMP-N
VALUE IS 0.
03 SM-CYSCREEN PIC X(04) USAGE IS COMP-N
VALUE IS 1.
....
GET-SCREEN-RESOLUTION.
INITIALIZE SI-WIDTH.
INITIALIZE SI-HEIGHT.
CALL "@[DISPLAY]:user32.dll@WINAPI"
ON EXCEPTION
CONTINUE
END-CALL.
CALL "@[DISPLAY]:GetSystemMetrics"
USING BY VALUE
SM-CXSCREEN
SIZE IS
4
RETURNING
SI-WIDTH
ON EXCEPTION
CONTINUE
END-CALL.
CALL "@[DISPLAY]:GetSystemMetrics"
USING BY VALUE
SM-CYSCREEN
SIZE IS
4
RETURNING
SI-HEIGHT
ON EXCEPTION
CONTINUE
END-CALL.
CANCEL "@[DISPLAY]:User32.dll".
.