Mettre une application en premier plan? et autres questions
jnbrunet
Messages postés258Date d'inscriptionsamedi 25 décembre 2004StatutMembreDernière intervention13 novembre 2012
-
29 mars 2005 à 19:45
Hedrock
Messages postés9Date d'inscriptionlundi 7 juillet 2003StatutMembreDernière intervention30 mars 2005
-
30 mars 2005 à 15:37
Quelles sont les apis pour mettre une application(j'ai son handle) en premier plan, pour fermer cette même application, et pour exécuter un raccoursi?
Jn
A voir également:
Mettre une application en premier plan? et autres questions
Hedrock
Messages postés9Date d'inscriptionlundi 7 juillet 2003StatutMembreDernière intervention30 mars 2005 30 mars 2005 à 15:37
Salut,
Pour mettre une feuille au premier plan:
Private Declare Function SetWindowPos Lib "user32" (ByVal hwnd As Long, ByVal hWndInsertAfter As Long, ByVal x As Long, ByVal y As Long, ByVal cx As Long, ByVal cy As Long, ByVal wFlags As Long) As Long
'**
Private Const DEVANT = -1&
Private Const NON_DEVANT = -2&
Private Const SWP_NOMOVE = &H2
Private Const SWP_NOSIZE = &H1
Private Const SWP_NOACTIVATE = &H10
Private Const SWP_SHOWWINDOW = &H40
Public Sub FormTop(ctrl As Form)
SetWindowPos ctrl.Hwnd, DEVANT, 0, 0, 0, 0, SWP_NOMOVE Or SWP_NOSIZE
End Sub
Public Sub FormNoTop(ctrl As Form)
SetWindowPos ctrl.Hwnd, NON_DEVANT, 0, 0, 0, 0, SWP_NOMOVE Or SWP_NOSIZE
End Sub
Ce code marche avec le handle d'un formulaire, essaye de voir si ça marche
dans ton cas.
Pour exécuter un raccourcis (ou tout autre document):
Private Declare Function ShellExecute Lib "shell32.dll" Alias "ShellExecuteA" (ByVal hwnd As Long, ByVal lpOperation As String, ByVal lpFile As String, ByVal lpParameters As String, ByVal lpDirectory As String, ByVal nShowCmd As Long) As Long