PC Review


Reply
Thread Tools Rate Thread

Determine if a Form is active

 
 
=?Utf-8?B?RG91Zw==?=
Guest
Posts: n/a
 
      16th Sep 2005
I'm using reflection to launch a form based on a click event from another
application. I want to be able to check if the form is active on the desktop
and bring it upfront and not relaunch the form again and again.

Can someone tell me how to do this? Thanks, doug
 
Reply With Quote
 
 
 
 
Oliver Sturm
Guest
Posts: n/a
 
      17th Sep 2005
Doug wrote:

>I'm using reflection to launch a form based on a click event from another
>application. I want to be able to check if the form is active on the
>desktop
>and bring it upfront and not relaunch the form again and again.
>
>Can someone tell me how to do this? Thanks, doug


You should store the reference to the form away when you create it, so
when you get there again, you can easily check if you've got the reference
already. But you'll also have to find a way to be informed if the form
closes, so you can reset the reference - you could introduce an event or a
callback that's called when the form is closing.

I guess this is really the only viable solution. You could go search
around with Windows API functions, but that's not a good solution to start
with and will be further complicated by the fact that you don't know
anything about the form in question (assuming you wouldn't want to store
the reference).


Oliver Sturm
--
Expert programming and consulting services available
See http://www.sturmnet.org (try /blog as well)
 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to determine if /3GB is active. Fritz Microsoft C# .NET 2 24th Sep 2009 03:24 PM
How to determine the active form John Brown Microsoft Dot NET Framework Forms 12 28th Jul 2007 07:06 AM
How to determine the active form John Brown Microsoft C# .NET 12 28th Jul 2007 07:06 AM
Determine if a transaction is active Tom Microsoft ADO .NET 0 27th Feb 2004 08:29 PM
Determine active presentation in VBA =?Utf-8?B?RnJlZCBH?= Microsoft Powerpoint 1 27th Dec 2003 04:00 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 07:50 PM.