获取任务栏的电池和电话信号指示器图标并绘制到图片框中
有没有办法获取任务栏的电池和电话信号指示器图标,然后绘制到图片框或其他东西中?
为什么我需要这个?
我需要所有可用的屏幕空间,因此所有表单都最大化,并且它们覆盖了 windowsmobile 任务栏。但是,我必须以几种形式显示有关电池电话信号强度的信息。
我知道如何获取它们的值(例如 systeminformation.phonesignalstrength),但我想要的是“当前图标”,所以我不需要担心它们的值。这只是用户的视觉信息。
在最后一种情况下,如果这是不可能的,如何从 windowsmobile shell 获取这些图标,所以我将自己绘制它们,处理它们假设的每个不同的状态/值。 (这是我不想做的!)
提前感谢并为我糟糕的英语感到抱歉。
Is there any way to get taskbar's battery and phonesignal indicators icons and then draw into a picturebox or something?
Why do I need this?
I need all screen space available, so all forms are maximized and they cover up the windowsmobile taskbar. But, I have to display information about battery e phone signal strength in just a couple of forms.
I know how to get their values (like systeminformation.phonesignalstrength), but what I want is the "current icon", so I don't need to worry about their values. It's just a visual information for the user.
In last case, if this is not possible, how to get those icons from windowsmobile shell, so I'll draw them by my self, treating each differente status/values that they assume. (This is what I don't want to do!)
Thanks in advance and sorry for my poor english.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
已经有类似的例子可用。 看看。
我本想粘贴它的代码,但它是用 C++ 编写的,将其全部粘贴到这里会很大:)
您需要将该 C++ 代码转换为 C#。
您需要 -
1.找到系统托盘的句柄。
2. 获取托盘中按钮的数量(没错)。
3. 对于每个按钮...
a) 读取按钮数据缓冲区。
b) 从该缓冲区获取 TRAYDATA。
c) 获取与此 TRAYDATA 对象实例相关的图标。
另一篇非常好的文章链接
There is already similar example available. Have a look.
I would have pasted the code for it, but it is in C++ and it would be huge to paste it all here :)
You would need to covert that C++ code to C#.
You will need to -
1. Find the handle of system tray.
2. Get number of buttons (that's right) in the tray.
3. For each button...
a) Read button data buffer.
b) Get TRAYDATA from that buffer.
c) Get Icon related to this TRAYDATA object instance.
Another very good article link here.
大多数任务栏图像都以 .BMP 文件形式存储在 \Windows 目录中。例如,在 Windows Mobile 6 中,电池图像位于 \Windows\battery.bmp 中。您可以使用 Windows Mobile 设备模拟器和远程文件查看器将文件复制到您的 PC。不同版本的 Windows Mobile 中的图像有时会有所不同。
Most of the taskbar images are stored as .BMP files in the \Windows directory. For example, in Windows Mobile 6, the battery image is located in \Windows\battery.bmp. You can use Windows Mobile Device Emulator and Remote File Viewer to copy the files to your PC. The images are sometimes different in different versions of Windows Mobile.