screensavers en fivewin

screensavers en fivewin

Postby QAZWSX2K » Tue Sep 22, 2009 3:26 pm

saludos, necesito hacer un protector de pantalla con noticias para la empresa, y basandome en la idea que lei en este post http://forums.fivetechsupport.com/viewtopic.php?f=18&t=14125&p=72816&hilit=screensavers#p72816 y aunque he hecho algo mas rudimentario, si ven la web que comenta antonio no veo la manera de hacer algo parecido con fivewin, para comenzar les comentare los problemas que he encontrado a ver en que me pueden ayudar

- la ventana o dialogo no quedan siempre on top, si bien se activa como protector y aparece la ventana maximizada si le doy a la tecla de inicio pierde el foco, etc
- a la ventana o dialogo me veo obligado ponerle los iconos de salir, minimizar, etc para que pueda salir con esc, de lo contrario no sale con esc y al darle alf+f4 cierra la aplicacion pero permanece en memoria
- eso sin mencionar que la imagen debe ser bmp, y aunque puedo con freeimage ponerle con jpg no consigo que tome el tamaño del escritorio


saludos y gracias por su comentarios e ideas
Software especializado para oficinas contables con grandes volumenes de Informacion
Impresion de todos los formularios del Seniat, Dian

alex_patino74@hotmail.com
whatsapp 57+3214777217
User avatar
QAZWSX2K
 
Posts: 363
Joined: Tue Oct 25, 2005 7:06 pm
Location: Bogota - Caracas

Re: screensavers en fivewin

Postby QAZWSX2K » Wed Sep 23, 2009 1:16 pm

:arrow:
Software especializado para oficinas contables con grandes volumenes de Informacion
Impresion de todos los formularios del Seniat, Dian

alex_patino74@hotmail.com
whatsapp 57+3214777217
User avatar
QAZWSX2K
 
Posts: 363
Joined: Tue Oct 25, 2005 7:06 pm
Location: Bogota - Caracas

Re: screensavers en fivewin

Postby Daniel Garcia-Gil » Wed Sep 23, 2009 2:34 pm

Hola...

Por favor podrias colocar la rutina que usas, talvez podriamos ayudarte a lograr lo que quieres hacer y seria mas facil tener el punto de partida
User avatar
Daniel Garcia-Gil
 
Posts: 2365
Joined: Wed Nov 02, 2005 11:46 pm
Location: Isla de Margarita

Re: screensavers en fivewin

Postby Antonio Linares » Wed Sep 23, 2009 5:32 pm

Alex,

En samples\GetTime.prg tienes un ejemplo que tal vez pueda serte útil.
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 41469
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: screensavers en fivewin

Postby QAZWSX2K » Thu Sep 24, 2009 2:49 pm

Excelente con el ejemplo que me comento antonio pude darme cuenta de que estaba mal y en base a ese solucione el problema, gracias a ambos
Software especializado para oficinas contables con grandes volumenes de Informacion
Impresion de todos los formularios del Seniat, Dian

alex_patino74@hotmail.com
whatsapp 57+3214777217
User avatar
QAZWSX2K
 
Posts: 363
Joined: Tue Oct 25, 2005 7:06 pm
Location: Bogota - Caracas

Re: screensavers en fivewin

Postby Cgallegoa » Thu Sep 24, 2009 3:55 pm

El ejemplo FWH\Samples\GetTime.prg mejorado:

Code: Select all  Expand view

#include "FiveWin.ch"

static nTime := 0

function Main()

   local oDlg, oSay, oGet, cTest := Space( 10 )

   DEFINE DIALOG oDlg TITLE "Test"

   @ 0.5, 8 SAY oSay PROMPT "Elapsed time: " + AllTrim( Str( nTime ) ) + " secs."

   @ 3, 7 GET oGet VAR cTest PASSWORD

   ACTIVATE DIALOG oDlg CENTERED ;
      ON INIT BuildTimer( oDlg, oSay, oGet )

return nil

function BuildTimer( oDlg, oSay, oGet )

   local oTmr

   DEFINE TIMER oTmr OF oDlg ;
      ACTION ( nTime++, oSay:Refresh(), If( nTime > 02, ScreenSaver(),)) INTERVAL 1000

   ACTIVATE TIMER oTmr

   oGet:bKeyDown = { | nKey | nTime := 0, nKey }

return nil


function ScreenSaver()
   LOCAL oTimer2, oSay, oFont

   static oDlg

   nTime = 0

   if oDlg == nil

      ShowWindow( FindWindow( "Shell_TrayWnd", "" ), 0 ) // Taskbar
      ShowWindow( FindWindow( "Button", "Start" ), 0 ) // Vista round button

      DEFINE FONT oFont NAME "Ms Sans Serif" SIZE 0,20 BOLD
      DEFINE DIALOG oDlg STYLE WS_VISIBLE COLOR nRGB(255,255,255),nRGB(0,0,125) SIZE GetSysMetrics( 0 ), GetSysMetrics( 1 )

      @ 10, 10 SAY oSay PROMPT "This is a screensaver" COLORS nRGB(255,255,255),nRGB(0,0,125) FONT oFont

      oDlg:bKeyDown = { || oDlg:End() }

      ACTIVATE DIALOG oDlg ;
         ON INIT (BuildTimer2(oDlg, oSay));
         ON CLICK oDlg:End()

      ShowWindow( FindWindow( "Shell_TrayWnd", "" ), 1 )
      ShowWindow( FindWindow( "Button", "Start" ), 1 )

      oDlg = nil
      nTime = 0
   endif

return nil



function BuildTimer2( oDlg, oSay )
   local oTmr

   DEFINE TIMER oTmr OF oDlg ;
      ACTION ( MoveSay(oDlg,oSay) ) INTERVAL 1000

   ACTIVATE TIMER oTmr
return nil


Procedure MoveSay(oDlg,oSay)
   local nHeightScr := 768  - 30
   local nWidthScr  := 1024 - 54
   local nRow       := nRandom(nHeightScr)
   local nCol       := nRandom(nWidthScr)
   local nColorR    := nRandom(255)
   local nColorG    := nRandom(255)
   local nColorB    := nRandom(255)
   local nTextWidth := GetTextWidth(oSay:hDC,"This is a screensaver",oSay:oFont)
   local lFlg1 := .F. , lFlg2 := .F. , lFlg3 := .F.

   nRow := iif(nRow==0,1,nRow)
   nCol := iif(nCol==0,1,nCol)
   nCol := iif(nCol > (nWidthScr-nTextWidth),nWidthScr-nTextWidth,nCol)

   lFlg1 := nColorR >=  0 .AND. nColorR <=  50   //   33
   lflg2 := nColorG >=  0 .AND. nColorG <=  50   //   49
   lFlg3 := nColorB >= 75 .AND. nColorB <= 175   //  132
   if lFlg1 .AND. lFlg2 .AND. lFlg3
      nColorR += 50
      nColorG += 50
      nColorB += 50
   endif

   oSay:Hide()
   oSay:Move(nRow,nCol,,.T.)
   oSay:SetColor( nRGB(nColorR,nColorG,nColorB) , nRGB(0,0,125) )
   oSay:Show()

Return


Saludos,

Carlos Gallego
Saludos,

Carlos Gallego

*** FWH-23.10, xHarbour 1.2.3 Build 20190603, Borland C++7.30, PellesC ***
Cgallegoa
 
Posts: 427
Joined: Sun Oct 16, 2005 3:32 am
Location: Quito - Ecuador


Return to FiveWin para Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 132 guests