|
CorrectWritingEx
- 0
Sends text to the CorrectText dialog box to allow the user to edit text using
the Japanese Data Input Window. (Japanese version only.)
INT CorrectWritingEx( HWND hwnd, LPSTR lpText, UINT cbText, LPCWX lpcwx )
Parameters
hwnd
Handle of the owner of the CorrectText dialog box or writing tool used to edit
the text. This can be NULL.
lpText
Far pointer to a buffer containing text to correct. This is copied into the
Data Input Window's edit control. If lpText is NULL, a WM_GETTEXT message is sent to the text source window, specified by
the hwndText member of lpcwx, or if lpcwx or its hwndText member is NULL, to hwnd. On successful exit, a WM_SETTEXT message will be sent to that window with
modified text.
cbText
Size of the lpText buffer. If the source of the text is an edit control constrained by
EM_LIMITTEXT, cbText should reflect that size. If lpText is NULL, the cbText value will be used to limit text if it is greater than zero; otherwise, no
limit is used and the returned text may be of arbitrary size.
lpcwx
Address of a CWX structure, or NULL. The structure is used to specify optional correction
parameters; for a description of its members, see CWX. If this value is NULL, the following default assumptions are made:
- The text window is the same as the owner window hwnd.
- A default recognition context is used.
- The edit control style is a combination of ES_LEFT and ES_MULTILINE.
- All text is selected; the caption is "Edit Text".
- Most recently use values for context flags, keyboard, keyboard states,
position, and size are used.
Return Value
If there is a programming or memory error, the negative value CWXR_ERROR is
returned. Otherwise, one of the following nonnegative values is returned:
Constant
| Description
| CWXR_MODIFIED
| User pressed the OK button.
| CWXR_UNMODIFIED
| User pressed the Cancel button, or closed the dialog, or pressed the OK button
but did not make any changes to the text.
|
Comments
An application must be sure to initialize the CWX structure properly if it is used. In particular, the cbSize member must be set to sizeof(CWX), and the remaining fields (at least up to dwSel) are typically set to zero.
Example
The following example shows how to initialize and call CorrectWritingEx when a button is pressed in a dialog:
CWX cwx = {sizeof(CWX), 0, NULL, NULL, {0}, 0L, 0L};
cwx.hwndText = GetDlgItem(hdlg, IDD_ETSL); // dialog edit
cwx.dwEditStyle = GetWindowLong(cwx.hwndText, GWL_STYLE)
| ES_PASSWORD;
cwx.dwSel = SendMessage(cwx.hwndText, EM_GETSEL, 0, 0);
_fstrcpy((LPSTR)cwx.szCaption, (LPSTR)"Enter your password:");
// we specify kbd and context, but use MRU placement
cwx.wApplyFlags = CWXA_KBD | CWXA_STATE | CWXA_CONTEXT;
// don't update most-recently used settings for this one-shot:
cwx.wApplyFlags |= CWXA_NOUPDATEMRU;
cwx.ixkb = CWXK_QWERTY;
cwx.rgState[CWXK_QWERTY-CWXK_FIRST] = CWXKS_HAN | CWXKS_ROMA;
cwx.dwFlags = CWX_NOTOOLTIPS | CWX_TOPMOST; // no distractions
if (CorrectWritingEx(hdlg, NULL, 0, &cwx) != CWXR_MODIFIED)
ErrBox(EB_WHOAREYOU);
// validate pwd in the text window etc...
See Also
CWX
| Last news from Greatis Software |
 |
|
Nostalgia .Net |
|
.Net is powerful, but not all-powerful, so sometimes we need to use Win32 API for our .Net applications. It's simple enough with Platform Invoke if you have Win32 skill, but we do not always have time to dig the ancient documentation, declare the special types that are compatible with Win32, find the values of the Win32's constants and so on. Nostalgia .Net offers several simple-to-use classes, and components that will allow you to forget about the headache of Win32 and just use the power of Win32 in your application the same way as you use the native. Net classes. More » |
| Recommended software for developers |
 |
|
Ultimate Pack |
|
Component pack for Delphi and C++ Builder that contains runtime form designer, runtime object inspector, print suite and much more for the very special price. More » |
 |
|
Form Designer .Net |
|
Unique runtime form design solution that allows to edit any form in .Net WinForms application at runtime with full source codes for only 300 euro! More » |
 |
|
Print Suite .Net |
|
Print Suite .Net is a set of components for easy printing texts, images and grids from your WinForms applications. Full C# source codes are available More » |
 |
|
Gradient Controls .Net |
|
Gradient Controls .Net offers controls with gradient background feature. Labels, panels and so on... Full C# source codes are available More » |
 |
|
Greatis iGrid |
|
iGrid plots drawing grid right over your desktop, so you can use it everywhere, with any drawing application without any special plugins for different graphic editors. More » |
All the contacts and projectsDmitry Vasiliev (just.dmitry)
Related LinksSoftware for Visual Studio .NET developers Software for Delphi and C++ Builder developers Software for Visual Basic 6 developers Delphi Tips&Tricks MegaDetailed.NET More Online Helps Win32 Programmer's Reference Win32 Multimedia Programmer's Reference OLE Programmer's Reference Microsoft Windows Pen API Programmer's Reference Microsoft Windows Sockets 2 Reference Microsoft Windows Telephony API (TAPI) Programmer's Reference Unix Manual Pages
|