473,387 Members | 1,464 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,387 software developers and data experts.

Keeping a VB.Net Window in foreground

I have a VB.Net windows application which must look as if it was
embedded in a larger windows application. The 2nd application will not
allow embedding of a VB.Net application - only ActiveX. This means that
the VB.Net application must be called as an EXE.

I need the VB.Net window to remain in the foreground, even when the
larger application gets focus. It's fairly easy to bring the window to
the foreground when some event occurs, but it's another matter to keep
it there all the time.

I think there's probably a simple way to do this but I don't know it.

Frank Maxey

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 20 '05 #1
4 5923
Set form TopMost property to true.

HTH,

Shane

<fdmaxey> wrote in message news:eT**************@TK2MSFTNGP10.phx.gbl...
I have a VB.Net windows application which must look as if it was
embedded in a larger windows application. The 2nd application will not
allow embedding of a VB.Net application - only ActiveX. This means that
the VB.Net application must be called as an EXE.

I need the VB.Net window to remain in the foreground, even when the
larger application gets focus. It's fairly easy to bring the window to
the foreground when some event occurs, but it's another matter to keep
it there all the time.

I think there's probably a simple way to do this but I don't know it.

Frank Maxey

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

Nov 20 '05 #2

<fdmaxey> wrote in message news:eT**************@TK2MSFTNGP10.phx.gbl...
I have a VB.Net windows application which must look as if it was
embedded in a larger windows application. The 2nd application will not
allow embedding of a VB.Net application - only ActiveX. This means that
the VB.Net application must be called as an EXE.

I need the VB.Net window to remain in the foreground, even when the
larger application gets focus. It's fairly easy to bring the window to
the foreground when some event occurs, but it's another matter to keep
it there all the time.

I think there's probably a simple way to do this but I don't know it.


No, not really. SStory's suggestion will keep the app on top of ALL windows,
not just the 2nd application, so I don't think it's what you want. I think
your best bet would be to use the SetParent() API function to make your .NET
app an "owned window" of the 2nd app.
Nov 20 '05 #3
Thanks! I new it was something embarrassingly simple. I just didn't
know where to look.

Frank Maxey

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 20 '05 #4
This is true it will be topmost of all....

Shane

"Jeff Johnson [MVP: VB]" <i.***@enough.spam> wrote in message
news:uJ**************@TK2MSFTNGP12.phx.gbl...

<fdmaxey> wrote in message news:eT**************@TK2MSFTNGP10.phx.gbl...
I have a VB.Net windows application which must look as if it was
embedded in a larger windows application. The 2nd application will not
allow embedding of a VB.Net application - only ActiveX. This means that
the VB.Net application must be called as an EXE.

I need the VB.Net window to remain in the foreground, even when the
larger application gets focus. It's fairly easy to bring the window to
the foreground when some event occurs, but it's another matter to keep
it there all the time.

I think there's probably a simple way to do this but I don't know it.
No, not really. SStory's suggestion will keep the app on top of ALL

windows, not just the 2nd application, so I don't think it's what you want. I think
your best bet would be to use the SetParent() API function to make your ..NET app an "owned window" of the 2nd app.

Nov 20 '05 #5

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

Similar topics

4
by: Brian Kitt | last post by:
I don't know where to ask this question. If you know of a better place to ask it, please let me know. I have a main web page containing many links to detail pages. All detail links open with...
11
by: objectref | last post by:
Hi to all, is there a way to get the window handle of the main window of an application or process ? For example, if someone opens Microsoft Word, he gets a window so he/she can write text....
0
by: Tom | last post by:
Here is a very strange problem that I am stumped by. I have a rather large application written in VB.NET (of course) using Framework 1.1. As you know, with an MDI application you can have multiple...
8
by: Tom | last post by:
I am using VB.NET to control another program. I have the program's window hwnd; however, I need to be able to set the focus to that other programs window so I can send it some keystrokes. I thought...
3
by: Carl Fenley | last post by:
I am trying to capture the Windows QueryCancelAutoPlay message that is sent to the "foreground window" when an AutoRun enabled CD is inserted into a drive. Enabling and Disabling AutoRun...
1
by: Terry Olsen | last post by:
In my chat application, I create a new window for each private chat. I use the FlashWindowEx API to flash the window if it's not the Foreground window. I determine the Foreground window using the...
6
by: Jen | last post by:
I've implemented single-instance functionality in my .exe by using the mutex method. Works great. But when the .exe detects that it is not the first instance I want to bring the main window of...
1
by: kia | last post by:
Is there any way with JavaScript(I mean programmatically) that we can open the window as a new foreground tab, every time a new tabbed window is opened? For example, like IE7, when user clicks a...
2
by: niros | last post by:
Hi, I am working with 2 softwares (2 process). Sometimes, when process A pop's up an MDI window, If I will scroll the mouse wheel on it, it will scroll (and send the needed WM) process B. If I...
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: 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: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
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...

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.