Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How to Highlight a minimized App
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00697567
Message ID:
00697775
Vues:
18
>George, I've advanced a little bit but am still stuck !!
>
>I've set up a .prg as follows:
>------------------------------------
>* ShowWind
>*
>Declare Integer FindWindow in Win32API ;
> String @lpClassName,String @lpWindowName
>
>lcApplicationTitle = "cmd.exe"
>lnHWnd = Findwindow(0,@lcApplicationTitle)
>wait window 'Windows handle for cmd.exe = ' + Str(lnHWnd)
>
>Declare Integer ShowWindow in Win32API ;
> Integer hwnd, Integer nCmdShow
> * lnhWnd is the Window Title
> * Restore it to its last size and position
>= ShowWindow(lnHWnd,9)
>-------------------------------------
>

Rather than the WinAPI, I'd recommend using the WSH's Wscript.Shell's AppActivate() method - pass it the name of the executable or part of the title of the top-level Window of an app, and it'll select the app, bring the top-level window to the foreground and activate the top-level window. You'd use it like:
oShell = CREATEOBJ('Wscript.Shell')
oShell.AppActivate('CMD.EXE')
EMail: EdR@edrauh.com
"See, the sun is going down..."
"No, the horizon is moving up!"
- Firesign Theater


NT and Win2K FAQ .. cWashington WSH/ADSI/WMI site
MS WSH site ........... WSH FAQ Site
Wrox Press .............. Win32 Scripting Journal
eSolutions Services, LLC

The Surgeon General has determined that prolonged exposure to the Windows Script Host may be addictive to laboratory mice and codemonkeys
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform