Page 1 of 1

I.E /FF address bar manipulation

Posted: Mon Jul 24, 2006 10:31 am
by Pantcho!!
Hello,
I have a generel question regarding domain names and domain masking in the browsers address bar.

I would to create a little software that helps manage certing stuff,By catching the address from the address bar of the browser and then filter it.
I mean grabbing the address when the user has input and press enter/go
and the software will check the domain name and if it consists a bad word such as SEX or somthing it will forward it to a diffrent IP but stays with the SAME name in the address bar.

This need to manipulate I.E with accessing the DNS server and name servers etc etc.

I tought of 2 options,
1. hard one - making a proxy server - which make users want to avoid using proxies.
2. easy one - edit the HOSTS file in the "...drivers\etc\hosts" and create whatever name i wish or change on the fly (can be suspicous for hijacking browser and this method is bad idea becuase of many spywares)

any suggestions? :roll:

Posted: Mon Jul 24, 2006 10:37 am
by thefool
(can be suspicous for hijacking browser and this method is bad idea becuase of many spywares)
Don't know how suspicious it is; but it is an easy thing to change. And many knows the trick..

The proxy server would allow you to check the content of the page too; wich would help you create a bettter filter. You could make a point system for words too and so on.

Be aware of the word "SEX", as it also means gender; this is also the problem with other words. Just because a page contains the word "porn" doesnt mean its a porn page. It could also be a page against it or so.

Posted: Fri Jul 28, 2006 12:30 pm
by Pantcho!!
Found this on the forums to reterive I.E address,

posted by justin

Code: Select all

hedit.l=0 

Procedure EnumFunc(hchild,lparam) 
  Shared hedit 
  class$=Space(30) 
  GetClassName_(hchild,@class$,30) 
  If class$="Edit" 
    hedit=hchild 
    ProcedureReturn 0 
  EndIf 
  ProcedureReturn 1 
EndProcedure 

;IE handle 
hie.l=FindWindow_("IEFrame",#null) 
If hie=0 : MessageRequester("Error","IE Window not found.",0) : End : EndIf 

;find Edit handle 
EnumChildWindows_(hie,@EnumFunc(),0) 
If hedit=0 : MessageRequester("Error","Edit control not found.",0) : End : EndIf 

;get text 
editcont$=Space(500) 
sendmessage_(hedit,#WM_GETTEXT,500,@editcont$) 

MessageRequester("Edit",editcont$,0) 
this doesnt work :?

anyone have idea why?

Posted: Fri Jul 28, 2006 1:04 pm
by srod
It works okay here on xp home.

Posted: Fri Jul 28, 2006 4:27 pm
by Pantcho!!
This Code returns a null result in "editcont$"

Tested on WIN XP home edition
and WIN XP PRO SP2

I get this weird results if i debug all the class$ results in the procedure
i see the "edit" 2 times!

plz help or maybe there is a way to get this ?

Posted: Fri Jul 28, 2006 4:57 pm
by thefool
srod wrote:It works okay here on xp home.
On XP pro sp2 danish it doesnt work.

edit: solved.

Code: Select all

hedit.l=0
Global editcont$
editcont$=Space(500)

Procedure EnumFunc(hchild,lparam)
  Shared hedit
  class$=Space(30)
  GetClassName_(hchild,@class$,30)
  If class$="Edit"
  
    hedit=hchild
    ;editcont$=Space(500)
SendMessage_(hedit,#WM_GETTEXT,500,@editcont$)
If editcont$=""
;nothing
Else
    ProcedureReturn 0
    EndIf

  EndIf
  ProcedureReturn 1
EndProcedure

;IE handle
hie.l=FindWindow_("IEFrame",#Null)
Debug hie
If hie=0 : MessageRequester("Error","IE Window not found.",0) : End : EndIf

;find Edit handle
EnumChildWindows_(hie,@EnumFunc(),0)
If hedit=0 : MessageRequester("Error","Edit control not found.",0) : End : EndIf

MessageRequester("Edit",editcont$,0)