Copy the title of the active window to the clipboard in Microsoft Windows in Dragon NaturallySpeaking's advanced scripting - naturallyspeaking

Is there any way to copy the title of the active window to the clipboard in Microsoft Windows in Dragon NaturallySpeaking's advanced scripting?
A workaround I use is to define an AutoHotkey script:
^!l::
WinGetActiveTitle, Title
Clipboard = %Title%
return
and call the keyboard shortcut in the voice command:
but I would prefer not to have to jungle it between AutoHotkey and Dragon NaturallySpeaking. Can it be done in "pure" advanced scripting?

Yes, you can copy the title of the active window to the clipboard using Dragon NaturallySpeaking's advanced scripting as follows:
'
' get window title
'
Sub Main
Clipboard ( GetWindowTitle )
End Sub
'
' Use these Windows Functions for Getting an active Window title
'
Declare Function GetForegroundWindow Lib "user32" () As Long
'
Declare Function GetWindowText Lib "user32" _
Alias "GetWindowTextA" ( ByVal hwnd As Long , _
ByVal lpString As String , ByVal cch As Long ) As Long
'
' GetWindowTitle
' (Gets an active Window title)
'
Function GetWindowTitle() As String
Dim x As Integer
Dim TitleText As String * 300
Dim hw As Long
hw = GetForegroundWindow()
x = GetWindowText ( hw , TitleText , Len ( TitleText ) )
GetWindowTitle = Trim ( Left ( TitleText , x ) )
End Function
'
Now, I keep all the functions in a global '#Uses file (with other declarations, functions and global constants, etc.), so I just need the Main Sub part, but you can put all of the referenced functions and declarations in the one script where you need it, too.
Hth

Related

How can I use Autokey to grab highlighted text + url and then insert said highlighted text + url in the placeholders of a phrase?

I'm trying to get Autokey to work like Autohotkey worked for me in Windows.
One very useful function that was possible to set up in Autohotkey was assigning a keyboard key to grab highlighted text, then go to url, grab that url, and then insert the highlighted text and URL in specific places within a predetermined phrase.
It was extremely useful to create text with links in different formats.
The Autohotkey script for what I'm describing looked something like this:
insert::
clipboard =
Send, ^c
ClipWait
myText = %clipboard%
Send, !d
clipboard =
Send, ^c
ClipWait
myURL = %clipboard%
myLink = %myText%
clipboard = %myLink%
return
Is there a way to translate that into a working Autokey script?
# assigning a keyboard key to
# `hotkey - a key or combination of keys that, when pressed, will trigger AutoKey to do something; run a script, insert a phrase or display a menu. A hotkey can be created using any key on the keyboard (within reason), with or without one or more modifier keys. The modifier keys are Shift, Control, Alt and Super (a.k.a. Windows).`
# [Guide](https://github.com/autokey/autokey/wiki/Beginners-Guide)
import os, time
# grab highlighted text
myText = clipboard.get_selection()
# then go to url
myCmd = "/usr/bin/firefox --new-window http://www. your site .biz/"
os.system(myCmd)
time.sleep(0.25)
# grab that url, and then
keyboard.send_keys('<F6>')
time.sleep(0.25)
myURL = clipboard.get_selection()
# insert the highlighted text and URL in specific places within a predetermined phrase.
# run a window wait, then paste the texts there. Following example opens a msgbox2sec.ahk (create it first):
myCmd = 'wine ~/.wine/drive_c/Program\ Files/AutoHotkey/AutoHotkey.exe /home/administrator/Desktop/msgbox2sec.ahk'
os.system(myCmd)
time.sleep(0.25)
active_class = window.get_active_class()
if not active_class == "your class name": # for example: "autokey-gtk.Autokey-gtk":
time.sleep(0.25) # sleep longer
myLink = "" + myText + ""
# paste your link, then copy it:
keyboard.send_keys(myLink)
# select select a line:
keyboard.send_keys('<home>')
keyboard.send_keys("<shift>+<end>")
# copy line to clipboard:
keyboard.send_keys('<ctrl>+c')
# or copy line to variable:
c = clipboard.get_selection()

DoCmd.BrowseTo acBrowseToForm MULTIPLE WHERE conditions

