to run an exe file in the panel of c#.net application











up vote
1
down vote

favorite
1













  1. I want to run an exe file on my winform .net application within the panel using c# code

  2. I'm able to run exe file on the button click with System.Diagnostics.ProcessStartInfo and Process p = Process.Start("notepad.exe"); but what is the code to run this notepad file or any other exe file within the panel using c# code?


  3. I want to run the application within the panel not on the separate window.i had run the following code but the exe does not stay on the screen nor it opens within the panel
    please tell me the solution for this.



        Process p = Process.Start("notepad.exe");
    Thread.Sleep (600); // Allow the process to open it's window
    SetParent(p.MainWindowHandle, panel1.Handle);


    [DllImport("user32.dll")]
    static extern IntPtr SetParent(IntPtr hWndChild, IntPtr hWndNewParent);











share|improve this question




















  • 1




    @zoya, Did you check the article I suggested? It shows an example of what you are looking for.
    – Giorgi
    Jan 29 '10 at 9:03















up vote
1
down vote

favorite
1













  1. I want to run an exe file on my winform .net application within the panel using c# code

  2. I'm able to run exe file on the button click with System.Diagnostics.ProcessStartInfo and Process p = Process.Start("notepad.exe"); but what is the code to run this notepad file or any other exe file within the panel using c# code?


  3. I want to run the application within the panel not on the separate window.i had run the following code but the exe does not stay on the screen nor it opens within the panel
    please tell me the solution for this.



        Process p = Process.Start("notepad.exe");
    Thread.Sleep (600); // Allow the process to open it's window
    SetParent(p.MainWindowHandle, panel1.Handle);


    [DllImport("user32.dll")]
    static extern IntPtr SetParent(IntPtr hWndChild, IntPtr hWndNewParent);











share|improve this question




















  • 1




    @zoya, Did you check the article I suggested? It shows an example of what you are looking for.
    – Giorgi
    Jan 29 '10 at 9:03













up vote
1
down vote

favorite
1









up vote
1
down vote

favorite
1






1






  1. I want to run an exe file on my winform .net application within the panel using c# code

  2. I'm able to run exe file on the button click with System.Diagnostics.ProcessStartInfo and Process p = Process.Start("notepad.exe"); but what is the code to run this notepad file or any other exe file within the panel using c# code?


  3. I want to run the application within the panel not on the separate window.i had run the following code but the exe does not stay on the screen nor it opens within the panel
    please tell me the solution for this.



        Process p = Process.Start("notepad.exe");
    Thread.Sleep (600); // Allow the process to open it's window
    SetParent(p.MainWindowHandle, panel1.Handle);


    [DllImport("user32.dll")]
    static extern IntPtr SetParent(IntPtr hWndChild, IntPtr hWndNewParent);











share|improve this question
















  1. I want to run an exe file on my winform .net application within the panel using c# code

  2. I'm able to run exe file on the button click with System.Diagnostics.ProcessStartInfo and Process p = Process.Start("notepad.exe"); but what is the code to run this notepad file or any other exe file within the panel using c# code?


  3. I want to run the application within the panel not on the separate window.i had run the following code but the exe does not stay on the screen nor it opens within the panel
    please tell me the solution for this.



        Process p = Process.Start("notepad.exe");
    Thread.Sleep (600); // Allow the process to open it's window
    SetParent(p.MainWindowHandle, panel1.Handle);


    [DllImport("user32.dll")]
    static extern IntPtr SetParent(IntPtr hWndChild, IntPtr hWndNewParent);








.net winforms panel exe






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Apr 30 '14 at 14:12









l4mpi

4,24032245




4,24032245










asked Jan 29 '10 at 8:39









zoya

22841020




22841020








  • 1




    @zoya, Did you check the article I suggested? It shows an example of what you are looking for.
    – Giorgi
    Jan 29 '10 at 9:03














  • 1




    @zoya, Did you check the article I suggested? It shows an example of what you are looking for.
    – Giorgi
    Jan 29 '10 at 9:03








1




1




@zoya, Did you check the article I suggested? It shows an example of what you are looking for.
– Giorgi
Jan 29 '10 at 9:03




@zoya, Did you check the article I suggested? It shows an example of what you are looking for.
– Giorgi
Jan 29 '10 at 9:03












4 Answers
4






active

oldest

votes

















up vote
3
down vote



accepted










I think what you are talking about is embedding an application in your panel.



This is only possibly with executables that have been created to be embedded. Notepad is not one of those. Some browsers can be - Mozilla is one example, and IE is another.






