Table of Contents

 

How to Use the 32-bit UniEdit DLL

InitializeUniDLL

CleanupUniDLL

CreateUniEditWindow

DestroyUniEditWindow

SaveToBuffer

LoadFromBuffer

SetReadOnly

GetReadOnly

EnumLanguages

ChangeLanguage

UnicodeBrowser

ShowKeyboardHelp

ConvertToUCS2

ConvertFromUCS2

 

How to Use the 32-bit UniEdit DLL

Include file UNIDLL.H

Lib file UNIEDIT.LIB

DLL file UNIEDIT.DLL

Exported functions that can be called from other applications are listed below.

InitializeUniDLL

BOOL InitializeUniDLL (HWND);

Parameters:

HWND Handle to the parent window.

Return value: A Boolean value is returned. Returns TRUE if successful, otherwise returns FALSE.

Each Windows application MUST make a InitializeUniDLL call before issuing any other DLL function calls. This function can thus be used for initialization purposes. The application or DLL may only issue further functions after a successful InitializeUniDLL invocation.

CleanupUniDLL

BOOL CleanupUniDLL (HWND);

Parameters:

HWND Handle to the parent window.

Return value: A Boolean value is returned. Returns TRUE if successful, otherwise returns FALSE.

This function terminates the use of UniEdit DLL. Usually called when terminating the application or from other DLL. This function call frees any resources allocated on behalf of the application or DLL.

 

CreateUniEditWindow

HWND CreateUniEditWindow( LPCTSTR lpszWindowName,

HWND hWndParent,

HINSTANCE hInstance,

DWORD dwStyle,

DWORD dwExStyle,

int Left,

int Top,

int Width,

int Height );

The CreateUniEditWindow function creates a child multi-lingual window. It specifies the initial position and size of the window. The function also specifies the window's parent and the application instance.

Parameters:

lpszWindowName Window caption to appear in window title bar, if used.

hWndParent Identifies the parent or owner window of the window being created. A valid window handle must be supplied.

hInstance Identifies the instance of the module to be associated with the window.

dwStyle Window style for the window. Any valid style for SDK CreateWindowEx function may be used. See Windows SDK documentation and comments in sample calling application module "generic.c."

dwExStyle Extended window style for the window. Any valid extended style for SDK CreateWindowEx function may be used. See Windows SDK documentation and comments in sample calling application module "generic.c."

Left Specifies the initial horizontal position of the window.

Top Specifies the initial vertical position of the window.

Width Specifies the width, in device units, of the window.

Height Specifies the height, in device units, of the window.

Return value: UniEdit window handle if successful, otherwise zero.

DestroyUniEditWindow

void DestroyUniEditWindow( HWND hUniEditWindow );

The DestroyUniEditWindow function destroys the specified window.

Parameters:

hUniEditWindow Identifies the window to be destroyed.

 

SaveToBuffer

int SaveToBuffer( HWND hUniEditWindow, int iMaxLen, LPWORD lpBufText );

Parameters:

hUniEditWindow Valid UniEdit window handle

iMaxLen Maximum number of Unicode characters that fits in lpBufText buffer

lpBufText Pointer to Unicode word buffer

Return value: Total number of Unicode characters copied to the word buffer. The return value is less than zero if an error occurs.

LoadFromBuffer

int LoadFromBuffer( HWND hUniEditWindow, int iActBufLen, LPWORD lpBufText );

Parameters:

hUniEditWindow Valid UniEdit window handle

iActBufLen Number of Unicode characters in lpBufText buffer

lpBufText Pointer to Unicode word buffer

Return value: Total number of Unicode characters read from the word buffer. The return value is less than zero if error occurs.

 

SetReadOnly

void SetReadOnly( HWND hUniEditWindow, BOOL bReadOnly );

Parameters:

hUniEditWindow Valid UniEdit window handle

bReadOnly TRUE - to set read only window

FALSE - to set read/write window

GetReadOnly

BOOL GetReadOnly( HWND hUniEditWindow );

Parameters:

hUniEditWindow Valid UniEdit window handle

Return value: A Boolean value is returned.

TRUE - UniEdit window is read only

FALSE - UniEdit window is read/write

 

EnumLanguages

BOOL EnumLanguages(char Language[][75], DWORD dwReserved)

Enumerates all the available languages in the installed system. Reads and builds based on the DLL application WINCALIS.INI file.

Parameters:

Language Array of char pointers, each can hold up to 75 characters, can be a maximum of 500

dwReserved Reserved for future use

Return value: A Boolean value is returned. Returns TRUE if successful, otherwise returns FALSE. Failure will result if all languages cannot be fit into the Language pointer.

 

ChangeLanguage

BOOL ChangeLanguage(HWND hUniEditWindow, LPCSTR szLanguage)

Parameters:

hUniEditWindow Valid UniEdit window handle

szLanguage Switch to this language - one of the Enumerated languages

Return value: A Boolean value is returned. Returns TRUE if successful, otherwise returns FALSE if it failed to switch to the language specified by szLanguage

UnicodeBrowser

HANDLE UnicodeBrowser (HWND hWnd)

Creates a Unicode browser window using parent window handle hWnd. Returns a handle to a modeless dialog box used in dispatching messages.

Parameters:

HWND Handle to the parent window.

Return value: Handle to a modeless dialog box

Register a window message with string "UnicodeBrowser" to receive character input from the dialog. In your application you can call RegisterWindowMessage ("UnicodeBrowser"). This returns a message id that is used in the window proc to pass on messages. Your application window procedure should call SendMessage to input a character to a specific UniEdit window.

Refer to the sample application for more information.

 

ShowKeyboardHelp

BOOL ShowKeyboardHelp (HWND hWnd)

Parameters:

HWND Handle to the parent window.

Shows keyboard layout for the active keyboard. Should be called each time active language is changed.

 

ConvertToUCS2

int ConvertToUCS2 (short nType, LPVOID lpInBuffer, LPWORD lpOutBuffer)

Used for importing other code format files as Unicode files.

Parameters:

nType - a number giving the type of conversion filter to apply to the input buffer (see comments below)

lpInBuffer - input buffer

lpOutBuffer - output buffer - sufficient memory should be allocated before calling this function

nType Filter

1004 Byte-reversed Unicode

1005 UTF8

1006 UTF7

