PC Review


Reply
Thread Tools Rate Thread

Browser extension button not working after first use?

 
 
Sujoan
Guest
Posts: n/a
 
      31st Mar 2006
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 toolbar button

gets disabled and grayed out. I have implemented
IOleCommandTarget::QueryStatus implementation method as follows:

public int QueryStatus(ref Guid pguidCmdGroup, int cCmds, IntPtr
prgCmds, IntPtr pCmdText)
{
OLECMD ocmd;
bool temp= true;
ocmd.cmdf=
(UInt32)OLECMDF.OLECMDF_ENABLED|(UInt32)OLECMDF.OLECMDF_SUPPORTED;
Marshal.StructureToPtr(ocmd.cmdf,prgCmds,temp);
return 0;



}


public int Exec(ref Guid pguidCmdGroup, uint nCmdID, uint nCmdExecOpt,
object[] pvaIn, object[] pvaOut)
{
Speak();//This function works fine;actually the text on the web page

is read out here!
return 0;


}


Since the button is disabled after first use, iam not able to use my
required functionality on navigation to other pages.Please somebody
help me in this regard.
Thanks and Regards,
Sujoan.

 
Reply With Quote
 
 
 
 
Rob ^_^
Guest
Posts: n/a
 
      1st Apr 2006
Hi Sujoan,

Enable your button AFTER your com object has completed reading the page.

Also when your com object starts you should check for other running
instances. You can only allow a page to be read at one time.

So Pseudo-code

Button Press > Start com > disable button > read page > complete page
reading (maybe look for esc key to cancel reading) > enable button

Regards.
"Sujoan" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> 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 toolbar button
>
> gets disabled and grayed out. I have implemented
> IOleCommandTarget::QueryStatus implementation method as follows:
>
> public int QueryStatus(ref Guid pguidCmdGroup, int cCmds, IntPtr
> prgCmds, IntPtr pCmdText)
> {
> OLECMD ocmd;
> bool temp= true;
> ocmd.cmdf=
> (UInt32)OLECMDF.OLECMDF_ENABLED|(UInt32)OLECMDF.OLECMDF_SUPPORTED;
> Marshal.StructureToPtr(ocmd.cmdf,prgCmds,temp);
> return 0;
>
>
>
> }
>
>
> public int Exec(ref Guid pguidCmdGroup, uint nCmdID, uint nCmdExecOpt,
> object[] pvaIn, object[] pvaOut)
> {
> Speak();//This function works fine;actually the text on the web page
>
> is read out here!
> return 0;
>
>
> }
>
>
> Since the button is disabled after first use, iam not able to use my
> required functionality on navigation to other pages.Please somebody
> help me in this regard.
> Thanks and Regards,
> Sujoan.
>



 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Browser extension button disabled after first use? Sujoan Microsoft Dot NET 0 31st Mar 2006 01:48 PM
Browser Extension button disabled after first use? Sujoan Microsoft C# .NET 0 31st Mar 2006 01:46 PM
the OK button on Add/Edit Application Extension Mapping is perminantly disabled even when i specify my executable and extension. how to fix? I am running IIS on windows xp pro for development. Daniel Microsoft Dot NET Framework 0 17th Oct 2005 09:37 PM
internet browser back & forward button not working Ryan Glaves Windows XP Internet Explorer 1 29th Jul 2004 01:26 PM
back button not working, browser reverts to last page viewed oliver Windows XP Internet Explorer 2 29th Dec 2003 02:40 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 12:21 PM.