-----------------------------------------------------------

New Message on BDOTNET

-----------------------------------------------------------
From: phpkid
Message 1 in Discussion

Hi All,   I am looking for VB.NET code which can help me get the active window (the 
one user has got focus to) title. I know you can do this usign Win 32 API like this:   
Private Declare Function GetActiveWindow Lib "user32" () As Long
Private Declare Function GetWindowText Lib "user32" Alias "GetWindowTextA" (ByVal hwnd 
As Long, ByVal lpString As String, ByVal cch As Long) As Long
Private Declare Function GetWindowTextLength Lib "user32" Alias "GetWindowTextLengthA" 
(ByVal hwnd As Long) As Long

Private Sub Form_Load()
    Timer1.Interval = 5000
    Timer1.Enabled = True
End Sub

Private Sub Timer1_Timer()
    Dim lWnd As Long
    Dim strName As String
   
    lWnd = GetActiveWindow
    strName = String(GetWindowTextLength(lWnd) + 1, Chr$(0))
    GetWindowText lWnd, strName, Len(strName)
    Debug.Print strName

End Sub
   but I want to use, Managed code and not API calls.  Do you know of way of achieving 
the same in Managed code? Also, is there any event which tells me that Active window 
has been changed by user??   JD

-----------------------------------------------------------

To stop getting this e-mail, or change how often it arrives, go to your E-mail 
Settings.
http://groups.msn.com/BDOTNET/_emailsettings.msnw

Need help? If you've forgotten your password, please go to Passport Member Services.
http://groups.msn.com/_passportredir.msnw?ppmprop=help

For other questions or feedback, go to our Contact Us page.
http://groups.msn.com/contact

If you do not want to receive future e-mail from this MSN group, or if you received 
this message by mistake, please click the "Remove" link below. On the pre-addressed 
e-mail message that opens, simply click "Send". Your e-mail address will be deleted 
from this group's mailing list.
mailto:[EMAIL PROTECTED]

Reply via email to