tags:

views:

65

answers:

3

I noticed Firefox 4, Opera and Chrome, and IE 7/8 put buttons and controls in the title/caption bar, how is this done?

Thanks http://img199.imageshack.us/img199/3307/slayerf.png

alt text

A: 

Yes, you can do that.. you have use window hooks, insert your dll in remote process and run the function of dll remotely. here is full fledged article dealing with it :-

http://www.codeproject.com/KB/threads/winspy.aspx

thatsalok
Why on earth FF/IE/Opera they should inject some code in *their own process*?
Matteo Italia
+2  A: 

What they probably do is turn the caption bar off entirely (by excluding the WS_CAPTION window style), add a glass area to the top of the window, and then draw their own controls.

See http://msdn.microsoft.com/en-us/magazine/cc163435.aspx for more on glass.

Frederik Slijkerman
A: 

Probably they simply handle the WM_NCPAINT message and draw part of the non-client area (which includes the borders and the caption bar) by themselves; they will also handle WM_NCLBUTTONDOWN, WM_NCHITTEST and other WM_NC* messages to emulate the behavior of a button on the caption bar.

Or at least, this was the way it was commonly done before Aero; I don't know how much it changed this kind of things.

Matteo Italia
Most MS own apps (IE, M$Office) do not have caption bar. They historically used undocumented functions to draw it themselves (IIRC since XP the functions have become official and documented). In Windows it is impossible to override completely the caption bar painting: the buttons there do not have state known to application, thus Windows itself has to draw them.
Dummy00001
Yes, you can do that! check out my another article regarding this, there i insert toolbar into Microsoft Outlook Express! click herehttp://www.codeproject.com/KB/COM/EfOelibrary.aspx .. please atleast check fact before downvoting someone!
thatsalok
I'm not saying that you can't do that with dll injection, I'm saying that if you want to do that in *your* app (which is what the OP asks - "how do they do that") there's no need to inject anything, for the simple fact that their code is already running in their own process by definition. And, by the way, you should have posted your comment under the other post.
Matteo Italia