нашёл код для показа Unicode символов в заголовке формы
1.
2.
3.
4.
5.
6.
7.
8.
9.
10.
11.
12.
13.
14.
15.
16.
17.
18.
19.
20.
21.
22.
23.
24.
25.
26.
27.
28.
29.
30.
31.
32.
33.
34.
35.
36.
37.
38.
39.
40.
41.
42.
43.
Option Explicit
Private Declare Function GetModuleHandleW Lib "kernel32" (ByVal lpModuleName As Long) As Long
Private Declare Function GetProcAddress Lib "kernel32" (ByVal hModule As Long, ByVal lpProcName As String) As Long
Private Declare Function GetWindowLongA Lib "user32" (ByVal hWnd As Long, ByVal nIndex As Long) As Long
Private Declare Function SetWindowLongA Lib "user32" (ByVal hWnd As Long, ByVal nIndex As Long, ByVal dwNewLong As Long) As Long
Private Declare Function SetWindowLongW Lib "user32" (ByVal hWnd As Long, ByVal nIndex As Long, ByVal dwNewLong As Long) As Long
Private Declare Function SetWindowTextW Lib "user32" (ByVal hWnd As Long, ByVal lpString As Long) As Long
Private Const GWL_WNDPROC = - 4
Private m_Caption As String
Public Property Get CaptionW() As String
CaptionW = m_Caption
End Property
Public Property Let CaptionW(ByRef NewValue As String)
Static WndProc As Long, VBWndProc As Long
m_Caption = NewValue
' get window procedures if we don't have them
If WndProc = 0 Then
' the default Unicode window procedure
WndProc = GetProcAddress(GetModuleHandleW(StrPtr("user32")), "DefWindowProcW")
' window procedure of this form
VBWndProc = GetWindowLongA(hWnd, GWL_WNDPROC)
End If
' ensure we got them
If WndProc <> 0 Then
' replace form's window procedure with the default Unicode one
SetWindowLongW hWnd, GWL_WNDPROC, WndProc
' change form's caption
SetWindowTextW hWnd, StrPtr(m_Caption)
' restore the original window procedure
SetWindowLongA hWnd, GWL_WNDPROC, VBWndProc
Else
' no Unicode for us
Caption = m_Caption
End If
End Property
' usage sample
Private Sub Form_Load()
'русские буквы но могут быть и другие
CaptionW = ChrW$( 1088 ) & ChrW$( 1089 ) & ChrW$( 1090 ) & ChrW$( 1091 )
End Sub
всё бы хорошо но этот код не работает в Windows 2000
вопрос можно ли как заставить работать этот код и в Windows 2000 ?
Спасибо