473,406 Members | 2,217 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

Set Focus to a particular process

Hi
I found a particular process that is running on my machine. I have th
eprocess ID for that how to set Focus to that Process

Regards
Saurabh
Nov 17 '05 #1
3 3036
Hi,

You do not focus on a process, in any case you focus on a form, you can use
Process.MainWindowHandle to get the ID of the main window, then you can
focus it by using SetForegroundWindow

Note that even doing this you cannot assure that the expected window to be
focused , just the main window of the process.

cheers,

--
Ignacio Machin,
ignacio.machin AT dot.state.fl.us
Florida Department Of Transportation

"Saurabh Sharma" <sa*****@hireproindia.com> wrote in message
news:e2**************@TK2MSFTNGP10.phx.gbl...
Hi
I found a particular process that is running on my machine. I have th
eprocess ID for that how to set Focus to that Process

Regards
Saurabh

Nov 17 '05 #2
That is working only for the main form but if it is in another form then its
not working. Is there any method to do that.

Regards
Saurabh
"Ignacio Machin ( .NET/ C# MVP )" <ignacio.machin AT dot.state.fl.us> wrote
in message news:uF****************@TK2MSFTNGP09.phx.gbl...
Hi,

You do not focus on a process, in any case you focus on a form, you can
use Process.MainWindowHandle to get the ID of the main window, then you
can focus it by using SetForegroundWindow

Note that even doing this you cannot assure that the expected window to be
focused , just the main window of the process.

cheers,

--
Ignacio Machin,
ignacio.machin AT dot.state.fl.us
Florida Department Of Transportation

"Saurabh Sharma" <sa*****@hireproindia.com> wrote in message
news:e2**************@TK2MSFTNGP10.phx.gbl...
Hi
I found a particular process that is running on my machine. I have th
eprocess ID for that how to set Focus to that Process

Regards
Saurabh


Nov 17 '05 #3

Hi,
AFAIK there is not, can you change the target app?
cheers,

--
Ignacio Machin,
ignacio.machin AT dot.state.fl.us
Florida Department Of Transportation

"Saurabh Sharma" <sa*****@hireproindia.com> wrote in message
news:O1**************@TK2MSFTNGP09.phx.gbl...
That is working only for the main form but if it is in another form then
its not working. Is there any method to do that.

Regards
Saurabh
"Ignacio Machin ( .NET/ C# MVP )" <ignacio.machin AT dot.state.fl.us>
wrote in message news:uF****************@TK2MSFTNGP09.phx.gbl...
Hi,

You do not focus on a process, in any case you focus on a form, you can
use Process.MainWindowHandle to get the ID of the main window, then you
can focus it by using SetForegroundWindow

Note that even doing this you cannot assure that the expected window to
be focused , just the main window of the process.

cheers,

--
Ignacio Machin,
ignacio.machin AT dot.state.fl.us
Florida Department Of Transportation

"Saurabh Sharma" <sa*****@hireproindia.com> wrote in message
news:e2**************@TK2MSFTNGP10.phx.gbl...
Hi
I found a particular process that is running on my machine. I have th
eprocess ID for that how to set Focus to that Process

Regards
Saurabh



Nov 17 '05 #4

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

Similar topics

5
by: 'bonehead | last post by:
Greetings, I'm still something of a newbie to html/php/mysql. I have a php/html form with several fields of type "input". If the user enters improper data in a particular field and clicks the...
1
by: | last post by:
I'm trying to get (or set) the focus on an external window but to no avail. I've imported the "GetActiveWindow" and "GetFocus" from the user32.dll but those 2 functions seem to only work for windows...
6
by: Abhi poddar | last post by:
Hi Friends, In a window form I have a datagrid and certain action of user I want to select and set a focus to a particular row. I am to select a particular row using dataGrid1.Select(int row), but...
0
by: hzgt9b | last post by:
Using VB .NET 2003, I am having problems with a windows application that I have written: Here's the situation. The application I created has a main form that has its TopMost property set to True...
3
by: Sharon | last post by:
I need to allow single instance of my process. I did found the other System.Diagnostics.Process as follow: System.Diagnostics.Process currentProcess =...
4
by: Roger | last post by:
Hi, I am confused about the differences between this.window.focus(), window.focus(), and this.focus(). I want to use the calls in a <body onload="..."tag. What are the differences between...
3
by: =?Utf-8?B?Vmlua2k=?= | last post by:
Hello Everyone, I am not sure what am I doing wrong here. I spend almost whole day working on this. I am trying to set focus on the process that I started by Process.start. Below is my code...
1
mafaisal
by: mafaisal | last post by:
How to Focus Particular Cells of Datagridview in vb.net ie, in FlexGrid We got focus by With flexgrid1 .Row=0 .col=1 .focus end with then we get focus on col1 in Datagridview how get it..?
10
by: Gary | last post by:
I'm trying to find a way to determin which window Within-Another-Program currently has the focus. THE SITUATION: (Skip down to "My Question" if you don't want the background...) * This is...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
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...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
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...

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.