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

Home Posts Topics Members FAQ

Returning application name from hWnd handle.

Hi
I am trying to find the application from a hWnd handle.

ie. if the hWnd is to Internet explorer, I want to try to return
iexplore.exe (as per processes in Task Manager), or some other indicator
that its IE.

Can anyone help?

Thanks
Mar 11 '06 #1
5 3429
On Sat, 11 Mar 2006 16:47:41 GMT, "Paul Aspinall" <pa**@aspy.co.uk> wrote:
Hi
I am trying to find the application from a hWnd handle.

ie. if the hWnd is to Internet explorer, I want to try to return
iexplore.exe (as per processes in Task Manager), or some other indicator
that its IE.

Can anyone help?

Thanks

Didn't you ask this question in an earlier post 3 minutes before?

Otis Mukinfus
http://www.arltex.com
http://www.tomchilders.com
Mar 11 '06 #2
"Paul Aspinall" <pa**@aspy.co.uk> schrieb:
I am trying to find the application from a hWnd handle.

ie. if the hWnd is to Internet explorer, I want to try to return
iexplore.exe (as per processes in Task Manager), or some other indicator
that its IE.


Loop through the process list returned by
'System.Diagnostics.Process.GetProcesses' and compare the handle to the
'Process' objects' 'MainWindowHandle' property value.

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

Mar 11 '06 #3
Thanks for the reply.
I just found this, literally about 30 minutes ago, and got it working.

Thanks
"Herfried K. Wagner [MVP]" <hi***************@gmx.at> wrote in message
news:ui**************@TK2MSFTNGP11.phx.gbl...
"Paul Aspinall" <pa**@aspy.co.uk> schrieb:
I am trying to find the application from a hWnd handle.

ie. if the hWnd is to Internet explorer, I want to try to return
iexplore.exe (as per processes in Task Manager), or some other indicator
that its IE.


Loop through the process list returned by
'System.Diagnostics.Process.GetProcesses' and compare the handle to the
'Process' objects' 'MainWindowHandle' property value.

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

Mar 12 '06 #4
I think you can probably answer this question for yourself.

In actuality, my news server never posted it after 1 hour, so I posted it
again, only to find that it posted them both 2 hours later.

Useful comment though.


"Otis Mukinfus" <ph***@emailaddress.com> wrote in message
news:l2********************************@4ax.com...
On Sat, 11 Mar 2006 16:47:41 GMT, "Paul Aspinall" <pa**@aspy.co.uk> wrote:
Hi
I am trying to find the application from a hWnd handle.

ie. if the hWnd is to Internet explorer, I want to try to return
iexplore.exe (as per processes in Task Manager), or some other indicator
that its IE.

Can anyone help?

Thanks

Didn't you ask this question in an earlier post 3 minutes before?

Otis Mukinfus
http://www.arltex.com
http://www.tomchilders.com

Mar 12 '06 #5

The problem with MainWindowHandle is that there can only be one per
process, even though applications like Internet Explorer have multiple
top level windows in the same process.
Mattias

--
Mattias Sjögren [C# MVP] mattias @ mvps.org
http://www.msjogren.net/dotnet/ | http://www.dotnetinterop.com
Please reply only to the newsgroup.
Mar 12 '06 #6

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

Similar topics

1
5460
by: Sharon | last post by:
Hi all, Is it possible to programmatically get the IIS application name at run time? If so, how? A software package we bought requires some cache file generated on the server, since we have...
1
1825
by: Dennis | last post by:
Hi, I am wondering that the Application Name in Virtual Directory is compulsory be non-empty field when configuring Virtual Directory for ASP.NET application? I realized some of my ASP.NET...
4
3652
by: bruce | last post by:
Hello, I'm almost embarrassed to ask this question, but my searches have not yielded any results. How does one change what the Application.Name property returns in Access 2003? I see that it...
2
13113
by: Chang | last post by:
how to get the name of a running application using C# e.g. if i have 20 dll files and my application name is MyGreatApplication then how to get the name "MyGreatApplication" at runtime? thx in...
1
5954
by: Wilfried Mestdagh | last post by:
Hi, I try to make an about form and put it in my own namespace/class. It works but if I want to display eg application name, it does not. It display name of the calss where the aboutbox is in...
4
2688
by: RJDev | last post by:
Hi, Is there anyone who can help me in resolving the Application Name of my IIS Aaplication. I want to check the application name to see what configuration i need to use because multiple virtual...
3
1536
by: Paul Aspinall | last post by:
Hi I am trying to find the application from a hWnd handle. ie. if the hWnd is to Internet explorer, I want to try to return iexplore.exe (as per processes in Task Manager), or some other...
2
3005
by: 4.spam | last post by:
Hello, all. DB2 ESE v9.1.3, Windows XP. I want to change the application name of current connection. I have wrote such SP using sqleseti api call: --- #include <sqlenv.h> #include...
4
1007
by: Microsoft Newsserver | last post by:
Hi, I dont get involved with IIS much, but recently we had a situation regarding the Default Application name which I dont fully understand. In essence, we have a main web and underneath it...
0
7233
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
7342
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,...
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...
0
7505
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...
0
5650
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,...
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
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 ...

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.