Screen resolution detection
The application I am testing is a VB6 app with TestPartner version is 6.1.0. I find that tests playback fine in one screen resolution, but when I playback from a different PC, where the screen resolution is not set the same, playback is not doing what it should be doing.
There are many custom controls in this applicaiton and I see a fair number of x,y coordinates in the recorded tests, and this is fine, it is a limitation of the system we are testing. We have set as a standard that all tests should be recorded at a particular resolution.
What I would like to do is prior to running my test(s), check that the resolution matches what we have set as our standard.
Anyone have any VB script that would detect the screen resolution?
Re: Screen resolution detection
No worries, i found something online
Private Declare Function GetSystemMetrics Lib "user32.dll" (ByVal nIndex As Long) As Long
Const SM_CXSCREEN = 0
Const SM_CYSCREEN = 1
Dim x As Long
Dim y As Long
Dim MyMessage As String
Dim MyResponse As VbMsgBoxResult
x = GetSystemMetrics(SM_CXSCREEN)
y = GetSystemMetrics(SM_CYSCREEN)
If x = 1280 And y = 1024 Then
MyMessage = "Your current screen resolution is " & x & " X " & y & vbCrLf & "These tests were designed " & _
" to run with a screen resolution of 1280 X 1024 and will not function properly " & _
"with your current settings." & vbCrLf & "Please adjust your resolution and re-run the test?"
MyResponse = MsgBox(MyMessage, vbExclamation, "Incorrect Screen Resolution")