ChromaPIX
Programmer's API
Revision 1.0
Last modified 15 January, 1999
© (1997-1999) Silicon Pixels
http://www.siliconpixels.com
Forward:
The ChromaPIX (CPIX) programmer's API has been developed to give third-party programmers a stable means to control CPIX from their applications. Since the location and descriptions of control buttons may change, using this API is the best way of ensuring that we don't 'break' your application when we make changes to CPIX. Also, since CPIX is expecting commands issued in this manner, it allows us to process them in a manner that best fits CPIX' internal architecture.
Please note this API supercedes the previous ActiveX control interface.
Step 1. Registering the CPIX message:
When CPIX loads, it registers a
custom Windows message, with the string "CPIX". Any client application that wishes to use the API must
do the same. It does not matter if the client application is
loaded first, because once the message is registered, other calls
to RegisterWindowMessage will return the same message ID. For
example,
gCPIX_MSG = RegisterWindowMessage("CPIX")
Step 2. Getting a handle to the desired CPIX window:
Once the client has registered the message, the next step is to determine the hWnd (window handle) of the CPIX window you wish to control. There are actually several ways to do this. The best way is with the EnumWindows call, but that requires a callback function. The Visual Basic 5.0 example code shows how to do this in VB, and should serve as a template for C or Delphi applications as well.
Bear in mind that all CPIX windows have a unique string in the title bar; "CPIX-1", "CPIX-2", etc. If you want to use the top-most window, just look for the first window with "CPIX" in the caption. EnumWindows returns the window list using the desktop Z-order, so the first one found will be the topmost one.
Step 3. Using the CPIX control message:
CPIX uses the wParam parameter to determine
which action to take when a command message is received. As of
the 0.96.15 version, it will respond to the following commands:
CPIX_CTL_COPY = 1 | Copy the current image to the clipboard |
CPIX_CTL_PASTE = 2 | Paste the current image from the clipboard |
CPIX_CTL_AUTORX = 3 | Begin Auto-Receive mode |
CPIX_CTL_MANRX = 4 | Begin Manual Receive mode |
CPIX_CTL_TX = 5 | Transmit the current image |
CPIX_CTL_STBY = 6 | Begin Standby mode |
For example, if we wanted to command CPIX to transmit, we would
send the desired CPIX window the CPIX message, with the
CPIX_CTL_TX constant in the wParam parameter of the PostMessage
call :
PostMessage(hWnd, gCPIX_MSG, CPIX_CTL_TX, 0)
Getting assistance:
If you need help using the API, please send email to Jim Barber . We'll do what we can to help out.
jlb