Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / .NET Framework / New Users / March 2006

Tip: Looking for answers? Try searching our database.

Finding the current application which has focus.

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Paul Aspinall - 11 Mar 2006 12:54 GMT
Hi
Does anyone have any code which can be used to find the current application
which has focus?

I want to try to retrieve the application name, or process name from the app
which has current focus.

Thanks
Michael Nemtsev - 11 Mar 2006 14:37 GMT
Hello Paul,

Use API GetForegroundWindow() function
http://www.pinvoke.net/default.aspx/user32/GetForegroundWindow.html

PA> Hi
PA> Does anyone have any code which can be used to find the current
PA> application
PA> which has focus?
PA> I want to try to retrieve the application name, or process name from
PA> the app which has current focus.
PA>
PA> Thanks
PA>
---
WBR,
Michael  Nemtsev :: blog: http://spaces.msn.com/laflour

"At times one remains faithful to a cause only because its opponents do not
cease to be insipid." (c) Friedrich Nietzsch
Stoitcho Goutsev (100) - 13 Mar 2006 15:44 GMT
Paul,

There is no managed solution for that. You need to call  GetForegroundWindow
API for example.

Signature

HTH
Stoitcho Goutsev (100)

> Hi
> Does anyone have any code which can be used to find the current
[quoted text clipped - 6 lines]
>
> Thanks

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.