473,406 Members | 2,769 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

IE Extension:IOleCommandTarget Implementation in C#

Hi,
I want to create a IE Extension in C#. I have added a button to IE
standard toolbar and then made IE call the DLL when button is clicked.
In this DLL, I want to capture the button click. To identify this,
I have started with the following code:
*--------------------------------------------------------------------------**

[StructLayout(LayoutKind.Sequential)]
public struct OLECMDTEXT
{
public UInt32 cmdtextf;
public UInt32 cwActual;
public UInt32 cwBuf;
public char rgwz;
}

[StructLayout(LayoutKind.Sequential)]
public struct OLECMD
{
public UInt32 cmdID;
public UInt64 cmdf;
}
[ComImport(), Guid("B722BCCB-4E68-101B-A2BC-00AA00404770"),
InterfaceType(ComInterfaceType.InterfaceIsIUnknown )]
public interface IOleCommandTarget
{
[PreserveSig()]
int QueryStatus( [In, MarshalAs(UnmanagedType.Struct)]
ref Guid
pguidCmdGroup, [MarshalAs(UnmanagedType.U4)]
int cCmds,
[In, Out] IntPtr prgCmds, [In, Out] IntPtr
pCmdText);
[PreserveSig()]
int Exec(ref Guid pguidCmdGroup, uint nCmdID, uint
nCmdExecOpt,
object[] pvaIn, [In, Out,
MarshalAs(UnmanagedType.LPArray)]
object[] pvaOut);
}
*--------------------------------------------------------------------------*----------------------------*

Now, I need to implement the QueryStatus& Exec methods for the button
click. What all the parameters to be handled inside this QueryStatus
method to give information about the button?
I found that nCmdID for my button has to be given to invoke Exec
method. Already IDs exist only for the standard buttons. In the
tutorial for "adding toolbar button", i found that 1 is to be given.
But 1 already exist for a standard button. Please give a clear idea on
this.
Can anybody point me to a sample implementation for these methods on
similar scenario or help me directly in this?
Thanks and Regards,
Sujoan

Mar 18 '06 #1
0 1112

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Peter Sparago | last post by:
(Sorry in advance for the long post.) Hi, I'm having a great deal of difficulty buiding a Python COM extension. I am using the MSHTML ActiveX control in my application but I need to interact...
4
by: Mark | last post by:
Hi.. I have a c# class that i'm using to implement some extension functions and one of those functions is a simple push/pop stack. I made the c# code fairly generic, taking and returning objects...
1
by: Milos | last post by:
Hello, I need to create a IE Extension in C#. I want to add a button to IE standard toolbar and then make IE call the DLL when button is clicked. I have started with the following code ...
0
by: Sujoan | last post by:
Hi, I want to create a IE Extension in C#. I have added a button to IE standard toolbar and then made IE call the DLL when button is clicked. In this DLL, I want to capture the button click. ...
0
by: Sujoan | last post by:
Hi, I have added a button to IE backed by a COM object using C#. Iam able to achieve the required functionality on the click of the button. However, I am unable to click the button again, i.e., my...
0
by: Sujoan | last post by:
Hi, I have added a button to IE backed by a COM object using C#. Iam able to achieve the required functionality on the click of the button. However, I am unable to click the button again, i.e., my...
52
by: lovecreatesbeauty | last post by:
Why the C standard committee doesn't provide a standard implementation including the C compiler and library when the language standard document is published? C works on the abstract model of low...
2
by: Michael Hudson | last post by:
The PyPy development team has been busy working and we've now packaged our latest improvements, completed work and new experiments as version 0.9.0, our fourth public release. The highlights of...
1
by: klerik123456 | last post by:
I try set soap extension attributes on client side. For example: Implementation in web service: public class EncryptMessageAttribute : SoapExtensionAttribute { private string...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.