PinkRabbit84
Messages postés40Date d'inscriptiondimanche 22 octobre 2000StatutMembreDernière intervention29 décembre 2004
-
19 mars 2003 à 02:08
PinkRabbit84
Messages postés40Date d'inscriptiondimanche 22 octobre 2000StatutMembreDernière intervention29 décembre 2004
-
20 mars 2003 à 03:46
Comment fait on pour afficher une form sans qu'elle est le focus. C'est pour faire comme les alerts de MSN.
fredlynx
Messages postés662Date d'inscriptionmercredi 16 janvier 2002StatutModérateurDernière intervention16 octobre 20103 19 mars 2003 à 10:16
Essaye ça...
'-----------------------------------------------------
' Dans un module.bas
'-----------------------------------------------------
Public Type RECT
Left As Long
Top As Long
Right As Long
Bottom As Long
End Type
Public Type POINTAPI
X As Long
Y As Long
End Type
Public Type WINDOWPLACEMENT
length As Long
flags As Long
showCmd As Long
ptMinPosition As POINTAPI
ptMaxPosition As POINTAPI
rcNormalPosition As RECT
End Type
Private Declare Function GetWindowPlacement Lib "user32" _
(ByVal hwnd As Long, _
lpwndpl As WINDOWPLACEMENT) As Long
Private Declare Function SetWindowPlacement Lib "user32" _
(ByVal hwnd As Long, _
lpwndpl As WINDOWPLACEMENT) As Long
Public Const SW_HIDE = 0
Public Const SW_SHOWNORMAL = 1
Public Const SW_SHOWMINIMIZED = 2
Public Const SW_SHOWMAXIMIZED = 3
Public Const SW_SHOWNOACTIVATE = 4
Public Sub ShowWindows(FrmHwnd As Long, ShowMode As Long, Optional PosLeft As Long -1, Optional PosTop As Long -1, Optional PosRight As Long = -1, Optional PosBottom As Long = -1)
Dim Fenêtre As WINDOWPLACEMENT
With Fenêtre
If PosLeft <> -1 Then .rcNormalPosition.Left = PosLeft
If PosRight <> -1 Then .rcNormalPosition.Right = PosRight
If PosTop <> -1 Then .rcNormalPosition.Top = PosTop
If PosBottom <> -1 Then .rcNormalPosition.Bottom = PosBottom
.length = Len(Fenêtre)
.flags = 0&
.showCmd = ShowMode
End With
Call SetWindowPlacement(FrmHwnd, Fenêtre)
End Sub
'-----------------------------------------------------
' Fin du module
'-----------------------------------------------------
'-----------------------------------------------------
' Appel de la fonction par ...
'-----------------------------------------------------
' Sans activer la fen^tre
ShowWindows Me.hwnd, SW_SHOWNOACTIVATE