| Ce projet nécessite 1 timer Private
Declare Function GetUserName Lib "advapi32.dll" Alias "GetUserNameA"
(ByVal lpBuffer As String, nSize As Long) As Long
Private Declare Function GetTempPath Lib "kernel32" Alias
"GetTempPathA" (ByVal nBufferLength As Long, ByVal lpBuffer As String) As Long
Private Declare Function IsIconic Lib "user32" (ByVal hwnd As Long) As Long
Private Sub Form_Load()
'VbAndJava 1999/2000
'Guerrault Yonni
'E-Mail : Yonni4@iFrance.com
Timer1.Interval = 100
Timer1.Enabled = True
Dim strTemp As String, strUserName As String
strTemp = String(100, Chr$(0))
GetTempPath 100, strTemp
strTemp = Left$(strTemp, InStr(strTemp, Chr$(0)) - 1)
strUserName = String(100, Chr$(0))
GetUserName strUserName, 100
strUserName = Left$(strUserName, InStr(strUserName, Chr$(0)) - 1)
MsgBox "Hello " + strUserName + Chr$(13) + "Le chemin de Temp est " +
strTemp
End Sub
Private Sub Timer1_Timer()
Dim Boo As Boolean
Boo = IsIconic(Me.hwnd)
Me.Caption = "Form1 minimisé: " + Str$(Boo)
End Sub |