473,796 Members | 2,599 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Bring to Front

Hello,

I have created an application that searches to see if a process is running
and if it is it maximizes it's window.

i.e.

For Each AProcess In AProcesses
If AProcess.StartI nfo.WindowStyle <> ProcessWindowSt yle.Maximized Then
AProcess.StartI nfo.WindowStyle = ProcessWindowSt yle.Maximized
ShowWindow(APro cess.MainWindow Handle, 3)
End If
Next

Is there also a way to make the window "BRING TO FRONT" also?

Thanks,

Chuck
Jul 21 '05 #1
1 2495
"Charles A. Lackman" <Ch*****@Create ItSoftware.net> schrieb:
For Each AProcess In AProcesses
If AProcess.StartI nfo.WindowStyle <> ProcessWindowSt yle.Maximized Then
AProcess.StartI nfo.WindowStyle = ProcessWindowSt yle.Maximized
ShowWindow(APro cess.MainWindow Handle, 3)
End If
Next

Is there also a way to make the window "BRING TO FRONT" also?


You can use the 'SetForegroundW indow' function (+ 'MainWindowHand le' as
handle) to do that (for more info, see MSDN and
<URL:http://www.pinvoke.net/>).

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://dotnet.mvps.org/dotnet/faqs/>

Jul 21 '05 #2

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

Similar topics

7
11095
by: tom | last post by:
Hi, I want a listbox below a hidden calendar control. The problem is that the listbox will shadow the calendar when the calendar is visible. How can I bring the calendar from back to front? Thanks in advance.
0
1955
by: ACaunter | last post by:
HI there.. I have a dropdown menu for my asp.net website (not a combo box with the down arrow).. its for Home, Compant, ... , Contact Us... and then when the mouse goes over it, the sub menus are displayed for each one... Those sub menus are written as tables.. The menu i can set to Bring to front before i run the program.. which is fine.. but when the sub menus come out.. then are at the back, so i can't see them.. How can i bring them...
9
21654
by: DraguVaso | last post by:
Hi, I want my application to bring another application to the Front. I thought best way to do this was by the Process-model: Dim c As Process = Process.GetCurrentProcess() Dim p As Process For Each p In Process.GetProcessesByName("EXTRA") If Left(p.MainWindowTitle, 4) = "Appl" Then 'Here I should be able to Bring the Process to the Front!!!
2
4978
by: Don | last post by:
I have two programs. One is supposed to bring the other (which is already running either minimized or at the bottom of the window z-order) to the front so that it becomes the foremost application. How do you do this? I've tried using the API functions BringWindowToTop, SetForegroundWindow, and SetWindowPos and can't get any of them to work reliably. BringWindowToTop and SetForegroundWindow don't do anything, and SetWindowPos only seems...
3
4784
by: M O J O | last post by:
Hi, I have an application where I've implemented a global hotkey, so no matter what other application is in front (have focus), my app will react when the key combination is pressed. This works fine. My problem is now that the form I want to show, does not come to the front. I've tried to set Topmost to true, but then the form doesn't recieve focus.
5
25021
by: Iain Bishop | last post by:
I have a simple form with 4 command buttons and 1 label. The label is sometimes visible and sometimes not. When it is visible I want it to be in front of the buttons. I've tried bringing the label to the front and sending the buttons to the back. In design view the form looks fine, but whenever I open the form the label is behind the buttons. Has anyone else experienced this and know the solution? Is this a known fault? I wouldn't think...
1
7316
by: Marcel Brekelmans | last post by:
Hello, I have an application with a notifyIcon. When my application's main form is hidden by some other window I would like to bring it in front by single-clicking the NotifyIcon. However, I can't get it done. In the Click event I've used all sorts of methods: this.SetTopLevel(true); this.Show(); this.Focus();
2
4072
by: =?Utf-8?B?R2lkaQ==?= | last post by:
Hi, I asked here yesterday about bringing a form to front with hotkey while using different application then mine (meaning, when i'm using outlook, and pressing ALT+T it will bring a form from my application to front), my problem was that after i press the hotkey, the window stays in minimize state instead of being in the front. i fount an article in google explaining (i think) how to solve this problem, but i couldn't understand what...
1
1304
by: Curious | last post by:
I have a dialog that should be in front of other dialogs. Now it was in front of others only for a little while, before it "disappeared". I've found out that it doesn't disapper. Instead, it is "hiding" behind other dialogs. What can I do to bring it to the front?
1
2712
by: swethak | last post by:
Hi, How to do the bring front and bring back an images using javascript.
0
9524
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10449
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10217
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10168
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10003
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9047
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6785
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
1
4114
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 we have to send another system
2
3730
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.