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. Adding button/control to an existing dialog

Adding button/control to an existing dialog

Scheduled Pinned Locked Moved C / C++ / MFC
question
10 Posts 7 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.
  • I Offline
    I Offline
    Identity Undisclosed
    wrote on last edited by
    #1

    Hello, I have a handle of a dialog(The dialog lies in another process). Now I want to add a button to that dialog, is it possible ? Thanks.

    E _ S S S 6 Replies Last reply
    0
    • I Identity Undisclosed

      Hello, I have a handle of a dialog(The dialog lies in another process). Now I want to add a button to that dialog, is it possible ? Thanks.

      E Offline
      E Offline
      Eytukan
      wrote on last edited by
      #2

      Have a function in your Dialog class that has this : CButton* pButton = new CButton; pButton->Create("NewButton", WS_CHILD | WS_VISIBLE, CRect(x, y, x1, y1), this, 1234);


      OK,. what country just started work for the day ? The ASP.NET forum is flooded with retarded questions. -Christian Graus Best wishes to Rexx[^]

      I 1 Reply Last reply
      0
      • I Identity Undisclosed

        Hello, I have a handle of a dialog(The dialog lies in another process). Now I want to add a button to that dialog, is it possible ? Thanks.

        _ Offline
        _ Offline
        _Superman_
        wrote on last edited by
        #3

        You can either do CreateRemoteThread to create a thread in the other process and create the button from that thread. Or you can write a hook DLL that loads into the remote process and then create the button from the hook procedure. I don't think you can create a button using the handle of another window or dialog.

        «_Superman_»

        I 1 Reply Last reply
        0
        • I Identity Undisclosed

          Hello, I have a handle of a dialog(The dialog lies in another process). Now I want to add a button to that dialog, is it possible ? Thanks.

          S Offline
          S Offline
          SandipG
          wrote on last edited by
          #4

          Identity Undisclosed wrote:

          have a handle of a dialog(The dialog lies in another process). Now I want to add a button to that dialog, is it possible

          Can you tell why you need this?

          Regards, Sandip.

          I 1 Reply Last reply
          0
          • S SandipG

            Identity Undisclosed wrote:

            have a handle of a dialog(The dialog lies in another process). Now I want to add a button to that dialog, is it possible

            Can you tell why you need this?

            Regards, Sandip.

            I Offline
            I Offline
            Identity Undisclosed
            wrote on last edited by
            #5

            Just for learning purposes :)

            1 Reply Last reply
            0
            • E Eytukan

              Have a function in your Dialog class that has this : CButton* pButton = new CButton; pButton->Create("NewButton", WS_CHILD | WS_VISIBLE, CRect(x, y, x1, y1), this, 1234);


              OK,. what country just started work for the day ? The ASP.NET forum is flooded with retarded questions. -Christian Graus Best wishes to Rexx[^]

              I Offline
              I Offline
              Identity Undisclosed
              wrote on last edited by
              #6

              I think I mentioned that the dialog exists in another process.

              1 Reply Last reply
              0
              • _ _Superman_

                You can either do CreateRemoteThread to create a thread in the other process and create the button from that thread. Or you can write a hook DLL that loads into the remote process and then create the button from the hook procedure. I don't think you can create a button using the handle of another window or dialog.

                «_Superman_»

                I Offline
                I Offline
                Identity Undisclosed
                wrote on last edited by
                #7

                Yes, I was thinking that global hooks will be helpful. But can I get some sample code please. http://www.google.com

                1 Reply Last reply
                0
                • I Identity Undisclosed

                  Hello, I have a handle of a dialog(The dialog lies in another process). Now I want to add a button to that dialog, is it possible ? Thanks.

                  S Offline
                  S Offline
                  shark_17
                  wrote on last edited by
                  #8

                  you learn process manage. For example: Pipe,Signal,Message,mapped memory,semaphore,Socket

                  1 Reply Last reply
                  0
                  • I Identity Undisclosed

                    Hello, I have a handle of a dialog(The dialog lies in another process). Now I want to add a button to that dialog, is it possible ? Thanks.

                    S Offline
                    S Offline
                    Sarath C
                    wrote on last edited by
                    #9

                    :) Resource Hacker[^] is a nice tool where you can permanently modify the resources of executable. Even if you create the button somehow, you will not be able to manage the messages properly. Anyway Injecting your custom DLL to the other project will help you to some extend....

                    -Sarath. "Great hopes make everything great possible" - Benjamin Franklin

                    My blog - Sharing My Thoughts

                    1 Reply Last reply
                    0
                    • I Identity Undisclosed

                      Hello, I have a handle of a dialog(The dialog lies in another process). Now I want to add a button to that dialog, is it possible ? Thanks.

                      S Offline
                      S Offline
                      Stuart Dootson
                      wrote on last edited by
                      #10

                      Use this project[^] to inject code into the remote process. The code you inject should create the new button.

                      Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p

                      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