Thanks for the fixes (V2017.4.11)

Unfortunately has now a new error

SetErrorMode(2)
SetWindowPosition(GetMaxDeviceWidth()/2-GetDeviceWidth()/2,GetMaxDeviceHeight()/2-GetDeviceHeight()/2)
local dx as integer
local dy as integer
local mx as integer
local my as integer
while GetRawKeyPressed(27)=0
dx=GetDeviceWidth()
dy=GetDeviceHeight()
SetScreenResolution(dx,dy)
SetVirtualResolution(dx,dy)
mx=20 //GetPointerX()-20
my=20 //GetPointerY()-20
drawline( mx,my, mx,my, -1,-1)
drawline( mx-3,my, mx-8,my, -1,-1)
drawline( mx+3,my, mx+8,my, -1,-1)
drawline( mx,my-3, mx,my-8, -1,-1)
drawline( mx,my+3, mx,my+8, -1,-1)
sync()
endwhile

Here an more accurate error analysis

SetErrorMode(2)
SetWindowPosition(GetMaxDeviceWidth()/2-GetDeviceWidth()/2,GetMaxDeviceHeight()/2-GetDeviceHeight()/2)
local dx as integer
local dy as integer
local count as float
while GetRawKeyPressed(27)=0
dx=GetDeviceWidth()
dy=GetDeviceHeight()
SetScreenResolution(dx,dy)
SetVirtualResolution(dx,dy)
for count=0 to 359.9 step 0.1
drawline( 50+cos(count)*30,50+sin(count)*30, 50+cos(count)*40,50+sin(count)*40, -1,-1 )
next
sync()
endwhile