News:

Masm32 SDK description, downloads and other helpful links
Message to All Guests

Main Menu

Add Buttons on the Caption Bar

Started by spSofiane, August 22, 2012, 05:10:10 AM

Previous topic - Next topic

spSofiane

How to add Buttons on the Caption Bar ?

dedndave

never tried that one - lol
but - the caption bar is a window like any other
if you can get a handle to it, you can probably put buttons there

the problem i see is that getting the handle under 2K, XP or vista may be one thing
but it will probably require special code under windows 7

all in all, it may be simpler to create a window without a caption bar and make your own

qWord

Hi,
that not easy: you need to response to WM_NCPAINT and some other WM_NC*-messages to implement the behavior and appearance of button in the title bar. Also I think that it becomes more complicated for Aero-Windwos  (DWM) - I would stay away from such idea...
MREAL macros - when you need floating point arithmetic while assembling!

jj2007

One option is a topmost little window that hovers above the caption. Difficult but works on Win7, too.

spSofiane

thnx for all i found this Article :

http://www.codeproject.com/Articles/11699/CCaptionButton-Add-Buttons-on-the-Caption-Bar

but a want to know if it is possible to do it with MASM32

please help me, i know that is very complicated to do it but no impossible

jj2007

Quote from: spSofiane on August 22, 2012, 06:03:42 AM
but a want to know if it is possible to do it with MASM32

Sure it is possible in Masm32. But guess why the first comment is titled "Doesn't work in Windows 7". The technique used for the RichMasm menus does work with Aero and Win7, but it is definitely not simple. Here are the few lines that create the auxiliary window that overlays the caption. Once you have that, it gets difficult ;)

   invoke CreateWindowEx, WS_EX_TRANSPARENT or WS_EX_TOPMOST or WS_EX_LAYERED or WS_EX_TOOLWINDOW,
   offset szClassMenuWin, Null,
   WS_VISIBLE or WS_POPUP,   ; no caption!
   Null, Null, MenuTextWidth, eax,
   0, 0, hInstance, Null

Alternatively, you can try another method described here.

hfheatherfox07

Quote from: spSofiane on August 22, 2012, 06:03:42 AM
thnx for all i found this Article :

http://www.codeproject.com/Articles/11699/CCaptionButton-Add-Buttons-on-the-Caption-Bar


That thing rearranged all my icons  :(

Also Every body else is right .... Draw your own is better ... if you want a custom Title Bar than it does not matter if you redraw it your self any ways
Your code and your skills will be assimilated. Your programming language is irrelevant.
We are the ASM Borg and you will become part of us. Compile and be assembled.