I am new to Access 2010 VBA but have solid SQL background. I am trying to open/browse a form from a toogle button based on complex filter.
The form is called: FormSuivi
In SQL, the filter would be like this:
WHERE Randomise = 'Y' AND ActualSxDate is not null
AND datediff('d', Date(),ActualSxDate) > 140 AND DCD = 0;
In this Accessdatabase, the following field's types are:
Randomise: text
ActualSxDate: Date
DCD: Yes/no -> integer (-1/0)
For now, all I managed to do is to implement one condition at a time:
Private Sub Toggle25_Click()
DoCmd.BrowseTo acBrowseToForm, "FormSuivi", , "Randomise = """ & "Y" & """"
End Sub
How can all the conditions listed in SQL be squeezed into a VBA command line?
The parameter WhereCondition can be a full WHERE string, without the WHERE keyword. Including ANDs, parentheses, etc.
Single quotes ' help to keep the string readable (as opposed to """ constructs).
Variables need to be concatenated, e.g.
Dim S As String
S = "Randomise = '" & strRandomise & "' AND ActualSxDate is not null " & _
"AND datediff('d', Date(),ActualSxDate) > 140 AND DCD = " & bDCD
DoCmd.BrowseTo acBrowseToForm, "FormSuivi", , S

How to get Unicode char on IME window in VB6?

I have a special case when the user is first typing through IME by Press Alphabetic KeyCode on my Grid UserControl, How do I pick up the Unicode on IME Window? If the user is typing in English, it is OK. But if the user is typing Chinese or Japanese on IME, the Unicode turns into question marks.
Select Case uMsg
Case WM_IME_SETCONTEXT
If Not wParam = 0 Then
Dim flag As Boolean
flag = ImmAssociateContextEx(lng_hWnd, 0, 16)
If flag Then
Dim IntPtr As Long
IntPtr = ImmGetContext(lng_hWnd)
flag = ImmSetOpenStatus(IntPtr, True)
End If
End If
Case WM_IME_STARTCOMPOSITION
Dim hIMC As Long
hIMC = ImmGetContext(lng_hWnd)
Dim cf As COMPOSITIONFORM
cf.dwStyle = 2
cf.ptCurrentPos.X = UserControl1.ScaleLeft + 3
cf.ptCurrentPos.Y = UserControl1.ScaleTop + UserControl1.Height - 16
ImmSetCompositionWindow hIMC, cf
Case WM_IME_CHAR
'Send IME Char to UserControl1.KeyPress
UserControl1_KeyPress(wParam And &HFFFF&)
Exit Sub
End Select
After I use different Subclasser from Krool, now I can get Right Unicode. Not sure why Paul Caton and LaVolpe cSelfSubHookCallBack doesn't work.
The Subclasser may internally turn Unicode to ANSI or failed to prevent Windows from UNICODE to ANSI conversion.

I need to convert the date from mm/dd/yyyy to dd/mm/yyyy in vbscript

