Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Making top level form active
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Divers
Thread ID:
00768739
Message ID:
00806821
Vues:
30
Glad to help. I'm still looking for that perfect solution, though. <g>

The one where we don't have to see the VFP main window "flash" and we can get the top level form to get the focus properly. I still think there was a thread out here on the UT that had one suggestion I don't think I tried and it sounded like it had potential.

>Thanks very much for this!
>
>I had given up long ago, living with the need to click to make it active (had the code line in Init()).
>In Activate() did it for me!
>
>
>>I recently had this same problem that is due to some bugs in VFP. I tried all the solutions presented here. The API call did not work for me for whatever reason. Putting SCREEN=OFF in the CONFIG.FPW that is compiled into the EXE simply results in your original problem - the app does not get focus as it should. I did notice that it seemed to depend on the operating system - on some computers the app would receive focus properly. At least that's my memory of it. The only way I could get it to receive focus reliably was to put
>>
>>application.Visible = .f.
>>
>>in the Activate method of the form (not the Init - there's a KB article on that - it has to be in the Activate). This, however, causes the "flashing" - you see the VFP desktop, then it is hidden and you just see your app. Not attractive, but for my purposes it just really wasn't that big of a deal. I'd rather have the app get the focus as it should after it is started.
>>
>>
>>
>>>>>>>>>I have a single form called from a PRG. It is set up as a top level form. I also set _SCREEN.Visible=.f. at the top of my PRG. The problem is that when I run the executable I create I see the form (with no desktop, as desired) but I have to click on the screen to make it active. I have mostly done FPW apps so I'm not that fluent in the basics of VFP 6. What do I need to add to make the form active?
>>>>>>>>
>>>>>>>>I heavily work with SDI forms and never had this problem. However I don't do that the way you do. I think your problem is using :
>>>>>>>>_screen.visible = .f.
>>>>>>>>
>>>>>>>>What I do is to have a config.fpw with :
>>>>>>>>screen = off
>>>>>>>>
>>>>>>>>Cetin
>>>>>>>
>>>>>>>I thought of that and tried it but I have more than one program in the same directory. I don't want all apps to have the screen invisible. That's why I put it in the code.
>>>>>>>
>>>>>>>I wound up putting the code in the screen's Activate event code.
>>>>>>
>>>>>>You could then create a special config.fpw only for that one. ie:
>>>>>>*config.spc
>>>>>>screen=off
>>>>>>
>>>>>>myexe -cconfig.spc
>>>>>>
>>>>>>Cetin
>>>>>
>>>>>I thought of that too but the user usually winds up just double-clicking the executable in Windows Explorer. We can't count on the user using a particular shortcut. Thanks for the suggestion, though.
>>>>
>>>>Then build that particular CONFIG.FPW into the .EXE. That way, only that .EXE has that behavior.
>>>
>>>I didn't realize you could build a CONFIG.FPW file into the .EXE. Is there anything special you have to do for your app to use that file other than include it in the project? Does the app know to look there for the CONFIG data?
eCost.com continues to rip people off
Check their rating at ResellerRatings.com
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform