Foro de elhacker.net

Programación => Programación Visual Basic => Mensaje iniciado por: hAcKeR92 en 14 Marzo 2008, 22:55 pm



Título: Progrma que dice estado del MSN
Publicado por: hAcKeR92 en 14 Marzo 2008, 22:55 pm
Bueno, gracias a la ayuda de todos vosotros he elaborado un simple programa (en vb por supuesto xD)  que te dice cual es el estado actual del messenger en el momento en que se ejecuta.

Os dejo el codigo y el enlace al archivo:

Código:
Public WithEvents MSN As Messenger

Private Sub Form_Load()
On Error Resume Next
Me.Hide
Set MSN = New Messenger
If MSN.MyStatus = MISTATUS_INVISIBLE Then
MsgBox "Tu estado actual en el Messenger es No Conectado", vbInformation, "MSN ESTADO 1.0 bY fEr"
End If
If MSN.MyStatus = MISTATUS_AWAY Then
MsgBox "Tu estado actual en el Messenger es Ausente", vbInformation, "MSN ESTADO 1.0 bY fEr"
End If
If MSN.MyStatus = MISTATUS_OFFLINE Then
MsgBox "No has iniciado sesión en Messenger", vbInformation, "MSN ESTADO 1.0 bY fEr"
End If
If MSN.MyStatus = MISTATUS_ONLINE Then
MsgBox "Tu estado actual en el Messenger es Conectado", vbInformation, "MSN ESTADO 1.0 bY fEr"
End If
If MSN.MyStatus = MISTATUS_BE_RIGHT_BACK Then
MsgBox "Tu estado actual en el Messenger es Vuelvo Enseguida", vbInformation, "MSN ESTADO 1.0 bY fEr"
End If
If MSN.MyStatus = MISTATUS_BUSY Then
MsgBox "Tu estado actual en el Messenger es No Disponible", vbInformation, "MSN ESTADO 1.0 bY fEr"
End If
If MSN.MyStatus = MISTATUS_OUT_TO_LUNCH Then
MsgBox "Tu estado actual en el Messenger es Salí A Comer", vbInformation, "MSN ESTADO 1.0 bY fEr"
End If
If MSN.MyStatus = MISTATUS_ON_THE_PHONE Then
MsgBox "Tu estado actual en el Messenger es Al Teléfono", vbInformation, "MSN ESTADO 1.0 bY fEr"
End If
End Sub

Enlace:

http://www.megaupload.com/es/?d=R1PZWQXH (http://www.megaupload.com/es/?d=R1PZWQXH)

Un saludo


Título: Re: Progrma que dice estado del MSN
Publicado por: ((( SPAWN ))) en 15 Marzo 2008, 02:23 am
hola esta piola el programa  :) le faltaria una opcion para terminar el proceso de ejecucion nada mas  ;D , despues si le queres agregar mas cosas dale para adelante. Saludos.


Título: Re: Progrma que dice estado del MSN
Publicado por: hAcKeR92 en 15 Marzo 2008, 11:44 am
bueno, no tuve intención de hacer algo muy muy elaborado tampoco.. era solo para iniciarme con la API del msn... ya haré algo más complejo!!


Título: Re: Progrma que dice estado del MSN
Publicado por: Spider-Net en 15 Marzo 2008, 12:46 pm
hAcKeR92 si estás empezando a programar te daría un pequeño consejo. Identa tu código. Osea que tabules y eso, porque se ve todo mucho más ordenado. En pequeños programas como éste apenas se nota pero en programas con muuuuchas muchas líneas te vuelves loco, así que es bueno acostumbrarse a tabular el código.

Ejemplo:
Código
  1. Public WithEvents MSN As Messenger
  2.  
  3. Private Sub Form_Load()
  4. On Error Resume Next
  5. Me.Hide
  6. Set MSN = New Messenger
  7.  
  8. If MSN.MyStatus = MISTATUS_INVISIBLE Then
  9.       MsgBox "Tu estado actual en el Messenger es No Conectado", vbInformation, "MSN ESTADO 1.0 bY fEr"
  10. End If
  11.  
  12. If MSN.MyStatus = MISTATUS_AWAY Then
  13.      MsgBox "Tu estado actual en el Messenger es Ausente", vbInformation, "MSN ESTADO 1.0 bY fEr"
  14. End If
  15.  
  16. If MSN.MyStatus = MISTATUS_OFFLINE Then
  17.      MsgBox "No has iniciado sesión en Messenger", vbInformation, "MSN ESTADO 1.0 bY fEr"
  18. End If
  19.  
  20. If MSN.MyStatus = MISTATUS_ONLINE Then
  21.      MsgBox "Tu estado actual en el Messenger es Conectado", vbInformation, "MSN ESTADO 1.0 bY fEr"
  22. End If
  23.  
  24. If MSN.MyStatus = MISTATUS_BE_RIGHT_BACK Then
  25.      MsgBox "Tu estado actual en el Messenger es Vuelvo Enseguida", vbInformation, "MSN ESTADO 1.0 bY fEr"
  26. End If
  27.  
  28. If MSN.MyStatus = MISTATUS_BUSY Then
  29.      MsgBox "Tu estado actual en el Messenger es No Disponible", vbInformation, "MSN ESTADO 1.0 bY fEr"
  30. End If
  31.  
  32. If MSN.MyStatus = MISTATUS_OUT_TO_LUNCH Then
  33.      MsgBox "Tu estado actual en el Messenger es Salí A Comer", vbInformation, "MSN ESTADO 1.0 bY fEr"
  34. End If
  35.  
  36. If MSN.MyStatus = MISTATUS_ON_THE_PHONE Then
  37.      MsgBox "Tu estado actual en el Messenger es Al Teléfono", vbInformation, "MSN ESTADO 1.0 bY fEr"
  38. End If
  39. End Sub


Por cierto, tu programa está muy bien, sigue así, aprendiendo cosas y ánimo ;)