Contole application

Résolu
hmamine Messages postés 15 Date d'inscription samedi 3 mai 2003 Statut Membre Dernière intervention 30 septembre 2007 - 21 juin 2005 à 20:55
hmamine Messages postés 15 Date d'inscription samedi 3 mai 2003 Statut Membre Dernière intervention 30 septembre 2007 - 22 juin 2005 à 14:30
slt, bon voila j'voudrai savoir si on pe controler une application (exemple.exe, sa visibliter sur l'ecran , son positionnemrnt) par une otre application (celle con a programmer)


Par Amine

4 réponses

daetips Messages postés 142 Date d'inscription jeudi 10 juillet 2003 Statut Membre Dernière intervention 10 novembre 2007
21 juin 2005 à 21:24
Ben tu dois chopper le handle

Public Declare Function FindWindowEx Lib "user32" Alias "FindWindowExA" (ByVal hWnd1 As Long, ByVal hWnd2 As Long, ByVal lpsz1 As String, ByVal lpsz2 As String) As Long
Private Declare Function MoveWindow Lib "user32" (ByVal hwnd As Long, ByVal x As Long, ByVal y As Long, ByVal nWidth As Long, ByVal nHeight As Long, ByVal bRepaint As Long) As Long
Public Declare Function GetWindowLong Lib "user32" Alias "GetWindowLongA" (ByVal hwnd As Long, ByVal nIndex As Long) As Long
Public Declare Function SetWindowLong Lib "user32" Alias "SetWindowLongA" (ByVal hwnd As Long, ByVal nIndex As Long, ByVal dwNewLong As Long) As Long
Public Declare Function SetLayeredWindowAttributes Lib "user32" (ByVal hwnd As Long, ByVal crKey As Long, ByVal bAlpha As Byte, ByVal dwflags As Long) As Long

Dim handle as long
handle=findwindow(vbnullstring,"Le nom de la fenêtre a modifier")

Public Function Position(ByVal nHwnd As Long, ByVal x As Long, ByVal y As Long, ByVal nWidth As Long, ByVal nHeight As Long)
MoveWindow nHwnd, x, y, nWidth, nHeight, 1
End Function

Par "visiblité sur l'écran" je pense que tu parles de transparence

'alphaAmount entre 0 et 255

Public Sub MakeWindowTransparent(ByVal hwnd As Long, ByVal alphaAmount As Byte)
Dim lStyle As Long
lStyle = GetWindowLong(hwnd, GWL_EXSTYLE)
lStyle = lStyle Or WS_EX_LAYERED
SetWindowLong hwnd, GWL_EXSTYLE, lStyle
SetLayeredWindowAttributes hwnd, 0, alphaAmount, LWA_ALPHA
End Sub

@+
Daetips
3
daetips Messages postés 142 Date d'inscription jeudi 10 juillet 2003 Statut Membre Dernière intervention 10 novembre 2007
21 juin 2005 à 21:26
oups j'ai oublié les const dsl ! lol

Public Const WS_EX_LAYERED = &H80000
Public Const LWA_COLORKEY = &H1
Public Const LWA_ALPHA = &H2
Public Const GWL_EXSTYLE = (-20)

@+
Daetips
3
Mikey_md Messages postés 33 Date d'inscription dimanche 10 octobre 2004 Statut Membre Dernière intervention 2 février 2014
21 juin 2005 à 21:18
oui tu peut, mais je ne sais pas comment on fait, c'est une histoire de handle, j'ai pas tout compris mais je sais que l'on peut
0
hmamine Messages postés 15 Date d'inscription samedi 3 mai 2003 Statut Membre Dernière intervention 30 septembre 2007
22 juin 2005 à 14:30
Par Amine
0
Rejoignez-nous