|
-
Sep 7th, 2000, 07:15 PM
#1
Thread Starter
Addicted Member
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 ..."
-
Sep 7th, 2000, 07:24 PM
#2
Fanatic Member
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]
-
Sep 7th, 2000, 07:43 PM
#3
Conquistador
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
-
Sep 7th, 2000, 07:44 PM
#4
Thread Starter
Addicted Member
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..
-
Sep 7th, 2000, 07:47 PM
#5
Thread Starter
Addicted Member
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 !
-
Sep 7th, 2000, 08:02 PM
#6
Conquistador
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|