So far I have this:
FormatDateTime(negativeItemsRS("ItemDate"), 0)
Its displaying the date in the format of mm/dd/yyyy. I want to convert that to a dd/mm/yyyy
Please help not sure how to do this.
Thanks,
You have to set the locale id to one that uses the date format that you want. I don't remember which format used where, but either UK (2057) or US (1033) should work.
You haven't specified your environment. In ASP you could use the LCID property in the Language directive or in the Session or Response classes, depending on what scope you want for the setting:
<%#Language="VBScript" LCID="1033"%>
or
Session.LCID = 1033
or
Response.LCID = 1033
To change the date from MM/DD/YYY to DD/MM/YYYY in VB Script very simple steps can be used as given below
Let say "date1" (MM/DD/YY) = 03/06/2014
I want "date2" to be in DD/MM/YY as 06/03/2014
d = Day(date1)
m = Month(date1)
y = Year(date1)
date2 = d & "/" & m & "/" & y
Will give the required result.
What you need is a FormatDate function. I used to do this the hard way with manual concatentation, but I discovered that there are a few .NET libraries that are accessible from COM and thus from ASP Classic. My version leverages the fact that I have a StringBuilder class which is a wrapper around the StringBuilder class in .NET.
'******************************************************************************
Public Function FormatDate( sFormat, dDateValue )
'PURPOSE: To format a date with any arbitrary format
'ARGS:
' sFormat is the defined formats as used by the .NET Framework's System.DateTimeFormatInfo.
' Note that this format is case-sensitive.
'CALLS:
' 1. System.Text.StringBuilder class in the .NET Framework.
'EXAMPLE CALL:
' Dim sFormatedDate
' sFormatedDate = FormatDate( "MM/dd/yy", "1/1/1900 12:00 AM" )
' Or
' sFormatedDate = FormatDate( "MM/dd/yyyy", "1/1/1900 12:00 AM" )
'DESIGN NOTE:
' This function leverages the fact that System.Text.StringBuilder is COMVisible.
' Thus, we can call its AppendFormat function from here.
' You can find more information about the format string parameters allowed at
' http://msdn.microsoft.com/en-us/library/system.globalization.datetimeformatinfo.aspx
Dim oStringBuilder
Dim sSbFormatString
Dim dDate
If Not IsDate( dDateValue ) Then
FormatDate = vbNullString
Exit Function
End If
On Error Resume Next
dDate = CDate(dDateValue)
If Err.number <> 0 Then
FormatDate = vbNullString
Exit Function
End If
'if an empty format string is passed, then simply return
'the value using the default shortdate format.
If Len(sFormat & vbNullString) = 0 Then
sSbFormatString = "{0:d}"
Else
sSbFormatString = "{0:" & sFormat & "}"
End If
Set oStringBuilder = CreateObject("System.Text.StringBuilder")
Call oStringBuilder.AppendFormat(sSbFormatString, dDate)
FormatDate = oStringBuilder.ToString()
Set oStringBuilder = Nothing
End Function
'**************************************************************************
' Use this class to concatenate strings in a much more
' efficient manner than simply concatenating a string
' (strVariable = strVariable & "your new string")
Class StringBuilder
'PURPOSE: this class is designed to allow for more efficient string
' concatenation.
'DESIGN NOTES:
' Originally, this class built an array and used Join in the ToString
' method. However, I later discovered that the System.Text.StringBuilder
' class in the .NET Framework is COMVisible. That means we can simply use
' it and all of its efficiencies rather than having to deal with
' VBScript and its limitations.
Private oStringBuilder
Private Sub Class_Initialize()
Set oStringBuilder = CreateObject("System.Text.StringBuilder")
End Sub
Private Sub Class_Terminate( )
Set oStringBuilder = Nothing
End Sub
Public Sub InitializeCapacity(ByVal capacity)
On Error Resume Next
Dim iCapacity
iCapacity = CInt(capacity)
If Err.number <> 0 Then Exit Sub
oStringBuilder.Capacity = iCapacity
End Sub
Public Sub Clear()
Call Class_Initialize()
End Sub
Public Sub Append(ByVal strValue)
Call AppendFormat("{0}", strValue)
End Sub
Public Sub AppendFormat(ByVal strFormatString, ByVal strValue)
Call oStringBuilder.AppendFormat(strFormatString, (strValue & vbNullString))
End Sub
'Appends the string with a trailing CrLf
Public Sub AppendLine(ByVal strValue)
Call Append(strValue)
Call Append(vbCrLf)
End Sub
Public Property Get Length()
Length = oStringBuilder.Length
End Property
Public Property Let Length( iLength )
On Error Resume Next
oStringBuilder.Length = CInt(iLength)
End Property
'Concatenate the strings by simply joining your array
'of strings and adding no separator between elements.
Public Function ToString()
ToString = oStringBuilder.ToString()
End Function
End Class
So, with this class you could do something like:
FormatDate("dd/MM/yyyy", RS("DateField"))
Note that the string passed in is case-sensitive.
EDIT I see that at some point I amended my FormatDate function to eliminate the use of my VBScript StringBuilder class and instead just use the .NET class directly. I'll leave the VBScript StringBuilder class in there for reference in case anyone is interested. (I did swap the order of the two however to make the code that appears at the top more applicable to the problem).

What's the best option to display Unicode text (hebrew, etc.) in VB6

