[C\C++ - win32] - how can i get the desktop toolbar and window caption bar HWND?

how can i get the window caption bar HWND?
(i have see some browsers using come controls on caption bar: menus(like firefox) and tabs(like chrome))
I think I'm having trouble understanding your question, are you referring to the data in the 'Title' field of the HTML document associated with a given site? For example, you can see the title of this post, [C\C++ - win32] - how can i get the desk - C++ Forum, in the title bar of your browser window. If you right-click on this window and select 'view page source' from the resulting drop-down box you will then find the same data slotted between the <title> and </title> flags (hint: use ctrl+f).
some programs, like firefox, have some controls on Window Caption. how can i see the NC HWND?
for put the controls on Window Caption
I think I get what you are asking now and the answer is going to be drastically different for each application you are targeting. Those tabs are their own WNDCLASS(EX) sturcts and they aren't easy to grab. The add-ons you see adding options to the drop down context menu in Firefox for example do so through some mechanism of the 'Gecko' API: https://developer.mozilla.org/en-US/Add-ons/Plugins/Gecko_Plugin_API_Reference . From what I can tell, the overwhelming number of people who write these plug-ins use JavaScript to do so. Where as Chrome would use some completely different API: https://developer.chrome.com/extensions/api_index . Then there is the Windows shell for things that are not specific to something with it's own set of custom controls: http://msdn.microsoft.com/en-us/library/bb773177(v=vs.85).aspx
theres another simple way: make the form without border and add the menu/tabs ;)

anotherthing: the GetDesktopWindow() give the desktop HWND, how can i get the HWND from toolbar?
See, now I'm lost again. Are you talking about an application you wrote? Or are you talking about an existing app from another party?
sorry about that... i'm trying.
i mean the Windows toolbar. how can i get the HWND Windows toolbar?
(from desktop HWND or something)
Last edited on
In that case, I can't think of anything. Sorry.
i know the classname: TOOLBARCLASSNAME (if the Windows use these one). and the parent from GetDesktopWindow() function. these info can give you some ideas?
What I think he means is how, for example, the browser can put tabs on the titlebar of your application when maximized. (Google Chrome does this.)

Also, many programs will also put stuff on the window frame (that's its correct name) even when not maximized.

This is is something of a black art, since it is highly OS-dependent.

For Vista through Windows 7 (and if you install Aero Glass on 8) you can use the Windows Glass API to "extend" the drawing surface of your forms into the glass.
http://msdn.microsoft.com/en-us/magazine/cc163435.aspx
(And google around "aero glass api". Don't shy away from the Delphi articles either.)

For older versions of windows, you want to google "paint nonclient window area".

I don't know anything about the Windows 8 API.


And after all that, you've got about as many hurdles to hop in *nix. Not to mention OS X.

For all the grief, it sure can make your app look pretty, but it might not be worth it.


Hope this helps.
Search for following functions:
FindWindowEx
FindWindow
GetWindow

Topic archived. No new replies allowed.