![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
|
Support:
Products:
Downloads:
Press: |
Developer APIPenfriend W3 and Penfriend XP support communication with third party products for adding prediction to their operation, displaying words and generating keystrokes within that application. To see it in action, please download PredClient. This is only relevant to developers who can read and write C programs. The design principle, which works across Win16 and Win32, uses Windows Messages and Global Atom strings to pass messages between applications. A standard message number and atom handle is defined, and then for each communication, the atom string is set to contain data and a message sent to indicate that it is ready. Details are included in the PredClient package which is free to download.
There is a message sequence to establish communication between the two programs. Then, two tell Penfriend that another letter has been typed, you send it a message. It will send you a new list of predicted words to display. Each time a choice is made, you tell Penfriend so it can update its records. The list of predicted words can be requested at any time, too. The list of predicted words will come as several messages because of the size limitations on Global Atom strings. Each group starts and ends with a special marker message, and in the middle there will be zero or more messages containing lists of words. Each word is given twice; as the word to display on screen to the user, and the letters which need to be typed in order to achieve that (possibly including backspaces). INGREDIENTSPenfriend server application, ie Penfriend for Windows v0.98 or higher A Penfriend client application which the user sees, and talks to the server Windows 3.1, Windows 95, or whatever that supports GlobalAtoms Two fresh GlobalAtoms with which to communicate strings. These are rare! PREPARATIONThe message number from RegisterWindowMessage("PenfriendShare") When the client starts, it should broadcast PFC_FINDSERVER (see below) Similarly, the server may broadcast PFS_FINDCLIENT. To load Penfriend if it doesn't reply to PFC_FINDSERVER, execute the command in the registry key HKEY_CLASSES_ROOT\Lexicon_PF\Config\Server then try once more. METHODThis example is written in C. MyAtom=GlobalAddAtom("w=666 n=\"Penfriend Client\" v=\"1.01\")
PostMessage(HWND_BROADCAST,PenfriendShareMessage,MyAtom,PFC_FINDSERVER);
Where each process also listens for such messages to process.
(lParam: LSB-byte=command, byte1=sequence number, bytes2,3=reserved)
SERVING SUGGESTIONClicker 3 for Windows 95 could display predictions in a grid window The Windows message used for all of this comes from RegisterWindowMessage() with the string held in PFS_MESSAGENAME #define PFS_MESSAGENAME "PenfriendShare" The command numbers and meanings are as follows. Those beginning PFC_ are sent by the client (you), and those beginning PFS_ are sent by the server (Penfriend).
For PostMessage(), the following parameters are passed:
Detail strings
PFC_FINDSERVER is broadcast to all windows by the client. The string contains:
PFC_KEYSTROKE is sent by the client when it knows that keys have been pressed.
PFS_PREDICTIONS is sent by the server when it has new data to display. It may send more than one of this message, but will compress them if space allows "%s","%s" "%s","%s" "%s","%s" ... means pairs of display-type strings The display part should appear on screen. The 'type' part should be simulated as keystrokes if chosen. If the type part begins '(' instead of '"' then it is a sequence of decimal ASCII codes PFC_COMMAND
The remaining commands should be obvious. |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|