Cinni U Patel

Hi Experts,
I am a kid to IE Extensions development. Have just 2 months to hands on Browser Extension Development in IE and Mozilla Firefox.
.
I have an ImageButton called "Parent Login" placed along with IE's default commands Buttons like Home,Refresh,Print etc.

I have done some registry entries to place my button with IE's default Command Buttons. Upto this all is perfect from my side.

Problem occurs here:
I want to change the image of "ParentLogin" button when parent is logged in successfully.
Can someone guide me how to implement this


Thanks in Advance,
Cheers, Cinni Patel





Re: Internet Explorer Extension Development How to change apperance of IE' command button on some event ?

IECUSTOMIZER

Hi Cinni,

You need to add a Toolbar or BHO to your project to manage the button state. This requires quite advanced programming skills in C++. Alternatively you could create a HTML toolbar like the Alexa Toolbar which is written in a mixture of HTML and javascript and has its own buttons placed on the toolbar, which have states that are managed by javascripting.

I presume your Command Bar button uses a script to navigate to a login page on a web site. There should be no need (other than cosmetic) to change the command bar button state as if your user represses the login button, the server code should detect that the user is already logged in and redirect the request to their last visited page or just use response.end to ignore the request.

Regards.






Re: Internet Explorer Extension Development How to change apperance of IE' command button on some event ?

Cinni U Patel

Hi IECUSTOMIZER
Thanks for your quick reply, i have used win32 call to chaange image icon of my IE command button. It works fine now when IE is currently open.

Now, I want to work with IE startUp Event and make win32 call to change image.

Is there any EVENT by BHO which i can handle on IE startup and after Default ToolBar is initailised

I have written code in BHO's BeforeNavigate2 method, but it gets executed before my custom command button is drawn on ToolBar. So i am unable to change icon by win32 calls programetically as it is not detecting my button when my IE gets started.

Please give me right direction, Thanks in Advance..











Re: Internet Explorer Extension Development How to change apperance of IE' command button on some event ?

IECUSTOMIZER

Hi Cinni,

There is no event, you have to use a Windows Messages Callback to intercept the redraw messages that are sent to the Command bar as it is drawn, and replace them with your own WM_OWNERDRAW message.

This is realy, realy hard. Start by using the Spy++ utility that comes with Visual Studio(Tools folder) to examine the messages that are sent to the Rebar.

I can't give you any links that will help you with this but you may get some ideas by doing a web search for SendMessage API.

Regards.






Re: Internet Explorer Extension Development How to change apperance of IE' command button on some event ?

Cinni U Patel

Hi IECUSTOMIZER
First of all thanks for a quick reply.
Yes i have worked with spy++ for some time to view win32 messages!
I need to solve my problem anyhow! let me try with surfing more! Whenever i ll get some idea on it, i ll let you know so u can suggest me more !

Thanks in advance





Re: Internet Explorer Extension Development How to change apperance of IE' command button on some event ?

Cinni U Patel

Hi IECUSTOMIZER

Please refer the code i posted below. It implements a Callback made after 2 seconds Timer interval. The call back will be killed once it is executed-after 2 seconds(Meanwhile my Custom Command button will be loaded in ToolBar od IE..


private TimerProc Cb = null;
private int ID_CB_Timer = 0;

private delegate void TimerProc(IntPtr hWnd, uint nMsg, int nIDEvent, int dwTime);

public void ChangeCommandButtonAppearance(bool isLoggedIn,bool isNewInstanceofIE)
{
Cb = new TimerProc(this.OnTickTimer);
ID_CB_Timer = Win32API.SetTimer(IntPtr.Zero, 0, (int)2000, Cb);
}
private void OnTickTimer(IntPtr hWnd, uint nMsg, int nIDEvent, int dwTime)
{
makeWin32Call(this.newInstancehWnd, this.newInstanceIsLoggedIn,true); // Will execute my Win32 Call to change CommandButton icon.
killTimer();
}
private bool killTimer()
{
int rs = 0; bool isKilled = false;
rs = Win32API.KillTimer(IntPtr.Zero,this.ID_CB_Timer);
if(rs==0) isKilled = true;
rs = Win32API.GetLastError(); // Here we could search with GetLastError what is the cause the timer does not stop ticking
string strMessage=Win32API.GetAPIErrorMessageDescription(rs);
return isKilled;
}

Is this the same you suggested me for Windows messages CALLBACK M i following correct path Please suggest me. I am near to result with this method. Just wanted to ask m i going with correct direction

Thanks in Advance





Re: Internet Explorer Extension Development How to change apperance of IE' command button on some event ?

santoshkandhukuri

Hi,

IS there a way I can spy on the user's web browsing. I mean i want to create a log file with list of websites accessed by the user in IE7. Could you give me some ideas on this...........