Foro de elhacker.net

Programación => Programación Visual Basic => Mensaje iniciado por: Miseryk en 26 Diciembre 2010, 12:08 pm



Título: [Resuelto] Chinese - Japanese
Publicado por: Miseryk en 26 Diciembre 2010, 12:08 pm
Hola a to2, una vez, como me suele pasar, encontré un código que me mostraba un mensaje (MsgBox) con Kanjis (simbolos chinos / japoneses) no me acuerdo donde está, vale oro, alguno de ustedes sabe como hacer éso? Desde ya muchas gracias.


Título: Re: [Resuelto] Chinese
Publicado por: Miseryk en 26 Diciembre 2010, 12:21 pm
Weno encontré el código, es super largo, hace controles propios, acá pongo algo muy útil.

Código
  1. Option Explicit
  2.  
  3. Private Declare Function GetModuleHandleW Lib "kernel32" (ByVal lpModuleName As Long) As Long
  4. Private Declare Function GetProcAddress Lib "kernel32" (ByVal hModule As Long, ByVal lpProcName As String) As Long
  5. Private Declare Function GetWindowLongA Lib "user32" (ByVal hWnd As Long, ByVal nIndex As Long) As Long
  6. Private Declare Function SetWindowLongA Lib "user32" (ByVal hWnd As Long, ByVal nIndex As Long, ByVal dwNewLong As Long) As Long
  7. Private Declare Function SetWindowLongW Lib "user32" (ByVal hWnd As Long, ByVal nIndex As Long, ByVal dwNewLong As Long) As Long
  8. Private Declare Function SetWindowTextW Lib "user32" (ByVal hWnd As Long, ByVal lpString As Long) As Long
  9.  
  10. Private Const GWL_WNDPROC = -4
  11.  
  12. Private m_Caption As String
  13.  
  14. Public Property Get CaptionW() As String
  15.    CaptionW = m_Caption
  16. End Property
  17.  
  18. Public Property Let CaptionW(ByRef NewValue As String)
  19.    Static WndProc As Long, VBWndProc As Long
  20.    m_Caption = NewValue
  21.    ' get window procedures if we don't have them
  22.    If WndProc = 0 Then
  23.        ' the default Unicode window procedure
  24.        WndProc = GetProcAddress(GetModuleHandleW(StrPtr("user32")), "DefWindowProcW")
  25.        ' window procedure of this form
  26.        VBWndProc = GetWindowLongA(hWnd, GWL_WNDPROC)
  27.    End If
  28.    ' ensure we got them
  29.    If WndProc <> 0 Then
  30.        ' replace form's window procedure with the default Unicode one
  31.        SetWindowLongW hWnd, GWL_WNDPROC, WndProc
  32.        ' change form's caption
  33.        SetWindowTextW hWnd, StrPtr(m_Caption)
  34.        ' restore the original window procedure
  35.        SetWindowLongA hWnd, GWL_WNDPROC, VBWndProc
  36.    Else
  37.        ' no Unicode for us
  38.        Caption = m_Caption
  39.    End If
  40. End Property
  41.  
  42. Private Sub Form_Load()
  43. Me.CaptionW = "UniControls sample: " & ChrW$(&H3042) & ChrW$(&H3044) & ChrW$(&H3046) & ChrW$(&H3048) & ChrW$(&H304A)
  44. End Sub
  45.  

El archivo se llama UniControl2117366192008.rar, por si lo encuentrar en internet,, debe ser de Planet Source Code (Y), no sé como subirlo acá y x lo q ví, creo q no se puede. (Y)


Título: Re: [Resuelto] Chinese
Publicado por: Psyke1 en 26 Diciembre 2010, 16:52 pm
Muy interesante ;)
Voy a buscar más al respecto... :)

DoEvents! :P