home *** CD-ROM | disk | FTP | other *** search
-
- ΓòÉΓòÉΓòÉ 1. Sketch Input Window ΓòÉΓòÉΓòÉ
-
- You can draw or sketch to this window. Press "SELECT CONTROL" to display a list
- box containing a list of SKETCH control messages to choose from. To execute a
- particular control message, highlight an item from the list box and press "OK".
- To get help for a particular control message, highlight an item from the list
- box and press "HELP".
-
-
- ΓòÉΓòÉΓòÉ 2. Control Message Selection ΓòÉΓòÉΓòÉ
-
- Highlight an item from the list box and press "HELP" to display help for a
- particular Control Message.
-
- Highlight an item from the list box and press "OK" to execute the Message.
-
-
- ΓòÉΓòÉΓòÉ 3. Auxiliary Data ΓòÉΓòÉΓòÉ
-
- Choose "No Auxiliary Data" to send a zero value with SKM_SET_CTL_AUXDATA_MODE
- and retrieve no auxiliary data for subsequent strokes. Choose "All Auxiliary
- Data" to send a value of ADF_ALL with SKM_SET_CTL_AUXDATA_MODE and retrieve all
- auxiliary data for subsequent strokes.
-
-
- ΓòÉΓòÉΓòÉ 4. SKM_DELETE_ALL_STROKES ΓòÉΓòÉΓòÉ
-
- This Control Message is sent to the control to request deletion of all strokes
- in the stroke database.
-
- Returns:
- TRUE - Success (All strokes deleted)
- FALSE - No strokes in the stroke database to delete.
-
- Example:
-
- BOOL rc;
-
- rc = (BOOL) WinSendMsg(hSKETCHControl,
- SKM_DELETE_ALL_STROKES,
- NULL,
- NULL);
-
- Press "OK" to execute control message SKM_DELETE_ALL_STROKES.
-
-
- ΓòÉΓòÉΓòÉ 5. SKM_UNDO_LAST_STROKE ΓòÉΓòÉΓòÉ
-
- This message tells the control to clear the ink of the last stroke and to
- delete it from the stroke database.
-
- Returns:
- TRUE - Success (Last stroke deleted)
- FALSE - No strokes in the stroke database to undo.
-
- Example:
-
- BOOL rc;
-
- rc = (BOOL) WinSendMsg(hSKETCHControl,
- SKM_UNDO_LAST_STROKE,
- NULL,
- NULL);
-
- Press "OK" to execute control message SKM_UNDO_LAST_STROKE.
-
-
- ΓòÉΓòÉΓòÉ 6. SKM_QUERY_CTL_DRAW_POINTER ΓòÉΓòÉΓòÉ
-
- This message returns the drawing pointer handle.
-
- Example:
-
- HPOINTER DrawPtr;
-
- DrawPtr = (HPOINTER) WinSendMsg(hSKETCHControl,
- SKM_QUERY_CTL_DRAW_POINTER,
- NULL,
- NULL);
-
- Press "OK" to execute control message SKM_QUERY_CTL_DRAW_POINTER.
-
-
- ΓòÉΓòÉΓòÉ 7. SKM_QUERY_CTL_INK_WIDTH ΓòÉΓòÉΓòÉ
-
- This message returns the control's current ink width.
-
- Returns:
- ULONG ulWidth - Control Ink Width
- FALSE - Failure
-
- Example:
-
- ULONG ulWidth;
-
- ulWidth = (ULONG) WinSendMsg(hSKETCHControl,
- SKM_QUERY_CTL_INK_WIDTH,
- NULL,
- NULL);
-
- Press "OK" to execute control message SKM_QUERY_CTL_INK_WIDTH.
-
-
- ΓòÉΓòÉΓòÉ 8. SKM_QUERY_CTL_INK_COLOR ΓòÉΓòÉΓòÉ
-
- This message returns the control's current ink color.
-
- Returns:
- LONG lColor - Control Ink Color
- CLR_ERROR - Failure
-
- Example:
-
- LONG lColor;
-
- lColor = (LONG) WinSendMsg(hSKETCHControl,
- SKM_QUERY_CTL_INK_COLOR,
- NULL,
- NULL);
-
- Press "OK" to execute control message SKM_QUERY_CTL_INK_COLOR.
-
-
- ΓòÉΓòÉΓòÉ 9. SKM_QUERY_CTL_INVISIBLE_MODE ΓòÉΓòÉΓòÉ
-
- This message queries the display mode of the ink, whether it is visible or
- invisible.
-
- Returns:
- TRUE - Ink is invisible.
- FALSE - Ink is visible.
-
- Example:
-
- USHORT usInvisible;
-
- usInvisible = (USHORT) WinSendMsg(hSKETCHControl,
- SKM_QUERY_CTL_INVISIBLE_MODE,
- NULL,
- NULL);
-
- Press "OK" to execute control message SKM_QUERY_CTL_INVISIBLE_MODE.
-
-
- ΓòÉΓòÉΓòÉ 10. SKM_SET_CTL_DRAW_POINTER ΓòÉΓòÉΓòÉ
-
- This message sets the drawing pointer handle and returns the previous pointer.
-
- Example:
-
- HPOINTER OldDrawPtr;
- HPOINTER NewDrawPtr;
- POINTER PTR_PEN blackpen.ptr
-
- NewDrawPtr = WinLoadPointer(HWND_DESKTOP, 0L, PTR_PEN);
- OldDrawPtr = (HPOINTER)WinSendMsg(hSKETCHControl,
- SKM_SET_CTL_DRAW_POINTER,
- MPFROMLONG(NewDrawPtr),
- NULL);
-
- Press "OK" to execute control message SKM_SET_CTL_DRAW_POINTER.
-
-
- ΓòÉΓòÉΓòÉ 11. SKM_SET_CTL_INK_WIDTH ΓòÉΓòÉΓòÉ
-
- This message sets the drawing stroke ink width for the control. Strokes created
- after this message will have the newly set width. The choices for the width are
- one or two pels. The default ink width is one pel.
-
- Returns:
- TRUE - Success
- FALSE - Ink width cannot be set.
-
- Example:
-
- BOOL rc;
- ULONG ulWidth = 2;
-
- rc = (BOOL) WinSendMsg(hSKETCHControl,
- SKM_SET_CTL_INK_WIDTH,
- MPFROMLONG(ulWidth2),
- NULL);
-
- Press "OK" to execute control message SKM_SET_CTL_INK_WIDTH.
-
-
- ΓòÉΓòÉΓòÉ 12. SKM_SET_CTL_INK_COLOR ΓòÉΓòÉΓòÉ
-
- This message sets the drawing stroke color for the control. Strokes created
- after this message will have the newly set color.
-
- Returns:
- TRUE - Success
- FALSE - Ink color cannot be set.
-
- Example:
-
- BOOL rc;
-
- rc = (BOOL) WinSendMsg(hSKETCHControl,
- SKM_SET_CTL_INK_COLOR,
- MPFROMLONG(CLR_RED),
- NULL);
-
- Press "OK" to execute control message SKM_SET_CTL_INK_COLOR.
-
-
- ΓòÉΓòÉΓòÉ 13. SKM_SET_CTL_INVISIBLE_MODE ΓòÉΓòÉΓòÉ
-
- This message sets the ink color to be invisible or visible. Set param1 to TRUE
- if you wish to select invisible ink. Set param1 to FALSE if you wish to select
- visible ink.
-
- Returns:
- TRUE - Success
- FALSE - Failure
-
- Example:
-
- BOOL rc;
- USHORT usInvisible = TRUE;
-
- rc = (BOOL) WinSendMsg(hSKETCHControl,
- SKM_SET_CTL_INVISIBLE_MODE
- MPFROMSHORT(usInvisible),
- NULL);
-
- Press "OK" to select invisible or visible mode and execute.
-
-
- ΓòÉΓòÉΓòÉ 14. SKM_RENDER_TO_CLIPBOARD ΓòÉΓòÉΓòÉ
-
- This message copies the screen resolution bitmap image from the sketch control
- to the Clipboard.
-
- Returns:
- TRUE - Success
- FALSE - Failure
-
- Example:
-
- BOOL rc;
-
- rc = (BOOL) WinSendMsg(hSKETCHControl,
- SKM_RENDER_TO_CLIPBOARD,
- NULL,
- NULL);
-
- Press "OK" to execute control message SKM_RENDER_TO_CLIPBOARD.
-
-
- ΓòÉΓòÉΓòÉ 15. SKM_QUERY_CTL_STROKE_COUNT ΓòÉΓòÉΓòÉ
-
- This message is used to get the count of strokes in the stroke database.
-
- Example:
-
- ULONG ulStrokeCount;
-
- ulStrokeCount = (ULONG) WinSendMsg(hSKETCHControl,
- SKM_QUERY_CTL_STROKE_COUNT,
- NULL,
- NULL);
-
- Press "OK" to execute control message SKM_QUERY_CTL_STROKE_COUNT.
-
-
- ΓòÉΓòÉΓòÉ 16. SKM_SET_STROKE_INK_COLOR ΓòÉΓòÉΓòÉ
-
- This message is used to reset the color attribute of stroke(i) in the stroke
- database. Parameter mp1 specifies the stroke number(1..n), and mp2 is the
- value for stroke(i) ink color.
-
- Returns:
- TRUE - Success
- FALSE - Failure
-
- Example:
-
- BOOL rc;
- LONG lStrokeColor = CLR_RED;
- ULONG ulStrokeNumber = 1;
-
- rc = (BOOL) WinSendMsg(hSKETCHControl,
- SKM_SET_STROKE_INK_COLOR,
- MPFROMLONG(ulStrokeNumber),
- MPFROMP(lStrokeColor) );
-
- Press "OK" to execute control message SKM_SET_STROKE_INK_COLOR.
-
-
- ΓòÉΓòÉΓòÉ 17. SKM_SET_STROKE_INK_WIDTH ΓòÉΓòÉΓòÉ
-
- This message is used to reset the width attribute of stroke(i) in the stroke
- database. Parameter mp1 specifies the stroke number(1..n), and mp2 is the
- value for stroke(i) ink width.
-
- Returns:
- TRUE - Success
- FALSE - Failure
-
- Example:
-
- BOOL rc;
- ULONG ulStrokeWidth = 2;
- ULONG ulStrokeNumber = 1;
-
- rc = (BOOL) WinSendMsg(hSKETCHControl,
- SKM_SET_STROKE_INK_WIDTH,
- MPFROMLONG(ulStrokeNumber),
- MPFROMLONG(ulStrokeWidth) );
-
- Press "OK" to execute control message SKM_SET_STROKE_INK_WIDTH.
-
-
- ΓòÉΓòÉΓòÉ 18. SKN_INK_COLOR_CHANGE ΓòÉΓòÉΓòÉ
-
- This Notification Message is sent to the parent by the control whenever the ink
- color for the drawing stroke has been changed. Parameter mp2 will contain the
- value of the color changed to.
-
- Example:
-
- LONG lColor;
-
- case WM_CONTROL:
- switch(SHORT2FROMMP(mp1))
- {
- case SKN_INK_COLOR_CHANGE:
- lColor = LONGFROMMP(mp2);
- break;
- }
-
- Press "OK" to change the ink color and receive Notification Message
- SKN_INK_COLOR_CHANGE.
-
-
- ΓòÉΓòÉΓòÉ 19. SKN_STROKE_ADD ΓòÉΓòÉΓòÉ
-
- This Notification Message is sent to the parent by the control when a stroke is
- about to be added to the stroke database. Parameter mp2 will contain the
- stroke number of the stroke about to be added. If the parent returns TRUE to
- the message, the stroke will not be added. If the parent returns FALSE, the
- stroke will be added.
-
- Example:
-
- ULONG ulStrokeNumber;
- BOOL AddTheStroke = TRUE;
-
- case WM_CONTROL:
- switch(SHORT2FROMMP(mp1))
- {
- case SKN_STROKE_ADD:
- lStrokeNumber = LONGFROMMP(mp2);
- if (AddTheStroke)
- return((MRESULT) FALSE);
- else
- return((MRESULT) TRUE);
- }
-
- Press "OK". When the next stroke is made in the sketch window, the Sketch
- Control will send Notification message SKN_STROKE_ADD.
-
-
- ΓòÉΓòÉΓòÉ 20. SKN_STROKE_UNDO ΓòÉΓòÉΓòÉ
-
- This Notification Message is sent to the parent by the control when a stroke is
- about to be deleted from the stroke database. Parameter mp2 will contain the
- stroke number of the stroke about to be deleted. If the parent returns TRUE to
- the message, the stroke will not be deleted. If the parent returns FALSE, the
- stroke will be deleted.
-
- Example:
-
- ULONG ulStrokeNumber;
- BOOL UndoTheStroke = TRUE;
-
- case WM_CONTROL:
- switch(SHORT2FROMMP(mp1))
- {
- case SKN_STROKE_UNDO:
- ulStrokeNumber = LONGFROMMP(mp2);
- if (UndoTheStroke)
- return((MRESULT) FALSE);
- else
- return((MRESULT) TRUE);
- }
-
- Press "OK" to undo the last stroke and receive Notification Message
- SKN_STROKE_UNDO.
-
-
- ΓòÉΓòÉΓòÉ 21. SKN_CONTROL_CLEARED ΓòÉΓòÉΓòÉ
-
- This Notification Message is sent to the parent by the control whenever the
- stroke database is about to be cleared of all strokes. Parameter mp2 will
- contain the number of strokes about to be deleted. If the parent returns TRUE
- to the message, the strokes will not be deleted, if the parent returns FALSE,
- all strokes will be deleted from the stroke database.
-
- Example:
-
- ULONG ulStrokes;
- BOOL ClearAllStrokes = TRUE;
-
- case WM_CONTROL:
- switch(SHORT2FROMMP(mp1))
- {
- case SKN_CONTROL_CLEARED:
- ulStrokes = LONGFROMMP(mp2);
- if (ClearAllStrokes)
- return((MRESULT) FALSE);
- else
- return((MRESULT) TRUE);
- }
-
- Press "OK" to clear all strokes and receive Notification Message
- SKN_CONTROL_CLEARED.
-
-
- ΓòÉΓòÉΓòÉ 22. SKM_SET_CTL_AUXDATA_MODE ΓòÉΓòÉΓòÉ
-
- This message informs the control that subsequent strokes will retrieve the
- specified pen stroke auxiliary data if the data can be returned by the device
- (pen, touch, mouse).
-
- Following is a list of the ADF_* flags defined in the header file penpm.h:
-
- ADF_TIMESTAMP- Point timestamp
- ADF_FLAGS - Point flags
- ADF_SCREENZ - Z axis value
- ADF_ANGLE - Device angle
- ADF_ROTATION - Device rotation
- ADF_BUTTON - Button status
- ADF_OEM - OEM spec. data byte cnt
- ADF_USER - always set
- ADF_ALL - All fields
- ADF_OEM_COUNT_MASK - OEM valid count
-
- These values can be ORed together to retrieve multiple fields of auxiliary data
- or a zero can be sent to reset so that no auxiliary data is retrieved for
- subsequent strokes.
-
- Example:
-
- BOOL rc;
- ULONG ulAuxData = ADF_TIMESTAMP;
-
- rc = (BOOL) WinSendMsg(hSKETCHControl,
- SKM_SET_CTL_AUXDATA_MODE,
- MPFROMLONG(ulAuxData),
- NULL);
-
- Press "OK" to choose to have subsequent strokes retrieve all or none of the
- auxiliary data and execute the message.
-
-
- ΓòÉΓòÉΓòÉ 23. SKN_INK_WIDTH_CHANGE ΓòÉΓòÉΓòÉ
-
- This Notification Message is sent to the parent by the control whenever the ink
- width for the drawing stroke has been changed. Parameter mp2 will contain the
- value of the width changed to.
-
- Example:
-
- LONG ulWidth;
- case WM_CONTROL:
- switch(SHORT2FROMMP(mp1))
- {
- case SKN_INK_WIDTH_CHANGE:
- ulWidth = LONGFROMMP(mp2);
- break;
- }
-
- Press "OK" to change the ink width and receive a SKN_INK_WIDTH_CHANGE
- notification message.
-
-
- ΓòÉΓòÉΓòÉ 24. SKM_GET_BITMAP ΓòÉΓòÉΓòÉ
-
- This message creates a screen resolution bitmap image from the sketch control
- and returns its handle.
-
- Example:
-
- HBITMAP hBitmap;
-
- hBitmap = (HBITMAP) WinSendMsg(hSKETCHControl,
- SKM_GET_BITMAP,
- NULL,
- NULL);
-
- The handle returned can be used to save the bitmap to a file on disk. Press
- "OK" to execute control message SKM_GET_BITMAP. The bitmap handle will be
- displayed and you may choose to save the bitmap to a file.
-
-
- ΓòÉΓòÉΓòÉ 25. SKM_QUERY_BITMAP_SIZE ΓòÉΓòÉΓòÉ
-
- This message returns the size of the bitmap that could be returned with the
- SKM_GET_BITMAP or the SKM_RENDER_TO_CLIPBOARD messages. The returned values
- are dependent on whether the control has a border. If the control does not
- contain a border, the bitmap's size is the same size as the control's window.
- If the control does contain a border, the bitmap's size will be reduced by 2
- pixels in the X and Y directions.
-
- Returns: size(ULONG)
- LOUSHORT = Size in pixels in the X direction.
- HIUSHORT = Size in pixels in the Y direction.
- FALSE = An error occured.
-
- Example:
-
- ULONG ulSize;
- SHORT sSizeX;
- SHORT sSizeY;
-
- ulSize = (ULONG) WinSendMsg(hSKETCHControl,
- SKM_QUERY_BITMAP_SIZE,
- NULL,
- NULL);
-
- sSizeX = LOUSHORT(lSize);
- sSizeY = HIUSHORT(lSize);
-
- Press "OK" to execute control message SKM_QUERY_BITMAP_SIZE.
-
-
- ΓòÉΓòÉΓòÉ 26. SKM_QUERY_STROKE_LENGTH ΓòÉΓòÉΓòÉ
-
- This message is used to retrieve the size, in bytes, of stroke(i). A zero
- return code signals an error, such as stroke not available.
-
- Example:
-
- ULONG ulLength;
- ULONG ulStrokeNumber = 1;
-
- ulLength = (ULONG) WinSendMsg(hSKETCHControl,
- SKM_QUERY_STROKE_LENGTH,
- MPFROMLONG(ulStrokeNumber),
- NULL);
-
- Press "OK" to execute control message SKM_QUERY_STROKE_INK_WIDTH.
-
-
- ΓòÉΓòÉΓòÉ 27. SKM_QUERY_STROKE_DATA ΓòÉΓòÉΓòÉ
-
- This message is used to retrieve stroke(i) from the stroke database. MP1
- specifies the stroke(1..n), MP2 is a pointer to a buffer to hold the contents
- of the stroke, including any aux data. The buffer size is determined by a
- SKM_QUERY_STROKE_LENGTH.
-
- Returns:
- TRUE - Success
- FALSE - Failure
-
- Example:
-
- ULONG ulLength;
- ULONG ulStrokeNumber = 1;
- BOOL rc;
- PSKETCHSTROKEDEF pStrokeData;
-
- ulLength = (LONG) WinSendMsg(hSKETCHControl,
- SKM_QUERY_STROKE_LENGTH,
- MPFROMLONG(ulStrokeNumber),
- NULL);
-
- pStrokeData = malloc(ulLength);
- rc = (BOOL) WinSendMsg(hSKETCHControl,
- SKM_QUERY_STROKE_DATA,
- MPFROMLONG(ulStrokeNumber),
- MPFROMP(pStrokeData) );
-
-
- free(pStrokeData);
-
- Press "OK" to execute control message SKM_QUERY_STROKE_DATA.
-
-
- ΓòÉΓòÉΓòÉ 28. SKM_QUERY_STROKE_INK_COLOR ΓòÉΓòÉΓòÉ
-
- This message returns the color attribute of stroke(i) in the stroke database.
- Parameter mp1 specifies the stroke number(1..n) to query.
-
- Returns:
- LONG lColor - color of stroke number(1..n)
- CLR_ERROR - Failure
-
- Example:
-
- LONG lColor;
- ULONG ulStrokeNumber = 1;
-
- lColor = (LONG) WinSendMsg(hSKETCHControl,
- SKM_QUERY_STROKE_INK_COLOR,
- MPFROMLONG(ulStrokeNumber),
- NULL );
-
- Press "OK" to execute control message SKM_QUERY_STROKE_INK_COLOR.
-
-
- ΓòÉΓòÉΓòÉ 29. SKM_QUERY_STROKE_INK_WIDTH ΓòÉΓòÉΓòÉ
-
- This message returns the width attribute of stroke(i) in the stroke database.
- Parameter mp1 specifies the stroke number(1..n) to query.
-
- Returns:
- ULONG ulWidth - width of stroke number(1..n)
- FALSE - Failure
-
- Example:
-
- ULONG ulWidth;
- ULONG ulStrokeNumber = 1;
-
- ulWidth = (LONG) WinSendMsg(hSKETCHControl,
- SKM_QUERY_STROKE_INK_WIDTH,
- MPFROMLONG(ulStrokeNumber),
- NULL );
-
- Press "OK" to execute control message SKM_QUERY_STROKE_INK_WIDTH.