PC Review


Reply
Thread Tools Rate Thread

call program windows in my application like a child

 
 
Sheikko
Guest
Posts: n/a
 
      21st Dec 2006
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

 
Reply With Quote
 
 
 
 
Michael Nemtsev
Guest
Posts: n/a
 
      21st Dec 2006
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


 
Reply With Quote
 
Sheikko
Guest
Posts: n/a
 
      21st Dec 2006
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.

On 21 Dic, 15:15, Michael Nemtsev <nemt...@msn.com> wrote:
> 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


 
Reply With Quote
 
Michael Nemtsev
Guest
Posts: n/a
 
      21st Dec 2006
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


 
Reply With Quote
 
Sheikko
Guest
Posts: n/a
 
      21st Dec 2006
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?

On 21 Dic, 16:07, Michael Nemtsev <nemt...@msn.com> wrote:
> 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


 
Reply With Quote
 
Michael Nemtsev
Guest
Posts: n/a
 
      21st Dec 2006
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...564c2dff6613fb

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


 
Reply With Quote
 
Sheikko
Guest
Posts: n/a
 
      21st Dec 2006
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


 
Reply With Quote
 
Sheikko
Guest
Posts: n/a
 
      8th Jan 2007
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


 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Getting Focus on outside application child windows Gessler Microsoft C# .NET 0 12th Feb 2010 04:22 PM
Smart Device Application Call External Program (Shell) Jason Gyetko Microsoft Dot NET 0 1st Jun 2005 09:24 PM
How to call windows media player in an application program on PPC using C#? Albert Hsieh Microsoft C# .NET 1 1st Jun 2005 01:53 PM
How to call a VB6 application from Windows Service Application =?Utf-8?B?REg=?= Microsoft Dot NET 3 5th May 2004 05:08 PM
Call legacy program for vb.net application =?Utf-8?B?Q2FzbGFu?= Microsoft VB .NET 1 23rd Jan 2004 09:50 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 05:07 PM.