如何注册形式,在Windows Mobile WM_DEVICECHANGE消息形式、消息、Mobile、Windows

2023-09-07 04:14:10 作者:山河不入梦

我使用C#.net 3.5紧凑框架编写code ..请任何一个可以告诉我,我如何注册形式WM_DEVICECHANGE以及如何处理该消息中的WindowProc。

i am using c# .net 3.5 compact framework to write code.. please can any one tell me how do i register a form for WM_DEVICECHANGE and how to handle that message in windowproc..

如果我这样做,我得到设备硬件的变化暗示..即时通讯没有得到怎么写,请告知。

if i do this i get intimation of device hardware change.. i m not getting how to write please tell.

感谢

推荐答案

其实WM_DEVICECHANGE不太可能是你想要的。你可能想通过调用 RequestDeviceNotifications 并挂接到Windows CE的设备通知队列传递给它一个句柄与 CreateMsgQueue 创建一个队列。

Actually WM_DEVICECHANGE is unlikely to be what you want. You probably want to hook into Windows CE's device notification queue by calling RequestDeviceNotifications and passing to it a handle to a queue created with CreateMsgQueue.

如果你不喜欢这样的P写入所有/调用code,像往常一样已经是智能设备框架已经它已经完成,并在一个更合乎逻辑的对象模型。

If you don't feel like writing all of this P/Invoke code, as usual the Smart Device Framework already has it already done and in a more logical object model.