Ver Mensaje Individual
  #9 (permalink)  
Antiguo 24/01/2012, 06:11
Avatar de pkj
pkj
 
Fecha de Ingreso: julio-2006
Ubicación: Órbita sincrónica
Mensajes: 899
Antigüedad: 18 años, 8 meses
Puntos: 29
Respuesta: Ocultar Caracteres de Inputbox

solo tienes que añadir un modulo bas y pegarle este codigo:

Código vb:
Ver original
  1. Option Explicit
  2.  
  3.  
  4.  
  5.  
  6.  
  7. ' Declaraciones del Api
  8.  
  9. Private Declare Function KillTimer Lib "user32" (ByVal hwnd As Long, _
  10.  
  11.                                         ByVal nIDEvent As Long) As Long
  12.  
  13.  
  14.  
  15. Private Declare Function SendMessageLongRef Lib "user32" _
  16.  
  17.         Alias "SendMessageA" ( _
  18.  
  19.         ByVal hwnd As Long, _
  20.  
  21.         ByVal wMsg As Long, _
  22.  
  23.         ByVal wParam As Long, _
  24.  
  25.         ByRef lParam As Long) As Long
  26.  
  27.  
  28.  
  29. Private Declare Function FindWindow Lib "user32" _
  30.  
  31.         Alias "FindWindowA" ( _
  32.  
  33.         ByVal lpClassName As String, _
  34.  
  35.         ByVal lpWindowName As String) As Long
  36.  
  37.                          
  38.  
  39. Private Declare Function FindWindowEx Lib "user32" _
  40.  
  41.         Alias "FindWindowExA" ( _
  42.  
  43.         ByVal hWnd1 As Long, _
  44.  
  45.         ByVal hWnd2 As Long, _
  46.  
  47.         ByVal lpsz1 As String, _
  48.  
  49.         ByVal lpsz2 As String) As Long
  50.  
  51.                          
  52.  
  53. Private Declare Function SetTimer Lib "user32" ( _
  54.  
  55.         ByVal hwnd As Long, _
  56.  
  57.         ByVal nIDEvent As Long, _
  58.  
  59.         ByVal uElapse As Long, _
  60.  
  61.         ByVal lpTimerFunc As Long) As Long
  62.  
  63.                          
  64.  
  65.                          
  66.  
  67. Private m_ASC As Long
  68.  
  69.  
  70.  
  71.  
  72.  
  73. Sub inputbox_Password(El_Form As Form, Caracter As String)
  74.  
  75.      
  76.  
  77.     m_ASC = Asc(Caracter)
  78.  
  79.      
  80.  
  81.     Call SetTimer(El_Form.hwnd, &H5000&, 100, AddressOf TimerProc)
  82.  
  83.  
  84.  
  85. End Sub
  86.  
  87.  
  88.  
  89.  
  90.  
  91. Private Sub TimerProc(ByVal hwnd As Long, ByVal uMsg As Long, ByVal idEvent As Long, _
  92.  
  93.                                                                 ByVal dwTime As Long)
  94.  
  95.          
  96.  
  97.     Dim Handle_InputBox As Long
  98.  
  99.      
  100.  
  101.     'Captura el handle del textBox del InputBox
  102.  
  103.     Handle_InputBox = FindWindowEx(FindWindow("#32770", App.Title), 0, "Edit", "")
  104.  
  105.                  
  106.  
  107.     'Le establece el PasswordChar
  108.  
  109.     Call SendMessageLongRef(Handle_InputBox, &HCC&, m_ASC, 0)
  110.  
  111.     'Finaliza el Timer
  112.  
  113.     Call KillTimer(hwnd, idEvent)
  114.  
  115.  
  116.  
  117. End Sub

Y donde muestras el inputbox desde tu codigo solo pon:

Dim Password as string

Call inputbox_Password(Me, "*")

PassWord = InputBox(" Ingrese el Password ", App.Title)

y tendras en la variable password el pass tecleado por el user

al menos eso he entendido yo, aunque no lo he probado

suerte
__________________
No hay preguntas tontas, solo gente estup..., ¡No!, ¿como era? No hay gente que pregunte a tontos... ¡Nooo!... ¡Vaya cabeza!