call program windows in my application like a child

  • Thread starter Thread starter Sheikko
  • Start date Start date
S

Sheikko

Hi all,
i have an application and i wan to call another program into it, like
notepad, so when i minimize the notepad, or maximize, it must rest in
my application.
thank you
 
Hello Sheikko,

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
 
Yes,
I have a parent child and want to call in it not a form, but an entire
application, like notepad, word..ecc.

I have solved the problem of process...I have used the HardwareButtons
(solution found in the visual help), at this scope I have included the
WindowsCe.Forms.dll to my project even if it for pocket PC.
I think is a bug of visual developper that filter this dll and it don't
let you to use it.

Thank you if you can help me.
 
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
 
excuse me but this question if for pc not for pocket pc, in fact I have
postd it here in (microsoft.public.dotnet.languages.csharp).
I want only to creaet an application parent MDI and to call in it
another program (i.e. notepad) like his child.
Do you think is possible?

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
 
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/micro...read/thread/9282d35ee70bd218/7c564c2dff6613fb

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?
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
 
thanks I will try tomorrow and I tell you something. thanks.

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/microsoft.public.dotnet.framework/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?
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
 
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.

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/microsoft.public.dotnet.framework/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?
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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top