I have some customers who want to use our speech therapy software in Hebrew.
The programs are in VB6. The best option I'm aware of are:
use the Forms 2.0 controls from MS Office, but you can't distribute them.
http://www.hexagora.com/en_dw_unictrl.asp $899
http://www.iconico.com/UniToolbox/ $499
Any other options?
I found this tutorial very useful. Yes it is partially an ad for another Unicode Control Suite, but it has a lot of information about how to do it yourself and what issues are involved.
EDIT
I knew I had way more on this stored in my bookmarks.
First of all there is an article from Chilkat (another component vendor) about how to use the Font's charset (assuming it is a unicode font) to set different font types (you have to manually change the .frm since charset isn't exposed in the gui). Then all you have to do is convert from AnsiToUTF8 and back to support different languages (that is what Chilkat's control does).
Second, there are the Vesa Piittinen's free (Creative Commons, source included) VB6 controls for download here. They include Textbox, Label, Menu, List, Dialog, CommandButton, Caption (form's caption)). I haven't played with them much, but basically he is doing all the onPaint and the nice thing is that is all done in VB and you can look at the source.
Presumably your users don't have Hebrew selected as the system default code page, otherwise you could just use the native VB6 controls (bearing in mind that Hebrew is right-to-left, obviously!).
Don't use Forms 2 - it will crash your VB6 program. Microsoft Knowledge Base article: "FM20.DLL is known to have many problems when used with Visual Basic and other developer products. Its use is neither recommended nor supported in any Visual Studio product."
I've no personal experience of the others, but your #3 option UniToolbox has been around for years and Google throws up some positive chatter about it on the newsgroups (EDIT - for instance VB6 internationalisation guru Michael Kaplan recommended it in a post in 2004 and a blog post in 2005).
One whacky option is to use API calls with the native VB6 controls - some pointers in Michael Kaplan's excellent book on Internationalization with VB6 and some sample code on his website too. But it would be lots of work. Do buy the book anyway as it's a gold mine of information on international issues in VB6. For instance the sample chapter explains your problems with Hebrew. Look for it secondhand as it's out of print.
Here is all you should need:
Option Explicit
'
Private Type GETTEXTEX
cb As Long
flags As Long
codepage As Long
lpDefaultChar As Long
lpUsedDefChar As Long
End Type
'
Private Type GETTEXTLENGTHEX
flags As Long
codepage As Long
End Type
'
Private Type SETTEXTEX
flags As Long
codepage As Long
End Type
'
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 Declare Sub PutMem4 Lib "msvbvm60" (Destination As Any, Value As Any)
Private Declare Function SysAllocStringLen Lib "oleaut32" (ByVal OleStr As Long, ByVal bLen As Long) As Long
Private Declare Function OpenClipboard Lib "user32.dll" (ByVal hWnd As Long) As Long
Private Declare Function EmptyClipboard Lib "user32.dll" () As Long
Private Declare Function CloseClipboard Lib "user32.dll" () As Long
Private Declare Function IsClipboardFormatAvailable Lib "user32.dll" (ByVal wFormat As Long) As Long
Private Declare Function GetClipboardData Lib "user32.dll" (ByVal wFormat As Long) As Long
Private Declare Function SetClipboardData Lib "user32.dll" (ByVal wFormat As Long, ByVal hMem As Long) As Long
Private Declare Function GlobalAlloc Lib "kernel32.dll" (ByVal wFlags As Long, ByVal dwBytes As Long) As Long
Private Declare Function GlobalLock Lib "kernel32.dll" (ByVal hMem As Long) As Long
Private Declare Function GlobalUnlock Lib "kernel32.dll" (ByVal hMem As Long) As Long
Private Declare Function GlobalSize Lib "kernel32" (ByVal hMem As Long) As Long
Private Declare Function lstrcpy Lib "kernel32.dll" Alias "lstrcpyW" (ByVal lpString1 As Long, ByVal lpString2 As Long) As Long
Private Declare Function SendMessage Lib "user32.dll" Alias "SendMessageA" (ByVal hWnd As Long, ByVal wMsg As Long, ByVal wParam As Long, ByRef lParam As Any) As Long
Private Declare Function SendMessageWLng Lib "user32" Alias "SendMessageW" (ByVal hWnd As Long, ByVal wMsg As Long, ByVal wParam As Long, ByVal lParam As Long) As Long
'
' The following is from MSDN help:
'
' UNICODE: International Standards Organization (ISO) character standard.
' Unicode uses a 16-bit (2-byte) coding scheme that allows for 65,536 distinct character spaces.
' Unicode includes representations for punctuation marks, mathematical symbols, and dingbats,
' with substantial room for future expansion.
'
' vbUnicode constant: Converts the string toUnicode using the default code page of the system.
' vbFromUnicode constant: Converts the string from Unicode to the default code page of the system.
'
' LCID: The LocaleID, if different than the system LocaleID. (The system LocaleID is the default.)
'
Public Property Let UniCaption(ctrl As Object, sUniCaption As String)
Const WM_SETTEXT As Long = &HC
' USAGE: UniCaption(SomeControl) = s
'
' This is known to work on Form, MDIForm, Checkbox, CommandButton, Frame, & OptionButton.
' Other controls are not known.
'
' As a tip, build your Unicode caption using ChrW.
' Also note the careful way we pass the string to the unicode API call to circumvent VB6's auto-ASCII-conversion.
DefWindowProcW ctrl.hWnd, WM_SETTEXT, 0&, ByVal StrPtr(sUniCaption)
End Property
Public Property Get UniCaption(ctrl As Object) As String
Const WM_GETTEXT As Long = &HD
Const WM_GETTEXTLENGTH As Long = &HE
' USAGE: s = UniCaption(SomeControl)
'
' This is known to work on Form, MDIForm, Checkbox, CommandButton, Frame, & OptionButton.
' Other controls are not known.
Dim lLen As Long
Dim lPtr As Long
'
lLen = DefWindowProcW(ctrl.hWnd, WM_GETTEXTLENGTH, 0&, ByVal 0&) ' Get length of caption.
If lLen Then ' Must have length.
lPtr = SysAllocStringLen(0&, lLen) ' Create a BSTR of that length.
PutMem4 ByVal VarPtr(UniCaption), ByVal lPtr ' Make the property return the BSTR.
DefWindowProcW ctrl.hWnd, WM_GETTEXT, lLen + 1&, ByVal lPtr ' Call the default Unicode window procedure to fill the BSTR.
End If
End Property
Public Property Let UniClipboard(sUniText As String)
' Puts a VB string in the clipboard without converting it to ASCII.
Dim iStrPtr As Long
Dim iLen As Long
Dim iLock As Long
Const GMEM_MOVEABLE As Long = &H2
Const GMEM_ZEROINIT As Long = &H40
Const CF_UNICODETEXT As Long = &HD
'
OpenClipboard 0&
EmptyClipboard
iLen = LenB(sUniText) + 2&
iStrPtr = GlobalAlloc(GMEM_MOVEABLE Or GMEM_ZEROINIT, iLen)
iLock = GlobalLock(iStrPtr)
lstrcpy iLock, StrPtr(sUniText)
GlobalUnlock iStrPtr
SetClipboardData CF_UNICODETEXT, iStrPtr
CloseClipboard
End Property
Public Property Get UniClipboard() As String
' Gets a UNICODE string from the clipboard and puts it in a standard VB string (which is UNICODE).
Dim iStrPtr As Long
Dim iLen As Long
Dim iLock As Long
Dim sUniText As String
Const CF_UNICODETEXT As Long = 13&
'
OpenClipboard 0&
If IsClipboardFormatAvailable(CF_UNICODETEXT) Then
iStrPtr = GetClipboardData(CF_UNICODETEXT)
If iStrPtr Then
iLock = GlobalLock(iStrPtr)
iLen = GlobalSize(iStrPtr)
sUniText = String$(iLen \ 2& - 1&, vbNullChar)
lstrcpy StrPtr(sUniText), iLock
GlobalUnlock iStrPtr
End If
UniClipboard = sUniText
End If
CloseClipboard
End Property
Public Sub SetupRichTextboxForUnicode(rtb As RichTextBox)
' Call this so that the rtb doesn't try to do any RTF interpretation. We will just be using it for Unicode display.
' Once this is called, the following two procedures will work with the rtb.
Const TM_PLAINTEXT As Long = 1&
Const EM_SETTEXTMODE As Long = &H459
SendMessage rtb.hWnd, EM_SETTEXTMODE, TM_PLAINTEXT, 0& ' Set the control to use "plain text" mode so RTF isn't interpreted.
End Sub
Public Property Let RichTextboxUniText(rtb As RichTextBox, sUniText As String)
' Usage: Just assign any VB6 string to the rtb.
' If the string contains Unicode (which VB6 strings are capable of), it will be correctly handled.
Dim stUnicode As SETTEXTEX
Const EM_SETTEXTEX As Long = &H461
Const RTBC_DEFAULT As Long = 0&
Const CP_UNICODE As Long = 1200&
'
stUnicode.flags = RTBC_DEFAULT ' This could be otherwise.
stUnicode.codepage = CP_UNICODE
SendMessageWLng rtb.hWnd, EM_SETTEXTEX, VarPtr(stUnicode), StrPtr(sUniText)
End Property
Public Property Get RichTextboxUniText(rtb As RichTextBox) As String
Dim uGTL As GETTEXTLENGTHEX
Dim uGT As GETTEXTEX
Dim iChars As Long
Const EM_GETTEXTEX As Long = &H45E
Const EM_GETTEXTLENGTHEX As Long = &H45F
Const CP_UNICODE As Long = 1200&
Const GTL_USECRLF As Long = 1&
Const GTL_PRECISE As Long = 2&
Const GTL_NUMCHARS As Long = 8&
Const GT_USECRLF As Long = 1&
'
uGTL.flags = GTL_USECRLF Or GTL_PRECISE Or GTL_NUMCHARS
uGTL.codepage = CP_UNICODE
iChars = SendMessageWLng(rtb.hWnd, EM_GETTEXTLENGTHEX, VarPtr(uGTL), 0&)
'
uGT.cb = (iChars + 1) * 2
uGT.flags = GT_USECRLF
uGT.codepage = CP_UNICODE
RichTextboxUniText = String$(iChars, 0&)
SendMessageWLng rtb.hWnd, EM_GETTEXTEX, VarPtr(uGT), StrPtr(RichTextboxUniText)
End Property
Public Sub SaveStringToUnicodeFile(sData As String, sFileSpec As String)
' These are typically .TXT files. They can be read with notepad.
Dim iFle As Long
'
iFle = FreeFile
Open sFileSpec For Binary As iFle
Put iFle, , &HFEFF ' This is the Unicode header to a text file. First byte = FF, second byte = FE.
Put iFle, , UnicodeByteArrayFromString(sData)
Close iFle
End Sub
Public Function LoadStringFromUnicodeFile(sFileSpec As String) As String
' These are typically .TXT files. They can be read with notepad.
Dim iFle As Long
Dim bb() As Byte
Dim i As Integer
'
iFle = FreeFile
Open sFileSpec For Binary As iFle
Get iFle, , i
If i <> &HFEFF Then ' Unicode file header. First byte = FF, second byte = FE.
Close iFle
Exit Function ' It's not a valid Unicode file.
End If
ReDim bb(1 To LOF(iFle) - 2&)
Get iFle, , bb
Close iFle
LoadStringFromUnicodeFile = bb ' This directly copies the byte array to the Unicode string (no conversion).
' Note: If you try to directly read the file as a string, VB6 will attempt to convert the string from ASCII to Unicode.
End Function
Public Function AsciiByteArrayFromString(s As String) As Byte()
' This converts the "s" string to an ASCII string before placing in the byte array.
AsciiByteArrayFromString = StrConv(s, vbFromUnicode)
End Function
Public Function StringFromAsciiByteArray(bb() As Byte) As String
' This assumes that the "bb" array uses only one byte per character and expands it to UNICODE before placing in string.
StringFromAsciiByteArray = StrConv(bb, vbUnicode)
End Function
Public Function UnicodeByteArrayFromString(s As String) As Byte()
' This directly copies the Unicode string into the byte array, using two bytes per character (i.e., Unicode).
UnicodeByteArrayFromString = s
End Function
Public Function StringFromUnicodeByteArray(bb() As Byte) As String
' This directly copies the byte array into the Unicode string, using two bytes per character.
'
' Interestingly, you can assign an odd number of bytes to a string.
' The Len(s) function will not count the last (odd) byte, but the LenB(s) function will correctly report it.
' However, it is advisable to keep the byte array an even number of bytes.
StringFromUnicodeByteArray = bb
End Function
According to KB224305 ("INFO: Usage and Redistribution of FM20.DLL"), you can install the free "Microsoft ActiveX Control Pad", which in turn installs the Forms 2.0 Library.
Maybe this is an option for you.
Charset table from this link
DBCS - Double-Byte Character Set
DBCS is actually not the correct terminology for what Windows uses. It is actually MBCS where a character can be 1 or 2 bytes. To illustrate this consider the following code which will take a Unicode string of English and Chinese characters, convert to a byte array of MBCS Chinese, dump the byte array to the immediate window, and finally convert it back to a Unicode string to display in a Unicode aware textbox. The byte array when converted using Chinese(PRC) LCID = 2052 contains single bytes for the english characters and double bytes for the Unicode characters. This proves that it is MBCS and not DBCS:
Here are some comments about displaying Unicode characters in Microsoft Visual Basic forms using resource (.RES) files:
When I pasted Russian or Japanese characters to Microsoft Visual Basic 6 Resource Editor when creating a resource (.RES) file, the characters would appear as question marks (?) both in MSVB6 Resource Editor and in MSVB6 forms displayed on a computer with Russian or Japanese locale, respectively, using the resource DLL that I built from the RES file through MSVB6.
However, if I added the characters to the resource file by pasting them into Resource Hacker http://www.angusj.com/resourcehacker, the characters still would display as question marks in MSVB6 Resource Editor, but would display correctly on a computer with appropriate locale after I built the resource DLLs through MSVB6.
One can make resource DLLs for each of several languages and use Microsoft's GetUserDefaultLCID or GetUserDefaultLocaleName to decide which to load.