473,385 Members | 2,269 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,385 software developers and data experts.

Set focus to a process and maximize it?

I have the Process object for a process. How do I set focus to that
process and maximize it?

Michael Passalacqua
Portland Community College
CIS Faculty

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 20 '05 #1
2 3906
The .Net process object has a MainWindowHandle property. The process whose
window you want to max must have such main window. The MainWindowHandle
gives your the native handle of that window, so you can call a Win32
function "ShowWindow" with this handle.

You need declare it like
<DllImport("user32", CharSet=CharSet.Auto)>
Public Declare Function ShowWindow(ByVal hwnd as IntPtr, ByVal nCmdShow as
Integer) as Boolean

you need check Win32 document to see how to pass the nCmdShow.

Thanks
Lifeng
Nov 20 '05 #2
Thanks, that works!

Michael Passalacqua
Portland Community College
CIS Faculty

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 20 '05 #3

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

Similar topics

1
by: Sanjay Seshasainam | last post by:
How can I maximize a process window I am using the Process class in System.Diagnostics. I can identify the specific process I want using the window title after that I want to maximize the...
1
by: Sumit | last post by:
Hi all, I have an MDI form in which i open some other forms. I dont want the Control Box (having minimize, restore/maximize and close button) Even though I have set the controlbox property of...
4
by: Michael Passalacqua | last post by:
How do I set focus to another application that is running, and maximize the main window? Michael Passalacqua Portland Community College CIS Faculty *** Sent via Developersdex...
0
by: bamapookie | last post by:
I've written an app that starts and monitors a number of processes. If one of those processes dies, the app restarts it. One of the options I've written hides the main window of the monitored...
0
by: bamapookie | last post by:
I've written an app that starts and monitors a number of processes. If one of those processes dies, the app restarts it. One of the options I've written hides the main window of the monitored...
0
by: bamapookie | last post by:
I'm sorry if this was posted several times. I did not see my previous post appear after I posted it. I've written an app that starts and monitors a number of processes. If one of those...
0
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...
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...
0
by: ARC | last post by:
I posted this before, but no response. Hopefully the MVP folks will know the answer. I'm not sure how other's are using the new split form, but what I like about it is I can design the header...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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?
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
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...
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...

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.