I have created a c# application where I have successfully created a
System.Diagnostics.Process and set the parent to be a GUI Control so
the process is embedded in the panel and looks like part of my
software application.

I would like to be able to have a smaller version of the process shown
and click on it and have it bring up the full-screen. I have the
process so it can be shown and when a button is clicked, resized to
fullscreen, but whenever the process itself is clicked on, the process
is activated and the system tries to go in and use the process.

To overcome this, I have tried to deactivate the control (which works,
now clicking on the external software process does nothing), but I
can't overwrite the onClick command.

I tried to put a blank panel on top of the panel including the process
in order to catch the onClick event there, but regardless of my
efforts to BringToFront or SendToBack the process (change the z-
order), it does not display on top and clicking only clicks on the
external process.

Does anyone have any ideas for how I could achieve this effect so that
when it isn't full screen, clicking on it would make it full screen,
and the process would be active and behave as it currently does only
when it is full-sized?

Thanks!

RE: Overriding the onclick of a process by FamilyTreeMike

FamilyTreeMike
Fri Mar 14 06:46:03 CDT 2008

Please take a look at this similar discussion, if you haven't already:

http://msdn.microsoft.com/newsgroups/default.aspx?query=notepad+process&dg=microsoft.public.dotnet.languages.csharp&cat=en-us-msdn-visualtools-vcsharp&lang=en&cr=US&pt=ed4263a6-cf84-4d66-b0fb-befccc28a9bd&catlist=6A7CD498-017F-42B4-997F-87D976E887DE%2C774F24A2-F71F-425F-AC2B-DC48AB0DA5C9&dglist=&ptlist=&exp=&sloc=en-us

The subject is "ShowDialog - Cross-thread operation not valid: Control
'CheckAccountInfo' accessed from a thread other than the thread it was
created on", but it sounds like what you are trying.

"mbarb5ne@verizon.net" wrote:

> I have created a c# application where I have successfully created a
> System.Diagnostics.Process and set the parent to be a GUI Control so
> the process is embedded in the panel and looks like part of my
> software application.
>
> I would like to be able to have a smaller version of the process shown
> and click on it and have it bring up the full-screen. I have the
> process so it can be shown and when a button is clicked, resized to
> fullscreen, but whenever the process itself is clicked on, the process
> is activated and the system tries to go in and use the process.
>
> To overcome this, I have tried to deactivate the control (which works,
> now clicking on the external software process does nothing), but I
> can't overwrite the onClick command.
>
> I tried to put a blank panel on top of the panel including the process
> in order to catch the onClick event there, but regardless of my
> efforts to BringToFront or SendToBack the process (change the z-
> order), it does not display on top and clicking only clicks on the
> external process.
>
> Does anyone have any ideas for how I could achieve this effect so that
> when it isn't full screen, clicking on it would make it full screen,
> and the process would be active and behave as it currently does only
> when it is full-sized?
>
> Thanks!
>

Re: Overriding the onclick of a process by mbarb5ne

mbarb5ne
Wed Mar 19 14:10:46 CDT 2008

From what I get from this link, folks are trying to embed a Dialog
window with another application and are getting threading errors.
Maybe this IS my problem and I'm just lucky enough not to get it in
that particular format, but what's going on with me is that the
executable application is running well as expected, I would just like
to be able to make in inactive (which I'm able to do), and to put a
blank panel above it to catch the onClick event. Then when I catch
that and make the screen full-sized (which I am currently able to do
by pushing a button, just not an overlay over the panel), I would
eliminate the blank panel and let the user interact with the external
application.

When I try to put that blank panel over the other application, it
seems to occupy the correct space, I just can't bring it to the
forefront.