0. "DOS Page 437 (IBM ASCII/Text CALIS)",

  1. "DOS Page 850 (Multilingual)",
  2. "DOS Page 852 (Latin Slavic)",
  3. "IBM Page 855 (Cyrillic)",
  4. "DOS Page 857 (Turkish)",
  5. "DOS Page 860 (Portugal)",
  6. "DOS Page 861 (Icelandic)",
  7. "DOS Page 863 (Canadian French)",
  8. "IBM Page 864 (Arabic)",
  9. "DOS Page 865 (Nordic)",
  10. "DOS Page 866 (Cyrillic)",
  11. "DOS Page 869 (Greek)",
  12. "PC Page M4",
  13. "PC Page 1004",
  14. "PC Page 1040 (Hangul)",
  15. "PC Page 1041 (Katakana)",
  16. "PC Page 1043 (E. Asian SBCS)",
  17. "ISO 8859/1 (Latin1)",
  18. "ISO 8859/2 (Latin2)",
  19. "ISO 8859/3 (Latin3)",
  20. "ISO 8859/4 (Latin4)",
  21. "ISO 8859/5 (New KOI-8) (Cyrillic)",
  22. "ISO 8859/6 (Arabic)",
  23. "ISO 8859/7 (Greek)",
  24. "ISO 8859/8 (Hebrew)",
  25. "ISO 8859/9",
  26. "ISO 6438 (African Latin)",
  27. "ISO 5428-1980 (Bibliog. Greek)",
  28. "Windows Page 1250 (E.Europe)",
  29. "Windows Page 1251 (Cyrillic)",
  30. "Windows Page 1252 (ANSI+)",
  31. "Windows Page 1253 (Greek)",
  32. "Windows Page 1254 (Turkish)",
  33. "Windows Page 1255 (Hebrew)",
  34. "Windows Page 1256 (Arabic)",
  35. "Windows Page 1257 (Baltic)",
  36. "Cyrillic KOI-7",
  37. "Cyrillic GOST 19768-74 (Old KOI-8)",
  38. "Cyrillic Brjabrin's Alternativnyj. Var.",
  39. "Cyrillic Brjabrin's Osnovnoj Var.",
  40. "Cyrillic AATSEEL Rex",
  41. "Persian ISIRI3342.1993",
  42. "Persian Farsi Gerdsooz",
  43. "ISCII 1988 Devanagari",
  44. "ISCII 1988 Bengali",
  45. "ISCII 1988 Gurmukhi",
  46. "ISCII 1988 Gujarati",
  47. "ISCII 1988 Oriya",
  48. "ISCII 1988 Tamil",
  49. "ISCII 1988 Telugu",
  50. "ISCII 1988 Kannada",
  51. "ISCII 1988 Malayalam",
  52. "Thai Industrial Standard 620-2529",
  53. "Vietnamese VISCII Standard",
  54. "EACC ANSI Z39.64 24-bit CJK",
  55. "Chinese CCCII 24-bit",
  56. "Chinese Big-5 (Taiwan)",
  57. "Chinese GB-2312-80 (P.R.C.)",
  58. "Chinese GB-2312-80 modal 7-bit",
  59. "Chinese Duke Chinese Typist 2.0",
  60. "Chinese Complex-style (Traditional)",
  61. "Chinese Simple-style (Modern)",
  62. "Japanese Shift-JIS",
  63. "Japanese JIS modal 7-bit",
  64. "Japanese Extended Unix Code",
  65. "Korean KS Wansung ( ->Uni.2.0)",
  66. "Korean KS Johab ( ->Uni.2.0)",
  67. "Korean KS Unif.Hangul ( ->Uni.2.0)",
  68. "Korean KS modal 7-bit ( ->Uni.2.0)",
  69. "Korean KS Compat. Uni. -> Pure Uni.",
  70. "Macintosh Arabic",
  71. "Macintosh Central Europe",
  72. "Macintosh Croatian",
  73. "Macintosh Cyrillic",
  74. "Macintosh Greek",
  75. "Macintosh Icelandic",
  76. "Macintosh Latin (Roman)",
  77. "Macintosh Romanian",
  78. "Macintosh (Adobe) Symbol",
  79. "Macintosh Turkish",
  80. "Macintosh Ukrainian",
  81. "WinCALIS 1.0 BASE (All W.Europe)",
  82. "WinCALIS 1.0 CYRILLIC (Russian)",
  83. "WinCALIS 1.0 EEUR (All E.Europe)",
  84. "WinCALIS 1.0 PGREEK (Greek)",
  85. "WinCALIS 1.0 (Jpn. Hiragana)",
  86. "WinCALIS 1.0 (Jpn. Katakana)",
  87. "WinCALIS 1.0 (Vietnamese)",
  88. "Amharic Text CALIS",
  89. "East European Text CALIS",
  90. "Greek Text CALIS",
  91. "Hebrew Text CALIS",
  92. "Portuguese Text CALIS",
  93. "Russian Text CALIS",
  94. "User-supplied 8-bit char. set",
  95. "Unicode 1.0 -> Unicode 1.1",
  96. "Unicode 1.1 -> Unicode 2.0",
  97. "WinCALIS 2.x Uni.->Pure Unicode",

 

ConvertFromUCS2

int ConvertFromUCS2 (short nType, LPWORD lpInBuffer, LPVOID lpOutBuffer)

Used for exporting to other code format files from Unicode format

Parameters:

nType - a number giving the type of conversion filter to apply to the input buffer (see comments section for ConvertToUCS2)

lpInBuffer - input buffer

lpOutBuffer - output buffer - sufficient memory should be allocated before calling this function