473,471 Members | 1,814 Online
Bytes | Software Development & Data Engineering Community
Create 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
3 1533
>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?


You may be able to accomplish that with the System.Disgnostics.Process
class, but a more straight forward way is to call the the
GetWindowModuleFileName Win32 API.
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 11 '06 #2
Hi
I've tried to call this, but it doesn't seem to return the details of
everthing. ie. it only returns the details on some hWnd , and not on others.

Any ideas?

Thanks
"Mattias Sjögren" <ma********************@mvps.org> wrote in message
news:%2******************@TK2MSFTNGP12.phx.gbl...
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?


You may be able to accomplish that with the System.Disgnostics.Process
class, but a more straight forward way is to call the the
GetWindowModuleFileName Win32 API.
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 11 '06 #3
>I've tried to call this, but it doesn't seem to return the details of
everthing. ie. it only returns the details on some hWnd , and not on others.

Any ideas?


Yeah you're right it does seem a bit goofy. Apparently it only works
properly on Windows 9x. :(

You can also use GetWindowThreadProcessId to get the process the
window belongs to and then get more information from there.
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 #4

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

Similar topics

5
by: DraguVaso | last post by:
Hi, How can you see with a VB.NET-application if the Window of another Application (for exemple an opened Word-Document) is Mimized? Is there also a way to see if it is Maximized? Thanks a...
9
by: Guy | last post by:
I have extended the datetimepicker control to incorporate a ReadOnly property. I have used the new keyword to implement my own version of the value property, so that if readonly == true then it...
3
by: Sushil Srivastava | last post by:
Hi Guys, Would you be able to help me using C# GUI (with user interface component) in my MFC application. I have used managed extension, COM-interops, etc but problem is this C# component has...
3
by: Lumpierbritches | last post by:
I have an application my partner wrote that would allow an autoresponse to any Mapi compliant email that apparently in .Net won't, can someone assist me with fixing this? Here is the code: ...
3
by: dahuzizyd | last post by:
Hi all I want to judge an application is runing or not when another application start . If the application is running , get focus. I use the Pinvoke to invoke the FindWindow function ,I...
3
by: kill.segfault | last post by:
hi, I am working with a ICA32 citrix client from windows xp, where I am trying to use some automation through citrix client so that I can unmann a tedious file-copy through one of the published...
5
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
by: Mesan | last post by:
Hello everyone, Thanks to many useful posts in this newsgroup and others, I've been able to come very close to something I've been wanting to do for a very long time. I've figured out how to...
3
by: Firecore | last post by:
Does anyone know how to use this? I was browsing a few tutorials on the net, and I saw one that shows how to display stuff on the screen. I added a few events. This is my code: #include...
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
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
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,...
1
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
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
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

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.