Add my item in System Pupup menu in titlebar

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts
  • Esfahan
    Forum Member
    • Oct 2007
    • 233

    Add my item in System Pupup menu in titlebar

    Hi All
    I am interest to know how can i add my item in System Pupup menu in titlebar.
    I have think this place is best site for "About" and "info" link... .
    I'm waiting for your method for do it.
    Thanks a lot in advanced
  • ShadowUK
    No longer a forum member
    • Oct 2007
    • 1321

    #2
    Can't be done without some kind of funky DLL.

    Comment

    • Esfahan
      Forum Member
      • Oct 2007
      • 233

      #3
      Okey shadow
      I had doubt to done it in easy method ,but may be... .

      Comment

      • holtgrewe
        Indigo Rose Customer
        • Jul 2002
        • 779

        #4
        Plugin...

        ShadowUK
        You were looking for a plugin to write... there 'ya go ...

        Comment

        • RizlaUK
          Indigo Rose Customer
          • May 2006
          • 5478

          #5
          easy, but i have not got time

          here how to do it in PB
          Code:
          #Window = 0
          
          ; The lower 4 bits should not be used in a custom menu id and must
          ; be masked out when comparing in the callback
          ;
          #Menu_A = 1<<4
          #Menu_B = 2<<4
          #Menu_C = 3<<4
          
          Procedure WindowCallback(Window, Message, wParam, lParam)
            Result = #PB_ProcessPureBasicEvents
           
            If Message = #WM_SYSCOMMAND
             
              Select wParam & $FFF0    ; mask out the windows internal 4 bits
          
                Case #Menu_A
                  MessageRequester("", "Menu A")
                  Result = 0 ; return 0 to indicate the message was handled
               
                Case #Menu_B
                  MessageRequester("", "Menu B")
                  Result = 0     
               
                Case #Menu_C
                  MessageRequester("", "Menu C")
                  Result = 0     
          
              EndSelect
          
            EndIf
           
            ProcedureReturn Result
          EndProcedure
          
          If OpenWindow(#Window, 0, 0, 200, 200, "SystemMenu test", #PB_Window_ScreenCentered|#PB_Window_SystemMenu)
             
            systemMenu = GetSystemMenu_(WindowID(#Window), #False) ; copy the systemenu
            popupMenu = CreatePopupMenu_()  ; create a submenu
           
            If systemMenu And popupMenu
              ; fill submenu
              ;
              AppendMenu_(popupMenu, #MF_STRING, #Menu_A, "Custom A")
              AppendMenu_(popupMenu, #MF_STRING, #Menu_B, "Custom B") 
             
              ; add items to systemmenu. We insert above the 'close' item
              ;
              InsertMenu_(systemMenu, #SC_CLOSE, #MF_POPUP|#MF_STRING, popupMenu, "Custom SubMenu") ; add submenu
              InsertMenu_(systemMenu, #SC_CLOSE, #MF_STRING, #Menu_C, "Custom C")                   ; add another menu item
              InsertMenu_(systemMenu, #SC_CLOSE, #MF_SEPARATOR, 0, 0)                               ; add separator
            EndIf   
          
            ; This can be used to reset any changed done to the menu
            ;
            ; GetSystemMenu_(WindowID(#Window), #True) ; revert changes done the last time
           
            SetWindowCallback(@WindowCallback())
          
            Repeat
              Event = WaitWindowEvent()
            Until Event = #PB_Event_CloseWindow
          
          EndIf

          source :http://www.purebasic.fr/english/view...=140600#140600

          not sure if it will work in AMS tho as it needs to set a callback for the AMS window

          the above applied to an activex control would work tho, trasnslate the PB to VB make a ocx and bobs ya aunty!
          Last edited by RizlaUK; 07-31-2008, 08:05 AM.
          Embrace change in your life, you never know, it could all work out for the best

          Comment

          • Esfahan
            Forum Member
            • Oct 2007
            • 233

            #6
            Thanks man
            I don't work on PB , I know you are busy , if you or somebody have a free minutes in next times ,please do it for AMS :yes

            Comment

            • Imagine Programming
              Indigo Rose Customer
              • Apr 2007
              • 4251

              #7
              it is not possible in AMS, in pb it is... i do have PureBasic but i don't understand that script 100% i'll look at it later
              Bas Groothedde
              Imagine Programming :: Blog

              AMS8 Plugins
              IMXLH Compiler

              Comment

              • RizlaUK
                Indigo Rose Customer
                • May 2006
                • 5478

                #8
                like i say, i dont think it will work in PB anyway as its needs to run a callback function, but its a simple API task that can be achived in C++ or VB with ease, i just got a lot on right now with a paid project and dont really want to take time out for this
                Embrace change in your life, you never know, it could all work out for the best

                Comment

                Working...
                X