Announcement

Collapse
No announcement yet.

Howto change of caption buttons (min/max/close)?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Howto change of caption buttons (min/max/close)?

    I need to load own graphics (bitmap or icon) in caption buttons (min/max/close).
    Supported PBWin this option? how can make it better?

    Many thanks
    Yours sincerely

  • #2
    You will have to draw those. Before Vista, it was done during the WM_NCPAINT message.
    Last edited by Dominic Mitchell; 3 Mar 2008, 04:10 PM.
    Dominic Mitchell
    Phoenix Visual Designer
    http://www.phnxthunder.com

    Comment


    • #3
      Originally posted by Dominic Mitchell View Post
      You will have to draw those. Before Vista, it was done during the WM_NCPAINT message.
      Minimal example please.

      Thanks

      P.S. it make for WinXP only
      Last edited by Alexander Holzer; 3 Mar 2008, 04:37 PM.
      Yours sincerely

      Comment


      • #4
        Dominic,
        Just so I know

        Before Vista, it was done during the WM_NCPAINT message.
        A hint of warning there? or You have not tried under VISTA?

        Any avoidance of problems in my future is worth EVERY nugget
        Engineer's Motto: If it aint broke take it apart and fix it

        "If at 1st you don't succeed... call it version 1.0"

        "Half of Programming is coding"....."The other 90% is DEBUGGING"

        "Document my code????" .... "WHYYY??? do you think they call it CODE? "

        Comment


        • #5
          I found still no solution... i continue to try
          Yours sincerely

          Comment


          • #6
            Alex,
            Here's an example from Semen that should be useful.


            Found 60 odd hits in POFFS with a search "WM_NCPAINT".

            POFFS offline search engine for PB Forums - download here: http://www.reonis.com/POFFS/index.htm
            - Wouldn't be without it
            Rgds, Dave

            Comment


            • #7
              Thanks, I look at it tomorrow... now already 01:13 night :sleeping:
              Yours sincerely

              Comment


              • #8
                With the Aero feature on Vista, code that was used on XP and older systems to draw
                in the non-client area of a top-level window will not work properly on Vista. The new
                Desktop Windows Manager(DWM) will detect this and remove the glass frame leaving the
                window with the old basic frame. This allows the old code to modify the non-client
                area, but the result will probably not be very appealing.

                For a primer, see this link
                Dominic Mitchell
                Phoenix Visual Designer
                http://www.phnxthunder.com

                Comment


                • #9
                  would it not be popular or impossible to replicate the the caption bar in the client area?
                  paul
                  p purvis

                  Comment


                  • #10
                    I look for an example with loading own image in caption for change default buttons (min/max/close)!
                    Unfortunately I found no example with %WM_NCPAINT for this procedure.
                    Yours sincerely

                    Comment


                    • #11
                      Here's an alternate idea for you to try ...

                      Instead of trying to CHANGE the bitmaps for SC_CLOSE et al on the system menu, delete the items of interest from your (copy of , obtained with GetSystemMenu()) the system menu and then add your 'custom' items with the complete style info (e.g MFT_BITMAP) with AppendMenu().

                      (min/max/close are not in the caption area, they are on the system menu)
                      Michael Mattias
                      Tal Systems (retired)
                      Port Washington WI USA
                      [email protected]
                      http://www.talsystems.com

                      Comment


                      • #12
                        Originally posted by Michael Mattias View Post
                        ...

                        (min/max/close are not in the caption area, they are on the system menu)
                        1)
                        system menu:
                        - SC_CLOSE, SC_MINIMIZE (or SC_ICON), SC_MAXIMIZE (or SC_ZOOM) and have own icons
                        This code works fine.

                        Caption buttons (Nonclient-Area Components):
                        - WS_SYSMENU, WS_MINIMIZEBOX, WS_MAXIMIZEBOX have own icons...
                        Code:
                        ----------
                           |_|H|X|
                        ----------

                        Originally posted by Michael Mattias View Post
                        Here's an alternate idea for you to try ...

                        Instead of trying to CHANGE the bitmaps for SC_CLOSE et al on the system menu, delete the items of interest from your (copy of , obtained with GetSystemMenu()) the system menu and then add your 'custom' items with the complete style info (e.g MFT_BITMAP) with AppendMenu().
                        2) Thanks for idea, but I have tried - does not work.
                        Last edited by Alexander Holzer; 4 Mar 2008, 08:11 AM.
                        Yours sincerely

                        Comment


                        • #13
                          The best way to achieve this on VISTA, as well as on older Windows version, is to take control over the whole Window in plain SDK mode using the CreateWindowEx API.

                          I have explained the whole process in details on José Roca's forum, in the "SDK programming" section.

                          Note: The way i am doing this on VISTA, is the only way to write on the DWM composited section, and this can only be done if you are using plain ARGB colors and 32-bit graphic component using the alpha channel (like transparent png).

                          I know it would seem cumbersome to most of you, but this is the only way to control everything.
                          See the demo that i have posted there:
                          http://www.powerbasic.com/support/pb...ad.php?t=36361
                          The result acts exactly like a "native" window, and because it uses a "skin", you can even design one using the VISTA look on XP.

                          ...
                          Patrice Terrier
                          www.zapsolution.com
                          www.objreader.com
                          Addons: GDImage.DLL 32/64-bit (Graphic library), WinLIFT.DLL 32/64-bit (Skin Engine).

                          Comment


                          • #14
                            Ok, so you meant those things. (minimize box, et al).

                            But why would you want to replace the familiar icons with something else? Seems to me that would only confuse users.

                            I mean, even the icon-challenged (moi) know what clicking the "X" does.....
                            Michael Mattias
                            Tal Systems (retired)
                            Port Washington WI USA
                            [email protected]
                            http://www.talsystems.com

                            Comment


                            • #15
                              Hello, Michael,
                              have you heard about Style guide?
                              ..then you should not ask this question

                              In the certain cases, it concerns the basic/main interface too (..graphic design guides).

                              For today appearance of the interface created by many programming language is considered primitive, without ergonomics.
                              Last edited by Alexander Holzer; 4 Mar 2008, 11:44 AM.
                              Yours sincerely

                              Comment


                              • #16
                                Nice link.

                                But... not one of the referenced style guides has a thing to do with computer software.

                                I should have known this thread would end unpleasantly for me.

                                Sheesh, I must be one of those of whom it was once said there's one born every minute.

                                MCM
                                Michael Mattias
                                Tal Systems (retired)
                                Port Washington WI USA
                                [email protected]
                                http://www.talsystems.com

                                Comment


                                • #17
                                  it comes still...
                                  Yours sincerely

                                  Comment


                                  • #18
                                    The solution for this moment is covering of "default buttons" with new buttons.
                                    Helpful Link, Thanks Peter Redei.

                                    I have applied "CONTROL ADD IMGBUTTONX, ..." for image-buttons
                                    Yours sincerely

                                    Comment

                                    Working...
                                    X