CAMBIO RESOLUCION PANTALLA
Manuel:
No tengo xHarbour 99.61 para hacer la prueba, me olvide mencionar que uso Windows XP SP2
Saludos
No tengo xHarbour 99.61 para hacer la prueba, me olvide mencionar que uso Windows XP SP2
Saludos
SOI, s.a. de c.v.
estbucarm@gmail.com
http://www.soisa.mex.tl/
http://sqlcmd.blogspot.com/
Tel. (722) 174 44 45
Carpe diem quam minimum credula postero
estbucarm@gmail.com
http://www.soisa.mex.tl/
http://sqlcmd.blogspot.com/
Tel. (722) 174 44 45
Carpe diem quam minimum credula postero
- Manuel Valdenebro
- Posts: 706
- Joined: Thu Oct 06, 2005 9:57 pm
- Location: Málaga-España
Re: CAMBIO RESOLUCION PANTALLA
hola manuel:
tu "ya está solucionado" realmente si funciona!!!
usando tu ejemplo, he creado esta rutina:
#include 'fivewin.ch'
#Include "dll.ch"
#Include "Struct.ch"
FUNCTION MAIN()
LOCAL nResoAncho := GetSysMetrics(0)
IF nResoAncho > 800
CamReso ( 800, 600)
MSGINFO('HECHO. AQUI PUEDES INICIAR TU PROGRAMA ELABORADO PARA 800 X 600')
ENDI
RETU nil
Function CamReso(nAncho, nAlto)
Local DM_PELSWIDTH := nHex("80000")
Local DM_PELSHEIGHT := nHex("100000")
Local oDevMode
Local lPosible
Local cBuffer
Local lCamReso := .f.
DEFAULT nAncho := GetSysMetrics(0), ;
nAlto := GetSysMetrics(1)
STRUCT oDevMode
MEMBER cDevName AS STRING LEN 32
MEMBER nSpecVer AS WORD
MEMBER nDrvVer AS WORD
MEMBER nSize AS WORD
MEMBER nDrvExtra AS WORD
MEMBER nFields AS DWORD
MEMBER nOrientat AS WORD
MEMBER nPaperSiz AS WORD
MEMBER nPaperLen AS WORD
MEMBER nPaperWid AS WORD
MEMBER nScale AS WORD
MEMBER nCopies AS WORD
MEMBER nDefSrc AS WORD
MEMBER nPrnQlty AS WORD
MEMBER nColor AS WORD
MEMBER nDuplex AS WORD
MEMBER nYResolut AS WORD
MEMBER nTTOpt AS WORD
MEMBER nCollate AS WORD
MEMBER cFormName AS STRING LEN 32
MEMBER nUnusePad AS WORD
MEMBER nBitsPPel AS DWORD
MEMBER nPelWidth AS DWORD
MEMBER nPelHeigh AS DWORD
MEMBER nDisFlags AS DWORD
MEMBER nDisFreq AS DWORD
ENDSTRUCT
cBuffer := oDevMode:cBuffer
lPosible := EnumDisplaySettings(0, 0, @cBuffer)
IF lPosible
oDevMode:nFields := nOr(DM_PELSWIDTH, DM_PELSHEIGHT )
oDevMode:nPelWidth := nAncho
oDevMode:nPelHeigh := nAlto
cBuffer:=oDevMode:cBuffer
TRY
ChangeDisplaySettings(@cBuffer, 4)
lCamReso := .T.
CATCH
MsgAlert("Modo no soportado", "Error" )
END
else
MsgAlert("Modo no soportado", "Error" )
endif
return lCamReso
DLL32 FUNCTION EnumDisplaySettings(lpszDeviceName AS DWORD,;
iModeNum AS DWORD, ;
@lpDevMode AS LPSTR) AS BOOL PASCAL;
FROM "EnumDisplaySettingsA" LIB "User32.dll"
DLL32 STATIC FUNCTION ChangeDisplaySettings(@lpDevMode AS LPSTR,;
dwFlags AS DWORD) AS DWORD PASCAL;
FROM "ChangeDisplaySettingsA" LIB "User32.dll"
DLL32 FUNCTION ExitWindowsEx(uFlags AS DWORD,;
dwReserved AS DWORD) AS DWORD PASCAL;
LIB "user32.dll"
ahora puedo usar en cualquier plataforma una resolucion unica de 800 x 600
Muchos Saludos a los que realmente se esfuerzan por darle valor agregado a Fivewin!!!
Julio César Góme Cortéz
Analista Programador
QuiLiff Perú Software Development
Lima
tu "ya está solucionado" realmente si funciona!!!
usando tu ejemplo, he creado esta rutina:
#include 'fivewin.ch'
#Include "dll.ch"
#Include "Struct.ch"
FUNCTION MAIN()
LOCAL nResoAncho := GetSysMetrics(0)
IF nResoAncho > 800
CamReso ( 800, 600)
MSGINFO('HECHO. AQUI PUEDES INICIAR TU PROGRAMA ELABORADO PARA 800 X 600')
ENDI
RETU nil
Function CamReso(nAncho, nAlto)
Local DM_PELSWIDTH := nHex("80000")
Local DM_PELSHEIGHT := nHex("100000")
Local oDevMode
Local lPosible
Local cBuffer
Local lCamReso := .f.
DEFAULT nAncho := GetSysMetrics(0), ;
nAlto := GetSysMetrics(1)
STRUCT oDevMode
MEMBER cDevName AS STRING LEN 32
MEMBER nSpecVer AS WORD
MEMBER nDrvVer AS WORD
MEMBER nSize AS WORD
MEMBER nDrvExtra AS WORD
MEMBER nFields AS DWORD
MEMBER nOrientat AS WORD
MEMBER nPaperSiz AS WORD
MEMBER nPaperLen AS WORD
MEMBER nPaperWid AS WORD
MEMBER nScale AS WORD
MEMBER nCopies AS WORD
MEMBER nDefSrc AS WORD
MEMBER nPrnQlty AS WORD
MEMBER nColor AS WORD
MEMBER nDuplex AS WORD
MEMBER nYResolut AS WORD
MEMBER nTTOpt AS WORD
MEMBER nCollate AS WORD
MEMBER cFormName AS STRING LEN 32
MEMBER nUnusePad AS WORD
MEMBER nBitsPPel AS DWORD
MEMBER nPelWidth AS DWORD
MEMBER nPelHeigh AS DWORD
MEMBER nDisFlags AS DWORD
MEMBER nDisFreq AS DWORD
ENDSTRUCT
cBuffer := oDevMode:cBuffer
lPosible := EnumDisplaySettings(0, 0, @cBuffer)
IF lPosible
oDevMode:nFields := nOr(DM_PELSWIDTH, DM_PELSHEIGHT )
oDevMode:nPelWidth := nAncho
oDevMode:nPelHeigh := nAlto
cBuffer:=oDevMode:cBuffer
TRY
ChangeDisplaySettings(@cBuffer, 4)
lCamReso := .T.
CATCH
MsgAlert("Modo no soportado", "Error" )
END
else
MsgAlert("Modo no soportado", "Error" )
endif
return lCamReso
DLL32 FUNCTION EnumDisplaySettings(lpszDeviceName AS DWORD,;
iModeNum AS DWORD, ;
@lpDevMode AS LPSTR) AS BOOL PASCAL;
FROM "EnumDisplaySettingsA" LIB "User32.dll"
DLL32 STATIC FUNCTION ChangeDisplaySettings(@lpDevMode AS LPSTR,;
dwFlags AS DWORD) AS DWORD PASCAL;
FROM "ChangeDisplaySettingsA" LIB "User32.dll"
DLL32 FUNCTION ExitWindowsEx(uFlags AS DWORD,;
dwReserved AS DWORD) AS DWORD PASCAL;
LIB "user32.dll"
ahora puedo usar en cualquier plataforma una resolucion unica de 800 x 600
Muchos Saludos a los que realmente se esfuerzan por darle valor agregado a Fivewin!!!
Julio César Góme Cortéz
Analista Programador
QuiLiff Perú Software Development
Lima
- FranciscoA
- Posts: 1964
- Joined: Fri Jul 18, 2008 1:24 am
- Location: Chinandega, Nicaragua, C.A.
Re: CAMBIO RESOLUCION PANTALLA
Maggiro.
Realmente funciona!!!
Veremos mas adelante su comportamiento.
Gracias a todos los que lo hicieron posible.
Realmente funciona!!!
Veremos mas adelante su comportamiento.
Gracias a todos los que lo hicieron posible.
Francisco J. Alegría P.
Chinandega, Nicaragua.
Fwxh1204-MySql-TMySql
Chinandega, Nicaragua.
Fwxh1204-MySql-TMySql
- Manuel Valdenebro
- Posts: 706
- Joined: Thu Oct 06, 2005 9:57 pm
- Location: Málaga-España
Re: CAMBIO RESOLUCION PANTALLA
Hola Julio César,Maggiro wrote:hola manuel:
tu "ya está solucionado" realmente si funciona!!!
Me alegro que una rutina hecha hace 6 años, te haya servido. Ya ni me acordaba.
Un saludo
Manuel
Manuel
- José Vicente Beltrán
- Posts: 279
- Joined: Mon Oct 10, 2005 8:55 am
- Location: Algeciras, España
- Contact:
Re: CAMBIO RESOLUCION PANTALLA
Pues tengo que decir que para mi ha sido todo un descubrimiento, muy muy util
Muchas gracias una vez mas
Muchas gracias una vez mas
- José Vicente Beltrán
- Posts: 279
- Joined: Mon Oct 10, 2005 8:55 am
- Location: Algeciras, España
- Contact:
Re: CAMBIO RESOLUCION PANTALLA
¿Sabe alguien como se pueden conocer las resoluciones que admite una pantalla determinada?
no soy capaz de encontrar la función adecuada.
P.e mi monitor admite las siguientes resoluciones 1920x1080, 1600x900, 1280x720 y 800x600
Me gustaria poder saber las resoluciones en tiempo real para recomendar al usuario la mas adecuada a la hora de ejecutar la aplicación.
Gracias anticipadas
no soy capaz de encontrar la función adecuada.
P.e mi monitor admite las siguientes resoluciones 1920x1080, 1600x900, 1280x720 y 800x600
Me gustaria poder saber las resoluciones en tiempo real para recomendar al usuario la mas adecuada a la hora de ejecutar la aplicación.
Gracias anticipadas
Re: CAMBIO RESOLUCION PANTALLA
João Santos - São Paulo - Brasil
- José Vicente Beltrán
- Posts: 279
- Joined: Mon Oct 10, 2005 8:55 am
- Location: Algeciras, España
- Contact:
Re: CAMBIO RESOLUCION PANTALLA
Gracias karinha por contestar,
Pero lo que busco es algo parecido (si es que existe) a una funcion que devuelva un array con las distintas resoluciones que admite el monitor en uso.
De forma manual es lo que se hace en windows cuando pulsas en el menu contextual del boton derecho la opción 'resolución de pantalla' y el S.O. te indica las resoluciones que admite el monitor que se está usando.
Gracias de nuevo
Pero lo que busco es algo parecido (si es que existe) a una funcion que devuelva un array con las distintas resoluciones que admite el monitor en uso.
De forma manual es lo que se hace en windows cuando pulsas en el menu contextual del boton derecho la opción 'resolución de pantalla' y el S.O. te indica las resoluciones que admite el monitor que se está usando.
Gracias de nuevo
Re: CAMBIO RESOLUCION PANTALLA
// Origen:
http://forums.fivetechsupport.com/viewt ... BEMLocator
http://forums.fivetechsupport.com/viewt ... BEMLocator
Code: Select all
# include "fivewin.ch"
Function W_Main_Info ()
Local oDatos, oSrv, oJob, i, sMensaje := ""
Local oLoc := CreateObject ( "wbemScripting.SwbemLocator" )
Local objWMI
Local oResolucion, nResoIni, nResoFin
TRY
objWMI := oLoc:ConnectServer () && Aquí esta la configuración del Sistema
CATCH
TRY
objWMI := oLoc:ConnectServer ( "192.168.2.20" ) && 0.0.0.0
MsgInfo ( "IP OK" )
CATCH
MsgInfo ( "Error. Validando el servidor" )
CLOSE ALL
Return Nil
END
END
oResolucion := objWMI:ExecQuery ( "Select * from Win32_DesktopMonitor" )
sMensaje += CRLF + "Resolución de Pantalla:" + CRLF
FOR Each oDatos in oResolucion
sMensaje += "Alto: " + cValToChar ( oDatos:ScreenHeight ) + " * " + ;
"Ancho: " + cValToChar ( oDatos:ScreenWidth ) + CRLF
// aqui usted hace el controle
nResoIni := cValToChar ( oDatos:ScreenHeight )
nResoFin := cValToChar ( oDatos:ScreenWidth )
NEXT
MsgInfo ( sMensaje, "Información" )
RETURN NIL
João Santos - São Paulo - Brasil
- José Vicente Beltrán
- Posts: 279
- Joined: Mon Oct 10, 2005 8:55 am
- Location: Algeciras, España
- Contact:
Re: CAMBIO RESOLUCION PANTALLA
Gracias karinha,
voy a investigar en esa dirección.
voy a investigar en esa dirección.
Re: CAMBIO RESOLUCION PANTALLA
Puedes probar asi:
Code: Select all
#include "Fivewin.ch"
#Include "dll.ch"
#Include "Struct.ch"
Function Main()
Local aAllRes := {}
aAllRes := AllRes()
if !empty( aAllRes )
XBrowse( aAllRes )
endif
Return nil
#define ENUM_CURRENT_SETTINGS -1
#define ENUM_REGISTRY_SETTINGS -2
Function AllRes()
Local aAllRes := {}
Local oDevmode
Local oModos
Local i
STRUCT oDevMode
MEMBER cDevName AS STRING LEN 32
MEMBER nSpecVer AS WORD
MEMBER nDrvVer AS WORD
MEMBER nSize AS WORD
MEMBER nDrvExtra AS WORD
MEMBER nFields AS DWORD
MEMBER nOrientat AS WORD
MEMBER nPaperSiz AS WORD
MEMBER nPaperLen AS WORD
MEMBER nPaperWid AS WORD
MEMBER nScale AS WORD
MEMBER nCopies AS WORD
MEMBER nDefSrc AS WORD
MEMBER nPrnQlty AS WORD
MEMBER nColor AS WORD
MEMBER nDuplex AS WORD
MEMBER nYResolut AS WORD
MEMBER nTTOpt AS WORD
MEMBER nCollate AS WORD
MEMBER cFormName AS STRING LEN 32
MEMBER nUnusePad AS WORD
MEMBER nBitsPPel AS DWORD
MEMBER nPelWidth AS DWORD
MEMBER nPelHeigh AS DWORD
MEMBER nDisFlags AS DWORD
MEMBER nDisFreq AS DWORD
ENDSTRUCT
oModos := oDevMode:cBuffer
i := 0
do while .T.
if (EnumDisplaySettings(0, i, @oModos ))
AAdd( aAllRes, { oDevMode:nPelWidth, oDevMode:nPelHeigh, ;
oDevMode:nBitsPPel, oDevMode:nDisFreq } )
i++
else
exit
endif
Enddo
//? Len( aAllRes )
Return aAllRes
DLL32 FUNCTION EnumDisplaySettings(lpszDeviceName AS DWORD, iModeNum AS DWORD, ;
@lpDevMode AS LPSTR) AS BOOL PASCAL FROM "EnumDisplaySettingsA" LIB "User32.dll"
C. Navarro
Hay dos tipos de personas: las que te hacen perder el tiempo y las que te hacen perder la noción del tiempo
Si alguien te dice que algo no se puede hacer, recuerda que esta hablando de sus limitaciones, no de las tuyas.
Hay dos tipos de personas: las que te hacen perder el tiempo y las que te hacen perder la noción del tiempo
Si alguien te dice que algo no se puede hacer, recuerda que esta hablando de sus limitaciones, no de las tuyas.
- José Vicente Beltrán
- Posts: 279
- Joined: Mon Oct 10, 2005 8:55 am
- Location: Algeciras, España
- Contact:
Re: CAMBIO RESOLUCION PANTALLA
Cristobal,
Es exactamente lo que buscaba, lo tenia delante de las narices y no he sido capaz de verlo
Muchas gracias
Es exactamente lo que buscaba, lo tenia delante de las narices y no he sido capaz de verlo
Muchas gracias