As I can define this function to use in the FWH/xHarbour ?
- Code: Select all Expand view
CreateTerWindow
Open a TER Window:
HWND CreateTerWindow(ptr)
struct arg_list far *ptr;
The ptr argument points to a structure that provides the initial parameters to open a window. This structure includes the following parameters:
struct arg_list {
int x
Initial X position of the editing window. You may specify CW_USEDEFAULT here to use the default value. The CW_USEDEFAULT constant is defined by Windows as hex 8000 for 16 bit and hex 80000000 for 32 bit.
int y
Initial Y position of the editing window. You may specify CW_USEDEFAULT here to use the default value.
int width
Window width. You may specify CW_USEDEFAULT here to use the default value
int height
Window Height. You may specify CW_USEDEFAULT here to use the default value.
int LineLimit
Maximum number of lines allowed for text editing. Set this field to 0 to allow unlimited number of lines.
BOOL WordWrap
If set to TRUE, this flag enables the word wrapping feature.
BOOL PrintView
Normally (PrintView = FALSE) the text lines are wrapped at the right edge of the window. This is a convenient editing mode with better performance. In the print view edit mode, however, the text lines are wrapped as they would be wrapped when printed at the current printer.
BOOL PageMode
Set to TRUE to facilitate editing of documents one page at a time. This feature is useful when editing multiple column documents. The text is displayed in side-by-side columns. This mode also implies the PrintView mode.
BOOL FittedView
Special case of the page mode in which the text wraps to the window width and the soft page breaks are not displayed
BOOL ShowStatus
If set to TRUE, the editor will display a status line describing the current cursor location, and the insert/overtype indicator.
BOOL ShowMenu
If set to TRUE, the editor displays the editor menu under the caption bar. When set to FALSE, the editor commands must be selected using only the accelerator keys.
BOOL ShowHorBar
If set to TRUE, the editor displays the horizontal scroll bar.
BOOL ShowVerBar
If set to TRUE, the editor displays the vertical scroll bar.
BOOL ruler
Set this variable to TRUE to show a ruler with tab stops.
BOOL ToolBar
Set this variable to TRUE to show the tool bar.
BOOL UserCanClose
Set this variable to TRUE if you want your user to be able to close the TER window by selecting the exit option from the TER menu. Otherwise, your application will need to close the window by using the CloseTer function.
BOOL BorderMargins
Set this field to TRUE to create a thin margin around the text area within the TER window. This margin area is for cosmetic purpose only.
BOOL ReadOnly
This is a browser mode which does not allow text modifications.
int InitLine
The first line number to position on when the TER routine is called.
char InputType
This field specifies the input type to the editor. If you wish to pass a text file name to the editor, set this flag to 'F'. However, if the text input will be passed in a global memory buffer, set this flag to 'B'.
char file[129]
If the InputType field is set to 'F', this field specifies the full path of the input file.
HANDLE hBuffer
If the InputType field is set to 'B', this field specifies the handle to the global memory containing the input text data. To specify an empty buffer, allocate a buffer for 1 byte, place the 'delim' character in the first byte and set the 'BufferLen' field to 1. The input memory handle must be unlocked before calling the editor routine. You can get the updated text by using the GetTerBuffer prior to closing the TER window.
long BufferLen
When the InputType field is set to 'B', the BufferLen field specifies the length of the input buffer.
char delim
This character should be be set to 13 (carriage return character).
int SaveFormat
This field determines the format of the output file or buffer:
SAVE_DEFAULT:
Save in the format of the input file.
SAVE_TER:
Save in the native TER format.
SAVE_RTF:
Save in the Rich Text Format.
SAVE_TEXT:
Save in ASCII format.
SAVE_TEXT_LINES:
Save in ASCII format with line breaks.
SAVE_UTEXT
Save in the Unicode text format (not available in 16 bit)
HANDLE hInst
Handle for the current instance of the application.
HWND hParentWnd
Handle of the parent window. The DLL sends the TER_CLOSE message to this function before closing a TER window (see the CloseTer API function).
HWND hTextWnd
The editor fills in this field with the window handle of the editor window. The editor does this as soon as the window is created. You will need this handle to use other TER API functions.
DWORD style
The window style that you provide here is simply passed to the CreateWindow function.
char FontTypeFace[30]
Default font typeface for the document. Example: "Helv", "Courier", "System" etc. A menu option in the TER window provides multiple selections of typeface and point sizes to choose from.
int PointSize
Point size of the default font. Please remember that 72 points are equal to one inch. Most written correspondences use a letter size of 10 or 12 points.
BOOL open
The editor set this variable to a TRUE value after initializing a TER window.
BOOL modified
This variable is reserved for internal use.
}
Description: This function opens a TER window.
Return Value: If successful, the function returns the window handle of the new window. Otherwise it returns a NULL value. The handle to the newly opened window is also returned to you using the hTextWnd variable within the arg_list structure. If your application provides the data using a global buffer, the handle to the specified global buffer becomes the property of the DLL. Your application MUST not try to lock or free this handle. To get the updated text data, you should use the GetTerBuffer function.
Comments: This function is not available as an ActiveX control method. It must be used as a DLL function.