cs_stargates
Messages postés40Date d'inscriptionsamedi 24 juillet 2004StatutMembreDernière intervention10 janvier 2008
-
25 sept. 2004 à 11:58
cboulas
Messages postés2641Date d'inscriptionmercredi 2 juin 2004StatutMembreDernière intervention 8 janvier 2014
-
26 sept. 2004 à 11:00
J'ai confectionné un petit exécutable mot de passe et je le déploie avec installshield devstudio 9.
Je l'ai installé sur un autre ordi.
Tout fonctionne bien a part quand l'utilisateur se trompe de mot de passe.
Au lieu de fermer windows, il me donne un message d'erreur
Erreur 53 fichier introuvable
Voici le code
Code:
Option Explicit
Private Declare Function GetUserName Lib "advapi32.dll" Alias "GetUserNameA" (ByVal lpbuffer As String, nSize As Long) As Long
Private Declare Function EnableWindow Lib "user32" (ByVal hwnd As Long, ByVal fEnable As Long) As Long
Private Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As Long
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 SWP_HIDEWINDOW = &H80
Private Const SWP_SHOWWINDOW = &H40
Private HwndTaskBar As Long
Public OK As Boolean
Private Sub Form_Activate()
txtmotdepasse.PasswordChar = "*"
End Sub
Private Sub Form_Load()
Dim sBuffer As String
Dim lSize As Long
HwndTaskBar = FindWindow("Shell_traywnd", "")
Call SetWindowPos(HwndTaskBar, 0, 0, 0, 0, 0, SWP_HIDEWINDOW)
Call DesactiveBureau
sBuffer = Space$(255)
lSize = Len(sBuffer)
Call GetUserName(sBuffer, lSize)
If lSize > 0 Then
txtusername.Text = Left$(sBuffer, lSize)
Else
txtusername.Text = vbNullString
End If
End Sub
Private Sub cmdOK_Click()
'À faire - créer test pour mot de passe correct
'vérifier si mot de passe correct
If txtmotdepasse.Text = "stargate" Then
OK = True
Me.Hide
Call SetWindowPos(HwndTaskBar, 0, 0, 0, 0, 0, SWP_SHOWWINDOW)
Call ActiveBureau
End
Else
Shell "shutdown -s -t 0"
End If
End Sub
Sub DesactiveBureau()
Call EnableWindow(FindWindow(vbNullString, "Program Manager"), False)
End Sub
Sub ActiveBureau()
Call EnableWindow(FindWindow(vbNullString, "Program Manager"), True)
End Sub
Private Sub Form_QueryUnload(Cancel As Integer, UnloadMode As Integer)
Call SetWindowPos(HwndTaskBar, 0, 0, 0, 0, 0, SWP_SHOWWINDOW)
End Sub
Peut-on me dire quel est le fichier manquant + la solution
cboulas
Messages postés2641Date d'inscriptionmercredi 2 juin 2004StatutMembreDernière intervention 8 janvier 201416 25 sept. 2004 à 12:04
Salut,
A mon avis ton problème viens de l'extinction du PC, car les version windows 9x n'ont pas le ficheir "shutdown", regarde dans ma source : "Extinction de PC à distance" tu y trouvera tout les format d'extinction des windows NT, 9x, 2000, et Xp