Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. How to add menu to other applications

How to add menu to other applications

Scheduled Pinned Locked Moved C / C++ / MFC
tutorialquestion
6 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • D Offline
    D Offline
    Dody_DK
    wrote on last edited by
    #1

    Hey All I am wondering how to add new menu to other application, meaning I want to add a menu to another application that is not mine let's say I want to add menu to Windows Live Messenger or Yahoo! any idea how? thanks in advance!

    H 1 Reply Last reply
    0
    • D Dody_DK

      Hey All I am wondering how to add new menu to other application, meaning I want to add a menu to another application that is not mine let's say I want to add menu to Windows Live Messenger or Yahoo! any idea how? thanks in advance!

      H Offline
      H Offline
      Hamid Taebi
      wrote on last edited by
      #2

      When you run this code you have two "test" in File last option and another after help PROCESS_INFORMATION l_ProcessInfo; STARTUPINFO l_StartupInfo; ZeroMemory(&l_StartupInfo, sizeof(STARTUPINFO)); l_StartupInfo.cb = sizeof(STARTUPINFO); l_StartupInfo.dwFlags = STARTF_USESHOWWINDOW; l_StartupInfo.wShowWindow = SW_SHOWMAXIMIZED; CreateProcess(NULL, "Notepad.exe", NULL, NULL, FALSE, DETACHED_PROCESS, NULL, NULL, &l_StartupInfo, &l_ProcessInfo); MessageBox("Wait"); HWND hWnd = ::FindWindow("Notepad", NULL); //find notepad HMENU h=::GetMenu(hWnd); HMENU h2=GetSubMenu(h,0); AppendMenu(h2,MF_STRING,22,"test"); AppendMenu(h,MF_STRING,22,"test");

      _**


      **_

      WhiteSky


      D 1 Reply Last reply
      0
      • H Hamid Taebi

        When you run this code you have two "test" in File last option and another after help PROCESS_INFORMATION l_ProcessInfo; STARTUPINFO l_StartupInfo; ZeroMemory(&l_StartupInfo, sizeof(STARTUPINFO)); l_StartupInfo.cb = sizeof(STARTUPINFO); l_StartupInfo.dwFlags = STARTF_USESHOWWINDOW; l_StartupInfo.wShowWindow = SW_SHOWMAXIMIZED; CreateProcess(NULL, "Notepad.exe", NULL, NULL, FALSE, DETACHED_PROCESS, NULL, NULL, &l_StartupInfo, &l_ProcessInfo); MessageBox("Wait"); HWND hWnd = ::FindWindow("Notepad", NULL); //find notepad HMENU h=::GetMenu(hWnd); HMENU h2=GetSubMenu(h,0); AppendMenu(h2,MF_STRING,22,"test"); AppendMenu(h,MF_STRING,22,"test");

        _**


        **_

        WhiteSky


        D Offline
        D Offline
        Dody_DK
        wrote on last edited by
        #3

        thanks alot I didn't think it was easy like that to do what I am trying to, I thought I needed to hook the application first I have one more question, how I can I add the WM_COMMAND ability to this code so when I click on "test" a MessaBox will pop up? thanks in advance!

        H 1 Reply Last reply
        0
        • D Dody_DK

          thanks alot I didn't think it was easy like that to do what I am trying to, I thought I needed to hook the application first I have one more question, how I can I add the WM_COMMAND ability to this code so when I click on "test" a MessaBox will pop up? thanks in advance!

          H Offline
          H Offline
          Hamid Taebi
          wrote on last edited by
          #4

          You can see an article from Mr David Crow about "resource" maybe it is some helpful to you

          _**


          **_

          WhiteSky


          D 1 Reply Last reply
          0
          • H Hamid Taebi

            You can see an article from Mr David Crow about "resource" maybe it is some helpful to you

            _**


            **_

            WhiteSky


            D Offline
            D Offline
            Dody_DK
            wrote on last edited by
            #5

            I tried to find the article and searched after the arthur name but no result are you sure it is the right name? thanks!

            H 1 Reply Last reply
            0
            • D Dody_DK

              I tried to find the article and searched after the arthur name but no result are you sure it is the right name? thanks!

              H Offline
              H Offline
              Hamid Taebi
              wrote on last edited by
              #6

              See http://www.codeproject.com/cpp/UpdateResource.asp[^]

              _**


              **_

              WhiteSky


              1 Reply Last reply
              0
              Reply
              • Reply as topic
              Log in to reply
              • Oldest to Newest
              • Newest to Oldest
              • Most Votes


              • Login

              • Don't have an account? Register

              • Login or register to search.
              • First post
                Last post
              0
              • Categories
              • Recent
              • Tags
              • Popular
              • World
              • Users
              • Groups