=================================================================
Print-2-Image TM - (c) copyright 1990-1994 RPN/RPI/Imecom.
=================================================================

For more info, contact:
Resource Partners North
2157 Marc Lane, Suite 100
Burlington, Ontario
L7M 3W6  Canada
Tel. 905-336-2872
Fax. 905-336-3158
CIS: 74347,164

==============================================
Print-2-Image -
DEMO API SOURCE CODE FOR GUPTA SQLWINDOWS 4.1
==============================================

Overview
=========
Print-2-Image can be integrated with any Gupta 
SQLWIndows application.  

The [ShowApplication] section of the P2IMAGE.INI controls
what program (ShowAppExe executable) is launched after 
Print-2-Image finishes creating an image file on your
hard drive.

To test the SQLWindows API demo program:
======================--------===========
Change the entries in P2IMAGE.INI file to the 
following settings:

[ShowApplication]
UseShowApp=1
ShowAppExe=c:\gupta41\p2iapi.exe (or dir of p2iapi.exe)
ShowAppClass=SqlWin:Form
ShowAppTitle=P-2-I Demo API
ShowAppMsgAPIType=1	


UseShowApp (1 or 0)
---------------------
This switch to indicate whether you want the ShowAppExe to be
launched after creating an image file.  This corresponds to 
the "View on Completion" check box found in the Print-2-Image
Setup screen.


ShowAppExe (Dos path and file name for a program executable)
------------------------------------------------------------
This is the launch application.  It can be any program you want.


ShowAppClass (Window CLASS of the ShowAppExe program's main form.)
------------------------------------------------------------------
In the sample VB program - it is SqlWin:Form.  If you do not know
the CLASS of a window object, you can use SPY.EXE which comes with
the Windows 3.1 SDK.


ShowAppTitle (TITLE (or Caption) of the ShowAppExe main form.
--------------------------------------------------------------
In the sample VB program - it is P-2-I Demo API.


How are the CLASS and TITLE used?
==================================
Print-2-Image will use the CLASS and TITLE in the FindWindow
function to locate a running copy of the ShowAppExe.  
If FindWindow detects that the ShowAppExe is already running, 
a message (ShowAppMsgAPIType) is sent to the program as a 
"trigger" to indicate that an image was created.  The ShowAppExe
can then look at the P2IMAGE.INI file for more information.


ShowAppMsgAPIType - message API type
-------------------------------------
ShowAppMsgAPIType=1 is the recommended setting for SQLWindows.
This option determines which ACTION message type 
(1 is 0x400 + 4000) is sent to the ShowAppExe program.

The ShowAppExe can "trap" this ACTION message and activate
any custom process that will probably include reading the 
P2IMAGE.INI file for [Output] details.


Message API Choices:
=====================
;ShowAppMsgAPIType=0 //forces the command line API everytime
;ShowAppMsgAPIType=1 //if ShowAppExe running, send a pam user msg
;ShowAppMsgAPIType=2 //if ShowAppExe running, send a KeyUp Action
;ShowAppMsgAPIType=3 //if ShowAppExe running, send a DoubleClick 
;ShowAppMsgAPIType=4 //if ShowAppExe running, send a KeyDown 


Note: 
=======
For Visual Basic, we added Keyup and Doubleclick ACTIONS to the
messaging API.  These messages were added since in VB you cannot
declare a programmer-defined application message(PAM_).

However, in Gupta SQLWindows or C++, you can use the windows
message  =>  ShowAppMsgAPIType=1 (0x400 + 4000).  

** The default API-type is ShowAppMsgAPIType=1 **
 
For Visual Basic, we recommend ShowAppMsgAPIType=2 for 
Keyup ACTION trapping.


===============================
P2IRPN.DLL - C program
API message define statements:
===============================
#define WM_P2I_API1	   0x400 + 4000  // pam user
#define WM_P2I_API2	   0x0101   	 // KeyUp
#define WM_P2I_API3	   0x0203  	 // Double click    
#define WM_P2I_API4	   0x0100  	 // KeyDown    


Sample [ShowApplication] section
---------------------------------
UseShowApp=1
ShowAppExe=c:\gupta41\p2iapi.exe
ShowAppClass=SqlWin:Form
ShowAppTitle=P-2-I Demo API
ShowAppMsgAPIType=1	
;
;ShowAppExe=C:\P2image\SHOWFAX.EXE  //use below for ShowFax
;ShowAppClass=APPL_VIEWFAX
;ShowAppTitle=View a Fax
