Shell et focus

Résolu
cs_moi4975 Messages postés 109 Date d'inscription lundi 27 juin 2005 Statut Membre Dernière intervention 17 juillet 2007 - 14 août 2005 à 17:43
cs_DARKSIDIOUS Messages postés 15814 Date d'inscription jeudi 8 août 2002 Statut Membre Dernière intervention 4 mars 2013 - 14 août 2005 à 17:58
salut a tous,

voila j'ai un commandbutton qui doit exécuter une application mais je voudrai qu'il lance cette application en lui donnat le focus sur la mienne et en l'ouvrant non minimiser
mais je ne sais pas comment mettre en forme le code derrière shell !
Pouvez-vous m'aider ?

voila mon code:
Shell ("C:\Application.exe")

2 réponses

Utilisateur anonyme
14 août 2005 à 17:56
Bonjour,



Ceci:

Shell "C:\Application.exe", vbNormalNoFocus


ChRB
<hr size="2" width="100%">
Merci de cliquer sur "Réponse acceptée" si une réponse vous convient.
3
cs_DARKSIDIOUS Messages postés 15814 Date d'inscription jeudi 8 août 2002 Statut Membre Dernière intervention 4 mars 2013 129
14 août 2005 à 17:58
Il te suffit de lire la doc sur la fonction Shell :

The windowstyle named argument has these values:



Constant,
Value,
Description,
----

vbHide,
0,
Window is hidden and focus is passed to the hidden window.,
----

vbNormalFocus,
1,
Window has focus and is restored to its original size and
position.,
----

vbMinimizedFocus,
2,
Window is displayed as an icon with focus.,
----

vbMaximizedFocus,
3,
Window is maximized with focus.,
----

vbNormalNoFocus,
4,
Window is restored to its most recent size and position. The
currently active window remains active.,
----

vbMinimizedNoFocus,
6,
Window is displayed as an icon. The currently active window
remains active.



Donc si tu passe l'argument vbNormalNoFocus, VB devrait te lancer la feuille en grandeur normale mais sans lui donner le focus.

DarK Sidious

Un API Viewer (pour le VB, VB.NET, C, C# et Delphi) : www.ProgOtoP.com/popapi/
0