Hi,
I have tried the code example in the link you have provided, but he
doesn't work. The notepad process is creadte, but like a separated
program.
Here there is my code:
=================
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using System.Diagnostics;
using System.Runtime.InteropServices;
namespace chilTest01
{
public partial class Form1 : Form
{
[DllImport("user32.dll")]
private static extern int SetParent(IntPtr hWndChild, IntPtr
hWndNewParent);
[DllImport("User32")]
private static extern int ShowWindow(IntPtr hWnd, int
nCmdShow);
private const int SW_MAXIMIZE = 3;
Process p = new Process();
public Form1()
{
InitializeComponent();
}
/**
* this code call a form like a child.
*/
private void newToolStripMenuItem_Click(object sender,
EventArgs e)
{
Form2 newMDIChild = new Form2();
// Set the Parent Form of the Child window.
newMDIChild.MdiParent = this;
// Display the new form.
newMDIChild.Show();
}
private void processToolStripMenuItem_Click(object sender,
EventArgs e)
{
// start your application
p.StartInfo.FileName = "NOTEPAD.EXE";
p.StartInfo.UseShellExecute = true;
p.Start();
// change parent window and maximize inside the form
//SetParent(p.MainWindowHandle, this.Handle);
//ShowWindow(p.MainWindowHandle, SW_MAXIMIZE);
}
}
}
=================
Sheikko ha scritto:
> thanks I will try tomorrow and I tell you something. thanks.
>
> On 21 Dic, 17:02, Michael Nemtsev <nemt...@msn.com> wrote:
> > Hello Sheikko,
> >
> > It's a kind of hack, redirecting the process' window handler on your form one
> > Use SetParent and ShowWindow WinAPI methods
> >
> > http://groups.google.ru/group/micros...ramework/brows...
> >
> > S> excuse me but this question if for pc not for pocket pc, in fact I
> > S> have
> > S> postd it here in (microsoft.public.dotnet.languages.csharp).
> > S> I want only to creaet an application parent MDI and to call in it
> > S> another program (i.e. notepad) like his child.
> > S> Do you think is possible?
> > S> On 21 Dic, 16:07, Michael Nemtsev <nemt...@msn.com> wrote:
> > S>
> >
> > >> Hello Sheikko,
> >
> > >> S> Yes,
> > >> S> I have a parent child and want to call in it not a form, but an
> > >> S> entire
> > >> S> application, like notepad, word..ecc.
> > >> So call the app in the bounds of form?! Don't think it's even
> > >> possible. What
> > >> are u going to do? Maybe there is another alternative solution for
> > >> it, if
> > >> u describe what u wanna do
> > >> S> I have solved the problem of process...I have used the
> > >> S> HardwareButtons
> > >> S> (solution found in the visual help), at this scope I have included
> > >> S> the
> > >> S> WindowsCe.Forms.dll to my project even if it for pocket PC.
> > >> All CE questions are more appropriate for the compactframework group,
> > >> not this one
> >
> > >>>> What does it mean? MDI style or what?
> > >>>> What's wrong with Process.Start method?
> > >>>> S> it must rest in
> > >>>> S> my application.
> > >>>> ---
> > >>>> WBR,
> > >>>> Michael Nemtseva [C# MVP] :: blog:http://spaces.live.com/laflour
> > >>>> "The greatest danger for most of us is not that our aim is too high
> > >>>> and we miss it, but that it is too low and we reach it" (c)
> > >>>> Michelangelo---
> > >> WBR,
> > >> Michael Nemtsev [C# MVP] :: blog:http://spaces.live.com/laflour
> > >> "The greatest danger for most of us is not that our aim is too high
> > >> and we miss it, but that it is too low and we reach it" (c)
> > >> Michelangelo---
> > WBR,
> > Michael Nemtsev [C# MVP] :: blog:http://spaces.live.com/laflour
> >
> > "The greatest danger for most of us is not that our aim is too high and we
> > miss it, but that it is too low and we reach it" (c) Michelangelo