topic
stringlengths 1
63
| text
stringlengths 1
577k
⌀ |
---|---|
the use camera with fwppc | To all
I want the use camera with fwppc
i testing with function SHCameraCapture
But lib aygshell.lib Not Good With ARM
i Found aygshell.lib from Windows Mobile 5_0 SDK
I would like Export aygshell.lib from aygshell.dll
But aygshell.dll Not Found with Any system ( evc & Windows Mobile 5_0 SDK )
regards, hathal |
the use camera with fwppc | Hathal,
The problem is that you can't copy a system DLL out of the Pocket PC in order to do an implib.exe aygshell.lib aygshell.dll. Its blocked by Windows Mobile API.
Please post here your code and we may try to help you. |
the use camera with fwppc | OK this FULL SOURCE
#include "FWCE.ch"
//----------------------------------------------------------------------------//
function Main()
local oWnd
DEFINE WINDOW oWnd TITLE "TEST Cam "
@5, 10 BUTTON "TEST 1" SIZE 80, 25 ACTION;
CAM_CE(oWnd,5)
ACTIVATE WINDOW oWnd
return nil
********************************************************
#pragma BEGINDUMP
#include "windows.h"
#include "mmsystem.h"
#include "hbapi.h"
#include "uniqueid.h"
#include "AYGSHELL.h" // New Command With Windows Mobile 5_0 SDK
// i Testing this to cam.obj ok
LPWSTR AnsiToWide( LPSTR );
HB_FUNC( CAM_CE )
{
// CameraCaptureExample(NULL,12);
//}
// HRESULT
//int CameraCaptureExample(HWND hwndOwner, LPTSTR pszFilename)
// {
HRESULT hResult;
SHCAMERACAPTURE shcc;
// Set the SHCAMERACAPTURE structure.
ZeroMemory(&shcc, sizeof(shcc));
shcc.cbSize = sizeof(shcc);
// shcc.hwndOwner = hwndOwner;
shcc.hwndOwner = ( HWND ) hb_parnl( 1 );
shcc.pszInitialDir = TEXT("\\My Documents");
shcc.pszDefaultFileName = TEXT("test.3gp");
shcc.pszTitle = TEXT("Camera Demo");
shcc.VideoTypes = CAMERACAPTURE_VIDEOTYPE_MESSAGING;
shcc.nResolutionWidth = 176;
shcc.nResolutionHeight = 144;
shcc.nVideoTimeLimit = 15;
shcc.Mode = CAMERACAPTURE_MODE_VIDEOWITHAUDIO;
// Display the Camera Capture dialog.
hResult = SHCameraCapture(&shcc);
// The next statements will execute only after the user takes
// a picture or video, or closes the Camera Capture dialog.
if (S_OK == hResult)
{
// StringCchCopy(pszFilename, MAX_PATH, shcc.szFile);
StringCchCopy(AnsiToWide(hb_parc( 2 )), MAX_PATH, shcc.szFile);
// return TRUE;
}
// return TRUE;//hResult;
}
#pragma ENDDUMP |
the use camera with fwppc | Now we need to find a Pocket PC with camera to test it <!-- s:) --><img src="{SMILIES_PATH}/icon_smile.gif" alt=":)" title="Smile" /><!-- s:) --> |
the use camera with fwppc | if you link file to exe ok
send me copy
regards, hathal |
the use camera with fwppc | [quote="Antonio Linares":2utmfbn1]Now we need to find a Pocket PC with camera to test it <!-- s:) --><img src="{SMILIES_PATH}/icon_smile.gif" alt=":)" title="Smile" /><!-- s:) -->[/quote:2utmfbn1]
Antonio
My HP Ipaq 6515 has a camera
If you need some testing let me know.
Richard <!-- s:D --><img src="{SMILIES_PATH}/icon_biggrin.gif" alt=":D" title="Very Happy" /><!-- s:D --> |
the use camera with fwppc | Richard,
Thanks. The idea is to test Hathal code and see what it does. |
the use camera with fwppc | [quote="Antonio Linares":o2qe3o71]Richard,
Thanks. The idea is to test Hathal code and see what it does.[/quote:o2qe3o71]
Compile generates errors here is the log.
Note : My Ipaq runs win 2003 OS
ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿
³ FiveWin for Pocket PC - June 2005 Harbour development power ³Ü
³ (c) FiveTech, 1993-2005 for Microsoft Windows Pocket PC ³Û
ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙÛ
ÿ ßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßß
Compiling...
Harbour Compiler Alpha build 45.0 (Flex)
Copyright 1999-2005, <!-- m --><a class="postlink" href="http://www.harbour-project.org/">http://www.harbour-project.org/</a><!-- m -->
Compiling 'hathal.prg' and generating preprocessed output to 'hathal.ppo'...
Lines 57, Functions/Procedures 1
Generating C source output to 'hathal.c'... Done.
hathal.c
hathal.prg(26) : error C2065: 'SHCAMERACAPTURE' : undeclared identifier
hathal.prg(26) : error C2146: syntax error : missing ';' before identifier 'shcc'
hathal.prg(26) : error C2065: 'shcc' : undeclared identifier
hathal.prg(29) : error C2228: left of '.cbSize' must have class/struct/union type
hathal.prg(31) : error C2228: left of '.hwndOwner' must have class/struct/union type
hathal.prg(32) : error C2228: left of '.pszInitialDir' must have class/struct/union type
hathal.prg(33) : error C2228: left of '.pszDefaultFileName' must have class/struct/union type
hathal.prg(34) : error C2228: left of '.pszTitle' must have class/struct/union type
hathal.prg(35) : error C2228: left of '.VideoTypes' must have class/struct/union type
hathal.prg(35) : error C2065: 'CAMERACAPTURE_VIDEOTYPE_MESSAGING' : undeclared identifier
hathal.prg(36) : error C2228: left of '.nResolutionWidth' must have class/struct/union type
hathal.prg(37) : error C2228: left of '.nResolutionHeight' must have class/struct/union type
hathal.prg(38) : error C2228: left of '.nVideoTimeLimit' must have class/struct/union type
hathal.prg(39) : error C2228: left of '.Mode' must have class/struct/union type
hathal.prg(39) : error C2065: 'CAMERACAPTURE_MODE_VIDEOWITHAUDIO' : undeclared identifier
hathal.prg(42) : error C2065: 'SHCameraCapture' : undeclared identifier
hathal.prg(49) : error C2065: 'StringCchCopy' : undeclared identifier
hathal.prg(49) : error C2228: left of '.szFile' must have class/struct/union type
LINK : fatal error LNK1181: cannot open input file 'hathal.obj' |
the use camera with fwppc | Hathal,
Please provide us the "AYGSHELL.h" that you are using.
Use <!-- w --><a class="postlink" href="http://www.hyperload.com">www.hyperload.com</a><!-- w --> to upload it and provide its download link. Thanks.
Richard, thanks for your help <!-- s:) --><img src="{SMILIES_PATH}/icon_smile.gif" alt=":)" title="Smile" /><!-- s:) --> |
the use camera with fwppc | Antonio
AYGSHELL.h And AYGSHELL.lib
With Windows Mobile 5.0 Pocket PC SDK
say dir ( Include& lib )
--
from dir up
Compile
with this file
------
@ set hdir=%1harbour_CE
@ set vcdir=%1vce
@ set fwppc=%1fwppc
@ set include="inclode_NEW_dir";%vcdir%\include\arm;%hdir%\include;%fwppc%\include;%include%
@ set lib=%vcdir%\lib;%hdir%\lib;%lib%
@SET PATH=%PATH%;%vcdir%\bin;%hdir%\bin
-----
regards, hathal |
the world’s first modular smartphone. Really awesome!!! | [url:305wwair]http://www.extremetech.com/extreme/185417-google-turns-on-the-worlds-first-modular-smartphone-reveals-more-juicy-details-about-project-ara[/url:305wwair] |
theader con wbrowse... | Alguien tendra un ejemplo de como usar la clase theader con la twbrowse que lo pudiera proporcionar?
O ya vendra el browse nativo de FWH de este nuevo build con el aspecto que toma la theader?
Gracias |
there is a list of fivewin users around the world | there is a list of fivewin users around the world ? |
there is a list of fivewin users around the world | If you login, you can see a link to members in the upper right |
threads timeout | live demo:
[url:lrqf16di]https://fivetechsoft.github.io/snippets?20200218110744[/url:lrqf16di]
[code=fw:lrqf16di]<div class="fw" id="{CB}" style="font-family: monospace;"><span style="color: #00C800;">function</span> Main<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><br /> <span style="color: #00C800;">local</span> pThread<br /> <br /> pThread = hb_threadStart<span style="color: #000000;">(</span> @Test<span style="color: #000000;">(</span><span style="color: #000000;">)</span> <span style="color: #000000;">)</span><br /><br /> <span style="color: #00C800;">if</span> hb_threadWait<span style="color: #000000;">(</span> pThread, <span style="color: #000000;">5</span> <span style="color: #000000;">)</span> != <span style="color: #000000;">1</span> <span style="color: #B900B9;">// We wait 5 seconds</span><br /> hb_threadQuitRequest<span style="color: #000000;">(</span> pThread <span style="color: #000000;">)</span><br /> <span style="color: #00C800;">endif</span><br /><br /> hb_threadWaitForAll<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><br /> ? <span style="color: #ff0000;">"ok"</span><br /><br /><span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span><br /><br /><span style="color: #00C800;">function</span> Test<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><br /> ErrorBlock<span style="color: #000000;">(</span> <span style="color: #000000;">{</span> | oError | AP_RPuts<span style="color: #000000;">(</span> <span style="color: #ff0000;">"errorblock"</span> <span style="color: #000000;">)</span>, <span style="color: #00C800;">Break</span><span style="color: #000000;">(</span> oError <span style="color: #000000;">)</span> <span style="color: #000000;">}</span> <span style="color: #000000;">)</span><br /><br /> ? hb_Compiler<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> <br /> <span style="color: #00C800;">while</span> .T. <span style="color: #B900B9;">// endless loop to block the thread</span><br /> end<br /> <br /><span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span></div>[/code:lrqf16di] |
thumbnail of window | Hi,
Is it possible to get a thumbnail of this window by the window handle ? |
thumbnail of window | Given a windows handle you can get a bitmap with its image
and once you have the bitmap, you can resize it to the thumbnail required size
is that what you mean ? |
thumbnail of window | Thank you, Antonio! Yes, probably this solution is suitable. |
thumbnails | I make thumbnails of jpg files using the function MakeThumbNail(). How can I make the thumbnails of a different type - docx, pdf and so on ? |
till Now steps of creating Dialogs as main window | I tried to create small program that has a resource dialog as main window. Till Now I do not know the steps of creating the resource and I am asking if there are any include lines inside the program *.ch?
Thanks |
till Now steps of creating Dialogs as main window | [quote="Ehab Samir Aziz":3391ad02]I tried to create small program that has a resource dialog as main window. Till Now I do not know the steps of creating the resource and I am asking if there are any include lines inside the program *.ch?
Thanks[/quote:3391ad02]
Maybe i didnt understand exactly what you wanna do, because
its very simple to create an app with a main dialog from resource.
#Include "FiveWin.ch"
Function Main()
Local oDlg
DEFINE DIALOG oDlg RESOURCE "MAIN"
....
....
....
ACTIVATE DIALOG oDlg CENTERED
Return NIL
Regards |
till Now steps of creating Dialogs as main window | The idea I got the error message that main resource is not found. What my program should be edited by to make the resource visible to it ? |
till Now steps of creating Dialogs as main window | Ehab,
Are you storing your resources into the EXE or into an external DLL ?
If they are inside the EXE, open the EXE with the resources workshop and double check that the resources are there. |
till Now steps of creating Dialogs as main window | That is my code below : I created a resource called 1_2_02 that contained 1 Dialog also called 1_2_02 and my program also called 1_2_02.prg
#Include "FiveWin.ch"
Function Main()
Local oDlg
DEFINE DIALOG oDlg RESOURCE "1_2_02"
ACTIVATE DIALOG oDlg CENTERED
Return NIL
Application
===========
Path and name: E:\PROGRAMS\CLIPPER\FWEVAL\SITEX\1_2_02.EXE
Size: 632,000 bytes
Max files handles permited: ( SetHandleCount() ) 69
Error ocurred at: 01/01/05, 12:40:41
Error description: Error FiveWin/3 Cannot create Dialog Box:
Resource: 1_2_02 |
till Now steps of creating Dialogs as main window | Try to use another name different from "1_2_02" |
till Now steps of creating Dialogs as main window | Ok I renamed the dialog from 1_2_02 to main inside the resource 1_2_02.rc .Also I got an Error :
1_2_02.rc(13) error RW2001 : undefined keyword or key name :
WS_POPUP
Application
===========
Path and name: E:\PROGRAMS\CLIPPER\FWEVAL\SITEX\1_2_02.EXE
Size: 632,000 bytes
Max files handles permited: ( SetHandleCount() ) 69
Error ocurred at: 01/07/06, 00:52:57
Error description: Error FiveWin/3 Cannot create Dialog Box:
Resource: main |
till Now steps of creating Dialogs as main window | Ehab,
You have to #include "WinApi.ch" into your RC file. |
till Now steps of creating Dialogs as main window | Not all Tools works well in workshop , eg . the BorlandRadioButton doesn't work and the program gave me :
Can not find main resource. |
till Now steps of creating Dialogs as main window | Ehab,
If you use Borland own controls, then you have to load the Borland DLL from your application before using the resources:
local hDLL := LoadLibrary( "bwcc.dll" )
... your code...
FreeLibrary( hDLL ) |
till Now steps of creating Dialogs as main window | Is there a special library for every resource editor ? |
timage | I have a problem using the timage class. I can load a bmp file but if I try to load a jpg file the loadimage takes minutes and then does not display.Any ideasPeter |
timage | Hello,when you use different graphic-formats,FREEIMAGE.dll has to be included in your working-directory.I using JPG's as a background on a slow computerand it is very fast.RegardsUwe |
timage | Tried putting freeimage.dll in the working directory and also in windows/system32 folder but no joy. Still only works for bmp |
timage | Peter,Whats the size of your FreeImage.dll ? |
timage | Antonio1032kb |
timage | Peter,Ours is 1.056.768 bytes. It seems to be the same.Could you please email me one of the JPGs files that you are testing ? Thanks, |
timage | Peter,We have used fwh\samples\TestImg.prg to open and visualize your sent JPG and works fine <!-- s:-) --><img src="{SMILIES_PATH}/icon_smile.gif" alt=":-)" title="Smile" /><!-- s:-) --> |
timage | Just compiled testimg using feb xharbour and it does not display the jpg file.Any idea on what I am doing wrong |
timage | Peter,Please email me your TestImg.exe as a ZIP file, thanks |
timage | Peter,Your EXE is not working here <!-- s:-( --><img src="{SMILIES_PATH}/icon_sad.gif" alt=":-(" title="Sad" /><!-- s:-( -->Anyhow, we have just built samples\TestImg.prg using FWH 8.04 and latest xHarbour we provide, and it works fine <!-- s:-) --><img src="{SMILIES_PATH}/icon_smile.gif" alt=":-)" title="Smile" /><!-- s:-) --> |
timage | tried with 8.03 but still no good. Will wait for next release of xharbourThanks |
timage | Peter,I email you my EXE, please try it there. Thanks, |
timage | AntonioThe program you sent works with my dll so it must be down to the build. I cannot use the 8.04 with the current build of xHarbour as this will not build. I will try with the Feb beta build and then wait until they release the fixes for thisThanksPeter |
timage | AntonioDo I need any different five libs for the feb build of xharbour as I get errors on comile if i try |
timage | Peter,What compile errors do you get ? |
timage | hb_fun__clsactivecan build with 8.03 and feb xharbour butr still does not display jpg imagescannot buuild with 8.04 |
timage | Peter,I guess that you are using xHB commercial.Please ask Patrick Mast for a new beta, thanks |
timage | HB_FUN__CLSACTIVE.Ron Pinkas said to uninstall all previous versions and then rebuild but this did not make any difference. I can build with 8.03 but not 8.04 and I still cannot view jpg with 8.03 |
timage | Peter,Have you tried adding this function to your main PRG ?function __ClsActive(); return .F.also try withfunction __ClsActive(); return .T. |
timage | Antonioyes tried both but then it just gpfs |
timage | Peter,Patrick Mast said he has a working beta that works fine with FWH 8.04 |
timage | Will ask Patrick but that is proably a beta which is not available yet.Have you tried compiling with xharbour |
timage | Peter,If you use the xHarbour build that we provide (free one, not commercial) it works great with FWH 8.04.Why don't you use it in the meantime ? Richard Chidiak and others here have migrated from the commercial one to the free one, and they are very happy <!-- s:-) --><img src="{SMILIES_PATH}/icon_smile.gif" alt=":-)" title="Smile" /><!-- s:-) -->It looks as the free xHarbour version is much actively upgraded than the commercial one. |
timage | I need the sdqrdd so I am probably stuck with the commercial one |
timage | Peter,If you mean the SQLRDD there is already a Borland version, so you can migrate to the xHarbour Borland free build and never have these troubles again <!-- s:-) --><img src="{SMILIES_PATH}/icon_smile.gif" alt=":-)" title="Smile" /><!-- s:-) -->The xHarbour developers work on the free version and later on they port to the commercial version, thats why the commercial version is so outdated |
timage | OK So what is involved in changing |
timage | Just install the xharbour.exe that we provide and download the free Borland C compiler from here: <!-- w --><a class="postlink" href="http://www.fivetechsoft.com/files/freecommandlinetools.exe">www.fivetechsoft.com/files/freecommandlinetools.exe</a><!-- w -->Install Borland and then create these two files in c:\borland\bcc55\bin:(alternatively you can use c:\bcc55 instead of c:\borland\bcc55)bcc32.cfg:-I"c:\borland\bcc55\include"-L"c:\borland\bcc55\lib" ilink32.cfg:-L"c:\borland\bcc55\lib" Then go to fwh\samples\buildx.bat, edit it and adjust your paths, and then do: buildx.bat tutor01You should get your first running EXE with the free xHarbour and FWH 8.04 <!-- s:-) --><img src="{SMILIES_PATH}/icon_smile.gif" alt=":-)" title="Smile" /><!-- s:-) --> |
timage | How do I get the xharbour.exe My login and password are not working |
timage | Peter,You can download xHarbour.exe from here:<!-- w --><a class="postlink" href="http://www.fivetechsoft.com/files/xharbour.exe">www.fivetechsoft.com/files/xharbour.exe</a><!-- w --> |
timage | get loads of errors cannot open files eg assert.h |
timage | Peter,Have you created the two files that I told you in c:\borland\bcc55\bin ?If you want, we can provide you remote assistance from here to properly setup everything there for you. We can send you a small EXE that allows us to take control from here of your computer. It is totally safe. |
timage | Yes please |
timage | Peter,We have already sent you the remote assistance software. There is no need to install it. Just run it and provide us by email the shown ID and password. Keep the EXE running. |
timage | AntonioThanksI will try a build on one of my applications and let you know how it goesPeter |
timage | Peter,Everything configured and properly running <!-- s:-) --><img src="{SMILIES_PATH}/icon_smile.gif" alt=":-)" title="Smile" /><!-- s:-) -->I left samples\TestImg.exe running in your desktop showing a JPG file <!-- s:-) --><img src="{SMILIES_PATH}/icon_smile.gif" alt=":-)" title="Smile" /><!-- s:-) --> |
timage | AntonioDo you have a sample buildx where more than one prg file is compiledThanks |
timage | Peter,Simply add more calls to harbour.exe and bcc32.exe:%hdir%\bin\harbour another /n /i..\include;%hdir%\include /w /p %2 %3 > clip.log@type clip.logIF ERRORLEVEL 1 PAUSEIF ERRORLEVEL 1 GOTO EXITecho -O2 -e%1.exe -I%hdir%\include another.c > b32.bc%bcdir%\bin\bcc32 -M -c -v @b32.bcand then add the extra OBJs to this line:echo %1.obj another.obj, + >> b32.bcAlternatively you may use a make file for Borland. We provide a working one in fwh\makes\bormake.zip |
timage ( FWH 10.4) maestro Antonio/Daniel | Hola
Espero que estén bien
Revisando testimg.prg
no funciona oImage:SaveImage( "SAVED.JPG", 2, 25 ) guarda la imagen en 0 bytes y estaba trabajando bien |
timage ( FWH 10.4) maestro Antonio/Daniel | Luis,
Revisa este post:
[url:5degp8z2]http://forums.fivetechsupport.com/viewtopic.php?f=6&t=18733[/url:5degp8z2] |
timage ( FWH 10.4) maestro Antonio/Daniel | Gracias por la respuesta
Hice el cambio a dib.c
bmf.bfType = 0x4D42;
como lo planteo el Maestro Antonio linares
al colocar el dib.c en el buildh.bat es el mismo que trae FWH V10.4 me da varios warning y varios errores 12 en total
echo -O2 -e%1.exe -I%hdir%\include -I%bcdir%\include -I%fwh%\include %1.c [b:nyutnzge]dib.c[/b:nyutnzge] > b32.bc
%bcdir%\bin\bcc32 -M -c -v @b32.bc
le agregue este parametro por los includes de fwh -I%fwh%\include
de antemano gracias |
timage ( FWH 10.4) Resuelto | Cambiarlo en los archivos dib.c y dibbmp.c
bmf.bfType = 'BM';
Por:
bmf.bfType = 0x4D42;
como lo planteo el Maestro Antonio linares
para que no te salgan errores hay que compilar de la siguiente manera:
c:\bcc582\bin\bcc32 -D__HARBOUR__ -c [b:75b814ab]dib.c[/b:75b814ab]
c:\bcc582\bin\bcc32 -D__HARBOUR__ -c [b:75b814ab]dibbmp.c[/b:75b814ab]
recomiendo hacer cambios a los siguientes archivos
Ubicación: c:\bcc582\bin
[b:75b814ab]BCC32.CFG[/b:75b814ab]
-I"c:\bcc582\include;c:\bcc582\include\dinkumware";c:\fwh\include;c:\harbour\include"
-L"c:\bcc582\lib"
[b:75b814ab]ilink32.cfg[/b:75b814ab]
-L"c:\bcc582\lib"
en el caso que quieras colocarlo en una libreria haces lo siguiente
en mi caso necesite compilar dib.c y dibbmp.c lo que hice fue
cuando obtuve los Obj los copie en donde estaba la libreria
c:\bcc582\bin\tlib fivehc.lib -+ dibbmp.obj
c:\bcc582\bin\tlib fivehc.lib -+ dib.obj
espero que le sirva de ayuda a varios que puedan tener este problema |
timage ( V10.4) maestro Antonio/Daniel | Hola
Espero que estén bien
Revisando testimg.prg
no funciona oImage:SaveImage( "SAVED.JPG", 2, 25 ) guarda la imagen en 0 bytes y estaba trabajando bien |
timage - redimensionar imagem de recurso | Amigos, alguem sabe como posso redimensionar o tamanho de uma imagem desde um recurso?redefine image oBtima id 4095 of oDlg1 PIXEL adjust Obrigado |
timage - redimensionar imagem de recurso | oBitmap:SetSize( nWidth, nHeight )ooBitmap:Zoom( nZoom )depende de si quieres variar el tamano del control o hacer zoom |
timage - redimensionar imagem de recurso | obrigado Sr. Antonio! |
timage - redimensionar imagem de recurso | Hola,Tengo una imagen declarada como[code:1vj7h0lp]
REDEFINE IMAGE oImage ID ID_IMAGEN OF oDlg SCROLL
[/code:1vj7h0lp]
Quisiera saber si puedo moverla con el ratón al pulsar sobre ella.
Sería algo así como...
[code:1vj7h0lp]
oImage:onMouseOver( oMouse:CursorAspecto( 'mano' ), moverimagen() )
[/code:1vj7h0lp][/code] |
timage - redimensionar imagem de recurso | Javier,
Crea el bitmap con la claúsula DESIGN:
@ ..., ... BITMAP ... DESIGN
podras moverla automaticamente con el ratón. |
time schedule system | Hello friends,
I am starting on a web interface for my schedule system.
This system uses the file system directly without a database.
There is a daily folder for the next few years on the hard disk.
Virtually this system recreates an appointment book.
A simple file manager helps to assign the documents with drag & drop and a file browser.
Best regards,
Otto
[url:22ojve5t]https://mybergland.com/fwforum/scheduler.mp4[/url:22ojve5t] |
time schedule system | Hello friends,
Now editing the appointment items is working fine.
Best regards,
Otto
[img:3kzmwj3x]https://mybergland.com/fwforum/emaildesktopedit.gif[/img:3kzmwj3x] |
time schedule system | Otto, it's great, congratulations |
time schedule system | Dear Cristobal,
Thank you for the kind words.
Now also preload is working fine.
Best regards,
Otto
[img:3f59nnq4]https://mybergland.com/fwforum/preloademails.gif[/img:3f59nnq4] |
time schedule system | Hello friends,
Here you can see a size comparison.
Regards,
Otto
[img:2xrlkqit]https://mybergland.com/fwforum/resize.jpg[/img:2xrlkqit] |
time schedule system | Dear Otto,
You could supply the factor as a parameter:
function resizeImage( cSrc, cDst, nValue )
local nQuality := 0
local oImage := GdiBmp():New( cSrc )
local nFactor := oImage:GetWidth() / If( Empty( nValue ), 400, nValue )
local newHeight := oImage:GetHeight( nFactor )
FErase( cDst )
oImage:Resize( If( Empty( nValue ), 400, nValue ), newHeight )
oImage:Save( cDst, nQuality )
oImage:End()
return nil |
time with milliseconds | Does a function exist which returns the time with milliseconds? |
time with milliseconds | [code=fw:3aq4sbml]<div class="fw" id="{CB}" style="font-family: monospace;"><br />? DateTime<span style="color: #000000;">(</span><span style="color: #000000;">)</span> <span style="color: #B900B9;">// --> 14-03-2020 20:56:20.355</span><br /> </div>[/code:3aq4sbml] |
time with milliseconds | Please keep this function:
[code=fw:1i1lcs01]<div class="fw" id="{CB}" style="font-family: monospace;"><span style="color: #00C800;">function</span> TIME_MS<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><br />#ifdef __XHARBOUR__<br /> <span style="color: #00C800;">local</span> cTime := TTOC<span style="color: #000000;">(</span> DateTime<span style="color: #000000;">(</span><span style="color: #000000;">)</span>, <span style="color: #000000;">2</span> <span style="color: #000000;">)</span><br />#else<br /> <span style="color: #00C800;">local</span> cTime := HB_TTOC<span style="color: #000000;">(</span> HB_DateTime<span style="color: #000000;">(</span><span style="color: #000000;">)</span>, <span style="color: #ff0000;">""</span>, <span style="color: #ff0000;">"HH:MM:SS:FFF"</span> <span style="color: #000000;">)</span><br />#endif<br /><br /><span style="color: #00C800;">return</span> cTime<br /> </div>[/code:1i1lcs01]
? TIME_MS() will return a time string in format HH:MM:SS.CCC with milliseconds |
time with milliseconds | Many Thanks. |
time.windows.com | Masters, és posible sincronizar el reloj de windows 7 de la misma manera que con time.windows.com?
Gracias, saludos |
time.windows.com | Please, see:
[code=fw:39go7sxt]<div class="fw" id="{CB}" style="font-family: monospace;"><span style="color: #00D7D7;">#include</span> <span style="color: #ff0000;">"fivewin.ch"</span><br /><span style="color: #00D7D7;">#include</span> <span style="color: #ff0000;">"xbrowse.ch"</span><br /><br /><span style="color: #00C800;">function</span> main<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><br /><span style="color: #0000ff;">MsgInfo</span><span style="color: #000000;">(</span> GETSNTP<span style="color: #000000;">(</span> <span style="color: #ff0000;">"204.123.2.72"</span> <span style="color: #000000;">)</span>, <span style="color: #ff0000;">"GETSNTP() de Antonio Linares"</span> <span style="color: #000000;">)</span><br /><br /><br />msgalert<span style="color: #000000;">(</span>test<span style="color: #000000;">(</span><span style="color: #000000;">)</span>, <span style="color: #ff0000;">"CLASS TSNP"</span><span style="color: #000000;">)</span><br /><br />msgalert<span style="color: #000000;">(</span>testtime<span style="color: #000000;">(</span><span style="color: #000000;">)</span>, <span style="color: #ff0000;">"VIA HTTP"</span><span style="color: #000000;">)</span><br /><br /><br /><span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span><br /><br /><br /><br />Func Test<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><span style="color: #00C800;">Local</span> aNet := <span style="color: #000000;">{</span><span style="color: #000000;">}</span>,;<br /> nPort := <span style="color: #000000;">123</span>,;<br /> cIp := <span style="color: #ff0000;">"204.123.2.72"</span>,;<br /> lSync := .T.,;<br /> oSntp := <span style="color: #00C800;">NIL</span>,;<br /> cNetDate := <span style="color: #ff0000;">""</span><br /><br /><br /> oSntp := TSntp<span style="color: #000000;">(</span><span style="color: #000000;">)</span>:<span style="color: #00C800;">New</span><span style="color: #000000;">(</span> cIP, nPort, lSync <span style="color: #000000;">)</span><br /><br /> <span style="color: #00C800;">If</span> oSntp:<span style="color: #000000;">GetData</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> <span style="color: #B900B9;">// orignal code: ? oSntp:Date(), "date"</span><br /> cNetDate := oSntp:<span style="color: #000000;">Date</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> <span style="color: #00C800;">Else</span><br /> cNetDate := <span style="color: #ff0000;">"99/99/99"</span><br /> <span style="color: #00C800;">EndIf</span><br /><br /><span style="color: #00C800;">Return</span> cNetDate<br /><br /><br /><br /><br /><span style="color: #00C800;">FUNCTION</span> testTime<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> <span style="color: #00C800;">LOCAL</span> oHttp, hTime,cTime<br /> oHttp:=CreateObject<span style="color: #000000;">(</span> <span style="color: #ff0000;">"winhttp.winHttpRequest.5.1"</span> <span style="color: #000000;">)</span><br /> oHttp:<span style="color: #000000;">Open</span><span style="color: #000000;">(</span><span style="color: #ff0000;">"GET"</span>,<span style="color: #ff0000;">"http://json-time.appspot.com/time.json"</span>,.F.<span style="color: #000000;">)</span><br /> oHttp:<span style="color: #000000;">Send</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> oHttp:<span style="color: #000000;">waitForResponse</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> <span style="color: #00C800;">IF</span> oHttp:<span style="color: #000000;">Status</span> == <span style="color: #000000;">200</span><br /> hb_jsondecode<span style="color: #000000;">(</span>oHttp:<span style="color: #000000;">ResponseText</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span>,@hTime<span style="color: #000000;">)</span> <span style="color: #B900B9;">//Parse JSON to hash</span><br /> cTime:=Str<span style="color: #000000;">(</span>hTime<span style="color: #000000;">[</span><span style="color: #ff0000;">"hour"</span><span style="color: #000000;">]</span>,<span style="color: #000000;">2</span><span style="color: #000000;">)</span>+<span style="color: #ff0000;">":"</span>+Str<span style="color: #000000;">(</span>hTime<span style="color: #000000;">[</span><span style="color: #ff0000;">"minute"</span><span style="color: #000000;">]</span>,<span style="color: #000000;">2</span><span style="color: #000000;">)</span>+<span style="color: #ff0000;">":"</span>+Str<span style="color: #000000;">(</span>hTime<span style="color: #000000;">[</span><span style="color: #ff0000;">"second"</span><span style="color: #000000;">]</span>,<span style="color: #000000;">2</span><span style="color: #000000;">)</span><br /> <span style="color: #B900B9;">//--- just for test output data</span><br /> <span style="color: #0000ff;">xBrowse</span><span style="color: #000000;">(</span>hTime<span style="color: #000000;">)</span> <span style="color: #B900B9;">//All data in hash,</span><br /> <span style="color: #0000ff;">MsgInfo</span><span style="color: #000000;">(</span>cTime+<span style="color: #ff0000;">" GMT"</span><span style="color: #000000;">)</span> <span style="color: #B900B9;">//Time GMT</span><br /> <span style="color: #0000ff;">MsgInfo</span><span style="color: #000000;">(</span>hTime<span style="color: #000000;">[</span><span style="color: #ff0000;">"datetime"</span><span style="color: #000000;">]</span><span style="color: #000000;">)</span> <span style="color: #B900B9;">//Date time</span><br /> <span style="color: #B900B9;">//--</span><br /> <span style="color: #00C800;">ENDIF</span><br /><span style="color: #00C800;">RETURN</span> cTime<br /><br /><br /><br /><span style="color: #00C800;">FUNCTION</span> Time3<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><br /><span style="color: #00C800;">LOCAL</span> nTime := fCreate<span style="color: #000000;">(</span> <span style="color: #ff0000;">"chkdtime.bat"</span> <span style="color: #000000;">)</span><br /><span style="color: #00C800;">LOCAL</span> cBuff := <span style="color: #ff0000;">""</span><br /><span style="color: #00C800;">LOCAL</span> lRetu := .F.<br /><span style="color: #00C800;">LOCAL</span> cDbar := <span style="color: #ff0000;">"/"</span> <span style="color: #B900B9;">//</span><br /><span style="color: #00C800;">LOCAL</span> aEOL := <span style="color: #000000;">{</span> Chr<span style="color: #000000;">(</span><span style="color: #000000;">13</span><span style="color: #000000;">)</span> + Chr<span style="color: #000000;">(</span><span style="color: #000000;">10</span><span style="color: #000000;">)</span>, Chr<span style="color: #000000;">(</span><span style="color: #000000;">13</span><span style="color: #000000;">)</span>, Chr<span style="color: #000000;">(</span><span style="color: #000000;">10</span><span style="color: #000000;">)</span> <span style="color: #000000;">}</span><br /><br />fWrite<span style="color: #000000;">(</span> nTime, <span style="color: #ff0000;">"w32tm /stripchart /samples:1 /dataonly /computer:time.window.com >chkdtime.txt"</span> <span style="color: #000000;">)</span><br />fClose<span style="color: #000000;">(</span> nTime <span style="color: #000000;">)</span><br />ShellExecute<span style="color: #000000;">(</span> <span style="color: #000000;">0</span>, <span style="color: #ff0000;">"open"</span>, <span style="color: #ff0000;">"chkdtime.bat"</span>,,, <span style="color: #000000;">)</span><br />WaitSeconds<span style="color: #000000;">(</span> <span style="color: #000000;">2</span> <span style="color: #000000;">)</span><br /><span style="color: #00C800;">IF</span> <span style="color: #000000;">(</span> nTime := fOpen<span style="color: #000000;">(</span> <span style="color: #ff0000;">"chkdtime.txt"</span> <span style="color: #000000;">)</span> <span style="color: #000000;">)</span> > <span style="color: #000000;">0</span><br /> <span style="color: #00C800;">WHILE</span> hb_fReadLine<span style="color: #000000;">(</span> nTime, @cBuff, aEOL <span style="color: #000000;">)</span> = <span style="color: #000000;">0</span><br /> <span style="color: #00C800;">IF</span> cDbar $ cBuff<br /> cBuff := <span style="color: #0000ff;">subStr</span><span style="color: #000000;">(</span> cBuff, <span style="color: #00C800;">at</span><span style="color: #000000;">(</span> cDbar, cBuff <span style="color: #000000;">)</span> - <span style="color: #000000;">2</span> <span style="color: #000000;">)</span><br /> <span style="color: #00C800;">IF</span> cToD<span style="color: #000000;">(</span> <span style="color: #0000ff;">subStr</span><span style="color: #000000;">(</span> cBuff, <span style="color: #000000;">1</span>, <span style="color: #00C800;">at</span><span style="color: #000000;">(</span> <span style="color: #ff0000;">" "</span>, cBuff <span style="color: #000000;">)</span> - <span style="color: #000000;">1</span> <span style="color: #000000;">)</span> <span style="color: #000000;">)</span> > cToD<span style="color: #000000;">(</span> <span style="color: #ff0000;">"01/01/14"</span> <span style="color: #000000;">)</span><br /> msgStop<span style="color: #000000;">(</span> <span style="color: #ff0000;">"O PERÍODO DE AVALIAÇÃO TERMINOU"</span> + CRLF + <span style="color: #ff0000;">"SOLICITE UMA VERSÃO ATUALIZADA AO DESENVOLVEDOR"</span>, <span style="color: #ff0000;">"Atenção"</span> <span style="color: #000000;">)</span><br /> lRetu := .T.<br /> <span style="color: #00C800;">ENDIF</span><br /> EXIT<br /> <span style="color: #00C800;">ENDIF</span><br /> <span style="color: #00C800;">ENDDO</span><br /> fClose<span style="color: #000000;">(</span> nTime <span style="color: #000000;">)</span><br /><span style="color: #00C800;">ENDIF</span><br />fErase<span style="color: #000000;">(</span> <span style="color: #ff0000;">"chkdtime.bat"</span> <span style="color: #000000;">)</span><br />fErase<span style="color: #000000;">(</span> <span style="color: #ff0000;">"chkdtime.txt"</span> <span style="color: #000000;">)</span><br /><span style="color: #00C800;">RETURN</span> <span style="color: #000000;">(</span> lRetu <span style="color: #000000;">)</span><br /><br /><br /><br /><br /><br /><span style="color: #B900B9;">// TSNTP.PRG</span><br /><span style="color: #B900B9;">// Copyright by WenSheng come from TAIWAN</span><br /><span style="color: #00D7D7;">#include</span> <span style="color: #ff0000;">"hbclass.ch"</span><br /><span style="color: #00D7D7;">#include</span> <span style="color: #ff0000;">"common.ch"</span><br /><span style="color: #00C800;">CLASS</span> TSNTP<br /><br /> <span style="color: #00C800;">DATA</span> cServer,; <span style="color: #B900B9;">// server name/ip</span><br /> nPort,; <span style="color: #B900B9;">// server port</span><br /> lSync,; <span style="color: #B900B9;">// Sync flag</span><br /> lError<br /><br /> <span style="color: #00C800;">DATA</span> nYear,;<br /> nMonth,;<br /> nDay,;<br /> nWeek,;<br /> nDayOfYear<br /><br /> <span style="color: #00C800;">DATA</span> nHours,;<br /> nMinute,;<br /> nSeconds<br /><br /> <span style="color: #00C800;">METHOD</span> <span style="color: #00C800;">New</span><span style="color: #000000;">(</span>cServer, nPort, lSync<span style="color: #000000;">)</span><br /> <span style="color: #00C800;">METHOD</span> GetData<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> <span style="color: #0000ff;">MESSAGE</span> DATE <span style="color: #00C800;">METHOD</span> _Date<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> <span style="color: #0000ff;">MESSAGE</span> TIME <span style="color: #00C800;">METHOD</span> _Time<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><br /><span style="color: #00C800;">ENDCLASS</span><br /><br /><span style="color: #B900B9;">//</span><br /><span style="color: #00C800;">METHOD</span> <span style="color: #00C800;">New</span><span style="color: #000000;">(</span> cServer, nPort, lSync <span style="color: #000000;">)</span> <span style="color: #00C800;">CLASS</span> TSNTP<br /><span style="color: #00C800;">DEFAULT</span> cServer <span style="color: #0000ff;">to</span> <span style="color: #ff0000;">"time.windows.com"</span> <span style="color: #B900B9;">//</span><br /><span style="color: #00C800;">DEFAULT</span> nPort <span style="color: #0000ff;">to</span> <span style="color: #000000;">123</span> <span style="color: #B900B9;">// port</span><br /><span style="color: #00C800;">DEFAULT</span> lSync <span style="color: #0000ff;">to</span> .F. <span style="color: #B900B9;">//</span><br /><br /> ::<span style="color: #000000;">cServer</span> := cServer<br /> ::<span style="color: #000000;">nPort</span> := nPort<br /> ::<span style="color: #000000;">lSync</span> := lSync<br /> ::<span style="color: #000000;">lError</span> := .F.<br /><br /><span style="color: #00C800;">RETURN</span> <span style="color: #00C800;">Self</span><br /><br /><span style="color: #B900B9;">//</span><br /><span style="color: #00C800;">METHOD</span> GetData<span style="color: #000000;">(</span><span style="color: #000000;">)</span> <span style="color: #00C800;">CLASS</span> TSNTP<br /><span style="color: #00C800;">Local</span> xRet := HB_GetSNTP<span style="color: #000000;">(</span> ::<span style="color: #000000;">cServer</span>, ::<span style="color: #000000;">nPort</span>, ::<span style="color: #000000;">lSync</span> <span style="color: #000000;">)</span><br /> <span style="color: #00C800;">If</span> ValType<span style="color: #000000;">(</span>xRet<span style="color: #000000;">)</span> == <span style="color: #ff0000;">"N"</span><br /> ::<span style="color: #000000;">lError</span> := .T.<br /> ::<span style="color: #000000;">nYear</span> := <span style="color: #000000;">0</span><br /> ::<span style="color: #000000;">nMonth</span> := <span style="color: #000000;">0</span><br /> ::<span style="color: #000000;">nDay</span> := <span style="color: #000000;">0</span><br /> ::<span style="color: #000000;">nHours</span> := <span style="color: #000000;">0</span><br /> ::<span style="color: #000000;">nMinute</span> := <span style="color: #000000;">0</span><br /> ::<span style="color: #000000;">nSeconds</span> := <span style="color: #000000;">0</span><br /> ::<span style="color: #000000;">nWeek</span> := <span style="color: #000000;">0</span><br /> ::<span style="color: #000000;">nDayOfYear</span> := <span style="color: #000000;">0</span><br /> <span style="color: #00C800;">Else</span><br /> ::<span style="color: #000000;">lError</span> := .F.<br /> <span style="color: #B900B9;">// 0 1 2</span><br /> <span style="color: #B900B9;">// 12345678901234567890</span><br /> ::<span style="color: #000000;">nYear</span> := Val<span style="color: #000000;">(</span> <span style="color: #0000ff;">Substr</span><span style="color: #000000;">(</span> xRet, <span style="color: #000000;">1</span>, <span style="color: #000000;">4</span> <span style="color: #000000;">)</span><span style="color: #000000;">)</span><br /> ::<span style="color: #000000;">nMonth</span> := Val<span style="color: #000000;">(</span> <span style="color: #0000ff;">Substr</span><span style="color: #000000;">(</span> xRet, <span style="color: #000000;">5</span>, <span style="color: #000000;">2</span> <span style="color: #000000;">)</span><span style="color: #000000;">)</span><br /> ::<span style="color: #000000;">nDay</span> := Val<span style="color: #000000;">(</span> <span style="color: #0000ff;">Substr</span><span style="color: #000000;">(</span> xRet, <span style="color: #000000;">7</span>, <span style="color: #000000;">2</span> <span style="color: #000000;">)</span><span style="color: #000000;">)</span><br /> ::<span style="color: #000000;">nHours</span> := Val<span style="color: #000000;">(</span> <span style="color: #0000ff;">Substr</span><span style="color: #000000;">(</span> xRet, <span style="color: #000000;">9</span>, <span style="color: #000000;">2</span> <span style="color: #000000;">)</span><span style="color: #000000;">)</span><br /> ::<span style="color: #000000;">nMinute</span> := Val<span style="color: #000000;">(</span> <span style="color: #0000ff;">Substr</span><span style="color: #000000;">(</span> xRet, <span style="color: #000000;">11</span>, <span style="color: #000000;">2</span> <span style="color: #000000;">)</span><span style="color: #000000;">)</span><br /> ::<span style="color: #000000;">nSeconds</span> := Val<span style="color: #000000;">(</span> <span style="color: #0000ff;">Substr</span><span style="color: #000000;">(</span> xRet, <span style="color: #000000;">13</span>, <span style="color: #000000;">2</span> <span style="color: #000000;">)</span><span style="color: #000000;">)</span><br /> ::<span style="color: #000000;">nWeek</span> := Val<span style="color: #000000;">(</span> <span style="color: #0000ff;">Substr</span><span style="color: #000000;">(</span> xRet, <span style="color: #000000;">15</span>, <span style="color: #000000;">1</span> <span style="color: #000000;">)</span><span style="color: #000000;">)</span><br /> ::<span style="color: #000000;">nDayOfYear</span> := Val<span style="color: #000000;">(</span> <span style="color: #0000ff;">Substr</span><span style="color: #000000;">(</span> xRet, <span style="color: #000000;">16</span>, <span style="color: #000000;">3</span> <span style="color: #000000;">)</span><span style="color: #000000;">)</span><br /> <span style="color: #00C800;">EndIf</span><br /><br /><span style="color: #00C800;">RETURN</span> ! ::<span style="color: #000000;">lError</span><br /><br /><span style="color: #B900B9;">//</span><br /><span style="color: #00C800;">METHOD</span> _Date<span style="color: #000000;">(</span><span style="color: #000000;">)</span> <span style="color: #00C800;">CLASS</span> TSNTP<br /><span style="color: #00C800;">RETURN</span> StoD<span style="color: #000000;">(</span> PadL<span style="color: #000000;">(</span> ::<span style="color: #000000;">nYear</span>, <span style="color: #000000;">4</span>, <span style="color: #ff0000;">"0"</span> <span style="color: #000000;">)</span>+;<br /> PadL<span style="color: #000000;">(</span> ::<span style="color: #000000;">nMonth</span>, <span style="color: #000000;">2</span>, <span style="color: #ff0000;">"0"</span> <span style="color: #000000;">)</span>+;<br /> PadL<span style="color: #000000;">(</span> ::<span style="color: #000000;">nDay</span>, <span style="color: #000000;">2</span>, <span style="color: #ff0000;">"0"</span> <span style="color: #000000;">)</span><span style="color: #000000;">)</span><br /><br /><span style="color: #B900B9;">//</span><br /><span style="color: #00C800;">METHOD</span> _Time<span style="color: #000000;">(</span><span style="color: #000000;">)</span> <span style="color: #00C800;">CLASS</span> TSNTP<br /><span style="color: #00C800;">RETURN</span> PadL<span style="color: #000000;">(</span> ::<span style="color: #000000;">nHours</span>, <span style="color: #000000;">2</span>, <span style="color: #ff0000;">"0"</span> <span style="color: #000000;">)</span>+<span style="color: #ff0000;">":"</span>+;<br /> PadL<span style="color: #000000;">(</span> ::<span style="color: #000000;">nMinute</span>, <span style="color: #000000;">2</span>, <span style="color: #ff0000;">"0"</span> <span style="color: #000000;">)</span>+<span style="color: #ff0000;">":"</span>+;<br /> PadL<span style="color: #000000;">(</span> ::<span style="color: #000000;">nSeconds</span>, <span style="color: #000000;">2</span>, <span style="color: #ff0000;">"0"</span> <span style="color: #000000;">)</span><br /><br /><br /><br /><span style="color: #00C800;">FUNCTION</span> HB_GETSNTP<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><br /> <span style="color: #00C800;">LOCAL</span> cH := GETSNTP<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><br /> alert<span style="color: #000000;">(</span>ch<span style="color: #000000;">)</span><br /><br /><br /><span style="color: #00C800;">RETURN</span> <span style="color: #000000;">12345678901234567890</span><br /><br /><br /><br /><br /><br /><br /><span style="color: #00D7D7;">#pragma</span> BEGINDUMP<br /><br /><span style="color: #00D7D7;">#include</span> <hbapi.h><br /><span style="color: #00D7D7;">#include</span> <winsock.h><br /><span style="color: #00D7D7;">#include</span> <time.h><br /><br /><span style="color: #00D7D7;">#define</span> MAXLEN <span style="color: #000000;">1024</span><br /><br /><span style="color: #00C800;">HB_FUNC</span><span style="color: #000000;">(</span> GETSNTP <span style="color: #000000;">)</span><br /><span style="color: #000000;">{</span><br /> char * hostname = <span style="color: #000000;">(</span> char * <span style="color: #000000;">)</span> hb_parc<span style="color: #000000;">(</span> <span style="color: #000000;">1</span> <span style="color: #000000;">)</span>;<br /> unsigned char msg<span style="color: #000000;">[</span> <span style="color: #000000;">48</span> <span style="color: #000000;">]</span> = <span style="color: #000000;">{</span> <span style="color: #000000;">010</span>, <span style="color: #000000;">0</span>, <span style="color: #000000;">0</span>, <span style="color: #000000;">0</span>, <span style="color: #000000;">0</span>, <span style="color: #000000;">0</span>, <span style="color: #000000;">0</span>, <span style="color: #000000;">0</span>, <span style="color: #000000;">0</span> <span style="color: #000000;">}</span>; <span style="color: #B900B9;">// the packet we send</span><br /> unsigned long buf<span style="color: #000000;">[</span> MAXLEN <span style="color: #000000;">]</span>; <span style="color: #B900B9;">// the buffer we get back</span><br /> struct sockaddr_in server_addr;<br /> int s; <span style="color: #B900B9;">// socket</span><br /> WSADATA wsa;<br /> struct timeval timeout;<br /> fd_set fds;<br /> time_t tmit;<br /><br /><br /> WSAStartup<span style="color: #000000;">(</span> 0x101, &wsa <span style="color: #000000;">)</span>;<br /><br /> s = socket<span style="color: #000000;">(</span> PF_INET, SOCK_DGRAM, getprotobyname<span style="color: #000000;">(</span> <span style="color: #ff0000;">"udp"</span> <span style="color: #000000;">)</span>->p_proto <span style="color: #000000;">)</span>;<br /><br /> memset<span style="color: #000000;">(</span> &server_addr, <span style="color: #000000;">0</span>, sizeof<span style="color: #000000;">(</span> server_addr <span style="color: #000000;">)</span> <span style="color: #000000;">)</span>;<br /> server_addr.sin_family = AF_INET;<br /> server_addr.sin_addr.s_addr = inet_addr<span style="color: #000000;">(</span> hostname <span style="color: #000000;">)</span>;<br /> server_addr.sin_port = htons<span style="color: #000000;">(</span> <span style="color: #000000;">123</span> <span style="color: #000000;">)</span>; <span style="color: #B900B9;">// ntp port</span><br /><br /> sendto<span style="color: #000000;">(</span> s, msg, sizeof<span style="color: #000000;">(</span> msg <span style="color: #000000;">)</span>, <span style="color: #000000;">0</span>, <span style="color: #000000;">(</span> struct sockaddr * <span style="color: #000000;">)</span> &server_addr, sizeof<span style="color: #000000;">(</span> server_addr <span style="color: #000000;">)</span> <span style="color: #000000;">)</span>;<br /><br /> FD_ZERO<span style="color: #000000;">(</span> &fds <span style="color: #000000;">)</span>;<br /> FD_SET<span style="color: #000000;">(</span> s, &fds <span style="color: #000000;">)</span>;<br /> timeout.tv_sec = <span style="color: #000000;">10</span>;<br /> timeout.tv_usec = <span style="color: #000000;">0</span>;<br /><br /> <span style="color: #00C800;">if</span><span style="color: #000000;">(</span> <span style="color: #0000ff;">select</span><span style="color: #000000;">(</span> <span style="color: #000000;">0</span>, &fds, <span style="color: #00C800;">NULL</span>, <span style="color: #00C800;">NULL</span>, &timeout <span style="color: #000000;">)</span> <span style="color: #000000;">)</span><br /> <span style="color: #000000;">{</span><br /> recv<span style="color: #000000;">(</span> s, <span style="color: #000000;">(</span> void * <span style="color: #000000;">)</span> buf, sizeof<span style="color: #000000;">(</span> buf <span style="color: #000000;">)</span>, <span style="color: #000000;">0</span> <span style="color: #000000;">)</span>;<br /><br /> tmit = ntohl<span style="color: #000000;">(</span> buf<span style="color: #000000;">[</span> <span style="color: #000000;">10</span> <span style="color: #000000;">]</span> <span style="color: #000000;">)</span>;<br /> tmit-= 2208988800U;<br /> <span style="color: #000000;">}</span><br /> <span style="color: #00C800;">else</span><br /> MessageBox<span style="color: #000000;">(</span> <span style="color: #000000;">0</span>, <span style="color: #ff0000;">"can't read from NTP server"</span>, <span style="color: #ff0000;">"ERROR"</span>, <span style="color: #000000;">0</span> <span style="color: #000000;">)</span>;<br /><br /> WSACleanup<span style="color: #000000;">(</span><span style="color: #000000;">)</span>;<br /><br /> hb_retc<span style="color: #000000;">(</span> ctime<span style="color: #000000;">(</span> &tmit <span style="color: #000000;">)</span> <span style="color: #000000;">)</span>;<br /><span style="color: #000000;">}</span><br /><br /><span style="color: #00D7D7;">#pragma</span> ENDDUMP<br /><br /> </div>[/code:39go7sxt] |
time.windows.com | Gracias Lucas, me retorna:
ERROR:
CAN´T READ FROM NTP SERVER
VIA HTTP
NIL
Regards, saludos. |
time.windows.com | Lucas, esta function hace el mismo que a de Maestro Antonio?
[code=fw:3he4ej6h]<div class="fw" id="{CB}" style="font-family: monospace;"><br />Func Test<span style="color: #000000;">(</span><span style="color: #000000;">)</span> <br /><span style="color: #00C800;">Local</span> aNet := <span style="color: #000000;">{</span><span style="color: #000000;">}</span>,; <br /> nPort := <span style="color: #000000;">123</span>,; <br /> cIp := <span style="color: #ff0000;">"time.windows.com"</span>,; <br /> lSync := .T.,; <br /> oSntp := <span style="color: #00C800;">NIL</span> <br /><br /> ? <span style="color: #ff0000;">"test begin"</span> <br /><br /> <span style="color: #B900B9;">// test-1 </span><br /> <span style="color: #B900B9;">// lSync = .T., ?????, ? LocalTime ? NTP Server ???? </span><br /> oSntp := TSntp<span style="color: #000000;">(</span><span style="color: #000000;">)</span>:<span style="color: #00C800;">New</span><span style="color: #000000;">(</span> cIP, nPort, lSync <span style="color: #000000;">)</span> <br /> <span style="color: #B900B9;">// or oSntp := TSntp():New(); oSntp:cIp := '....'; oSntp:nPort = .... </span><br /> <span style="color: #00C800;">If</span> oSntp:<span style="color: #000000;">GetData</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span> <br /> ? oSntp:<span style="color: #000000;">Date</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span>, <span style="color: #ff0000;">"date"</span> <br /> ? oSntp:<span style="color: #000000;">Time</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span>, <span style="color: #ff0000;">"time"</span> <br /> ? oSntp:<span style="color: #000000;">nWeek</span>, <span style="color: #ff0000;">"Week"</span> <br /> ? oSntp:<span style="color: #000000;">nDayOfYear</span>, <span style="color: #ff0000;">"Day Of Year"</span> <br /> <span style="color: #00C800;">Else</span> <br /> ? <span style="color: #ff0000;">"Fail"</span> <br /> <span style="color: #00C800;">EndIf</span> <br /><br /> <span style="color: #B900B9;">// test-2 </span><br /> <span style="color: #00C800;">If</span> oSntp:<span style="color: #000000;">GetData</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span> <br /> ? oSntp:<span style="color: #000000;">Date</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span>, <span style="color: #ff0000;">"date"</span> <br /> ? oSntp:<span style="color: #000000;">Time</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span>, <span style="color: #ff0000;">"time"</span> <br /> <span style="color: #00C800;">Else</span> <br /> ? <span style="color: #ff0000;">"Fail"</span> <br /> <span style="color: #00C800;">EndIf</span> <br /><br /> ? <span style="color: #ff0000;">"test end"</span> <br /><br /><span style="color: #00C800;">Return</span> <span style="color: #00C800;">NIL</span> <br /><br /><span style="color: #B900B9;">// TSNTP.PRG </span><br /><span style="color: #B900B9;">// Copyright by WenSheng come from TAIWAN </span><br /><span style="color: #00D7D7;">#include</span> <span style="color: #ff0000;">"hbclass.ch"</span> <br /><span style="color: #00D7D7;">#include</span> <span style="color: #ff0000;">"common.ch"</span> <br /><span style="color: #00C800;">CLASS</span> TSNTP <br /><br /> <span style="color: #00C800;">DATA</span> cServer,; <span style="color: #B900B9;">// server name/ip </span><br /> nPort,; <span style="color: #B900B9;">// server port </span><br /> lSync,; <span style="color: #B900B9;">// Sync flag </span><br /> lError <br /><br /> <span style="color: #00C800;">DATA</span> nYear,; <br /> nMonth,; <br /> nDay,; <br /> nWeek,; <br /> nDayOfYear <br /><br /> <span style="color: #00C800;">DATA</span> nHours,; <br /> nMinute,; <br /> nSeconds <br /><br /> <span style="color: #00C800;">METHOD</span> <span style="color: #00C800;">New</span><span style="color: #000000;">(</span>cServer, nPort, lSync<span style="color: #000000;">)</span> <br /> <span style="color: #00C800;">METHOD</span> GetData<span style="color: #000000;">(</span><span style="color: #000000;">)</span> <br /> <span style="color: #0000ff;">MESSAGE</span> DATE <span style="color: #00C800;">METHOD</span> _Date<span style="color: #000000;">(</span><span style="color: #000000;">)</span> <br /> <span style="color: #0000ff;">MESSAGE</span> TIME <span style="color: #00C800;">METHOD</span> _Time<span style="color: #000000;">(</span><span style="color: #000000;">)</span> <br /><br /><span style="color: #00C800;">ENDCLASS</span> <br /><br /><span style="color: #B900B9;">// </span><br /><span style="color: #00C800;">METHOD</span> <span style="color: #00C800;">New</span><span style="color: #000000;">(</span> cServer, nPort, lSync <span style="color: #000000;">)</span> <span style="color: #00C800;">CLASS</span> TSNTP <br /><span style="color: #00C800;">DEFAULT</span> cServer <span style="color: #0000ff;">to</span> <span style="color: #ff0000;">"time.windows.com"</span> <span style="color: #B900B9;">// ???? </span><br /><span style="color: #00C800;">DEFAULT</span> nPort <span style="color: #0000ff;">to</span> <span style="color: #000000;">123</span> <span style="color: #B900B9;">// ?? port </span><br /><span style="color: #00C800;">DEFAULT</span> lSync <span style="color: #0000ff;">to</span> .F. <span style="color: #B900B9;">// ???? </span><br /><br /> ::<span style="color: #000000;">cServer</span> := cServer <br /> ::<span style="color: #000000;">nPort</span> := nPort <br /> ::<span style="color: #000000;">lSync</span> := lSync <br /> ::<span style="color: #000000;">lError</span> := .F. <br /><br /><span style="color: #00C800;">RETURN</span> <span style="color: #00C800;">Self</span> <br /><br /><span style="color: #B900B9;">// </span><br /><span style="color: #00C800;">METHOD</span> GetData<span style="color: #000000;">(</span><span style="color: #000000;">)</span> <span style="color: #00C800;">CLASS</span> TSNTP <br /><span style="color: #00C800;">Local</span> xRet := GetSNTP<span style="color: #000000;">(</span> ::<span style="color: #000000;">cServer</span>, ::<span style="color: #000000;">nPort</span>, ::<span style="color: #000000;">lSync</span> <span style="color: #000000;">)</span> <br /> <span style="color: #00C800;">If</span> ValType<span style="color: #000000;">(</span>xRet<span style="color: #000000;">)</span> == <span style="color: #ff0000;">"N"</span> <br /> ::<span style="color: #000000;">lError</span> := .T. <br /> ::<span style="color: #000000;">nYear</span> := <span style="color: #000000;">0</span> <br /> ::<span style="color: #000000;">nMonth</span> := <span style="color: #000000;">0</span> <br /> ::<span style="color: #000000;">nDay</span> := <span style="color: #000000;">0</span> <br /> ::<span style="color: #000000;">nHours</span> := <span style="color: #000000;">0</span> <br /> ::<span style="color: #000000;">nMinute</span> := <span style="color: #000000;">0</span> <br /> ::<span style="color: #000000;">nSeconds</span> := <span style="color: #000000;">0</span> <br /> ::<span style="color: #000000;">nWeek</span> := <span style="color: #000000;">0</span> <br /> ::<span style="color: #000000;">nDayOfYear</span> := <span style="color: #000000;">0</span> <br /> <span style="color: #00C800;">Else</span> <br /> ::<span style="color: #000000;">lError</span> := .F. <br /> <span style="color: #B900B9;">// 0 1 2 </span><br /> <span style="color: #B900B9;">// 12345678901234567890 </span><br /> <span style="color: #B900B9;">// ???? yyyymmddhhmmsswyda </span><br /> ::<span style="color: #000000;">nYear</span> := Val<span style="color: #000000;">(</span> <span style="color: #0000ff;">Substr</span><span style="color: #000000;">(</span> xRet, <span style="color: #000000;">1</span>, <span style="color: #000000;">4</span> <span style="color: #000000;">)</span><span style="color: #000000;">)</span> <br /> ::<span style="color: #000000;">nMonth</span> := Val<span style="color: #000000;">(</span> <span style="color: #0000ff;">Substr</span><span style="color: #000000;">(</span> xRet, <span style="color: #000000;">5</span>, <span style="color: #000000;">2</span> <span style="color: #000000;">)</span><span style="color: #000000;">)</span> <br /> ::<span style="color: #000000;">nDay</span> := Val<span style="color: #000000;">(</span> <span style="color: #0000ff;">Substr</span><span style="color: #000000;">(</span> xRet, <span style="color: #000000;">7</span>, <span style="color: #000000;">2</span> <span style="color: #000000;">)</span><span style="color: #000000;">)</span> <br /> ::<span style="color: #000000;">nHours</span> := Val<span style="color: #000000;">(</span> <span style="color: #0000ff;">Substr</span><span style="color: #000000;">(</span> xRet, <span style="color: #000000;">9</span>, <span style="color: #000000;">2</span> <span style="color: #000000;">)</span><span style="color: #000000;">)</span> <br /> ::<span style="color: #000000;">nMinute</span> := Val<span style="color: #000000;">(</span> <span style="color: #0000ff;">Substr</span><span style="color: #000000;">(</span> xRet, <span style="color: #000000;">11</span>, <span style="color: #000000;">2</span> <span style="color: #000000;">)</span><span style="color: #000000;">)</span> <br /> ::<span style="color: #000000;">nSeconds</span> := Val<span style="color: #000000;">(</span> <span style="color: #0000ff;">Substr</span><span style="color: #000000;">(</span> xRet, <span style="color: #000000;">13</span>, <span style="color: #000000;">2</span> <span style="color: #000000;">)</span><span style="color: #000000;">)</span> <br /> ::<span style="color: #000000;">nWeek</span> := Val<span style="color: #000000;">(</span> <span style="color: #0000ff;">Substr</span><span style="color: #000000;">(</span> xRet, <span style="color: #000000;">15</span>, <span style="color: #000000;">1</span> <span style="color: #000000;">)</span><span style="color: #000000;">)</span> <br /> ::<span style="color: #000000;">nDayOfYear</span> := Val<span style="color: #000000;">(</span> <span style="color: #0000ff;">Substr</span><span style="color: #000000;">(</span> xRet, <span style="color: #000000;">16</span>, <span style="color: #000000;">3</span> <span style="color: #000000;">)</span><span style="color: #000000;">)</span> <br /> <span style="color: #00C800;">EndIf</span> <br /><br /><span style="color: #00C800;">RETURN</span> ! ::<span style="color: #000000;">lError</span> <br /><br /><span style="color: #B900B9;">// </span><br /><span style="color: #00C800;">METHOD</span> _Date<span style="color: #000000;">(</span><span style="color: #000000;">)</span> <span style="color: #00C800;">CLASS</span> TSNTP <br /><span style="color: #00C800;">RETURN</span> StoD<span style="color: #000000;">(</span> PadL<span style="color: #000000;">(</span> ::<span style="color: #000000;">nYear</span>, <span style="color: #000000;">4</span>, <span style="color: #ff0000;">"0"</span> <span style="color: #000000;">)</span>+; <br /> PadL<span style="color: #000000;">(</span> ::<span style="color: #000000;">nMonth</span>, <span style="color: #000000;">2</span>, <span style="color: #ff0000;">"0"</span> <span style="color: #000000;">)</span>+; <br /> PadL<span style="color: #000000;">(</span> ::<span style="color: #000000;">nDay</span>, <span style="color: #000000;">2</span>, <span style="color: #ff0000;">"0"</span> <span style="color: #000000;">)</span><span style="color: #000000;">)</span> <br /><br /><span style="color: #B900B9;">// </span><br /><span style="color: #00C800;">METHOD</span> _Time<span style="color: #000000;">(</span><span style="color: #000000;">)</span> <span style="color: #00C800;">CLASS</span> TSNTP <br /><span style="color: #00C800;">RETURN</span> PadL<span style="color: #000000;">(</span> ::<span style="color: #000000;">nHours</span>, <span style="color: #000000;">2</span>, <span style="color: #ff0000;">"0"</span> <span style="color: #000000;">)</span>+<span style="color: #ff0000;">":"</span>+; <br /> PadL<span style="color: #000000;">(</span> ::<span style="color: #000000;">nMinute</span>, <span style="color: #000000;">2</span>, <span style="color: #ff0000;">"0"</span> <span style="color: #000000;">)</span>+<span style="color: #ff0000;">":"</span>+; <br /> PadL<span style="color: #000000;">(</span> ::<span style="color: #000000;">nSeconds</span>, <span style="color: #000000;">2</span>, <span style="color: #ff0000;">"0"</span> <span style="color: #000000;">)</span> <br /> </div>[/code:3he4ej6h]
Gracias, saludos. |
time.windows.com | Hola Lucas
Trato de probar este ejemplo pero no puedo ligar GETSNTP, existe esta funcion para xHarbour ?
Saludos |
timepicker | fwppc support timepicker ? |
timer con un boton | Gente:
Necesito programar un timer dentro de un botón que despues de 10 segundos de presionado muestre un msje
ayuda por favor
Hi guys,
I want to do a timer that shows a message after 10 seconds de pressing the button
please help me |
timer con un boton | Artu01:
A ver si me puedo explicar:
1.- Defines el objeto TIMER así: STATIC/LOCAL oTimer
2.- En el botón que active el timer pones como ACTION una función, así:
DEFINE BUTTON oBtns[01] OF oBar RESOURCE "New16" ACTION ActivaTimer()
3.- En la función ActivTimer() pones el siguiente código
[code=fw:38k0jzc4]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><span style="color: #00C800;">STATIC</span> <span style="color: #00C800;">FUNCTION</span> Tiempo<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> <span style="color: #00C800;">LOCAL</span> nIntervalo := <span style="color: #000000;">60000</span> * <span style="color: #000000;">15</span> <span style="color: #B900B9;">// Cada 15 minutos se activará el timer</span><br /><br /> <span style="color: #00C800;">IF</span> nIntervalo > <span style="color: #000000;">0</span><br /> <span style="color: #B900B9;">// 60,000 milesimas es igual a 1 minuto, se crea y se activa solo una vez</span><br /> <span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">TIMER</span> oTimer <span style="color: #0000ff;">OF</span> oWindow <span style="color: #0000ff;">INTERVAL</span> nIntervalo <span style="color: #0000ff;">ACTION</span> Ventana<span style="color: #000000;">(</span><span style="color: #000000;">)</span> <span style="color: #B900B9;">// 600000 es igual a 10 minutos</span><br /><br /> oTimer:<span style="color: #0000ff;">Activate</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> <span style="color: #00C800;">ENDIF</span><br /><span style="color: #00C800;">RETURN</span><span style="color: #000000;">(</span><span style="color: #00C800;">NIL</span><span style="color: #000000;">)</span><br /> </div>[/code:38k0jzc4]
4.- Si te fijas dentro del TIMER esta definida una función, Ventana(), en esa función metes el código
de lo que quieres que se haga.
Saludos |
timer con un boton | [img:1l6vwgj3]https://i.imgur.com/LqeJED9.png[/img:1l6vwgj3] |
timer con un boton | [code=fw:a1yhu854]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><span style="color: #B900B9;">//-> By Joao Santos - Sao Paulo - Brazil - <!-- e --><a href="mailto:[email protected]">[email protected]</a><!-- e --></span><br /><span style="color: #B900B9;">//-> Participacao Especial, Vailton Renato - <!-- e --><a href="mailto:[email protected]">[email protected]</a><!-- e --></span><br /><br /><span style="color: #00D7D7;">#Include</span> <span style="color: #ff0000;">"FiveWin.Ch"</span><br /><br /><span style="color: #00C800;">STATIC</span> oDlgRelog, oTimerRelog, lDesliga := .F., oWnd, oTimerPorta<br /><span style="color: #00C800;">STATIC</span> oFnt, oSaida<br /><br /><span style="color: #B900B9;">//---------------------------------------------------------------------------//</span><br /><br /><span style="color: #00C800;">FUNCTION</span> RELOG<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><br /> <span style="color: #00C800;">LOCAL</span> oSayMens, oFnt2, aGrad<br /><br /> oSayMens := <span style="color: #ff0000;">"This a Test message"</span><br /><br /> aGrad := <span style="color: #000000;">{</span> <span style="color: #000000;">{</span> <span style="color: #000000;">0.30</span>, CLR_BLACK, CLR_YELLOW<span style="color: #000000;">}</span>,<span style="color: #000000;">{</span> <span style="color: #000000;">0.70</span>, CLR_YELLOW, CLR_BLACK <span style="color: #000000;">}</span> <span style="color: #000000;">}</span><br /><br /> <span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">FONT</span> oFnt <span style="color: #0000ff;">NAME</span> <span style="color: #ff0000;">"Arial"</span> <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">08</span>, <span style="color: #000000;">20</span> BOLD<br /> <span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">FONT</span> oFnt2 <span style="color: #0000ff;">NAME</span> <span style="color: #ff0000;">"Arial"</span> <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">00</span>, <span style="color: #000000;">-12</span> BOLD<br /><br /> <span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">DIALOG</span> oDlgRelog <span style="color: #0000ff;">FROM</span> <span style="color: #000000;">3</span>, <span style="color: #000000;">3</span> <span style="color: #0000ff;">TO</span> <span style="color: #000000;">20</span>, <span style="color: #000000;">50</span> ;<br /> <span style="color: #0000ff;">TITLE</span> <span style="color: #ff0000;">"Test of Message with Timer"</span> ;<br /> GRADIENT aGrad TRANSPARENT ;<br /> <span style="color: #0000ff;">STYLE</span> nOR<span style="color: #000000;">(</span> DS_MODALFRAME <span style="color: #000000;">)</span><br /><br /> oDlgRelog:<span style="color: #000000;">lHelpIcon</span> := .F.<br /><br /> @ .<span style="color: #000000;">5</span>,<span style="color: #000000;">10</span> <span style="color: #0000ff;">SAY</span> oSayMens <span style="color: #0000ff;">OF</span> oDlgRelog <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">100</span>, <span style="color: #000000;">12</span> ;<br /> <span style="color: #0000ff;">COLOR</span> CLR_BLACK, CLR_WHITE TRANSPARENT <span style="color: #0000ff;">ADJUST</span><br /><br /> @ <span style="color: #000000;">5</span>, <span style="color: #000000;">11</span> <span style="color: #0000ff;">BUTTON</span> oSaida <span style="color: #0000ff;">PROMPT</span> <span style="color: #ff0000;">"&Timer"</span> <span style="color: #0000ff;">OF</span> oDlgRelog ;<br /> <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">50</span>, <span style="color: #000000;">14</span> ;<br /> <span style="color: #0000ff;">ACTION</span><span style="color: #000000;">(</span> ACIONA_TIMER<span style="color: #000000;">(</span> oWnd <span style="color: #000000;">)</span> <span style="color: #000000;">)</span><br /><br /> oSaida:<span style="color: #000000;">cToolTip</span> := <span style="color: #ff0000;">"Timer"</span><br /><br /> SET <span style="color: #0000ff;">FONT</span> <span style="color: #0000ff;">OF</span> oSaida <span style="color: #0000ff;">TO</span> oFnt<br /> SET <span style="color: #0000ff;">FONT</span> <span style="color: #0000ff;">OF</span> oDlgRelog <span style="color: #0000ff;">TO</span> oFnt2<br /><br /> <span style="color: #0000ff;">ACTIVATE</span> <span style="color: #0000ff;">DIALOG</span> oDlgRelog <span style="color: #0000ff;">CENTERED</span><br /><br /> <span style="color: #00C800;">IF</span> lDesliga<br /> oTimerRelog:<span style="color: #000000;">DeActivate</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> oTimerPorta:<span style="color: #000000;">DeActivate</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> <span style="color: #00C800;">ENDIF</span><br /><br /> oFnt:<span style="color: #000000;">End</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> oFnt2:<span style="color: #000000;">End</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><br /><span style="color: #00C800;">RETURN</span> <span style="color: #00C800;">NIL</span><br /><br /><span style="color: #00C800;">FUNCTION</span> ACIONA_TIMER<span style="color: #000000;">(</span> oWnd <span style="color: #000000;">)</span><br /><br /> <span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">TIMER</span> oTimerPorta <span style="color: #0000ff;">INTERVAL</span> <span style="color: #000000;">50</span> <span style="color: #0000ff;">OF</span> oDlgRelog ;<br /> <span style="color: #0000ff;">ACTION</span> ACIONA_RELOGIO<span style="color: #000000;">(</span> oWnd <span style="color: #000000;">)</span><br /><br /> <span style="color: #0000ff;">ACTIVATE</span> <span style="color: #0000ff;">TIMER</span> oTimerPorta<br /><br /><span style="color: #00C800;">RETURN</span> <span style="color: #00C800;">NIL</span><br /><br /><span style="color: #00C800;">FUNCTION</span> ACIONA_RELOGIO<span style="color: #000000;">(</span> oWnd <span style="color: #000000;">)</span><br /><br /> <span style="color: #00C800;">LOCAL</span> oFont<br /><br /> <span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">FONT</span> oFont <span style="color: #0000ff;">NAME</span> <span style="color: #ff0000;">"Arial"</span> <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">0</span>, <span style="color: #000000;">-70</span> BOLD<br /> <span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">FONT</span> oFnt <span style="color: #0000ff;">NAME</span> <span style="color: #ff0000;">"Arial"</span> <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">08</span>, <span style="color: #000000;">20</span> BOLD<br /><br /> <span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">TIMER</span> oTimerRelog <span style="color: #0000ff;">INTERVAL</span> <span style="color: #000000;">50</span> ;<br /> <span style="color: #0000ff;">ACTION</span> ExibeRelogio<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><br /> <span style="color: #0000ff;">ACTIVATE</span> <span style="color: #0000ff;">TIMER</span> oTimerRelog<br /><br /> SET <span style="color: #0000ff;">FONT</span> <span style="color: #0000ff;">OF</span> oDlgRelog <span style="color: #0000ff;">TO</span> oFont<br /> SET <span style="color: #0000ff;">FONT</span> <span style="color: #0000ff;">OF</span> oSaida <span style="color: #0000ff;">TO</span> oFnt<br /><br /> oFont:<span style="color: #000000;">End</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><br /> lDesliga := .T. <span style="color: #B900B9;">//-> Para Desligar o Timer</span><br /><br /> oTimerPorta:<span style="color: #000000;">DeActivate</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><br /><span style="color: #00C800;">RETURN</span> <span style="color: #00C800;">NIL</span><br /><br /><span style="color: #00C800;">FUNCTION</span> ExibeRelogio<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><br /> <span style="color: #00C800;">LOCAL</span> NewMensa := <span style="color: #ff0000;">"Mensagem"</span><br /><br /> <span style="color: #B900B9;">// Mensageria</span><br /> <span style="color: #00C800;">IF</span> ISWINDOWVISIBLE<span style="color: #000000;">(</span> oDlgRelog:<span style="color: #000000;">hWnd</span> <span style="color: #000000;">)</span><br /><br /> oDlgRelog:<span style="color: #0000ff;">Say</span><span style="color: #000000;">(</span> <span style="color: #000000;">3</span>, <span style="color: #000000;">01</span>, NewMensa, ;<br /> CLR_YELLOW, CLR_BLACK,, .F. <span style="color: #000000;">)</span><br /> <span style="color: #B900B9;">// .T. Esquerda - .F. Direita da Dialog.</span><br /><br /> <span style="color: #00C800;">ENDIF</span><br /><br /><span style="color: #00C800;">RETURN</span> <span style="color: #00C800;">NIL</span><br /><br /><span style="color: #B900B9;">//-> FIM / END</span><br /> </div>[/code:a1yhu854]
Saludos. |
timer con un boton | Gracias Armando y Joao al fin pude entender como trabaja el timer
Asi lo hice y funciono!
[code=fw:2whpc5d6]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><br /><span style="color: #00C800;">STATIC</span> oTmr<br /><br /><span style="color: #0000ff;">REDEFINE</span> <span style="color: #0000ff;">BUTTON</span> oBtnE <span style="color: #0000ff;">ID</span> <span style="color: #000000;">4029</span> <span style="color: #0000ff;">OF</span> oFld:<span style="color: #000000;">aDialogs</span><span style="color: #000000;">[</span><span style="color: #000000;">1</span><span style="color: #000000;">]</span> ; <br /><span style="color: #0000ff;">ACTION</span> <span style="color: #000000;">(</span> ActivaTimer<span style="color: #000000;">(</span><span style="color: #000000;">)</span> , Proceso<span style="color: #000000;">(</span><span style="color: #000000;">)</span> <span style="color: #000000;">)</span><br /><br /><span style="color: #00C800;">Static</span> <span style="color: #00C800;">Function</span> ActivaTimer<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> <span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">TIMER</span> oTmr <span style="color: #0000ff;">of</span> oMainWnd <span style="color: #0000ff;">INTERVAL</span> <span style="color: #000000;">10000</span> <span style="color: #0000ff;">ACTION</span> MuestraMsje<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> <span style="color: #0000ff;">ACTIVATE</span> <span style="color: #0000ff;">timer</span> oTmr<br /><span style="color: #00C800;">Return</span> <span style="color: #00C800;">Nil</span><br /><br /><span style="color: #00C800;">Function</span> MuestraMsje<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> Msgalert<span style="color: #000000;">(</span><span style="color: #ff0000;">'Finalizo tiempo de espera'</span><span style="color: #000000;">)</span><br /> Proceso<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><span style="color: #00C800;">Return</span> <span style="color: #00C800;">Nil</span><br /><br /><span style="color: #00C800;">Function</span> Proceso<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br />...<br />…<br /><br /><span style="color: #00C800;">if</span> ltimer<br /> otmr:<span style="color: #000000;">deactivate</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><span style="color: #00C800;">endif</span><br /><span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span><br /> </div>[/code:2whpc5d6]
GRACIAS!!! |
timer con un boton | Very good. Muy bién!
Saludos. |
timer con un boton | Artu01:
Excelente, Cuando nos lo explican todo es mas sencillo <!-- s:) --><img src="{SMILIES_PATH}/icon_smile.gif" alt=":)" title="Smile" /><!-- s:) -->
Saludos |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.