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.
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.
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.
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.
void DestroyUniEditWindow( HWND hUniEditWindow );
The DestroyUniEditWindow function destroys the specified window.
Parameters:
hUniEditWindow Identifies the window to be destroyed.
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.
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.
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
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
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.
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
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.
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.
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)",
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