473,509 Members | 2,528 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

MAIN FORM from PROCESS ?


Given p (as a process) how do I get the MainForm (let's assume that it
might exist) ?

-P

Jul 1 '07 #1
7 1624
Can you explan this a little bit more Pamela?

Cor
"pamela fluente" <pa***********@libero.itschreef in bericht
news:11*********************@57g2000hsv.googlegrou ps.com...
>
Given p (as a process) how do I get the MainForm (let's assume that it
might exist) ?

-P

Jul 2 '07 #2
On 2 Lug, 06:57, "Cor Ligthert [MVP]" <notmyfirstn...@planet.nl>
wrote:
Can you explan this a little bit more Pamela?

Yes.

I was wondering whether - given a windows application which has a
MainForm, for instance "Form1" - assuming that a function only knows
the process p, it would be possible to find the main form.
something like:

Function FindMainFormFromProcess(p System.DiagnosticProcess) as
Control
'... ?
end function

-P

Jul 2 '07 #3
"pamela fluente" <pa***********@libero.itschrieb
>
Given p (as a process) how do I get the MainForm (let's assume that
it might exist) ?
A Process object is more related to the unmanaged process. Maybe you are
looking for "Remoting": (but don't ask me anything about it; I know
nothing ;-)

http://msdn2.microsoft.com/en-us/lib...07(VS.80).aspx
Armin

Jul 2 '07 #4
On Jul 1, 1:46 pm, pamela fluente <pamelaflue...@libero.itwrote:
Given p (as a process) how do I get the MainForm (let's assume that it
might exist) ?

-P
I have to ask you what the purpose of this is? Also is the process you
are looking for a program you designed or one that a third party
created?

Thanks,

Seth Rowe

Jul 2 '07 #5
On 2 Lug, 13:59, rowe_newsgroups <rowe_em...@yahoo.comwrote:
On Jul 1, 1:46 pm, pamela fluente <pamelaflue...@libero.itwrote:
Given p (as a process) how do I get the MainForm (let's assume that it
might exist) ?
-P

I have to ask you what the purpose of this is? Also is the process you
are looking for a program you designed or one that a third party
created?

Thanks,

Seth Rowe
For now I am planning to use within "a program I designed", but, of
course,
it also would be nice to know the general answer, which, I guess,
could be quite complicate.

In other words, is it possible, given only the handle of a process to
get the MainForm?

-P
Jul 2 '07 #6
>Given p (as a process) how do I get the MainForm (let's assume that it
might exist) ?
You can't get a winforms Form object representing a window in another
process and do something useful with it, if that's what you're asking.
You can get the window handle, but that's about it.
Mattias

--
Mattias Sjögren [C# MVP] mattias @ mvps.org
http://www.msjogren.net/dotnet/ | http://www.dotnetinterop.com
Please reply only to the newsgroup.
Jul 2 '07 #7
On 2 Lug, 19:13, Mattias Sjögren <mattias.dont.want.s...@mvps.org>
wrote:
Given p (as a process) how do I get the MainForm (let's assume that it
might exist) ?

You can't get a winforms Form object representing a window in another
process and do something useful with it, if that's what you're asking.
You can get the window handle, but that's about it.

Mattias

--
Mattias Sjögren [C# MVP] mattias @ mvps.orghttp://www.msjogren.net/dotnet/|http://www.dotnetinterop.com
Please reply only to the newsgroup.
I see. Thank you Mattias.

-P

Jul 5 '07 #8

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

10
9712
by: MJB | last post by:
In the main function of my form I check to see if the application is already running. If it is, I throw up a message box telling the user. What I would like to do is also maximize the...
7
2371
by: Stu | last post by:
Hi, I have a combobox who's values change the recordsource of the form. Within this form, there is a subform, whos records also need to change pending the value in the combobox. I am able to get...
0
1163
by: Kueishiong Tu | last post by:
I have a window form application. It requires to retrieve data from a web site. Since the web request is very time consuming, so I create a work thread to do the job. How does the window main form...
2
2519
by: James R Esposito | last post by:
I am trying to transition from Access97 to Visual Basic.net. My biggest challenge to date is the creation of a Main/Sub Form. In Access97 You create a main form and you can then insert a sub...
8
6423
by: koorb | last post by:
I am starting a program from a module with the Sub main procedure and I want it to display two forms for the program's interface, but when I run the program both forms just open and then program...
0
1616
by: cvetomir.todorov | last post by:
We have an app which must be single instance. When we start the app we check if it is already running (using the Process object in the System.Diagnostics namespace) locating it by the name of the...
9
6149
by: | last post by:
Hi How to get a reference to main form in a Windows Form 2.0 Application? I'm making a a library and I need a reference to the main form of the application that is using that library. TIA
17
2327
by: GS | last post by:
the main menu in the application seemed to disappeared all together until I click on an control and select mainmenu1 in designer. then the mainmenu1 displays where it should be but running it or...
2
246
by: ats | last post by:
I have a project I am starting with Sub Main. In my Sub Main I currently have one line of code which is frmMenu.Initialise This event runs through some code that eventually shows the form....
5
2424
by: Thelma Roslyn Lubkin | last post by:
I am still having trouble trying to use a popup form to allow user to set filters for the main form. The main form is based on a single table. The popup contains 5 listboxes, so the user can...
0
7135
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
1
7067
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
1
5060
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4729
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3215
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3201
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1570
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
774
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
440
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.