I would really appreciate help to set the caption of the VB6 form to a unicode string under Windows XP/7
There are many people who have some ideas on how to do this, but it never seems to be permanent (if the form loses focus, gets partially covered etc the caption goes to ??????)
Many thanks
Ben
VB6 unicode form
Re: VB6 unicode form
Hi,
try this:
I do not use this anywhere, but I have been told that it works very well.
Regards
TiKu
try this:
Code: Select all
Call DefWindowProcW(Form1.hWnd, WM_SETTEXT, 0, StrPtr(myUnicodeString))
Regards
TiKu
Crunching for Fab36_Folding-Division at Folding@Home. Join Fab36/Fab30! - Folding@Home and BOINC
Boycott DRM! Boycott HDCP!
Boycott DRM! Boycott HDCP!
Re: VB6 unicode form
Unfortunately that just shows ?? in the title bar
Source code in full
Option Explicit
Private Declare Function DefWindowProcW Lib "user32" (ByVal hWnd As Long, ByVal wMsg As Long, ByVal wParam As Long, ByVal lParam As Long) As Long
Private Const WM_GETTEXT = &HD
Private Const WM_GETTEXTLENGTH = &HE
Private Const WM_SETTEXT = &HC
Private Sub Command1_Click()
Dim NewValue As String
NewValue = ChrW$(&H6B22) & ChrW$(&H8FCE)
DefWindowProcW Form1.hWnd, WM_SETTEXT, 0, StrPtr(NewValue)
End Sub
Source code in full
Option Explicit
Private Declare Function DefWindowProcW Lib "user32" (ByVal hWnd As Long, ByVal wMsg As Long, ByVal wParam As Long, ByVal lParam As Long) As Long
Private Const WM_GETTEXT = &HD
Private Const WM_GETTEXTLENGTH = &HE
Private Const WM_SETTEXT = &HC
Private Sub Command1_Click()
Dim NewValue As String
NewValue = ChrW$(&H6B22) & ChrW$(&H8FCE)
DefWindowProcW Form1.hWnd, WM_SETTEXT, 0, StrPtr(NewValue)
End Sub