Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
VFP steals window focus
Message
De
09/02/2007 19:52:40
 
 
À
09/02/2007 17:43:25
Information générale
Forum:
Visual FoxPro
Catégorie:
Problèmes
Divers
Thread ID:
01194295
Message ID:
01194330
Vues:
14
Hi Peter,

This may be irrelevant, but I've noticed generally strange behaviour - wrong windows getting focus - in XP Pro in general recently.
All manner of oddities
- a RDP session will start up but be behind other windows. Clicking in the RDP window doesn't help. I have to click on its title bar.
- Creating an Outlook e-mail and then moving to Explorer to drag a file to it (attachment), the 'base' Outlook window (not the new message one) somehow get brought in front of the new mesage window.
- there've been others but these are the 2 most consistent/bothersome.

Good luck


>I'm having a problem with VFP 9 exe stealing the focus from the active window when they don't have a app window.
>
>To reproduce this behavior:
>
>Create a new project. Add a .prg, with nothing in it (it doesn't matter if it does something or not, it's just simpler if it does nothing). Add a text file, named "config.fpw", with the following:
>
>---
>SCREEN = OFF
>RESOURCE = OFF
>---
>
>Compile to an .exe. Now open Task Manager, and make sure it is set to be "Always on Top". Open up a session of cmd.exe, and run your exe from there.
>
>It will "steal" the focus from whatever window is active (apparently to the VFP window... which isn't visible), and then close, returning focus to the topmost window. These particular instructions are just to give an obvious visual demonstration of the effect, but this happens no matter how you run the EXE, even if you use CreateProcess() and specify SW_HIDE.
>
>This is Very Bad for my intended application.
>
>Usually it's not too much of a problem, because the focus quickly goes back to the current app, and all you see is a flicker effect, and while I could work around this by creating a VFP OLE instance or something like that, I'd rather fix whatever is causing this problem than resort to hacks.
>
>This could be a Windows problem, I suppose, but I don't see any other programs causing the same behavior, and isn't Windows XP supposed to prevent applications from stealing the focus? Anyone have an idea?
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform