// ---------------------------------------------------------------------------
LONG __export CALLBACK WndProc(
HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam
)
{
switch( Msg )
{
case WM_CREATE:
{
// Turn on the writing pad
if( padOn() )
{
// Start recording...
padRecord( hWnd );
}
else
{
// Error
MessageBox( hWnd, "Unable to find writing pad", "TESTAPP", MB_OK );
PostQuitMessage( 1 );
}
break;
}
case WM_COMMNOTIFY:
{
// Check for any new data received
while( padUpdate() )
{
int x, y, p;
// If pen is down, get pen position info and draw it
if( padGet( &x, &y, &p ) )
{
RECT Rect;
HDC hDC;
5 - 6