PT-60 Mobile Computer Programming Manual

PT-60 Mobile Computer Programming Manual
PT-60 Mobile Computer
Programming Manual
DOC NO. UM-PT605-02
Oct. 2008
Version 1.0
© 2002-2007 byARGOX Information Co., Ltd.
http://www.argox.com
Table of Contents
OVERVIEW....................................................................................................................................................................................................................................1
SDK FUNCTIONS......................................................................................................................................................................................................................2
SYSAPIAX.DLL............................................................................................................................................................................................................................3
AUDIORELATEDFUNCTIONS......................................................................................................................................................................................5
Audio_GetVolume..............................................................................................................................................................................5
Audio_SetVolume...............................................................................................................................................................................6
BATTERYRELATEDFUNCTION...................................................................................................................................................................................7
GetBatteryStatus..................................................................................................................................................................................7
DISPLAYRELATEDFUNCTIONS ..................................................................................................................................................................................9
BacklightOn..........................................................................................................................................................................................9
Display_QueryBacklightIntensity.............................................................................................................................................10
GetBacklightStatus..........................................................................................................................................................................12
PowerOnLCD..................................................................................................................................................................................13
SetBacklightPWM...........................................................................................................................................................................14
KEYPADRELATEDFUNCTIONS...............................................................................................................................................................................15
EnablePowerButton.......................................................................................................................................................................15
GetKeypadAlphaMode................................................................................................................................................................16
SendKbdVisualKey.........................................................................................................................................................................17
SetKeypadAlphaMode..................................................................................................................................................................18
LEDRELATEDFUNCTIONS.......................................................................................................................................................................................19
GetKeypadLEDStatus...................................................................................................................................................................19
GoodReadLEDOn.........................................................................................................................................................................20
KeypadLEDOn................................................................................................................................................................................21
SYSTEMRELATEDFUNCTIONS................................................................................................................................................................................22
CallSuspend.......................................................................................................................................................................................22
EnableAutoConnect.......................................................................................................................................................................23
RegisterAlphaKeyNotification....................................................................................................................................................24
ShowChineseIME...........................................................................................................................................................................25
ShowDesktop....................................................................................................................................................................................26
ShowExploreToolbar.....................................................................................................................................................................27
ShowTaskbar.....................................................................................................................................................................................28
UnRegisterAlphaKeyNotification.............................................................................................................................................29
SCANAPIAX.DLL...................................................................................................................................................................................................................30
Programming Manual
II
API_SCANRELATEDFUNCTIONS.......................................................................................................................................................................32
API_Register......................................................................................................................................................................................32
API_Unregister................................................................................................................................................................................33
API_GetBarData............................................................................................................................................................................34
API_GetBarDataLength..............................................................................................................................................................36
API_GetBarType.............................................................................................................................................................................37
API_GetError...................................................................................................................................................................................38
API_GetSysError............................................................................................................................................................................39
API_GoodRead...............................................................................................................................................................................40
API_LoadSettingsFromFile........................................................................................................................................................41
API_Reset...........................................................................................................................................................................................42
API_ResetBarData.........................................................................................................................................................................43
API_SaveSettingsToFile................................................................................................................................................................44
API_SaveSettingsToScanner......................................................................................................................................................45
S2K_IsLoad.......................................................................................................................................................................................46
S2K_Load...........................................................................................................................................................................................47
SCAN_QueryStatus........................................................................................................................................................................48
SCAN_SendCommand................................................................................................................................................................49
SCAN2KEYRELATEDFUNCTIONS.........................................................................................................................................................................50
PT_OpenScan2Key.......................................................................................................................................................................50
PT_CloseScan2Key.......................................................................................................................................................................51
PT_SetToDefault..............................................................................................................................................................................52
SCANNERRELATEDFUNCTIONS.............................................................................................................................................................................53
PT_EnableScanner........................................................................................................................................................................53
PT_DisableScanner.......................................................................................................................................................................54
PT_CheckBarcodeData...............................................................................................................................................................55
PT_GetBarcodeData....................................................................................................................................................................56
PT_SetDefault...................................................................................................................................................................................58
SCANKEYRELATEDFUNCTIONS...........................................................................................................................................................................59
EnableTriggerKey...........................................................................................................................................................................59
GetLibraryVersion...........................................................................................................................................................................60
GetTriggerKeyStatus......................................................................................................................................................................61
PressTriggerKey...............................................................................................................................................................................62
TriggerKeyStatus..............................................................................................................................................................................63
VIBRATORRELATEDFUNCTIONS...........................................................................................................................................................................64
VibratorOn.........................................................................................................................................................................................64
SCAN COMMAND TABLE.............................................................................................................................................................................................65
FUNCTION RETURN VALUES...................................................................................................................................................................................76
Programming Manual
III
Overview
The Argox Mobile Computer Software Developer Kit (SDK) Help is intended to assist
programmers with the creation of applications for Argox Mobile Computers running a Microsoft®
Windows® .NET CE5.0 Operating System. It gives all of the details necessary for calling
functions which control the devices on the Argox Mobile Computer or access the Value-added
device module, such as Scanning and Wireless.
The help file is organized into two sections, one is the system related, and the other one is the
value-added scanning functions providing the following information:
•
Argox Mobile Computer standard Application Programming Interface (API) Definitions
for system related.
Audio
Display
Keypad
Led and Vibrator Indicators
Battery Status
System Settings
•
Argox Scanning device Application Programming Interface (API) Definitions
API definitions illustrate how to call a given function. The API definitions are structed with some
information including prototypes, parameters, return values, examples and requirements for each
API. The “Requirements” section gives the information on whether or not a device supports a
specific API function and the files to be included.
Programming Manual
1
SDK Functions
When user wants to use SDK to develop their own program, they should link DLL file or LIB file,
and include header file SYSAPIAX.H.
There are two examples to show how to use LIB file and DLL file on their project. We will use
Visual Studio 2005 to explain.
Example 1: Using LIB file.
At first you should include sysapiax.lib in your project.
#include "Sysapiax.h"
main()
{
.....
SetBacklightPWM(100, 100);
.....
}
Example 2: Using DLL file.
HINSTANCE dllHandle = NULL;
typedef DWORD (_stdcall *pfnSetBacklightPWM)(int nACPowerPercent, int
nBatteryPercent);
pfnSetBacklightPWM
m_SetBacklightPWM;
main()
{
dllHandle = LoadLibrary(L"SYSAPIAX.dll");
m_SetBacklightPWM = (pfnSetBacklightPWM) ::GetProcAddress(dllHandle,
_T("SetBacklightPWM"));
m_SetBacklightPWM(0, 0);
FreeLibrary(dllHandle);
}
Programming Manual
2
SYSAPIAX.DLL
In this SDK, we supply SYSAPIAX.DLL which includes several functions to allow programmer
to control device drivers and system functions. User can use WINCE develop tool like Visual
Studio 2005 to develop application program. The function description is given below.
Audio Related Functions
z
Audio_GetVolume – Query the current volume setting.
z
Audio_SetVolume – Set the volume setting.
Battery Related Function
z
GetBatteryStatus – Gets main battery status.
Display Related Functions
z
BacklightOn – Turn on or off screen backlight.
z
Display_QueryBacklightIntensity – Query backlight intensity.
z
GetBacklightStatus – Gets screen backlight status.
z
PowerOnLCD – Turn on or off LCD power.
z
SetBacklightPWM – Adjusts screen backlight brightness.
KeyPad Related Functions
z
EnablePowerButton – Enable and disable power button.
z
GetAlphaMode – Get the current input mode.
z
SendKbdVisualKey – Sends a visual key to key buffer.
z
SetAlphaMode – Change input mode.
LED Related Functions
z
GetKeypadLEDStatus – Gets keypad LED status.
z
GoodReadLEDOn – Turn on and off good read LED.
z
KeypadLEDOn – Turn on or off keypad LED.
System Related Functions
z
CallSuspend – Enter suspend mode.
z
EnableAutoConnect – Turn auto-connect on and off.
z
RegisterAlphaKeyNotification – Register a request with send a message when
the alpha key pressed.
z
ShowChineseIME – Display and hide the Chinese IME.
Programming Manual
3
z
ShowDeskTop – Display and hide all icons on desktop.
z
ShowExploreToolbar – Display and hide toolbar on windows explorer.
z
ShowTaskbar – Display and hide taskbar.
z
UnregisterAlphaKeyNotification – Unregister message request.
Programming Manual
4
Audio Related Functions
Audio_GetVolume
This function queries the current volume setting.
DWORD Audio_GetVolume
{
LPDWORD lpdwVolume
}
Parameters
lpdwVolume
[out]The current volume setting.
Return Values
If function succeeds, the return value is E_FUNC_SUCCEED. If function fails, the return value is
E_FUNC_ERROR.
Example
DWORD dwResult, dwVolume;
dwResult =Audio_GetVolume(&dwVolume);
if(dwResult != E_FUNC_SUCCEED)
AfxMessageBox(_T("Audio_GetVolume fail"));
else
{
CString strTemp;
strTemp.Format(_T("Volume:
%d"),dwVolume);
AfxMessageBox(strTemp);
}
Requirements
OS Versions: Windows CE 5.0 and later.
Header: sysapiax.h
Link Library: sysapiax.lib
Link DLL: sysapiax.dll
Device: PT60
Programming Manual
5
Audio_SetVolume
This function sets the current volume setting.
DWORDAudio_SetVolume
{
DWORD dwVolume
}
Parameters
dwVolume
[in] Specifies a new volume setting. The default setting is 0x99999999.
Return Values
If function succeeds, the return value is E_FUNC_SUCCEED. If function fails, the return value is
E_FUNC_ERROR.
Example
DWORD dwResult,dwVolume;
dwVolume = 0x11111111;
dwResult =Audio_SetVolume(dwVolume);
if(dwResult != E_FUNC_SUCCEED)
AfxMessageBox(_T("Audio_SetVolume fail"));
Requirements
OS Versions: Windows CE 5.0 and later.
Header: sysapiax.h
Link Library: sysapiax.lib
Link DLL: sysapiax.dll
Device: PT60
Programming Manual
6
Battery Related Function
GetBatteryStatus
This function gets main battery status.
int GetBatteryStatus
{
}
Parameters
None.
Return Values
The return value can be one of the values in the following table.
Return value
Description
0
battery high
1
battery low
2
battery critical
3
battery charging
4
no battery
5
battery unknown
Example
switch (GetBatteryStatus())
{
case 0:
AfxMessageBox(_T("Battery High"));
break;
case 1:
AfxMessageBox(_T("Battery Low"));
break;
case 2:
AfxMessageBox(_T("Battery Critical"));
break;
case 3:
AfxMessageBox(_T("Battery Charging"));
Programming Manual
7
break;
case 4:
AfxMessageBox(_T("No Battery"));
break;
case 5:
AfxMessageBox(_T("Battery Unknown"));
break;
}
Requirements
OS Versions: Windows CE 5.0 and later.
Header: sysapiax.h
Link Library: sysapiax.lib
Link DLL: sysapiax.dll
Device: PT60
Programming Manual
8
Display Related Functions
BacklightOn
This function will always turn on or off screen backlight.
DWORD BacklightOn
{
BOOLbOn
}
Parameters
bOn
[in] Flag that indicates whether turn on screen backlight(TRUE) or turn off screen backlight(FALSE).
Return Values
If function succeeds, the return value is E_FUNC_SUCCEED. If function fails, possible return value are
E_FUNC_ERROR, E_FUNC_PAR_ERROR.
Remarks
After this function turn on or off backlight, the backlight will always on or off.The backlight setting of display
properties in control panel does not work until terminal resets.
Example
DWORD dwResult;
dwResult = BacklightOn(TRUE);
if(dwResult != E_FUNC_SUCCEED)
AfxMessageBox(_T("BacklightOn fail"));
Requirements
OS Versions: Windows CE 5.0 and later.
Header: sysapiax.h
Link Library: sysapiax.lib
Link DLL: sysapiax.dll
Device: PT60
Programming Manual
9
Display_QueryBacklightIntensity
This function will return the backlight intensity of external power and battery power.
DWORD Display_QueryBacklightIntensity
{
LPDWORD lpdwACBacklight,
LPDWORD lpdwBatteryBacklight
}
Parameters
lpdwACBacklight
[out]The backlight intensity of external power.
lpdwBatteryBacklight
[out]The backlight intensity of battery power.
Return Values
If function succeeds, the return value is E_FUNC_SUCCEED. If function fails, possible return value are
E_FUNC_ERROR, E_FUNC_NULLPTR.
Remarks
The parameters will be one of the values in the following table.
Backlight intensity
Backlight brightness
4
super
3
normal
2
fine
1
micro
0
off
Example
DWORD dwResult, dwValue1, dwValue2;
dwResult = Display_QueryBacklightIntensity(&dwValue1, &dwValue2);
if(dwResult != E_FUNC_SUCCEED)
AfxMessageBox(_T("Display_QueryBacklightIntensity fail"));
else
{
CString strTemp;
strTemp.Format(_T("AC backlight intensity: %d, Battery backlight intensity: %d"), dwValue1,
Programming Manual
10
dwValue2);
AfxMessageBox(strTemp);
}
Requirements
OS Versions: Windows CE 5.0 and later.
Header: sysapiax.h
Link Library: sysapiax.lib
Link DLL: sysapiax.dll
Device: PT60
Programming Manual
11
GetBacklightStatus
This function gets screen backlight status.
DWORD GetBacklightStatus
{
}
Parameters
None.
Return Values
The return value indicates whether screen backlight is 1 = screen backlight on or screen backlight is 0 = screen
backlight off.
Example
DWORD dwResult;
dwResult = GetBacklightStatus();
if(dwResult == 1)
AfxMessageBox(_T("Backlight on"));
else
AfxMessageBox(_T("Backlight off"));
Requirements
OS Versions: Windows CE 5.0 and later.
Header: sysapiax.h
Link Library: sysapiax.lib
Link DLL: sysapiax.dll
Device: PT60
Programming Manual
12
PowerOnLCD
This function turns on or off LCD power.
DWORD PowerOnLCD
{
BOOLbOn
}
Parameters
bOn
[in] Flag that indicates whether turn on LCD power(TRUE) or turn off LCD power(FALSE).
Return Values
If function succeeds, the return value is E_FUNC_SUCCEED. If function fails, possible return value are
E_FUNC_ERROR, E_FUNC_PAR_ERROR.
Remarks
After calling this function with bOn is FALSE, terminal will only turn off LCD power. It means that terminal still
works.You should call this function to turn on LCD power or reset terminal.
Example
DWORD dwResult;
dwResult = PowerOnLCD(FALSE); //power off LCD
if(dwResult != E_FUNC_SUCCEED)
AfxMessageBox(_T("PowerOnLCD fail"));
Sleep(3000);
dwResult = PowerOnLCD(TRUE); //power on LCD
if(dwResult != E_FUNC_SUCCEED)
AfxMessageBox(_T("PowerOnLCD fail"));
Requirements
OS Versions: Windows CE 5.0 and later.
Header: sysapiax.h
Link Library: sysapiax.lib
Link DLL: sysapiax.dll
Device: PT60
Programming Manual
13
SetBacklightPWM
This function adjusts screen backlight brightness.
DWORD SetBacklightPWM
{
int nACPowerPercent,
int nBatteryPercent
}
Parameters
nACPowerPercent,nBatteryPercent
[in] One is brightness setting usingAC power and the other is brightness setting using battery. These two
members must be one of the values in the following table.
nPercent
Backlight brightness
100
super
75
normal
50
fine
25
micro
0
off
Return Values
If function succeeds, the return value is E_FUNC_SUCCEED. If function fails, possible return value are
E_FUNC_ERROR, E_FUNC_PAR_ERROR.
Remarks
The Backlight Setting program in Control Panel sets screen backlight brightness. Called this function will also
change the brightness in Backlight Setting.You can use this function or Backlight Setting program in Control Panel
to adjust backlight brightness.
Example
DWORD dwResult = SetBacklightPWM(100,100);
if(dwResult != E_FUNC_SUCCEED)
AfxMessageBox(_T("SetBacklightPWM fail"));
Requirements
OS Versions: Windows CE 5.0 and later.
Header: sysapiax.h
Link Library: sysapiax.lib
Link DLL: sysapiax.dll
Device: PT60
Programming Manual
14
KeyPad Related Functions
EnablePowerButton
This function will enable or disable power button.
DWORD EnablePowerButton
{
BOOLbOn
}
Parameters
bOn
[in] Flag that indicates whether enable power button(TRUE) or disable power button(FALSE).
Return Values
If function succeeds, the return value is E_FUNC_SUCCEED. If function fails, possible return value are
E_FUNC_ERROR, E_FUNC_PAR_ERROR.
Remarks
If the bOn parameter is FALSE, power button is disabled. The power button will not work when power button
pressed. If terminal enters suspend mode, the power button will work once to wake up.When terminal wakes up,
the power button is still disabled. Until this function calls with parameter TRUE to enable power button.
Example
DWORD dwResult;
dwResult = EnablePowerButton(FALSE);
if(dwResult != E_FUNC_SUCCEED)
AfxMessageBox(_T("EnablePowerButton fail"));
Requirements
OS Versions: Windows CE 5.0 and later.
Header: sysapiax.h
Link Library: sysapiax.lib
Link DLL: sysapiax.dll
Device: PT60
Programming Manual
15
GetKeypadAlphaMode
This function will get the current input mode.
DWORD GetKeypadAlphaMode
{
}
Parameters
None.
Return Values
The return value can be one of the values in the following table.
Return value
Alpha mode
0
numeric mode
1
lowercase letter mode
2
uppercase lette mode
Example
DWORD dwResult;
dwResult = GetKeypadAlphaMode();
switch (dwResult){
case 0:
AfxMessageBox(_T("Numeric mode"));
break;
case 1:
AfxMessageBox(_T("Lowercase letter mode"));
break;
case 2:
AfxMessageBox(_T("Uppercase letter mode"));
break;
}
Requirements
OS Versions: Windows CE 5.0 and later.
Header: sysapiax.h
Link Library: sysapiax.lib
Link DLL: sysapiax.dll
Device: PT60
Programming Manual
16
SendKbdVisualKey
This function sends a visual key to key buffer.
DWORD SendKbdVisualKey
{
BYTE Key
}
Parameters
Key
[in] Specifies a virtual-key code.
Return Values
If function succeeds, the return value is E_FUNC_SUCCEED. If function fails, possible return value are
E_FUNC_ERROR, E_FUNC_PAR_ERROR.
Example
CString strTemp;
strTemp = "VisualKey";
for(int i=0;i<strTemp.GetLength();i++)
SendKbdVisualKey((unsigned char)strTemp.GetAt(i));
Requirements
OS Versions: Windows CE 5.0 and later.
Header: sysapiax.h
Link Library: sysapiax.lib
Link DLL: sysapiax.dll
Device: PT60
Programming Manual
17
SetKeypadAlphaMode
This function will change input mode.
DWORD SetKeypadAlphaMode
{
int nMode
}
Parameters
nMode
[in] Flags for set input mode. This member must be one of the values in the following table.
Value
Alpha mode
0
numeric mode
1
lowercase letter mode
2
uppercase letter mode
Return Values
If function succeeds, the return value is E_FUNC_SUCCEED. If function fails, possible return value are
E_FUNC_ERROR, E_FUNC_PAR_ERROR.
Example
DWORD dwResult;
dwResult = SetKeypadAlphaMode(1);
if(dwResult != E_FUNC_SUCCEED)
AfxMessageBox(_T("SetKeypadAlphaMode fail"));
Requirements
OS Versions: Windows CE 5.0 and later.
Header: sysapiax.h
Link Library: sysapiax.lib
Link DLL: sysapiax.dll
Device: PT60
Programming Manual
18
LED Related Functions
GetKeypadLEDStatus
This function gets keypad LED status.
BOOLGetKeypadLEDStatus
{
}
Parameters
None.
Return Values
The return value indicates whether keypad LED is on(TRUE) or keypad LED is off(FALSE).
Example
BOOLbResult;
bResult = GetKeypadLEDStatus();
if(bResult == TRUE)
AfxMessageBox(_T("Keypad LED on"));
else if(bResult == FALSE)
AfxMessageBox(_T("Keypad LED off"));
Requirements
OS Versions: Windows CE 5.0 and later.
Header: sysapiax.h
Link Library: sysapiax.lib
Link DLL: sysapiax.dll
Device: PT60
Programming Manual
19
GoodReadLEDOn
This function turns on and off goodread LED.
DWORD GoodReadLEDOn
{
BOOLbOn
}
Parameters
bOn
[in] Flag that indicates whether turn on goodread LED(TRUE) or turn off goodread LED(FALSE).
Return Values
If function succeeds, the return value is E_FUNC_SUCCEED. If function fails, possible return value are
E_FUNC_ERROR, E_FUNC_PAR_ERROR.
Example
DWORD dwResult;
dwResult = GoodReadLEDOn(TRUE);
if(dwResult != E_FUNC_SUCCEED)
AfxMessageBox(_T("GoodReadLEDOn fail"));
Requirements
OS Versions: Windows CE 5.0 and later.
Header: sysapiax.h
Link Library: sysapiax.lib
Link DLL: sysapiax.dll
Device: PT60
Programming Manual
20
KeypadLEDOn
This function always turns on or off keypad LED.
DWORD KeypadLEDOn
{
BOOLbOn
}
Parameters
bOn
[in] Flag that indicates whether turn on keypad LED(TRUE) or turn off keypad LED(FALSE).
Return Values
If function succeeds, the return value is E_FUNC_SUCCEED. If function fails, possible return value are
E_FUNC_ERROR, E_FUNC_PAR_ERROR.
Remarks
The KeyPad LED setting in Control Panel is used to set the Keypad LED operation to meet requirements. Called
this function will change the KeyPad LED setting to always on or off.You can use this function or KeyPad LED
setting in Control Panel to always turn on or off keypad LED.
Example
DWORD dwResult;
dwResult = KeypadLEDOn(TRUE);
if(dwResult != E_FUNC_SUCCEED)
AfxMessageBox(_T("KeypadLEDOn fail"));
Requirements
OS Versions: Windows CE 5.0 and later.
Header: sysapiax.h
Link Library: sysapiax.lib
Link DLL: sysapiax.dll
Device: PT60
Programming Manual
21
System Related Functions
CallSuspend
After called this function, terminal will enter suspend mode.
void CallSuspend
{
}
Parameters
None.
Return Values
None.
Example
//suspend device
CallSuspend();
Requirements
OS Versions: Windows CE 5.0 and later.
Header: sysapiax.h
Link Library: sysapiax.lib
Link DLL: sysapiax.dll
Device: PT60
Programming Manual
22
EnableAutoConnect
The EnableAutoConnect function turnsAutoconnect on and off.
BOOLEnableAutoConnect
{
BOOLbEnable
}
Parameters
bEnable
[in] Flag that indicates whetherActiveSync is being automatically executed (TRUE) orActiveSync is
being not automatically executed (FALSE) when user plug cable into terminal.
Return Values
Return TRUE if the operation is successful; otherwise FALSE.
Remarks
After called EnableAutoConnect with bEnable set to TRUE, terminal will automatically executeActiveSync
program when user plug cable into terminal.After called EnableAutoConnect with bEnable set to FALSE,
terminal will not automatically executeActiveSync program when user plug cable into terminal.
Example
BOOLbResult;
bResult = EnableAutoConnect(TRUE);
if(bResult == FALSE)
AfxMessageBox(_T("EnableAutoConnect fail"));
Requirements
OS Versions: Windows CE 5.0 and later.
Header: sysapiax.h
Link Library: sysapiax.lib
Link DLL: sysapiax.dll
Device: PT60
Programming Manual
23
RegisterAlphaKeyNotification
Register the application to SYSAPIAX.dll, so that SYSAPIAX.dll will send a windows message to the application when the
alpha key pressed.
DWORD RegisterAlphaKeyNotification
{
HANDLE hWnd,
UINTuMsg
}
Parameters
hWnd
[in]The window handle of the application that is to receive the message.
uMsg
[in]The message value that is to be sent when alpha key pressed.
Return Values
Return 0 if the operation is successful, otherwise return 1.
Remarks
The application should call UnregisterAlphaKeyNotification function to unregister message from the dll.
Example
if(RegisterAlphaKeyNotification(this->m_hWnd,WM_USER+0x0001))
AfxMessageBox(_T("RegisterAlphaKeyNotification FAIL!!"));
Requirements
OS Versions: Windows CE 5.0 and later.
Header: sysapiax.h
Link Library: sysapiax.lib
Link DLL: sysapiax.dll
Device: PT60
Programming Manual
24
ShowChineseIME
The ShowChineseIME function display and hide the Chinese IME.
BOOLShowChineseIME
{
BOOLbShow
}
Parameters
bShow
[in] Flag that indicates whether display the Chinese IME(TRUE) or hide the Chinese IME(FALSE).
Return Values
Return TRUE if the operation is successful; otherwise FALSE.
Remarks
The Chinese IME only support in Chinese OS. It will work after call this function and reset terminal.
Example
BOOLbResult;
bResult = ShowChineseIME(TRUE);
if(bResult == FALSE)
AfxMessageBox(_T("ShowChineseIME fail"));
Requirements
OS Versions: Windows CE 5.0 and later.
Header: sysapiax.h
Link Library: sysapiax.lib
Link DLL: sysapiax.dll
Device: PT60
Programming Manual
25
ShowDesktop
The ShowDesktop function display and hide all icons on desktop.
BOOLShowDesktop
{
BOOLbShow
}
Parameters
bShow
[in] Flag that indicates whether display the desktop(TRUE) or hide the desktop(FALSE).
Return Values
Return TRUE if the operation is successful; otherwise FALSE.
Remarks
After called this function with parameter FALSE, terminal will hide all icons on desktop.After called this function
with parameter TRUE, terminal will display all icons which had already showed on desktop.
Example
BOOLbResult;
bResult = ShowDesktop(TRUE);
if(bResult == FALSE)
AfxMessageBox(_T("ShowDesktop fail"));
Requirements
OS Versions: Windows CE 5.0 and later.
Header: sysapiax.h
Link Library: sysapiax.lib
Link DLL: sysapiax.dll
Device: PT60
Programming Manual
26
ShowExploreToolbar
The ShowExploreToolbar function display and hide toolbar on windows explore.
BOOLShowExploreToolbar
{
BOOLbShow
}
Parameters
bShow
[in] Flag that indicates whether display the toolbar on windows explore (TRUE) or hide the toolbar on
windows explore (FALSE).
Return Values
Return TRUE if the operation is successful; otherwise FALSE.
Remarks
The ShowExploreToolbar function only effect the windows explorers that opened already.
Example
BOOLbResult;
bResult = ShowExploreToolbar(TRUE);
if(bResult == FALSE)
AfxMessageBox(_T("ShowExploreToolbar fail"));
Requirements
OS Versions: Windows CE 5.0 and later.
Header: sysapiax.h
Link Library: sysapiax.lib
Link DLL: sysapiax.dll
Device: PT60
Programming Manual
27
ShowTaskbar
The ShowTaskbar function display and hide the taskbar.
BOOLShowTaskbar
{
BOOLbShow
}
Parameters
bShow
[in] Flag that indicates whether display the taskbar(TRUE) or hide the taskbar(FALSE).
Return Values
Return TRUE if the operation is successful; otherwise FALSE.
Remarks
After called this function, terminal will display or hide taskbar. If taskbar is hide by this function, it need to call this
function to display taskbar again.
Example
BOOLbResult;
bResult = ShowTaskbar(TRUE);
if(bResult == FALSE)
AfxMessageBox(_T("ShowTaskbar fail"));
Requirements
OS Versions: Windows CE 5.0 and later.
Header: sysapiax.h
Link Library: sysapiax.lib
Link DLL: sysapiax.dll
Device: PT60
Programming Manual
28
UnRegisterAlphaKeyNotification
The UnregisterAlphaKeyNotification function requests that the application no longer receive alpha key pressed notification
messages.
DWORD UnregisterAlphaKeyNotification
{
HANDLE hWnd,
}
Parameters
hWnd
[in]The window handle of the application.
Return Values
Return 0 if the operation is successful, otherwise return 1.
Example
if(UnregisterAlphaKeyNotification(this->m_hWnd))
AfxMessageBox(_T("UnregisterAlphaKeyNotification FAIL!!"));
Requirements
OS Versions: Windows CE 5.0 and later.
Header: sysapiax.h
Link Library: sysapiax.lib
Link DLL: sysapiax.dll
Device: PT60
Programming Manual
29
SCANAPIAX.DLL
We supply SCANAPIAX.DLL to allow programmer to control scan device status. There are
several functions for user to use. User can use WINCE develop tool which like Visual Studio 2005
to develop application program to control scanner.
In this library, there are three different ways to control scanner module. These are API_SCAN,
Scan2Key and Scanner related functinos. Each related function can be used to control scanner
module in different way. These three related functions can not be used at the same time. User
should decide a suitably way to develop application. The following shows function description.
API_SCAN Related Functions
User use API_SCAN related functions to register application to SCANAPIAX.dll. API_SCAN
functions will send messages to report all activities, including error messages and scan data ready.
z
API_Register – Register the application to SCANAPIAX.dll
z
API_Unregister – Un-register the application from SCANAPIAX.dll
z
API_GetBarData – Get barcode data into the buffer.
z
API_GetBarDataLength – Return the scan data length.
z
API_GetBarType – Return the barcode type.
z
API_GetError – Get the error code.
z
API_GetSysError – Return the system error code.
z
API_GoodRead – Play sound and flash LED.
z
API_LoadSettingFromFile – Loader scanner setting form file.
z
API_Reset – Reset the scanner setting to default status.
z
API_ResetBarData – Clear the data buffer that the next new scan data can come
in.
z
API_SaveSettingToFile – Save current scanner setting to file.
z
API_SaveSettingsToScanner – Write the current scanner setting into scanner.
z
S2K_IsLoad – Check the scan.exe is running or not.
z
S2K_Load – Load or unload the scan.exe.
z
SCAN_QueryStatus – Query scanner setting.
z
SCAN_SendCommand – Send scanner command to change scanner status.
Scan2Key Related Functions
User use Scan2Key related functions to control scan.exe program. When scan.exe is loaded,
scan data will send to key buffer. User application can be get scan data just like standard
Programming Manual
30
keyboard input.
z
PT_OpenScan2Key – Execute scan.exe to scan barcode data into Terminal key
buffer.
z
PT_CloseScan2Key – Close scan.exe.
z
PT_SetToDefault – Reset the scanner setting.
Scanner Related Functions
User use Scanner related functions to control scanner module without messages. When user
use Scanner related functions, scan data will store in system buffer.
z
PT_EnableScanner – Enable scanner to scan barcode.
z
PT_DiableScanner – Disable scanner.
z
PT_CheckBarcodeData – Check whether there is barcode data on system buffer.
z
PT_GetBarcodeData – Get barcode data and type from system buffer.
z
PT_SetDeault – Reset the scanner setting to default value.
Scan Key Related Functions
z
EnableTriggerKey – Enable and disable scan key.
z
GetLibraryVersion – Get the library version.
z
GetTriggerKeyStatus – Get scan key status.
z
PressTriggerKey – Trigger scan key.
z
TriggerKeyStatus – Get scan key press status.
Vibrator Related Functions
z
VibratorOn – On and off vibration indicator.
Scan Command Table
The scan command table of terminal is used for SCAN_QueryStatus and
SCAN_SendCommand functions. The scan command provides the different way to setup
scan settings.
When user wants to use this library, user should link SCANAPIAX.DLL, SCANAPIAX.LIB
and the relate functions header file (SCANAPIAX.H).
Programming Manual
31
API_SCAN Related Functions
API_Register
Register the application to SCANAPIAX.dll, so that SCANAPIAX.dll can communication with the application. It will also open
scanner module to working mode.
BOOLAPI_Register
{
HWND hwnd
}
Parameters
hwnd
[in] the window handle which library will send message to report all activities of scanner.
Return Values
Return TRUE if the operation is successful, otherwise return FALSE.
Remarks
The application must callAPI_Unregister to unregister from the dll and close scanner module after done with
scanner. The messages can be one of the followings:
SM_DATA_READY: Indicates that scan data is successfully reading and ready to retrieve.
SM_ERROR_SYS : Indicates a system error, which is caused by calling system function. Call
API_GetSysError to get the system error code.
SM_ERROR_API : Indicates an error. CallAPI_GetError to get error code.
Example
if(!API_Register(theApp.GetMainWnd()->m_hWnd))
AfxMessageBox(_T("API_Register FAIL!!"));
Requirements
OS Versions: Windows CE 5.0 and later.
Header: scanapiax.h
Link Library: scanapiax.lib
Link DLL: scanapiax.dll
Device: PT60
Programming Manual
32
API_Unregister
Unregister the application from SCANAPIAX.dll and close scanner module.
void API_Unregister
{
}
Parameters
None
Return Values
None.
Example
API_Unregister();
Requirements
OS Versions: Windows CE 5.0 and later.
Header: scanapiax.h
Link Library: scanapiax.lib
Link DLL: scanapiax.dll
Device: PT60
Programming Manual
33
API_GetBarData
Get Barcode into the buffer.When you get the message SM_DATA_READY, call this function to get the barcode data.
UINTAPI_GetBarData
{
LPBYTE buffer,
UINT* uiLength,
UINT* uiBarType
}
Parameters
buffer
[out] buffer for string scanned data.
uiLength
[in/out] buffer size
uiBarType
[out] barcode type
Return Values
Return 1 if the operation is successful, otherwise return 0.
Remarks
If the buffer size is less than scan data, function return 0 and the parameter uiLength return the size of the buffer to
get barcode data.
Example
if(message == SM_DATA_READY){
CStringstrBarData,strBarType;
UINT uiSize, uiType, i;
char *pBuf;
uiSize = uiType = 0;
API_GetBarData(NULL, &uiSize, &uiType);
if(uiSize == 0)
strBarData = _T("No Data");
else{
pBuf = (char *)new char[uiSize+1];
Programming Manual
34
memset(pBuf, 0, uiSize+1);
API_GetBarData((LPBYTE)pBuf, &uiSize, &uiType);
strBarType.Format(_T("%d"), uiType);
for(i = 0 ; i < strlen(pBuf); i++)
strBarData += *(pBuf+i);
}
AfxMessageBox( _T("Type:") + strBarType + _T("\r\nBarcode:") + strBarData);
return 0;
}
Requirements
OS Versions: Windows CE 5.0 and later.
Header: scanapiax.h
Link Library: scanapiax.lib
Link DLL: scanapiax.dll
Device: PT60
Programming Manual
35
API_GetBarDataLength
Get the scan data length.
UINTAPI_GetBarDataLength
{
}
Parameters
None
Return Values
Scan data length
Example
if(message == SM_DATA_READY){
CString strData;
UINTuiSize, uiType, i,uiLength;
char *pBuf;
uiLength =API_GetBarDataLength();
if(uiLength == 0)
strData = _T("No Data");
else{
uiSize = uiLength+1;
pBuf = (char *)new char[uiSize];
memset(pBuf, 0, uiSize);
API_GetBarData((LPBYTE)pBuf, &uiSize, &uiType);
for(i = 0 ; i < strlen(pBuf); i++)
strData += *(pBuf+i);
}
AfxMessageBox(strData);
return 0;
}
Requirements
OS Versions: Windows CE 5.0 and later.
Header: scanapiax.h
Link Library: scanapiax.lib
Link DLL: scanapiax.dll
Device: PT60
Programming Manual
36
API_GetBarType
Get the barcode type.
UINTAPI_GetBarType
{
}
Parameters
None
Return Values
Return the barcode type
Remarks
value
Barcode
value
Barcode
BC_CODE11(100)
Code 11
BC_UPCA(113)
UPCA
BC_CODE39(101)
Code 39
BC_UPCE(114)
UPCE
BC_CODE93(102)
Code 93
BC_MATRIX_25(115)
Matrix 25
BC_CODE128(103)
Code 128
BC_PDF417(116)
PDF 417
BC_CODABAR(104)
Codabar
BC_CODE16K(117)
Code 16k
BC_EAN8(105)
EAN8
BC_CHINAPOST(118)
China Post
BC_EAN13(106)
EAN13
BC_RSS14(119)
RSS 14
BC_INDUSTRIAL_25(107)
Industrial 2 of 5
BC_RSS_LIMITED(120)
RSS Limited
BC_INTERLEAVED_25(108) Interleaved 2 of 5 BC_RSS_EXPANDED(121)
RSS Expanded
BC_STANDARD_25(109)
Standard 2 of 5
BC_PHARMACODE39(122) Pharama code39
BC_MSI_PLESSEY(110)
MSI Plessey
BC_MICRO_PDF(123)
Micro PDF
BC_UK_PLESSEY(111)
UK Plessey
BC_EANUCC(124)
UCC.EAN composite
BC_TELEPEN(112)
Telepen
Example
uiType =API_GetBarType();
Requirements
OS Versions: Windows CE 5.0 and later.
Header: scanapiax.h
Link Library: scanapiax.lib
Link DLL: scanapiax.dll
Device: PT60
Programming Manual
37
API_GetError
Get the error code.
DWORD API_GetError
{
}
Parameters
None
Return Values
The return value can be one of the following table:
Constant
Value
Description
ERR_WRITE_FAIL
WM_USER+1 Send commands to scanner module failed.
ERR_SETTING_FAIL
WM_USER+2 Set scanner setting failed.
ERR_SCANNER_NOT_OPEN WM_USER+3 Open scanner module failed.
ERR_INVALID_FILE
WM_USER+4 Invalid setting file.
Example
dwError =API_GetError();
strMess.Format(_T("API Error Code: %d"), dwError);
AfxMessageBox(strMess);
Requirements
OS Versions: Windows CE 5.0 and later.
Header: scanapiax.h
Link Library: scanapiax.lib
Link DLL: scanapiax.dll
Device: PT60
Programming Manual
38
API_GetSysError
Get the system error code.
DWORD API_GetSysError
{
}
Parameters
None
Return Values
Return the system error code that is returned by GetLastError().The description of system error code can be find in
MSDN.
Example
dwError =API_GetSysError();
strMess.Format(_T("System Error Code: %d"), dwError);
AfxMessageBox(strMess);
Requirements
OS Versions: Windows CE 5.0 and later.
Header: scanapiax.h
Link Library: scanapiax.lib
Link DLL: scanapiax.dll
Device: PT60
Programming Manual
39
API_GoodRead
This function plays a sound when buzzer indication of scan module is enable and flashes the goodread LED when the LED
indication of scan module is enable.
void API_GoodRead
{
}
Parameters
None
Return Values
None.
Remarks
UseAPI_GoodRead() to indicate user barcode data is scanned. The buzzer indication of scan module can be set by
scan configuration program in control panel. The LED indication of scan module can be set by
SCAN_SendCommand() function. If buzzer and LED indication are disable, theAPI_GoodRead will do nothing.
Example
API_GoodRead();
Requirements
OS Versions: Windows CE 5.0 and later.
Header: scanapiax.h
Link Library: scanapiax.lib
Link DLL: scanapiax.dll
Device: PT60
Programming Manual
40
API_LoadSettingsFromFile
Load scanner setting from file.
BOOLAPI_LoadSettingsFromFile
{
LPCTSTR filename
}
Parameters
filename
[in] the scanner setting file(*.axs)
Return Values
Return TRUE if the operation is successful, otherwise return FALSE.
Example
CString strFile;
CFileDialog dlg(TRUE, NULL, NULL, OFN_FILEMUSTEXIST| OFN_PATHMUSTEXIST);
if(dlg.DoModal() != IDOK)
return;
strFile = dlg.GetPathName();
if(theApp.m_API_LoadSettingsFromFile(strFile))
AfxMessageBox(_T("Load form file Succeed"));
else
AfxMessageBox(_T("Load from file Fail"));
Requirements
OS Versions: Windows CE 5.0 and later.
Header: scanapiax.h
Link Library: scanapiax.lib
Link DLL: scanapiax.dll
Device: PT60
Programming Manual
41
API_Reset
Reset the scanner setting to the default.
BOOLAPI_Reset
{
}
Parameters
None
Return Values
Return TRUE if the operation is successful, otherwise return FALSE.
Example
if(API_Reset())
AfxMessageBox(_T("Reset Succeed"));
else
AfxMessageBox(_T("Reset Fail"));
Requirements
OS Versions: Windows CE 5.0 and later.
Header: scanapiax.h
Link Library: scanapiax.lib
Link DLL: scanapiax.dll
Device: PT60
Programming Manual
42
API_ResetBarData
Clear the data buffer that the next new scan data can come in.
void API_ResetBarData
{
}
Parameters
None
Return Values
None.
Example
API_ResetBarData();
Requirements
OS Versions: Windows CE 5.0 and later.
Header: scanapiax.h
Link Library: scanapiax.lib
Link DLL: scanapiax.dll
Device: PT60
Programming Manual
43
API_SaveSettingsToFile
Save current scanner settings to file. The extension file name is “axs”.
BOOLAPI_SaveSettingsToFile
{
LPCTSTR filename
}
Parameters
filename
[in] the file name for the setting file.
Return Values
Return TRUE if the operation is successful, otherwise return FALSE.
Example
CString strFile;
CfileDialog dlg(FALSE, _T("axs"), NULL, OFN_CREATEPROMPT, _T("Scanner Settings Files (*.axs) |*.axs |
"));
if(dlg.DoModal() != IDOK)
return;
strFile = dlg.GetPathName();
if(API_SaveSettingsToFile(strFile))
AfxMessageBox(_T("Save to file Succeed"));
else
AfxMessageBox(_T("Save to file Fail"));
Requirements
OS Versions: Windows CE 5.0 and later.
Header: scanapiax.h
Link Library: scanapiax.lib
Link DLL: scanapiax.dll
Device: PT60
Programming Manual
44
API_SaveSettingsToScanner
Write the current scanner setting into scanner.
BOOLAPI_SaveSettingsToScanner
{
}
Parameters
None
Return Values
Return TRUE if the operation is successful, otherwise return FALSE.
Example
if(API_SaveSettingsToScanner())
AfxMessageBox(_T("Save to Scanner Succeed"));
else
AfxMessageBox(_T("Save to Scannere Fail"));
Requirements
OS Versions: Windows CE 5.0 and later.
Header: scanapiax.h
Link Library: scanapiax.lib
Link DLL: scanapiax.dll
Device: PT60
Programming Manual
45
S2K_IsLoad
Check the application scan.exe(scan barcode data into key buffer) is running.
BOOLS2K_IsLoad
{
}
Parameters
None
Return Values
The return value TRUE indicates that scan.exe is running.The return value FALSE indicates that scan.exe is not
running.
Example
if(S2K_IsLoad()){
AfxMessageBox(_T("scan.exe load"));
else
AfxMessageBox(_T("scan.exe does not load"));
Requirements
OS Versions: Windows CE 5.0 and later.
Header: scanapiax.h
Link Library: scanapiax.lib
Link DLL: scanapiax.dll
Device: PT60
Programming Manual
46
S2K_Load
Load or unload the scan.exe.
BOOLS2K_Load
{
BOOLbLoad,
DWORD dwTimeOut
}
Parameters
bLoad
[in]To set true to load scan.exe and false to unload scan.exe
dwTimeOut
[in]When unload scan.exe it will wait until the scan.exe closed or timeout by this parameter.
Return Values
Return TRUE if the operation is successful, otherwise return FALSE.
Example
if(S2K_Load(FALSE,1000)){
AfxMessageBox(_T("unload scan.exe success"));
else
AfxMessageBox(_T("unload scan.exe failed"));
Requirements
OS Versions: Windows CE 5.0 and later.
Header: scanapiax.h
Link Library: scanapiax.lib
Link DLL: scanapiax.dll
Device: PT60
Programming Manual
47
SCAN_QueryStatus
Query current scanner setting.
BOOLSCAN_QueryStatus
{
int nCommand1,
int nCommand2,
char*pReturn
}
Parameters
nCommand1
[in] See scan command table.
nCommand2
[in] See scan command table.
pReturn
[out]The current scanner setting. This buffer size must be large than 100.
Return Values
Return TRUE if the operation is successful, otherwise return FALSE.
Remarks
The pReturn value is depending on nCommand1 and nCommand2. The nCommand1 and nCommand2 decide
which scanner setting to be queried.
Example
char
*pValue;
pValue = (char *)new char[100];
memset(pValue, 0, 100);
//query Buzzer indication setting
SCAN_QueryStatus(5, 3, pValue);
Requirements
OS Versions: Windows CE 5.0 and later.
Header: scanapiax.h
Link Library: scanapiax.lib
Link DLL: scanapiax.dll
Device: PT60
Programming Manual
48
SCAN_SendCommand
Send scanner command to change scanner status.
BOOLSCAN_SendCommand
{
int nCommand1,
int nCommand2,
char*pValue
}
Parameters
nCommand1
[in] See scan command table.
nCommand2
[in] See scan command table.
pValue
[in] See scan command table.
Return Values
Return TRUE if the operation is successful, otherwise return FALSE.
Example
//Enable Buzzer indication setting
if(SCAN_SendCommand(5, 3, “1”))
AfxMessageBox(_T("Setup complete"));
else
AfxMessageBox(_T("Setup false"));
Requirements
OS Versions: Windows CE 5.0 and later.
Header: scanapiax.h
Link Library: scanapiax.lib
Link DLL: scanapiax.dll
Device: PT60
Programming Manual
49
Scan2Key Related Functions
PT_OpenScan2Key
Execute scan.exe to scan barcode data into Terminal key buffer.
BOOLPT_OpenScan2Key
{
}
Parameters
None
Return Values
Return TRUE if the operation is successful, otherwise return FALSE.
Example
BOOLbResult;
bResult = PT_OpenScan2Key();
if(!bResult)
AfxMessageBox(_T("PT_OpenScan2Key fail"));
Requirements
OS Versions: Windows CE 5.0 and later.
Header: scanapiax.h
Link Library: scanapiax.lib
Link DLL: scanapiax.dll
Device: PT60
Programming Manual
50
PT_CloseScan2Key
Close scan.exe.
void PT_CloseScan2Key
{
}
Parameters
None
Return Values
None.
Example
PT_CloseScan2Key()
Requirements
OS Versions: Windows CE 5.0 and later.
Header: scanapiax.h
Link Library: scanapiax.lib
Link DLL: scanapiax.dll
Device: PT60
Programming Manual
51
PT_SetToDefault
Reset the scanner setting.All scanner setting will reset to default value.
int PT_SetToDefault
{
}
Parameters
None
Return Values
Return 1 if the operation is successful, otherwise return 0.
Example
if(!PT_SetToDefault())
AfxMessageBox(_T("PT_SetToDefault fail"));
Requirements
OS Versions: Windows CE 5.0 and later.
Header: scanapiax.h
Link Library: scanapiax.lib
Link DLL: scanapiax.dll
Device: PT60
Programming Manual
52
Scanner Related Functions
PT_EnableScanner
Enable scanner to scan barcode. This function creates a thread to get scan data from scanner module and store scan data in the
system buffer.Application can use function call PT_GetBarcodeData to get scan data from system buffer.
int PT_EnableScanner
{
}
Parameters
None
Return Values
Return 0 if the operation is successful, otherwise return 1.
Example
if(PT_EnableScanner())
AfxMessageBox(_T("PT_EnableScanner fail"));
Requirements
OS Versions: Windows CE 5.0 and later.
Header: scanapiax.h
Link Library: scanapiax.lib
Link DLL: scanapiax.dll
Device: PT60
Programming Manual
53
PT_DisableScanner
This function will close scanner module.
void PT_DisableScanner
{
}
Parameters
None
Return Values
None.
Example
PT_DisableScanner();
Requirements
OS Versions: Windows CE 5.0 and later.
Header: scanapiax.h
Link Library: scanapiax.lib
Link DLL: scanapiax.dll
Device: PT60
Programming Manual
54
PT_CheckBarcodeData
Check whether there is available barcode data in system buffer.
BOOLPT_CheckBarcodeData
{
}
Parameters
None
Return Values
This function returnsTRUE if there are barcode data in system buffer. This function returns FALSE if there are no
barcode data in system buffer.
Example
if(PT_CheckBarcodeData())
m_strScanData = _T("There are barcode data in system buffer");
else
m_strScanData = _T("There are no barcode data in system buffer ");
Requirements
OS Versions: Windows CE 5.0 and later.
Header: scanapiax.h
Link Library: scanapiax.lib
Link DLL: scanapiax.dll
Device: PT60
Programming Manual
55
PT_GetBarcodeData
Get Barcode data and type from system buffer.
BOOLPT_GetBarcodeData
{
UINT* uiBarType,
Char* pBuffer,
UINT* uiMaxBufferLen
}
Parameters
uiBarType
[out] barcode type.
pBuffer
[out] buffer for storing scanned data..
uiMaxBufferLen
[in/out]The max buffer size
Return Values
Return TRUE if the operation is successful, otherwise return FALSE.
Remarks
If the buffer size is less than scan data, function return 0 and the parameter uiMaxBufferLen return the size of
barcode data.
Example
if(PT_CheckBarcodeData()){
if(PT_GetBarcodeData(&uiBarType, pBarData, &uiMaxLen)){
for(i = 0 ; i < strlen(pBarData) ; i++)
m_strScanData += *(pBarData + i);
}
else
m_strScanData = _T("Can't get scan data");
}
else
m_strScanData = _T("No Scan Data");
Programming Manual
56
Requirements
OS Versions: Windows CE 5.0 and later.
Header: scanapiax.h
Link Library: scanapiax.lib
Link DLL: scanapiax.dll
Device: PT60
Programming Manual
57
PT_SetDefault
Reset the scanner setting to default value.
BOOLPT_SetDefault
{
}
Parameters
None
Return Values
Return TRUE if the operation is successful, otherwise return FALSE.
Example
if(PT_SetDefault())
AfxMessageBox(_T("PT_SetDefault succeed"));
else
AfxMessageBox(_T("PT_SetDefault fail"));
Requirements
OS Versions: Windows CE 5.0 and later.
Header: scanapiax.h
Link Library: scanapiax.lib
Link DLL: scanapiax.dll
Device: PT60
Programming Manual
58
Scan Key Related Functions
EnableTriggerKey
This function will enable or disable scan key.
DWORD EnableTriggerKey
{
BOOLbEnable
}
Parameters
bEnable
[in] Flag that indicates whether enable scan key(TRUE) or disable scan key(FALSE).
Return Values
If function succeeds, the return value is E_FUNC_SUCCEED. If function fails, the return value is
E_FUNC_ERROR, E_FUNC_PAR_ERROR.
Remarks
This function is meaningful only if scanner is opened.The warm reset will enable scan key automatically.
Example
BOOLbResult;
bResult = EnableTriggerKey(TRUE);
if(bResult)
AfxMessageBox(_T("EnableTriggerKey Succeed"));
Else
AfxMessageBox(_T("EnableTriggerKey Fail"));
Requirements
OS Versions: Windows CE 5.0 and later.
Header: scanapiax.h
Link Library: scanapiax.lib
Link DLL: scanapiax.dll
Device: PT60
Programming Manual
59
GetLibraryVersion
Get library version number.
int GetLibraryVersion
{
}
Parameters
None
Return Values
The version number. If the return value is 101, it means that dll version is 1.01
Example
int nVersion;
CString strTemp;
nVersion = GetLibraryVersion();
strTemp.Format(_T("Version = %d"), nVersion);
AfxMessageBox(strTemp);
Requirements
OS Versions: Windows CE 5.0 and later.
Header: scanapiax.h
Link Library: scanapiax.lib
Link DLL: scanapiax.dll
Device: PT60
Programming Manual
60
GetTriggerKeyStatus
This function will get scan key status.
DWORD GetTriggerKeyStatus
{
}
Parameters
None.
Return Values
The return value 1 indicates that scan key is enable. The return value 0 indicates that scan key is disable.
Example
if(GetTriggerKeyStatus())
AfxMessageBox(_T("scan key ensable!"));
else
AfxMessageBox(_T("scan key disable!"));
Requirements
OS Versions: Windows CE 5.0 and later.
Header: scanapiax.h
Link Library: scanapiax.lib
Link DLL: scanapiax.dll
Device: PT60
Programming Manual
61
PressTriggerKey
This function will trigger scan key.
DWORD PressTriggerKey
{
BOOLbPress
}
Parameters
bPress
[in] Flag that indicates whether press scan key(TRUE) or release scan key(FALSE).
Return Values
If function succeeds, the return value is E_FUNC_SUCCEED. If function fails, the return value is
E_FUNC_ERROR.
Remarks
This function is meaningful only if scanner is opened.
Example
PressTriggerKey(TRUE);
Sleep(1000);
PressTriggerKey(FALSE);
Requirements
OS Versions: Windows CE 5.0 and later.
Header: scanapiax.h
Link Library: scanapiax.lib
Link DLL: scanapiax.dll
Device: PT60
Programming Manual
62
TriggerKeyStatus
This function will get scan key press status.
DWORD TriggerKeyStatus
{
}
Parameters
None.
Return Values
The return value 1 indicates that scan key is pressed.The return value 0 indicates that scan key is released.
Example
if(TriggerKeyStatus())
AfxMessageBox(_T("scan key pressed!"));
else
AfxMessageBox(_T("scan key release!"));
Requirements
OS Versions: Windows CE 5.0 and later.
Header: scanapiax.h
Link Library: scanapiax.lib
Link DLL: scanapiax.dll
Device: PT60
Programming Manual
63
Vibrator Related Functions
VibratorOn
This function turns on or off Vibration indicator
DWORD VibratorOn
{
BOOLbOn
}
Parameters
bOn
[in] Flag that indicates whether turn on vibrator(TRUE) or turn off vibrator LED(FALSE).
Return Values
If function succeeds, the return value is E_FUNC_SUCCEED. If function fails, possible return value is
E_FUNC_ERROR, E_FUNC_PAR_ERROR.
Remarks
Checked the “Scanner Vibrator” Setting in Scan ConfigurationAPis used to enable vibration indicator after
scanner good-read operation.. Called this function will not change the “Scanner Vibrator” setting.
Example
DWORD dwResult;
dwResult =VibratorOn(TRUE);
if(dwResult != E_FUNC_SUCCEED)
AfxMessageBox(_T("VibratorOn fail"));
Requirements
OS Versions: Windows CE 5.0 and later.
Header: scanapiax.h
Link Library: scanapiax.lib
Link DLL: scanapiax.dll
Device: PT60
Programming Manual
64
Scan Command Table
Command1
Command2
Value
5
2
0: Disable
Indication
LED indication
1: Enable
3
0: Disable
Buzzer indication
1: Enable
6
7
0: Before code data
Transmission
Code ID position
1:After code data
8
0: Disable
Code ID transmission
1: Proprietary ID
2:AIM ID
9
0: Disable
Code length transmission
1: Enable
10
0: Disable
Code name transmission
1: Enable
11
0: Disable
Case conversion
1: Upper case
2. Lower case
7
4
Scan
Double confirm
6
0~9
0 ~ 64
Global min. code length
7
0 ~ 64
Global max. code length
8
0: Disable
Inverted image scan
1: Enable
8
2
0x00 ~ 0xffASCII code
String setting
Suffix characters setting
22 characters.
3
0x00 ~ 0xffASCII code
Preamble characters settings
22 characters.
4
0x00 ~ 0xffASCII code
Postamble characters settings
22 characters.
10
1
0: Disable
Code 11
Read
1: Enable
2
0: Disable
Programming Manual
65
Check-sum verification
1: One digit
2:Two digits
3
0: Disable
Check-sum transmission
1: Enable
4
0 ~ 64
Max. code length
5
0 ~ 64
Min. code length
6
0 ~ 15
Truncate leading
7
0 ~ 15
Truncate ending
8
0x00 ~ 0xffASCII code(1 or 2 bytes)
Code ID setting
11
1
0: Disable
Code 39
Read
1: Enable
2
0: Disable
Check-sum verification
1: Enable
3
0: Disable
Check-sum transmission
1: Enable
4
0 ~ 64
Max. code length
5
0 ~ 64
Min. code length
6
0 ~ 20
Truncate leading
20: Truncate characters before space
7
0 ~ 15
Truncate ending
8
0x00 ~ 0xffASCII code(1 or 2 bytes)
Code ID setting
10
0: Standard
Format
1: FullASCII
13
0: Disable
Start/stop transmission
1: Enable
12
1
0: Disable
Code 93
Read
1: Enable
2
0: Disable
Check-sum verification
1: Enable
Programming Manual
66
3
0: Disable
Check-sum transmission
1: Enable
4
0 ~ 64
Max. code length
5
0 ~ 64
Min. code length
6
0 ~ 15
Truncate leading
7
0 ~ 15
Truncate ending
8
0x00 ~ 0xffASCII code(1 or 2 bytes)
Code ID setting
13
1
0: Disable
Code 128
Read
1: Enable
2
0: Disable
Check-sum verification
1: Enable
3
0: Disable
Check-sum transmission
1: Enable
4
0 ~ 64
Max. code length
5
0 ~ 64
Min. code length
6
0 ~ 15
Truncate leading
7
0 ~ 15
Truncate ending
8
0x00 ~ 0xffASCII code(1 or 2 bytes)
Code ID setting
10
0: Standard
Format
1: UCC.EAN 128
12
0x00 ~ 0xffASCII code(1 bytes)
UCC/EAN 128 ID setting
13
0x00 ~ 0xffASCII code(1 bytes)
Concatenation code
14
1
0: Disable
Codabar
Read
1: Enable
2
0: Disable
Check-sum verification
1: Enable
Programming Manual
67
3
0: Disable
Check-sum transmission
1: Enable
4
0 ~ 64
Max. code length
5
0 ~ 64
Min. code length
6
0 ~ 15
Truncate leading
7
0 ~ 15
Truncate ending
8
0x00 ~ 0xffASCII code(1 or 2 bytes)
Code ID setting
10
0:ABCD/ABCD
Start/stop type
1: abcd/abcd
2:ABCD/TN*E
3: abcd/tn*e
11
0: Disable
Start/stop transmission
1: Enable
15
1
0: Disable
EAN 8
Read
1: Enable
3
0: Disable
Check-sum transmission
1: Enable
6
0 ~ 15
Truncate leading
7
0 ~ 15
Truncate ending
8
0x00 ~ 0xffASCII code(1 or 2 bytes)
Code ID setting
10
0: None
Supplement digits
1: 2 digits
2: 5 digits
3: 2, 5 digits
4: UCC/EAN 128
5: 2, UCC/EAN 128
6: 5, UCC/EAN 128
7:All
Programming Manual
11
0: None
Truncation/expansion
1: Truncate leading zero
68
2: Expand to EAN 13
12
0: Disable
Expansion
1: Enable
16
1
0: Disable
EAN 13
Read
1: Enable
3
0: Disable
Check-sum transmission
1: Enable
6
0 ~ 15
Truncate leading
7
0 ~ 15
Truncate ending
8
0x00 ~ 0xffASCII code(1 or 2 bytes)
Code ID setting
10
0: None
Supplement digits
1: 2 digits
2: 5 digits
3: 2, 5 digits
4: UCC/EAN 128
5: 2, UCC/EAN 128
6: 5, UCC/EAN 128
7:All
12
0: Disable
ISBN/ISSN conversion
1: Enable
17
1
0:Disable
Industrial 2 of 5
Read
1:Enable
4
0 ~ 64
Max. code length
5
0 ~ 64
Min. code length
6
0 ~ 15
Truncate leading
7
0 ~ 15
Truncate ending
8
0x00 ~ 0xffASCII code(1 or 2 bytes)
Code ID setting
18
1
0: Disable
Interleaved 2 of 5
Read
1: Enable
2
0: Disable
Programming Manual
69
Check-sum verification
1: Enable
3
0: Disable
Check-sum transmission
1: Enable
4
0 ~ 64
Max. code length
5
0 ~ 64
Min. code length
6
0 ~ 15
Truncate leading
7
0 ~ 15
Truncate ending
8
0x00 ~ 0xffASCII code(1 or 2 bytes)
Code ID setting
19
1
0: Disable
Standard 2 of 5
Read
1: Enable
2
0: Disable
Check-sum verification
1: Enable
3
0: Disable
Check-sum transmission
1: Enable
4
0 ~ 64
Max. code length
5
0 ~ 64
Min. code length
6
0 ~ 15
Truncate leading
7
0 ~ 15
Truncate ending
8
0x00 ~ 0xffASCII code(1 or 2 bytes)
Code ID setting
20
1
0: Disable
MSI Plessey
Read
1: Enable
2
0: Disable
Check-sum verification
1: Mod 10
2: Mod 10/10
3: Mod 11/10
Programming Manual
3
0: Disable
Check-sum transmission
1: Enable
4
0 ~ 64
70
Max. code length
5
0 ~ 64
Min. code length
6
0 ~ 15
Truncate leading
7
0 ~ 15
Truncate ending
8
0x00 ~ 0xffASCII code(1 or 2 bytes)
Code ID setting
21
1
0: Disable
UK Plessey
Read
1: Enable
2
0: Disable
Check-sum verification
1: Enable
3
0: Disable
Check-sum transmission
1: Enable
4
0 ~ 64
Max. code length
5
0 ~ 64
Min. code length
6
0 ~ 15
Truncate leading
7
0 ~ 15
Truncate ending
8
0x00 ~ 0xffASCII code(1 or 2 bytes)
Code ID setting
22
1
0: Disable
Telepen
Read
1: Enable
2
0: Disable
Check-sum verification
1: Enable
3
0: Disable
Check-sum transmission
1: Enable
4
0 ~ 64
Max. code length
5
0 ~ 64
Min. code length
6
0 ~ 15
Truncate leading
7
Programming Manual
0 ~ 15
71
Truncate ending
8
0x00 ~ 0xffASCII code(1 or 2 bytes)
Code ID setting
10
0: Numeric
Format
1: FullASCII
23
1
0: Disable
UPCA
Read
1: Enable
3
0: Disable
Check-sum transmission
1: Enable
6
0 ~ 15
Truncate leading
7
0 ~ 15
Truncate ending
8
0x00 ~ 0xffASCII code(1 or 2 bytes)
Code ID setting
10
0: None
Supplement digits
1: 2 digits
2. 5 digtis
3: 2, 5 digits
4: UCC/EAN 128
5: 2, UCC/EAN 128
6: 5, UCC/EAN 128
7:All
11
0: None
Truncate/expansion
1: Truncate leading zero
2: Expand to EAN 13
24
1
0: Disable
UPCE
Read
1: Enable
3
0: Disable
Check-sum transmission
1: Enable
6
0 ~ 15
Truncate leading
7
0 ~ 15
Truncate ending
8
0x00 ~ 0xffASCII code(1 or 2 bytes)
Code ID setting
Programming Manual
10
0: None
Supplement digits
1: 2 digits
72
2: 5 digits
3: 2, 5 digits
4: UCC/EAN 128
5: 2, UCC/EAN 128
6: 5, UCC/EAN 128
7:All
11
0: None
Truncate/expansion
1: Truncate leading zero
2: Expand to EAN 13
3: Expand to UPCA
12
0: Disable
Expansion
1: Enable
13
0: Disable
UPCE-1
1: Enable
25
1
0: Disable
Matrix 25
Read
1: Enable
2
0: Disable
Check-sum verification
1: Enable
3
0: Disable
Check-sum transmission
1: Enable
4
0 ~ 64
Max. code length
5
0 ~ 64
Min. code length
6
0 ~ 15
Truncate leading
7
0 ~ 15
Truncate ending
8
0x00 ~ 0xffASCII code(1 or 2 bytes)
Code ID setting
26
1
0: Disable
PDF-417
Read
1: Enable
6
0 ~ 15
Truncate leading
7
0 ~ 15
Truncate ending
8
0x00 ~ 0xffASCII code(1 or 2 bytes)
Code ID setting
Programming Manual
73
10
0: Disable
Escape sequence Transmit
1: Enable
27
1
0: Disable
Code-16K
Read
1: Enable
6
0 ~ 15
Truncate leading
7
0 ~ 15
Truncate ending
8
0x00 ~ 0xffASCII code(1 or 2 bytes)
Code ID setting
28
1
0: Disable
China post
Read
1: Enable
4
0 ~ 64
Max. code length
5
0 ~ 64
Min. code length
6
0 ~ 15
Truncate leading
7
0 ~ 15
Truncate ending
8
0x00 ~ 0xffASCII code(1 or 2 bytes)
Code ID setting
29
1
0: Disable
RSS 14
Read
1: Enable
6
0 ~ 15
Truncate leading
7
0 ~ 15
Truncate ending
8
0x00 ~ 0xffASCII code(1 or 2 bytes)
Code ID setting
11
0: Disable
UCC/EAN 128 emulation
1: Enable
30
1
0: Disable
RSS Limited
Read
1: Enable
6
0 ~ 15
Truncate leading
7
0 ~ 15
Truncate ending
Programming Manual
74
8
0x00 ~ 0xffASCII code(1 or 2 bytes)
Code ID setting
11
0: Disable
UCC/EAN 128 emulation
1: Enable
31
1
0: Disable
RSS Expanded
Read
1: Enable
4
0 ~ 99
Max. code length
5
0 ~ 99
Min. code length
6
0 ~ 15
Truncate leading
7
0 ~ 15
Truncate ending
8
0x00 ~ 0xffASCII code(1 or 2 bytes)
Code ID setting
11
0: Disable
UCC/EAN 128 emulation
1: Enable
32
1
0: Disable
Italian Pharmacode 39
Read
1: Enable
4
0 ~ 64
Max. code length
5
0 ~ 64
Min. code length
6
0 ~ 15
Truncate leading
7
0 ~ 15
Truncate ending
8
0x00 ~ 0xffASCII code(1 or 2 bytes)
Code ID setting
Programming Manual
10
0: Disable
Leading “A”
1: Enable
75
Function Return Values
Constant
Value
Description
E_FUNC_SUCCEED
0x00000000
The function returned without error.
E_FUNC_ERROR
0x00000001
The function returned error.
E_FUNC_NULLPTR
0x00000002
Anull pointer was passed to the function.
E_FUNC_PAR_ERROR 0x00000003
Programming Manual
Ainvalid parameter was passed to the function.
76
Was this manual useful for you? yes no
Thank you for your participation!

* Your assessment is very important for improving the work of artificial intelligence, which forms the content of this project

Download PDF

advertisement