Home   Index   About
Ultimate Pack


Custom Search
DoDefaultPenInput

  1. 0

Initiates default handling of pen input.

int DoDefaultPenInput( HWND hwnd, UINT wEventRef )

Parameters

hwnd

Handle to the window initiating the default processing.

wEventRef

An identifier of a pen event in the input stream, from which input is begun. This identifier is the value returned from the GetMessageExtraInfo function.

Return Value

Returns one of the following values:

Constant
Description
PCMR_OK
Pen collection was successfully started.
PCMR_ALREADYCOLLECTING
StartPenInput has already been called for this session.
PCMR_APPTERMINATED
The application aborted input.
PCMR_ERROR
Illegal parameter or unspecified error.
PCMR_INVALID_PACKETID
Invalid packet identifier.
PCMR_SELECT
Press-and-hold was detected. Collection is not started.
PCMR_TAP
A pen tap was detected. Collection is not started.

Comments

DoDefaultPenInput
simplifies the pen input process by including the following capabilities in a single call:

  • Starts pen input by calling StartPenInput

  • Starts inking by calling StartInking

  • Saves the screen background overwritten by the ink

  • Collects the pen input data

  • Stops inking by calling StopInking

  • Stops pen input by calling StopPenInput

  • Targets the pen input data to windows

  • Recognizes results

  • Sends the recognition results to the targets

The default processing proceeds in three phases: initialization, data gathering, and termination. A set of submessages corresponds to each of the three phases.

  • During the initialization phase, the system sends the WM_PENEVENT sub-message PE_SETTARGETS and potentially several PE_GETPCMINFO and PE_GETINKINGINFO messages. After the target or the DefWindowProc function handles these messages and returns a value of PCMR_OK to indicate success, the data-gathering phase begins.

  • During the data-gathering phase, the window specified by the hwnd parameter starts to receive the core pen-input submessages PE_PENDOWN, PE_PENUP, and PE_PENMOVE. The window should let these submessages fall through to DefWindowProc, which translates them into the higher-level messages PE_BEGINDATA and PE_MOREDATA. These are sent to one of the windows specified in the htrgTarget members of the TARGET structures if targeting is in progress; otherwise, the messages are sent to hwnd.

  • The termination phase begins when the pen input terminates. The target window should let the core termination messages PE_TERMINATING and PE_TERMINATED fall through to DefWindowProc. The PE_ENDDATA, PE_RESULT, and PE_ENDINPUT submessages are sent by DefWindowProc while processing PE_TERMINATED.

A return value of LRET_ABORT to any of the WM_PENEVENT submessages aborts the entire process of default input.

See Also

WM_PENEVENT, StartPenInput, StartInking, StopPenInput, StopInking


Last news from Greatis Software

Nostalgia .Net     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 for Delphi and C++ Builder     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     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     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     Gradient Controls .Net offers controls with gradient background feature. Labels, panels and so on... Full C# source codes are available  More »

iGrid     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 projects

Dmitry Vasiliev (just.dmitry)

Related Links

Software 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

Free Tech Secrets ;) Copyright © 2008-2012 Free Tech Secrets ;) greatis just4fun network just4fun