share|improve this answer





















  • thanks...can u provide me the code for any other exe files
    – zoya
    Jan 29 '10 at 8:55






  • 3




    No, no I can't.
    – Oded
    Jan 29 '10 at 8:57










  • my code is opening running an exe file on the seperate window but not opening it within the panel.also the exe is not stable
    – zoya
    Jan 29 '10 at 9:06










  • exe is not stable? What does that mean?
    – Oded
    Jan 29 '10 at 9:09










  • ok then tell me the solution for running an exe within the panel means in that particular panel area not on the seperate window. tell me by screening my code that i have given..where i have to modify?
    – zoya
    Jan 29 '10 at 9:18


















up vote
2
down vote













I guess you are looking for this: Window Tabifier






share|improve this answer





















  • thanks for ur help...can u plz elaborate. i want to know that how could i navigate/toggle between the different exe files on my c# program on the button click event..basically i want to do toggling between the current and previously opened exe file..im able to run an exe file on my program but not able to provide an option for opening the previously running exe file.
    – zoya
    Jan 29 '10 at 9:03










  • can u provide me the solution for embedding the exe on the panel of my .netprogram using c#code. i dont want to execute the exe on the seperate window i want to execute it within the panel.
    – zoya
    Jan 29 '10 at 9:24










  • Just read the article. It comes with source code. I cannot do it for you.
    – Giorgi
    Jan 29 '10 at 10:12










  • tell me the solution for calling the third party application in the panel.
    – zoya
    Jan 29 '10 at 10:27


















up vote
0
down vote













What are you trying to do? you know that if its your own programs you want to run in the panel you could write some basic plugin code and get a control from a assembly with reflection..






share|improve this answer





















  • thanks for ur answer but can u provide me the solution for embedding the exe on the panel of my .netprogram using c#code. i dont want to execute the exe on the seperate window i want to execute it within the panel.
    – zoya
    Jan 29 '10 at 9:28


















up vote
0
down vote













What you want is pipe the output of the exe to your process. Usually when you do not do not pipe the output it defaults to stdout for a console application will be the console window by piping you are telling the exe you want the output to come to your process not the console window. Then you would have to create your own "panel" (a multiline textbox) and append the the output stream from the exe you invoked to it!



Learn here: http://msdn.microsoft.com/en-us/library/system.diagnostics.processstartinfo.redirectstandardoutput(v=VS.90).aspx






