Estimado Amigo :
A continuacion te copio un codigo que realiza el cambio de resolucion,
esta compuesto por el codigo basico que lo puedes encontrar en
Internet y la parte modificada por el colega Mario Torrealba...
Espero sirva a tus propositos y nos comentas como te redulso al final.
******************************************
*Funcion RESOLPANT
* Determina la Resolucion de la Pantalla
******************************************
FUNCTION ResolPant
Declare integer GetSystemMetrics in "user32", Long nIndex
resolucionX = GetSystemMetrics()
resolucionY = GetSystemMetrics()
*=messagebox(str(resolucionX)+" X"+ str(resolucionY))
RETURN TRANSFORM(SYSMETRIC(1))+"x"+TRANSFORM(SYSMETRIC(2))
ENDFUNC
*************************************************************************************
*!* Cambia la resolución de la pantalla
*!* Sintaxis: ChangeRes(tnWidth, tnHeight)
*!* Valor devuelto: llRetVal
*!* Argumentos: tnWidth, tnHeight
*!* tnWidth especifica la nueva anchura de la pantalla en pixels
*!* tnHeight especifica la nueva altura de la pantalla en pixels
*************************************************************************************
FUNCTION ChangeRes
LPARAMETERS tnWidth, tnHeight
LOCAL lnWidth, lnHeight, lnModeNum, lcDevMode
*!* Valores
lnModeNum = 0
lcDevMode = REPLICATE(CHR(0), 156)
lnWidth = IIF(EMPTY(tnWidth), 800, tnWidth)
lnHeight = IIF(EMPTY(tnHeight), 600, tnHeight)
*!* Instrucciones DECLARE DLL para cambiar resolución
DECLARE INTEGER EnumDisplaySettings IN Win32API STRING
lpszDeviceName,;
INTEGER iModeNum, STRING @lpDevMode
DECLARE INTEGER ChangeDisplaySettings IN Win32API STRING
@lpDevMode ,;
INTEGER dwFlags
*!* Bucle para obtener todos los modos disponibles
DO WHILE EnumDisplaySettings(NULL, lnModeNum, @lcDevMode) <> 0
lnModeNum = lnModeNum +1
ENDDO
*!* Configurar la structura DevMode
lcDevMode = STUFF(lcDevMode, 41, 4, LongToStr(1572864))
lcDevMode = STUFF(lcDevMode, 109, 4, LongToStr(tnWidth)) &&
Ancho
lcDevMode = STUFF(lcDevMode, 113, 4, LongToStr(tnHeight)) &&
Alto
*!* Cambiar resolucion
ChangeDisplaySettings(@lcDevMode, 1)
ENDFUNC
*******************************************************
* En el Init inicial de la forma yo valido esto
*******************************************************
WITH thisform
* nombre sistema
.caption=tcAppName+" Conectado en: "+ALLTRIM(ComputerName())+"
Desde la Sesion de: "+ALLTRIM(UserName())
*
* preg resolucion de pantalla
*
res=resolpant()
*
DO CASE
* caso 1200x800 && laptops
CASE res="1280x800" OR res="1280x768" OR res="1280x720"
.Top=5
.Left=5
.Height=675
.Width=1005
.MaxHeight=675
.MinHeight=675
.MaxWidth=1005
.MinWidth=1005
.AutoCenter=.t.
.WindowState=2
.WindowType=0
* caso 1024x768
CASE res="1024x768"
.Top=5
.Left=5
.Height=675
.Width=1005
.MaxHeight=675
.MinHeight=675
.MaxWidth=1005
.MinWidth=1005
* cambio resolucion
*=changeres(1024,768)
* caso 800x600
CASE res="800x600"
.Top=5
.Left=5
.Height=490
.Width=785
.MaxHeight=490
.MinHeight=490
.MaxWidth=785
.MinWidth=785
* cambio resolucion
*=changeres(800,600)
OTHERWISE && 800x600
IF messagebox('Desea Colocar la Resolucion x Defecto del
Sistema SI es grande 800x600 NO es pequeña 1024x768?',292,gcn_adv) =
6
.Top=5
.Left=5
.Height=490
.Width=785
.MaxHeight=490
.MinHeight=490
.MaxWidth=785
.MinWidth=785
* cambio resolucion
=changeres(800,600)
ELSE
.Top=5
.Left=5
.Height=675
.Width=1005
.MaxHeight=675
.MinHeight=675
.MaxWidth=1005
.MinWidth=1005
* cambio resolucion
=changeres(1024,768)
ENDIF
ENDCASE
.refresh
.lockscreen = .F.
ENDWITH
* En los inits de las formas aplico esto:
with thisform && frame.page.etc
FOR I =1 TO .ControlCount
IF SUBSTR(VERSION(),16,1)="9"
.CONTROLS(I).anchor=240
ENDIF
IF LEFT(.CONTROLS(I).NAME,1)="m" && apago campos configuro
etc, etc
.CONTROLS(I).ENABLED=.f.
ENDIF
ENDFOR
endwith
Saludos,
Gabriel
(Lima-Perú)
On 10 jun, 13:46, Darío Castillejos