wince定时拍照功能
来源:互联网 发布:咨询公司数据来源 编辑:程序博客网 时间:2024/05/16 08:05
实现代码:
public partial class Form1 : Form
{
/*
[DllImport("CoreDll")]
public static extern IntPtr FindWindow(
string lpClassName, // class name
string lpWindowName // window name
);
*/
[DllImport("CoreDll")]
public static extern IntPtr SendMessage(
IntPtr hWnd, // handle to destination window
uint Msg, // message
uint wParam, // first message parameter
uint lParam // second message parameter
);
[DllImport("CoreDll")]
public static extern IntPtr GetForegroundWindow();
System.Threading.Timer tmr;
public Form1()
{
InitializeComponent();
}
private void menuItem2_Click(object sender, EventArgs e)
{
Application.Exit();
}
private void menuItem1_Click(object sender, EventArgs e)
{
CameraCaptureDialog ccd = new CameraCaptureDialog();
ccd.Mode = CameraCaptureMode.Still;
object someState = new object();
TimerCallback tmrClbck = new TimerCallback(this.atTimer1);
tmr = new System.Threading.Timer(tmrClbck, someState, 10* 1000, -1);
if (ccd.ShowDialog() == DialogResult.OK)
{
pictureBox1.Image = new Bitmap(ccd.FileName);
//MessageBox.Show("OK");
}
}
private void atTimer1(object state)
{
Debug.WriteLine("Timer 1 On");
IntPtr hwnd = GetForegroundWindow();
SendMessage(hwnd, 0x100, 0x0d, 0xf20001);
object someState = new object();
TimerCallback tmrClbck = new TimerCallback(this.atTimer2);
tmr = new System.Threading.Timer(tmrClbck, someState, 2 * 1000, -1);
//tmr.Dispose();
}
private void atTimer2(object state)
{
Debug.WriteLine("Timer 2 On");
IntPtr hwnd = GetForegroundWindow();
SendMessage(hwnd, 0x101, 0x1b, 0xc0310001);
tmr.Dispose();
}
}
程序中发送的 message,不同的 device 不同,需要用 Remote Spy 去抓
http://hi.baidu.com/%D0%CF%BD%F2%C8%F0/blog/item/33f8c9170bea01064a90a712.html
参考:
http://hi.baidu.com/%D0%CF%BD%F2%C8%F0/blog/item/793132ddef3f28e876c6385f.html/cmtid/6b2f0307824e84c17b8947a2
http://www.christec.co.nz/blog/archives/208
- wince定时拍照功能
- wince定时拍照功能
- 定时拍照功能
- WINCE 拍照功能的实现
- android 实现定时拍照功能
- 每天都东想西想 - 定时拍照功能
- android 实现定时拍照功能
- 拍照功能
- 定时功能
- 定时功能
- Flex在线拍照功能
- 监听照相机拍照功能
- android基础--拍照功能
- getusermedia,拍照上传功能:
- Android实现拍照功能。
- 拍照功能的实现
- 调用系统拍照功能
- 图库和拍照功能
- 简易单链表模版(暂定最终版本)
- 自定义DataGridView的复选框列,点击最后一个会自动多出来一行的解决
- 阜阳之战
- JDK环境变量配置
- Programmer's Guide to Regular Expressions
- wince定时拍照功能
- 还原数据库一些注意问题
- (inline 和 宏 区别) || (const 和 #define区别)
- C# 加载文件生成exe服务端
- C# 实现u盘感染
- 算法题收集
- C#遍历磁盘感染aspx文件
- 实现字符串替换
- Java面试宝典2010版