Results 1 to 6 of 6

Thread: Findwindow

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Aug 2000
    Posts
    208

    Exclamation

    I want to do that :

    if I open and application
    ex : Netscape

    And I go to and XXX site..

    in the "netscape form caption" , it will be writted some thing like "netscape http://www.xxx.com"

    I want to my vb program detect some word ( in a word listbox ) and if a word in the listbox fit whit one word in the "netscape form caption" then close netscape or any program who have this word in is caption And show and msgbox
    like:

    msgbox "You are not autorised to open this application , the application will be close now ..."

  2. #2
    Fanatic Member
    Join Date
    Oct 1999
    Location
    MA, USA
    Posts
    523
    Use GetWindowText to get whatever is in the caption of the Navigator and then try using InStr function to compare the caption with what you have in the listbox

    Code:
    '//Example
    Dim stText As String
    Dim I As Integer
    
    stText = GetWindowText (blah, blah, blah) '//Use the web site I gave you to find out how to get the caption
    
    For I = 0 to List1.ListCount - 1
        If InStr(1, stText, List1.List(I)) > 1 Then
            MsgBox "Exiting the program"
            '//Exit program here or just exit the sub
        End If
    Next I
    [Edited by QWERTY on 09-07-2000 at 08:30 PM]

  3. #3
    Conquistador
    Join Date
    Dec 1999
    Location
    Australia
    Posts
    4,527
    you can also detect the current address, of your web browser, i have a project that does that, if the web site is in your list of baddies, close it

    except my example only works with ie, i think

  4. #4

    Thread Starter
    Addicted Member
    Join Date
    Aug 2000
    Posts
    208

    ha..

    that's doesn't help me cause I need to close the EXTERNAL application and not MY application..
    And I see for the URL incclude in your message..
    I dont want to get the FORM1 caption
    but check ALL the captio of ALL the program who was open
    And close the bad one..

  5. #5

    Thread Starter
    Addicted Member
    Join Date
    Aug 2000
    Posts
    208
    WhatI wnat to do ,
    it's to check in ALL the open program and close the bad one..
    It could be regedit or explorer or netscape ..
    If I have 10 program open,
    My VB program must check in ALL the caption of ALL the 10 program and if one contain a word in the word listbox, My VB program CLOSE the program but my program stay open !

  6. #6
    Conquistador
    Join Date
    Dec 1999
    Location
    Australia
    Posts
    4,527
    then you could enumerate all the windows, close the bad ones

    you can disable the registry through the registry

    go to http://www.regedit.com

    but be careful!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width