Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Invisible form to use as an NT Service
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Divers
Thread ID:
00440518
Message ID:
00440581
Vues:
17
Thanks Mal, I'll definitely give this a try. My brain just didn't want to wrap around such a simple task. Have a good one.

>Hi George:
>
>Try this...
>
>1. SCREEN=OFF in your CONFIG.FPW
>
>2. Have your TIMER read 2 other files just like you read your "STOP" file. a)Visible.txt and b)Invisible.txt. Of course only one or the other can exist at any one time.
>
>3. Obviously, when Visible.txt exists Form.Visible = .T. and Invisible.txt will make Form.Visible = .F.
>
>I have a data driven version of this - VFP's DBC/DBF should do fine. The timer polls the database once per timer event, as opposed to different files on the disk. Fields "VISIBLE" and "STOP" are set to either T/F depending on what you want at the time. You also don't have to worry about having both "Visible.txt" and "Invisible.txt" as one or the other.
>
>This can be extended to handle many other situations.
>
>HTH
>
>Mal
>
>
>
>
>
>
>>>>>>I am trying to create and app that will be turned into a service (using srvany). I have one form with a timer that checks every so often for certain files. The problem is that even though the visible property of the form is set to .f. it resets itself to .t. and is visible. Basically I have main.prg that says 'do form frmmain' followed by a read events.
>>>>>>
>>>>>>The form runs but is visible. Anyone have any idea what I am doing wrong?
>>>>>
>>>>>Have you included SCREEN=OFF in your CONFIG.FPW?
>>>>
>>>>No, I hadn't tried that because I wanted the screen available in case I wanted to bring up the debugger or something. Should not the screen be there with an invisible form if the form.visible=.f.?
>>>
>>>OIC. When I saw you wanted to create an NT Service, I thought you wanted the entire application to be invisible.
>>>
>>>Hmm... I don't know if you can do what you're trying to do. VFP might want something to have the focus, and for that to happen it must be visible.
>>>
>>>You could try programmatically adding an object to _Screen and working with that. Is it *just* a timer you need, or is there other stuff on the form?
>>
>>Well, you are right, when I am done I want the entire app to be invisible. Was just trying to have the form invisible but the _screen visible for debugging purposes. It's Friday and my brain isn't working properly :)
>>
>>I was thinking about doing it programmatically but needed this first version done by this afternoon and figured I would do a quick and dirty. The only things I have on the form are a timer and a command button. When the timer fires it calls a method on the form that checks for some files, does some stuff if they exist, and then goes back to sleep until the next timer event. One of the files that it checks for is a file named 'stop'. If it sees that one it is supposed to make the window visible so that I can shut it down rather than rudely killing the service. The button merely holds the commands 'thisform.release' and 'clear events'
>>
>>Thanks for your quick replys...especially on a Friday afternoon (grin)
Everything we see or seems
Is but a dream within a dream
- Edgar Allen Poe
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform