Home All Groups Group Topic Archive Search About

Returning application name from hWnd handle.

Author
11 Mar 2006 4:47 PM
Paul Aspinall
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

Author
11 Mar 2006 7:26 PM
Otis Mukinfus
On Sat, 11 Mar 2006 16:47:41 GMT, "Paul Aspinall" <p***@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
Are all your drivers up to date? click for free checkup

Author
12 Mar 2006 12:57 PM
Paul Aspinall
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.




Show quoteHide quote
"Otis Mukinfus" <ph***@emailaddress.com> wrote in message
news:l296125c2np2lmkdmmlsqfsimd0coag1kk@4ax.com...
> On Sat, 11 Mar 2006 16:47:41 GMT, "Paul Aspinall" <p***@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
Author
11 Mar 2006 8:01 PM
Herfried K. Wagner [MVP]
"Paul Aspinall" <p***@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/>
Author
12 Mar 2006 10:42 AM
Paul Aspinall
Thanks for the reply.
I just found this, literally about 30 minutes ago, and got it working.

Thanks


Show quoteHide quote
"Herfried K. Wagner [MVP]" <hirf-spam-me-here@gmx.at> wrote in message
news:uiw9EaURGHA.4264@TK2MSFTNGP11.phx.gbl...
> "Paul Aspinall" <p***@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/>
Author
12 Mar 2006 10:09 PM
Mattias Sjögren
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.

Bookmark and Share