Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
VFP Apps Always takes Focus - Can this be changed?
Message
De
25/04/2008 16:40:44
 
 
À
25/04/2008 10:45:13
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Versions des environnements
Visual FoxPro:
VFP 9 SP2
OS:
Windows XP SP2
Network:
Windows NT
Database:
MS SQL Server
Divers
Thread ID:
01312973
Message ID:
01313203
Vues:
31
Tracy,

I probably didn't make myself as clear as I could have. Each of my PRGS is launched by a scheduling program called "JIT.EXE" with the line of:
C:\VFP9\vfp9.exe" -t -cC:\VFP\Silent.fpw "DeleteFileOnReboot.prg
So, each PRG launches a copy of VFP9. I don't see how the API could help me, unless I was launching each of the PRGS from a master VFP9 application. Right?

Thanks,
Robert

>Try something like:
STORE ADLLS(dllArray) TO lnNumDLLs
IF ASCAN(dllArray,"GetActiveWindow") = 0
      DECLARE INTEGER GetActiveWindow IN User32 INTEGER
ENDIF
IF ASCAN(dllArray,"SetForegroundWindow") = 0
      DECLARE INTEGER SetForegroundWindow IN User32 INTEGER
ENDIF

*--Get the current calling program's window
IF TYPE('gnMainFoxWin') <> "N" .or. gnMainFoxWin = 0
      gnMainFoxWin=GetActiveWindow()
ENDIF

*--Run your prg that shifts focus
*--Note you might need a doevents after or a method of waiting for the focus
*--to shift so you can bring it back (don't call setforegroundwindow too 
*--soon)
*--Experiment with a DOEVENTS FORCE force here if you run into problems
*--but try it first without it

*--Bring focus back to the calling program
IF TYPE('gnFoxMainWin') = "N" AND gnFoxMainWin <> 0
      =SetForegroundWindow(gnMainFoxWin)            
ENDIF
DOEVENTS FORCE
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform