Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How to make application active after RUN /N7 (bug?)
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
01033827
Message ID:
01033845
Vues:
16
This message has been marked as the solution to the initial question of the thread.
I'm going to take a wild guess and say that you are running into the change that came about in Windows 2000 that changed the way that SetForegroundWindow operates. I wrote a FAQ about this over in the Tek-Tips Forum. Here's the link...

http://www.tek-tips.com/faqs.cfm?fid=4262


>To reproduce:
>
>1. Make sure that charmap.exe (or any other application executed by run /N) is in path.
>
>2. Create test.exe from the code below
>
>
BUILD PROJECT test FROM TEST
>BUILD EXE test FROM test
>QUIT
>
>3. Run test.exe outside VFP
>
>4. Press some character keys in keyboard
>
>Observed result:
>
>pressed keys are not echoed in screen
>
>Expected result:
>
>pressed keys must be echoed in screen
>
>Platforms: VFP 7, VFP 9 in XP SP2
>
>Any idea how to get expected result ?
>
>
RUN /N7 charmap.exe
>DECLARE SHORT SetForegroundWindow IN USER32.DLL INTEGER hWnd
>SetForegroundWindow(_screen.HWnd)
>ACTIVATE SCREEN
>CLEAR
>SET TALK OFF
>SET ECHO OFF
>? 'Press keyboard keys to test foreground state'
>?
>DO WHILE .t.
>  nres = INKEY()
>  IF nres=27
>    EXIT
>    ENDIF
>
>  IF nres#0
>    ??CHR(nres)
>    ENDIF
>ENDDO
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform