Elo TouchSystems MonitorMouse FOR WINDOWS NT Version 2.0 Appendix B Programming Options, Bool

Page 33

28Appendix B - Programming Options

The following example code demonstrates how to obtain Z data. For a complete example, see the included source code for ZAXIS.EXE.

#include "mmioctl.h"

HANDLE hndFile;

// Win32 handle of "MMDev" device

LONG

IoctlCode;

// Function to perform

ULONG

DataLength;

// Output buffer data length

DWORD

ReturnedLength;

// Actual number of bytes returned

LONG

IOBuffer;

// Input/output system buffer

BOOL

IoctlResult;

// Result of operation

//

// Open Win32 touchscreen device(MMDev)

//

hndFile = CreateFile( "\\\\.\\MMDev",

GENERIC_READ, FILE_SHARE_READ, NULL,

OPEN_EXISTING, 0,

NULL

// Open the device "MMDev"

);

if (hndFile == INVALID_HANDLE_VALUE) {// Was the device opened? MessageBox(NULL, "Unable to open touchscreen",

"Driver Loaded?", MB_OK);

return(0);

}

// See if controller supports Z before going any further

IOBuffer = 0;

IoctlCode = IOCTL_MM_ZAXIS_SUPPORT;

IoctlResult = 0;

DataLength = 4;

IoctlResult = DeviceIoControl(

hndFile,

 

// Handle to device

IoctlCode,

 

// IO Control code for

Read

NULL,

 

// We don't need input

data

0,

 

// No input buffer required, NULL bytes

&IOBuffer,

 

// Buffer from driver.

 

DataLength,

 

// Length of buffer in

bytes.

&ReturnedLength,

// Bytes placed in DataBuffer.

NULL

 

// NULL means wait till op. completes.

);

 

 

 

if (!IoctlResult)

// No z

 

 

MessageBox(NULL, "This controller does not support Z reporting capabilities",

"NO Z", MB_OK MB_ICONEXCLAMATION);

//

//Call the driver to get Z values

IOBuffer = 0;

IoctlResult = 0;

DataLength = sizeof(LONG);

Image 33
Contents MonitorMouse MonitorMouse for Windows NT Limited Warranty Software LicenseGoverning Law Contents Appendix B Programming Options About this Manual IntroductionTouchscreen Controller Compatibility About Monitormouse for Windows NTSoftware Compatibility IntroductionOther Versions of MonitorMouse Video CompatibilityProduct Registration Contacting ELOCustomer Service Before YOU Begin Installing MonitorMouse for Windows NTConfiguring the Controller Installing the SoftwareInstalling 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 Touchscreen Control Panel Using MonitorMouse for Windows NTUsing MonitorMouse for Windows NT Running the Touchscreen Control PanelCalibration Touchscreen Control Panel Mouse Button Emulation ModeClick Sound on Touches Tips on Using the Touchscreen in Windows NT Tips on Using the Touchscreen in Windows NTRemoving the Mouse Pointer Border WidthScrolling Using the Overscan AreaMaximizing Windows Option Buttons and Check BoxesTips on Public Access Touchscreen Applications Running DOS Programs from NTRunning DOS Programs from NT Using MonitorMouse for Windows NT General Information Installation ProblemsDisplay Problems Touch ProblemsAppendix a Troubleshooting Diagnostic Utilities Diagnostic UtilitiesComdump Sawdump Appendix a Troubleshooting Axis Capabilities $SSHQGL%Bool Appendix B Programming OptionsLaunching the Touchscreen Control Panel Calibrating from Within Your ProgramLaunching the Touchscreen Control Panel Appendix B Programming Options