简体   繁体   English

win7 32位下如何用C++ api通过TBBUTTONINFO结构体的iImage成员提取系统托盘上的图标?

[英]How to extract the icon on system tray through the iImage member of TBBUTTONINFO structure with C++ api under win7 32bit?

First of all,i have gotten the value of iImage member of TBBUTTONINFO structure.首先,我已经获得了 TBBUTTONINFO 结构的 iImage 成员的值。

Next,i wanna extract the icon on system tray through the iImage member of TBBUTTONINFO structure with C++ api under win7 32bit?接下来,我想在win7 32位下使用C++ api通过TBBUTTONINFO结构的iImage成员提取系统托盘上的图标?

Is it possible and if it is,what should i do?有没有可能,如果有,我该怎么办?

Thank you!谢谢!

Assuming you have already injected yourself into the Explorer process you can send TB_GETIMAGELIST to the toolbar and then call ImageList_GetIcon or ImageList_GetImageInfo .假设您已经将自己注入到 Explorer 进程中,您可以将TB_GETIMAGELIST发送到工具栏,然后调用ImageList_GetIconImageList_GetImageInfo

If on the other hand you have not injected into the process but are using VirtualAllocEx and ReadProcessMemory to get the toolbar info then you will have problems because you cannot easily copy GDI objects from one process to another.另一方面,如果您没有注入进程,而是使用VirtualAllocExReadProcessMemory来获取工具栏信息,那么您将遇到问题,因为您无法轻松地将 GDI 对象从一个进程复制到另一个进程。

This old application called TraySaver might be able to give you some help but what you are doing is not supported and can break at any point because the classname of the tray icon window and the taskbar window hierarchy is undocumented and you are not supposed to access it this way.这个名为TraySaver 的旧应用程序可能能够为您提供一些帮助,但您正在做的事情不受支持,并且可能随时中断,因为托盘图标窗口的类名和任务栏窗口层次结构没有记录,您不应该访问它这边走。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM