Checking Form Focus...
Checking Form Focus...
Checking Form Focus...
Checking Form Focus...
Checking Form Focus...
Checking Form Focus... Checking Form Focus... Checking Form Focus... Checking Form Focus... Checking Form Focus... Checking Form Focus... Checking Form Focus... Checking Form Focus...
Checking Form Focus... Checking Form Focus...
Checking Form Focus...
Go Back  Xtreme Visual Basic Talk > > > Checking Form Focus...


Reply
 
Thread Tools Display Modes
  #1  
Old 11-16-2006, 11:20 PM
GreeNjaY2002's Avatar
GreeNjaY2002 GreeNjaY2002 is offline
Centurion
 
Join Date: Nov 2003
Location: So.Cal - USA
Posts: 128
Question Checking Form Focus...


Is there an API that I can call on to check the Focus of a form?
__________________
I know it's hard to believe, but look at my picture!!! GreeNjaY's are real!!! It's awesome! I exist!!!

My mother always said, "If it works, leave it be. But I say,"If it works, Open it up and find out why..."

-=THE JAY=-
Reply With Quote
  #2  
Old 11-17-2006, 07:44 AM
bassmaster52 bassmaster52 is offline
Regular
 
Join Date: Aug 2005
Posts: 59
Default

You can use WM_ACTIVATEAPP
WM_ACTIVATEAPP: Detect Application Activation
Reply With Quote
  #3  
Old 02-16-2008, 12:13 PM
Son of Makuta Son of Makuta is offline
Newcomer
 
Join Date: Sep 2007
Posts: 19
Default

GetActiveWindow() works as well. The declaration goes:
Code:
Public Declare Function GetActiveWindow Lib "user32" () As Long
As far as I know, you can check if your form is the active one by using a simple If statement:
Code:
If GetActiveWindow = Form1.hWnd Then
    'Your form has the focus
Else
    'You don't
End If
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

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 Off
HTML code is Off

Forum Jump

Advertisement:





Free Publications
The ASP.NET 2.0 Anthology
101 Essential Tips, Tricks & Hacks - Free 156 Page Preview. Learn the most practical features and best approaches for ASP.NET.
subscribe
Programmers Heaven C# School Book -Free 338 Page eBook
The Programmers Heaven C# School book covers the .NET framework and the C# language.
subscribe
Build Your Own ASP.NET 3.5 Web Site Using C# & VB, 3rd Edition - Free 219 Page Preview!
This comprehensive step-by-step guide will help get your database-driven ASP.NET web site up and running in no time..
subscribe
Checking Form Focus...
Checking Form Focus...
Checking Form Focus... Checking Form Focus...
Checking Form Focus...
Checking Form Focus...
Checking Form Focus... Checking Form Focus... Checking Form Focus... Checking Form Focus... Checking Form Focus... Checking Form Focus... Checking Form Focus...
Checking Form Focus...
Checking Form Focus...
 
Checking Form Focus...
Checking Form Focus...
 
-->