Elo TouchSystems MonitorMouse FOR WINDOWS NT Version 2.0 Launching the Touchscreen Control Panel

Page 34

Launching the Touchscreen Control Panel

29

IoctlResult = DeviceIoControl(

hndFile,

// Handle to device

IoctlCode,

// IO Control code

 

NULL,

// We don't need input

data

0,

// No input buffer required, 0 bytes

&IOBuffer,

// Buffer from driver.

 

 

// This buffer will contain Z data

DataLength,

// Length of buffer in

bytes.

&ReturnedLength,

// Bytes placed in DataBuffer.

NULL

// NULL means wait I/O

completes.

);

if (!IoctlResult)

// We had a real mouse event.

;

//

The DeviceIoControl call will

 

//

return 0 if a mouse(not touch)

 

// event occurred.

LAUNCHING THE TOUCHSCREEN CONTROL PANEL

It is possible to launch the Touchscreen Control Panel directly from a Windows NT application using the following code:

handle = WinExec("control monmouse.cpl", SW_SHOWNORMAL);

CALIBRATING FROM WITHIN YOUR PROGRAM

You may also call the calibration procedure of the Touchscreen Control Panel directly from your program with the exported function Calibrate-Screen(). It takes two arguments-your window handle and a timeout value in seconds (0 = no timeout).

The following code fragment demonstrates how to call this function. For a complete example, see the included source code, CALIB.C.

WORD

Timeout;

 

 

HWND

hWnd;

//

window handle

FARPROC lpfnCalibrateScreen;

//

pointer to Calibrate function

HANDLE hLibrary;

 

// MONMOUSE.CPL library handle

//Load the Control Panel applet hLibrary = LoadLibrary("MONMOUSE.CPL"); if (hLibrary < (HANDLE)32) {

MessageBox(NULL, "Could not load Calibration Library.",

"NoLoad", MB_OK);

break;

}

// Get address of CalibrateScreen function

lpfnCalibrateScreen = GetProcAddress(hLibrary, MAKEINTRESOURCE(4));

//timeout in 5 minutes

Timeout = 300;

//Call CalibrateScreen function

(*lpfnCalibrateScreen)(hWnd, Timeout); FreeLibrary(hLibrary);

Image 34
Contents MonitorMouse MonitorMouse for Windows NT Software License Limited WarrantyGoverning Law Contents Appendix B Programming Options Introduction About this ManualSoftware Compatibility About Monitormouse for Windows NTTouchscreen Controller Compatibility IntroductionProduct Registration Video CompatibilityOther Versions of MonitorMouse Contacting ELOCustomer Service Installing MonitorMouse for Windows NT Before YOU BeginInstalling the Software Configuring the ControllerInstalling MonitorMouse for Windows NT Installing the Software Installing MonitorMouse for Windows NT Monitormouse for Windows NT Files MonitorMouse for Windows NT FilesMONMOUSE.SYS Modifications to Windows NT Configuration Modifications to Windows NT ConfigurationInstalling MonitorMouse for Windows NT Using MonitorMouse for Windows NT Touchscreen Control PanelRunning the Touchscreen Control Panel Using MonitorMouse for Windows NTCalibration Mouse Button Emulation Mode Touchscreen Control PanelClick Sound on Touches Removing the Mouse Pointer Tips on Using the Touchscreen in Windows NTTips on Using the Touchscreen in Windows NT Border WidthMaximizing Windows Using the Overscan AreaScrolling Option Buttons and Check BoxesRunning DOS Programs from NT Tips on Public Access Touchscreen ApplicationsRunning DOS Programs from NT Using MonitorMouse for Windows NT Installation Problems General InformationTouch Problems Display ProblemsAppendix a Troubleshooting Diagnostic Utilities Diagnostic UtilitiesComdump Sawdump Appendix a Troubleshooting $SSHQGL% Axis CapabilitiesAppendix B Programming Options BoolCalibrating from Within Your Program Launching the Touchscreen Control PanelLaunching the Touchscreen Control Panel Appendix B Programming Options