CAMBIO RESOLUCION PANTALLA

Postby Armando » Fri Feb 08, 2008 11:01 pm

Manuel:

:oops: 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
User avatar
Armando
 
Posts: 3229
Joined: Fri Oct 07, 2005 8:20 pm
Location: Toluca, México

Postby Manuel Valdenebro » Sat Feb 09, 2008 6:33 am

Yo lo estoy usando tambien en XP SP2
Un saludo

Manuel
User avatar
Manuel Valdenebro
 
Posts: 706
Joined: Thu Oct 06, 2005 9:57 pm
Location: Málaga-España

Postby ADBLANCO » Mon Feb 11, 2008 12:57 pm

Tambien me manda el error de windows;



Xh .997 y Fw 7.9
User avatar
ADBLANCO
 
Posts: 299
Joined: Mon Oct 22, 2007 3:03 pm
Location: Valencia - Venezuela

Re: CAMBIO RESOLUCION PANTALLA

Postby Maggiro » Sat Apr 19, 2014 9:00 pm

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
User avatar
Maggiro
 
Posts: 84
Joined: Thu Oct 14, 2010 3:26 am
Location: LIMA - PERU

Re: CAMBIO RESOLUCION PANTALLA

Postby FranciscoA » Sat Apr 19, 2014 10:21 pm

Maggiro.
Realmente funciona!!!
Veremos mas adelante su comportamiento.
Gracias a todos los que lo hicieron posible.
Francisco J. Alegría P.
Chinandega, Nicaragua.

Fwxh-MySql-TMySql
User avatar
FranciscoA
 
Posts: 2159
Joined: Fri Jul 18, 2008 1:24 am
Location: Chinandega, Nicaragua, C.A.

Re: CAMBIO RESOLUCION PANTALLA

Postby Manuel Valdenebro » Mon Apr 21, 2014 5:01 am

Maggiro wrote:hola manuel:
tu "ya está solucionado" realmente si funciona!!!


Hola Julio César,

Me alegro que una rutina hecha hace 6 años, te haya servido. Ya ni me acordaba.
Un saludo

Manuel
User avatar
Manuel Valdenebro
 
Posts: 706
Joined: Thu Oct 06, 2005 9:57 pm
Location: Málaga-España

Re: CAMBIO RESOLUCION PANTALLA

Postby José Vicente Beltrán » Mon Apr 21, 2014 5:56 pm

Pues tengo que decir que para mi ha sido todo un descubrimiento, muy muy util :)

Muchas gracias una vez mas :shock:
User avatar
José Vicente Beltrán
 
Posts: 282
Joined: Mon Oct 10, 2005 8:55 am
Location: Algeciras, España

Re: CAMBIO RESOLUCION PANTALLA

Postby José Vicente Beltrán » Tue Apr 22, 2014 10:35 am

¿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 :shock:
User avatar
José Vicente Beltrán
 
Posts: 282
Joined: Mon Oct 10, 2005 8:55 am
Location: Algeciras, España

Re: CAMBIO RESOLUCION PANTALLA

Postby karinha » Tue Apr 22, 2014 1:51 pm

João Santos - São Paulo - Brasil - Phone: +55(11)95150-7341
User avatar
karinha
 
Posts: 7831
Joined: Tue Dec 20, 2005 7:36 pm
Location: São Paulo - Brasil

Re: CAMBIO RESOLUCION PANTALLA

Postby José Vicente Beltrán » Tue Apr 22, 2014 2:14 pm

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 :shock:
User avatar
José Vicente Beltrán
 
Posts: 282
Joined: Mon Oct 10, 2005 8:55 am
Location: Algeciras, España

Re: CAMBIO RESOLUCION PANTALLA

Postby karinha » Tue Apr 22, 2014 3:38 pm

// Origen:

viewtopic.php?f=6&t=25108&start=0&hilit=WBEMScripting.SWBEMLocator

Code: Select all  Expand view  RUN

# 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 - Phone: +55(11)95150-7341
User avatar
karinha
 
Posts: 7831
Joined: Tue Dec 20, 2005 7:36 pm
Location: São Paulo - Brasil

Re: CAMBIO RESOLUCION PANTALLA

Postby José Vicente Beltrán » Tue Apr 22, 2014 4:29 pm

Gracias karinha,
voy a investigar en esa dirección. :shock:
User avatar
José Vicente Beltrán
 
Posts: 282
Joined: Mon Oct 10, 2005 8:55 am
Location: Algeciras, España

Re: CAMBIO RESOLUCION PANTALLA

Postby cnavarro » Tue Apr 22, 2014 5:55 pm

Puedes probar asi:
Code: Select all  Expand view  RUN

#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"


 
Cristobal Navarro
Hay dos tipos de personas: las que te hacen perder el tiempo y las que te hacen perder la noción del tiempo
El secreto de la felicidad no está en hacer lo que te gusta, sino en que te guste lo que haces
User avatar
cnavarro
 
Posts: 6549
Joined: Wed Feb 15, 2012 8:25 pm
Location: España

Re: CAMBIO RESOLUCION PANTALLA

Postby José Vicente Beltrán » Wed Apr 23, 2014 8:53 am

Cristobal,
Es exactamente lo que buscaba, lo tenia delante de las narices y no he sido capaz de verlo
Muchas gracias :shock:
User avatar
José Vicente Beltrán
 
Posts: 282
Joined: Mon Oct 10, 2005 8:55 am
Location: Algeciras, España

Previous

Return to FiveWin para Harbour/xHarbour

Who is online

Users browsing this forum: Google [Bot], lubin and 78 guests