thinkpad 使用重力感应编程
来源:互联网 发布:mac ps 添加字体 编辑:程序博客网 时间:2024/04/30 07:41
注意,只有是thinkpad 并支持重力感应,才回有sensor.dll (貌似是)
#include "stdafx.h"
#include <iostream>
#include "windows.h"
using namespace std;
typedef void(__stdcall *Print_)();
int main(){
int a;
HINSTANCE hDll; //DLL句柄
hDll = LoadLibrary("C:/Windows/System32/Sensor.DLL");
short cX = 0;
short cY = 0;
typedef struct
{
int PresentState;
short LatestRawAccelDataX;
short LatestRawAccelDataY;
short LatestAccelDataX;
short LatestAccelDataY;
char Temperature;
short LatestZeroG_X;
short LatestZeroG_Y;
} AccelerometerData;
typedef void (__stdcall * funcShockproofGetAccelerometerData)( AccelerometerData * );
funcShockproofGetAccelerometerData ShockproofGetAccelerometerData;
cin>>a;
if (hDll != NULL)
{
ShockproofGetAccelerometerData = (funcShockproofGetAccelerometerData)GetProcAddress( hDll, "ShockproofGetAccelerometerData" );
if( ShockproofGetAccelerometerData )
{
AccelerometerData ad = { 0 };
ShockproofGetAccelerometerData( &ad );
cX = ad.LatestZeroG_X;
cY = ad.LatestZeroG_Y;
cout<<cX<<","<<cY;
}
} else {
cout<<"hDll is null"<<endl;
}
return 0;
}
- thinkpad 使用重力感应编程
- Android重力感应编程
- android 重力感应的使用
- iOS设备使用重力感应
- iOS设备使用重力感应
- HTC 重力感应传感器编程资料总结
- HTC 重力感应传感器编程资料总结
- 重力感应
- 重力感应
- 重力感应
- 重力感应
- 重力感应
- Android 之 重力感应初步使用
- cocos2d-x 重力感应 加速器的使用
- 使用UIDynamicAnimator创建重力感应的View
- CoreMotion.framework 重力感应的使用
- 关于cocos2d-html5 中使用重力感应于重力加速
- 应用JNI技术在Java中读取ThinkPad重力感应蕊片实时数据
- 算法 按比例递增求和
- hive JDOFatalInternalException 解决
- android “attempt to write a readonly database”出错解决
- base-kernel-计时
- VC:使用VC自带的splash screen控件
- thinkpad 使用重力感应编程
- user-select介绍
- TCP拥塞控制机制
- 使用C#打造通用的数据库连接类
- c#访问各数据库的providerName各驱动
- 关于HTML5中渐变的问题,跪求各位大侠指导
- 离职中
- zoj 1589 Professor John
- base-kernel-系统调用