如何使用TB_GETBUTTON? [英] How to use TB_GETBUTTON?

查看:675
本文介绍了如何使用TB_GETBUTTON?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好,


提前致谢。


我正在使用ATL项目创建IE扩展。


在我的应用程序中,我试图访问单击的工具栏按钮。


我可以使用


<从工具栏中获取按钮的数量p> int count =(int):: SendMessage(hWndToolBar,TB_BUTTONCOUNT,0,0);


但是,当我尝试使用按钮时


:: SendMessage(hWndToolBar,TB_GETBUTTON,1,(LPARAM)& pTBBtn));


Internet Explorer停止处理请求并关闭。


我不明白确切的问题。


有人可以指导我如何处理这个问题吗?


问候,


Savan

解决方案

什么是pTBBtn?它是如何声明和初始化的?


你是不是试图通过一个单独的过程来做任何机会?参数为指针的消息通常不会跨进程边界工作(因为在一个进程的地址空间中有效的地址只是另一个进程中的随机垃圾)。


Hello,

Thanks in advance.

I am creating IE extension using ATL project.

In my application I am trying to access the clicked toolbar button.

I am able to get the count of buttons from the toolbar using

int count = (int)::SendMessage(hWndToolBar, TB_BUTTONCOUNT, 0, 0);

But, when I try to get the button using

::SendMessage(hWndToolBar, TB_GETBUTTON, 1, (LPARAM)&pTBBtn));

Internet explorer stops processing the request and get closes.

I am not understanding the exact problem.

Could some one guide me how to process this?

Regards,

Savan

解决方案

What's pTBBtn? How is it declared and initialized?

You are not trying to do it from a separate process, by any chance? Messages whose parameters are pointers don't generally work across process boundaries (because an address valid in one process' address space is just random garbage in another's).


这篇关于如何使用TB_GETBUTTON?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