share|improve this answer























    Your Answer






    StackExchange.ifUsing("editor", function () {
    StackExchange.using("externalEditor", function () {
    StackExchange.using("snippets", function () {
    StackExchange.snippets.init();
    });
    });
    }, "code-snippets");

    StackExchange.ready(function() {
    var channelOptions = {
    tags: "".split(" "),
    id: "1"
    };
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function() {
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled) {
    StackExchange.using("snippets", function() {
    createEditor();
    });
    }
    else {
    createEditor();
    }
    });

    function createEditor() {
    StackExchange.prepareEditor({
    heartbeatType: 'answer',
    convertImagesToLinks: true,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: 10,
    bindNavPrevention: true,
    postfix: "",
    imageUploader: {
    brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
    contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
    allowUrls: true
    },
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    });


    }
    });














     

    draft saved


    draft discarded


















    StackExchange.ready(
    function () {
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f2160767%2fto-run-an-exe-file-in-the-panel-of-c-net-application%23new-answer', 'question_page');
    }
    );

    Post as a guest















    Required, but never shown

























    4 Answers
    4






    active

    oldest

    votes








    4 Answers
    4






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes








    up vote
    3
    down vote



    accepted










    I think what you are talking about is embedding an application in your panel.



    This is only possibly with executables that have been created to be embedded. Notepad is not one of those. Some browsers can be - Mozilla is one example, and IE is another.






    share|improve this answer





















    • thanks...can u provide me the code for any other exe files
      – zoya
      Jan 29 '10 at 8:55






    • 3




      No, no I can't.
      – Oded
      Jan 29 '10 at 8:57










    • my code is opening running an exe file on the seperate window but not opening it within the panel.also the exe is not stable
      – zoya
      Jan 29 '10 at 9:06










    • exe is not stable? What does that mean?
      – Oded
      Jan 29 '10 at 9:09










    • ok then tell me the solution for running an exe within the panel means in that particular panel area not on the seperate window. tell me by screening my code that i have given..where i have to modify?
      – zoya
      Jan 29 '10 at 9:18















    up vote
    3
    down vote



    accepted










    I think what you are talking about is embedding an application in your panel.



    This is only possibly with executables that have been created to be embedded. Notepad is not one of those. Some browsers can be - Mozilla is one example, and IE is another.






    share|improve this answer





















    • thanks...can u provide me the code for any other exe files
      – zoya
      Jan 29 '10 at 8:55






    • 3




      No, no I can't.
      – Oded
      Jan 29 '10 at 8:57










    • my code is opening running an exe file on the seperate window but not opening it within the panel.also the exe is not stable
      – zoya
      Jan 29 '10 at 9:06










    • exe is not stable? What does that mean?
      – Oded
      Jan 29 '10 at 9:09










    • ok then tell me the solution for running an exe within the panel means in that particular panel area not on the seperate window. tell me by screening my code that i have given..where i have to modify?
      – zoya
      Jan 29 '10 at 9:18













    up vote
    3
    down vote



    accepted







    up vote
    3
    down vote



    accepted






    I think what you are talking about is embedding an application in your panel.



    This is only possibly with executables that have been created to be embedded. Notepad is not one of those. Some browsers can be - Mozilla is one example, and IE is another.






    share|improve this answer












    I think what you are talking about is embedding an application in your panel.



    This is only possibly with executables that have been created to be embedded. Notepad is not one of those. Some browsers can be - Mozilla is one example, and IE is another.







    share|improve this answer












    share|improve this answer



    share|improve this answer










    answered Jan 29 '10 at 8:50









    Oded

    405k70731899




    405k70731899












    • thanks...can u provide me the code for any other exe files
      – zoya
      Jan 29 '10 at 8:55






    • 3




      No, no I can't.
      – Oded
      Jan 29 '10 at 8:57










    • my code is opening running an exe file on the seperate window but not opening it within the panel.also the exe is not stable
      – zoya
      Jan 29 '10 at 9:06










    • exe is not stable? What does that mean?
      – Oded
      Jan 29 '10 at 9:09










    • ok then tell me the solution for running an exe within the panel means in that particular panel area not on the seperate window. tell me by screening my code that i have given..where i have to modify?
      – zoya
      Jan 29 '10 at 9:18


















    • thanks...can u provide me the code for any other exe files
      – zoya
      Jan 29 '10 at 8:55






    • 3




      No, no I can't.
      – Oded
      Jan 29 '10 at 8:57










    • my code is opening running an exe file on the seperate window but not opening it within the panel.also the exe is not stable
      – zoya
      Jan 29 '10 at 9:06










    • exe is not stable? What does that mean?
      – Oded
      Jan 29 '10 at 9:09










    • ok then tell me the solution for running an exe within the panel means in that particular panel area not on the seperate window. tell me by screening my code that i have given..where i have to modify?
      – zoya
      Jan 29 '10 at 9:18
















    thanks...can u provide me the code for any other exe files
    – zoya
    Jan 29 '10 at 8:55




    thanks...can u provide me the code for any other exe files
    – zoya
    Jan 29 '10 at 8:55




    3




    3




    No, no I can't.
    – Oded
    Jan 29 '10 at 8:57




    No, no I can't.
    – Oded
    Jan 29 '10 at 8:57












    my code is opening running an exe file on the seperate window but not opening it within the panel.also the exe is not stable
    – zoya
    Jan 29 '10 at 9:06




    my code is opening running an exe file on the seperate window but not opening it within the panel.also the exe is not stable
    – zoya
    Jan 29 '10 at 9:06












    exe is not stable? What does that mean?
    – Oded
    Jan 29 '10 at 9:09




    exe is not stable? What does that mean?
    – Oded
    Jan 29 '10 at 9:09












    ok then tell me the solution for running an exe within the panel means in that particular panel area not on the seperate window. tell me by screening my code that i have given..where i have to modify?
    – zoya
    Jan 29 '10 at 9:18




    ok then tell me the solution for running an exe within the panel means in that particular panel area not on the seperate window. tell me by screening my code that i have given..where i have to modify?
    – zoya
    Jan 29 '10 at 9:18












    up vote
    2
    down vote













    I guess you are looking for this: Window Tabifier






    share|improve this answer





















    • thanks for ur help...can u plz elaborate. i want to know that how could i navigate/toggle between the different exe files on my c# program on the button click event..basically i want to do toggling between the current and previously opened exe file..im able to run an exe file on my program but not able to provide an option for opening the previously running exe file.
      – zoya
      Jan 29 '10 at 9:03










    • can u provide me the solution for embedding the exe on the panel of my .netprogram using c#code. i dont want to execute the exe on the seperate window i want to execute it within the panel.
      – zoya
      Jan 29 '10 at 9:24










    • Just read the article. It comes with source code. I cannot do it for you.
      – Giorgi
      Jan 29 '10 at 10:12










    • tell me the solution for calling the third party application in the panel.
      – zoya
      Jan 29 '10 at 10:27















    up vote
    2
    down vote













    I guess you are looking for this: Window Tabifier






    share|improve this answer





















    • thanks for ur help...can u plz elaborate. i want to know that how could i navigate/toggle between the different exe files on my c# program on the button click event..basically i want to do toggling between the current and previously opened exe file..im able to run an exe file on my program but not able to provide an option for opening the previously running exe file.
      – zoya
      Jan 29 '10 at 9:03










    • can u provide me the solution for embedding the exe on the panel of my .netprogram using c#code. i dont want to execute the exe on the seperate window i want to execute it within the panel.
      – zoya
      Jan 29 '10 at 9:24










    • Just read the article. It comes with source code. I cannot do it for you.
      – Giorgi
      Jan 29 '10 at 10:12










    • tell me the solution for calling the third party application in the panel.
      – zoya
      Jan 29 '10 at 10:27













    up vote
    2
    down vote










    up vote
    2
    down vote









    I guess you are looking for this: Window Tabifier






    share|improve this answer












    I guess you are looking for this: Window Tabifier







    share|improve this answer












    share|improve this answer



    share|improve this answer










    answered Jan 29 '10 at 8:52









    Giorgi

    25.6k1170109




    25.6k1170109












    • thanks for ur help...can u plz elaborate. i want to know that how could i navigate/toggle between the different exe files on my c# program on the button click event..basically i want to do toggling between the current and previously opened exe file..im able to run an exe file on my program but not able to provide an option for opening the previously running exe file.
      – zoya
      Jan 29 '10 at 9:03










    • can u provide me the solution for embedding the exe on the panel of my .netprogram using c#code. i dont want to execute the exe on the seperate window i want to execute it within the panel.
      – zoya
      Jan 29 '10 at 9:24










    • Just read the article. It comes with source code. I cannot do it for you.
      – Giorgi
      Jan 29 '10 at 10:12










    • tell me the solution for calling the third party application in the panel.
      – zoya
      Jan 29 '10 at 10:27


















    • thanks for ur help...can u plz elaborate. i want to know that how could i navigate/toggle between the different exe files on my c# program on the button click event..basically i want to do toggling between the current and previously opened exe file..im able to run an exe file on my program but not able to provide an option for opening the previously running exe file.
      – zoya
      Jan 29 '10 at 9:03










    • can u provide me the solution for embedding the exe on the panel of my .netprogram using c#code. i dont want to execute the exe on the seperate window i want to execute it within the panel.
      – zoya
      Jan 29 '10 at 9:24










    • Just read the article. It comes with source code. I cannot do it for you.
      – Giorgi
      Jan 29 '10 at 10:12










    • tell me the solution for calling the third party application in the panel.
      – zoya
      Jan 29 '10 at 10:27
















    thanks for ur help...can u plz elaborate. i want to know that how could i navigate/toggle between the different exe files on my c# program on the button click event..basically i want to do toggling between the current and previously opened exe file..im able to run an exe file on my program but not able to provide an option for opening the previously running exe file.
    – zoya
    Jan 29 '10 at 9:03




    thanks for ur help...can u plz elaborate. i want to know that how could i navigate/toggle between the different exe files on my c# program on the button click event..basically i want to do toggling between the current and previously opened exe file..im able to run an exe file on my program but not able to provide an option for opening the previously running exe file.
    – zoya
    Jan 29 '10 at 9:03












    can u provide me the solution for embedding the exe on the panel of my .netprogram using c#code. i dont want to execute the exe on the seperate window i want to execute it within the panel.
    – zoya
    Jan 29 '10 at 9:24




    can u provide me the solution for embedding the exe on the panel of my .netprogram using c#code. i dont want to execute the exe on the seperate window i want to execute it within the panel.
    – zoya
    Jan 29 '10 at 9:24












    Just read the article. It comes with source code. I cannot do it for you.
    – Giorgi
    Jan 29 '10 at 10:12




    Just read the article. It comes with source code. I cannot do it for you.
    – Giorgi
    Jan 29 '10 at 10:12












    tell me the solution for calling the third party application in the panel.
    – zoya
    Jan 29 '10 at 10:27




    tell me the solution for calling the third party application in the panel.
    – zoya
    Jan 29 '10 at 10:27










    up vote
    0
    down vote













    What are you trying to do? you know that if its your own programs you want to run in the panel you could write some basic plugin code and get a control from a assembly with reflection..






    share|improve this answer





















    • thanks for ur answer but can u provide me the solution for embedding the exe on the panel of my .netprogram using c#code. i dont want to execute the exe on the seperate window i want to execute it within the panel.
      – zoya
      Jan 29 '10 at 9:28















    up vote
    0
    down vote













    What are you trying to do? you know that if its your own programs you want to run in the panel you could write some basic plugin code and get a control from a assembly with reflection..






    share|improve this answer





















    • thanks for ur answer but can u provide me the solution for embedding the exe on the panel of my .netprogram using c#code. i dont want to execute the exe on the seperate window i want to execute it within the panel.
      – zoya
      Jan 29 '10 at 9:28













    up vote
    0
    down vote










    up vote
    0
    down vote









    What are you trying to do? you know that if its your own programs you want to run in the panel you could write some basic plugin code and get a control from a assembly with reflection..






    share|improve this answer












    What are you trying to do? you know that if its your own programs you want to run in the panel you could write some basic plugin code and get a control from a assembly with reflection..







    share|improve this answer












    share|improve this answer



    share|improve this answer










    answered Jan 29 '10 at 9:14









    Peter

    21.7k31121165




    21.7k31121165












    • thanks for ur answer but can u provide me the solution for embedding the exe on the panel of my .netprogram using c#code. i dont want to execute the exe on the seperate window i want to execute it within the panel.
      – zoya
      Jan 29 '10 at 9:28


















    • thanks for ur answer but can u provide me the solution for embedding the exe on the panel of my .netprogram using c#code. i dont want to execute the exe on the seperate window i want to execute it within the panel.
      – zoya
      Jan 29 '10 at 9:28
















    thanks for ur answer but can u provide me the solution for embedding the exe on the panel of my .netprogram using c#code. i dont want to execute the exe on the seperate window i want to execute it within the panel.
    – zoya
    Jan 29 '10 at 9:28




    thanks for ur answer but can u provide me the solution for embedding the exe on the panel of my .netprogram using c#code. i dont want to execute the exe on the seperate window i want to execute it within the panel.
    – zoya
    Jan 29 '10 at 9:28










    up vote
    0
    down vote













    What you want is pipe the output of the exe to your process. Usually when you do not do not pipe the output it defaults to stdout for a console application will be the console window by piping you are telling the exe you want the output to come to your process not the console window. Then you would have to create your own "panel" (a multiline textbox) and append the the output stream from the exe you invoked to it!



    Learn here: http://msdn.microsoft.com/en-us/library/system.diagnostics.processstartinfo.redirectstandardoutput(v=VS.90).aspx






    share|improve this answer



























      up vote
      0
      down vote













      What you want is pipe the output of the exe to your process. Usually when you do not do not pipe the output it defaults to stdout for a console application will be the console window by piping you are telling the exe you want the output to come to your process not the console window. Then you would have to create your own "panel" (a multiline textbox) and append the the output stream from the exe you invoked to it!



      Learn here: http://msdn.microsoft.com/en-us/library/system.diagnostics.processstartinfo.redirectstandardoutput(v=VS.90).aspx






      share|improve this answer

























        up vote
        0
        down vote










        up vote
        0
        down vote









        What you want is pipe the output of the exe to your process. Usually when you do not do not pipe the output it defaults to stdout for a console application will be the console window by piping you are telling the exe you want the output to come to your process not the console window. Then you would have to create your own "panel" (a multiline textbox) and append the the output stream from the exe you invoked to it!



        Learn here: http://msdn.microsoft.com/en-us/library/system.diagnostics.processstartinfo.redirectstandardoutput(v=VS.90).aspx






        share|improve this answer














        What you want is pipe the output of the exe to your process. Usually when you do not do not pipe the output it defaults to stdout for a console application will be the console window by piping you are telling the exe you want the output to come to your process not the console window. Then you would have to create your own "panel" (a multiline textbox) and append the the output stream from the exe you invoked to it!



        Learn here: http://msdn.microsoft.com/en-us/library/system.diagnostics.processstartinfo.redirectstandardoutput(v=VS.90).aspx







        share|improve this answer














        share|improve this answer



        share|improve this answer








        edited Jul 6 '11 at 1:31

























        answered Jul 6 '11 at 1:23









        markmnl

        6,30374490




        6,30374490






























             

            draft saved


            draft discarded



















































             


            draft saved


            draft discarded














            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f2160767%2fto-run-an-exe-file-in-the-panel-of-c-net-application%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown





















































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown

































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown